text:
// Dependencies:
// 1) jQuery
// 2) browser.js
// 3) svgtransformlist.js
// 4) units.js

(function() {

if (!svgedit.utilities) {
	svgedit.utilities = {};
}

// Constants

// String used to encode base64.
var KEYSTR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
var NS = svgedit.NS;

// Much faster than running getBBox() every time
var visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use';
var visElems_arr = visElems.split(',');
//var hidElems = 'clipPath,defs,desc,feGaussianBlur,filter,linearGradient,marker,mask,metadata,pattern,radialGradient,stop,switch,symbol,title,textPath';

var editorContext_ = null;
var domdoc_ = null;
var domcontainer_ = null;
var svgroot_ = null;

svgedit.utilities.init = function(editorContext) {
	editorContext_ = editorContext;
	domdoc_ = editorContext.getDOMDocument();
	domcontainer_ = editorContext.getDOMContainer();
	svgroot_ = editorContext.getSVGRoot();
};

// Function: svgedit.utilities.toXml
// Converts characters in a string to XML-friendly entities.
//
// Example: '&' becomes '&'
//
// Parameters:
// str - The string to be converted
//
// Returns:
// The converted string
svgedit.utilities.toXml = function(str) {
	return $('<p/>').text(str).html();
};

// Function: svgedit.utilities.fromXml
// Converts XML entities in a string to single characters.
// Example: '&' becomes '&'
//
// Parameters:
// str - The string to be converted
//
// Returns:
// The converted string
svgedit.utilities.fromXml = function(str) {
	return $('<p/>').html(str).text();
};

// This code was written by Tyler Akins and has been placed in the
// public domain.  It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com

// schiller: Removed string concatenation in favour of Array.join() optimization,
// 				also precalculate the size of the array needed.

// Function: svgedit.utilities.encode64
// Converts a string to base64
svgedit.utilities.encode64 = function(input) {
	// base64 strings are 4/3 larger than the original string
//	input = svgedit.utilities.encodeUTF8(input); // convert non-ASCII characters
	input = svgedit.utilities.convertToXMLReferences(input);
	if(window.btoa) return window.btoa(input); // Use native if available
	var output = new Array( Math.floor( (input.length + 2) / 3 ) * 4 );
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0, p = 0;

	do {
		chr1 = input.charCodeAt(i++);
		chr2 = input.charCodeAt(i++);
		chr3 = input.charCodeAt(i++);

		enc1 = chr1 >> 2;
		enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
		enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
		enc4 = chr3 & 63;

		if (isNaN(chr2)) {
			enc3 = enc4 = 64;
		} else if (isNaN(chr3)) {
			enc4 = 64;
		}

		output[p++] = KEYSTR.charAt(enc1);
		output[p++] = KEYSTR.charAt(enc2);
		output[p++] = KEYSTR.charAt(enc3);
		output[p++] = KEYSTR.charAt(enc4);
	} while (i < input.length);

	return output.join('');
};

// Function: svgedit.utilities.decode64
// Converts a string from base64
svgedit.utilities.decode64 = function(input) {
	if(window.atob) return window.atob(input);
	var output = '';
	var chr1, chr2, chr3 = '';
	var enc1, enc2, enc3, enc4 = '';
	var i = 0;

	// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
	input = input.replace(/[^A-Za-z0-9\+\/\=]/g, '');

	do {
		enc1 = KEYSTR.indexOf(input.charAt(i++));
		enc2 = KEYSTR.indexOf(input.charAt(i++));
		enc3 = KEYSTR.indexOf(input.charAt(i++));
		enc4 = KEYSTR.indexOf(input.charAt(i++));

		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;

		output = output + String.fromCharCode(chr1);

		if (enc3 != 64) {
			output = output + String.fromCharCode(chr2);
		}
		if (enc4 != 64) {
			output = output + String.fromCharCode(chr3);
		}

		chr1 = chr2 = chr3 = '';
		enc1 = enc2 = enc3 = enc4 = '';

	} while (i < input.length);
	return unescape(output);
};

// Currently not being used, so commented out for now
// based on http://phpjs.org/functions/utf8_encode:577
// codedread:does not seem to work with webkit-based browsers on OSX
// 		'encodeUTF8': function(input) {
// 			//return unescape(encodeURIComponent(input)); //may or may not work
// 			var output = '';
// 			for (var n = 0; n < input.length; n++){
// 				var c = input.charCodeAt(n);
// 				if (c < 128) {
// 					output += input[n];
// 				}
// 				else if (c > 127) {
// 					if (c < 2048){
// 						output += String.fromCharCode((c >> 6) | 192);
// 					}
// 					else {
// 						output += String.fromCharCode((c >> 12) | 224) + String.fromCharCode((c >> 6) & 63 | 128);
// 					}
// 					output += String.fromCharCode((c & 63) | 128);
// 				}
// 			}
// 			return output;
// 		},

// Function: svgedit.utilities.convertToXMLReferences
// Converts a string to use XML references
svgedit.utilities.convertToXMLReferences = function(input) {
	var output = '';
	for (var n = 0; n < input.length; n++){
		var c = input.charCodeAt(n);
		if (c < 128) {
			output += input[n];
		} else if(c > 127) {
			output += ('&#' + c + ';');
		}
	}
	return output;
};

// Function: svgedit.utilities.text2xml
// Cross-browser compatible method of converting a string to an XML tree
// found this function here: http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f
svgedit.utilities.text2xml = function(sXML) {
	if(sXML.indexOf('<svg:svg') >= 0) {
		sXML = sXML.replace(/<(\/?)svg:/g, '<$1').replace('xmlns:svg', 'xmlns');
	}

	var out;
	try{
		var dXML = (window.DOMParser)?new DOMParser():new ActiveXObject('Microsoft.XMLDOM');
		dXML.async = false;
	} catch(e){
		throw new Error('XML Parser could not be instantiated');
	}
	try{
		if(dXML.loadXML) out = (dXML.loadXML(sXML)) ? dXML : false;
		else out = dXML.parseFromString(sXML, 'text/xml');
	}
	catch(e){ throw new Error('Error parsing XML string'); }
	return out;
};

// Function: svgedit.utilities.bboxToObj
// Converts a SVGRect into an object.
//
// Parameters:
// bbox - a SVGRect
//
// Returns:
// An object with properties names x, y, width, height.
svgedit.utilities.bboxToObj = function(bbox) {
	return {
		x: bbox.x,
		y: bbox.y,
		width: bbox.width,
		height: bbox.height
	};
};

// Function: svgedit.utilities.walkTree
// Walks the tree and executes the callback on each element in a top-down fashion
//
// Parameters:
// elem - DOM element to traverse
// cbFn - Callback function to run on each element
svgedit.utilities.walkTree = function(elem, cbFn){
	if (elem && elem.nodeType == 1) {
		cbFn(elem);
		var i = elem.childNodes.length;
		while (i--) {
			svgedit.utilities.walkTree(elem.childNodes.item(i), cbFn);
		}
	}
};

// Function: svgedit.utilities.walkTreePost
// Walks the tree and executes the callback on each element in a depth-first fashion
// TODO: FIXME: Shouldn't this be calling walkTreePost?
//
// Parameters:
// elem - DOM element to traverse
// cbFn - Callback function to run on each element
svgedit.utilities.walkTreePost = function(elem, cbFn) {
	if (elem && elem.nodeType == 1) {
		var i = elem.childNodes.length;
		while (i--) {
			svgedit.utilities.walkTree(elem.childNodes.item(i), cbFn);
		}
		cbFn(elem);
	}
};

// Function: svgedit.utilities.getUrlFromAttr
// Extracts the URL from the url(...) syntax of some attributes.
// Three variants:
//  * <circle fill="url(someFile.svg#foo)" />
//  * <circle fill="url('someFile.svg#foo')" />
//  * <circle fill='url("someFile.svg#foo")' />
//
// Parameters:
// attrVal - The attribute value as a string
//
// Returns:
// String with just the URL, like someFile.svg#foo
svgedit.utilities.getUrlFromAttr = function(attrVal) {
	if (attrVal) {
		// url("#somegrad")
		if (attrVal.indexOf('url("') === 0) {
			return attrVal.substring(5, attrVal.indexOf('"',6));
		}
		// url('#somegrad')
		else if (attrVal.indexOf("url('") === 0) {
			return attrVal.substring(5, attrVal.indexOf("'",6));
		}
		else if (attrVal.indexOf("url(") === 0) {
			return attrVal.substring(4, attrVal.indexOf(')'));
		}
	}
	return null;
};

// Function: svgedit.utilities.getHref
// Returns the given element's xlink:href value
svgedit.utilities.getHref = function(elem) {
	return elem.getAttributeNS(NS.XLINK, 'href');
};

// Function: svgedit.utilities.setHref
// Sets the given element's xlink:href value
svgedit.utilities.setHref = function(elem, val) {
	elem.setAttributeNS(NS.XLINK, 'xlink:href', val);
};

// Function: findDefs
//
// Returns:
// The document's <defs> element, create it first if necessary
svgedit.utilities.findDefs = function() {
	var svgElement = editorContext_.getSVGContent();
	var defs = svgElement.getElementsByTagNameNS(NS.SVG, 'defs');
	if (defs.length > 0) {
		defs = defs[0];
	} else {
		defs = svgElement.ownerDocument.createElementNS(NS.SVG, 'defs');
		if (svgElement.firstChild) {
			// first child is a comment, so call nextSibling
			svgElement.insertBefore(defs, svgElement.firstChild.nextSibling);
		} else {
			svgElement.appendChild(defs);
		}
	}
	return defs;
};

// TODO(codedread): Consider moving the next to functions to bbox.js

// Function: svgedit.utilities.getPathBBox
// Get correct BBox for a path in Webkit
// Converted from code found here:
// http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
//
// Parameters:
// path - The path DOM element to get the BBox for
//
// Returns:
// A BBox-like object
svgedit.utilities.getPathBBox = function(path) {
	var seglist = path.pathSegList;
	var tot = seglist.numberOfItems;

	var bounds = [[], []];
	var start = seglist.getItem(0);
	var P0 = [start.x, start.y];

	for(var i=0; i < tot; i++) {
		var seg = seglist.getItem(i);

		if(typeof seg.x == 'undefined') continue;

		// Add actual points to limits
		bounds[0].push(P0[0]);
		bounds[1].push(P0[1]);

		if(seg.x1) {
			var P1 = [seg.x1, seg.y1],
				P2 = [seg.x2, seg.y2],
				P3 = [seg.x, seg.y];

			for(var j=0; j < 2; j++) {

				var calc = function(t) {
					return Math.pow(1-t,3) * P0[j]
						+ 3 * Math.pow(1-t,2) * t * P1[j]
						+ 3 * (1-t) * Math.pow(t, 2) * P2[j]
						+ Math.pow(t,3) * P3[j];
				};

				var b = 6 * P0[j] - 12 * P1[j] + 6 * P2[j];
				var a = -3 * P0[j] + 9 * P1[j] - 9 * P2[j] + 3 * P3[j];
				var c = 3 * P1[j] - 3 * P0[j];

				if(a == 0) {
					if(b == 0) {
						continue;
					}
					var t = -c / b;
					if(0 < t && t < 1) {
						bounds[j].push(calc(t));
					}
					continue;
				}
				var b2ac = Math.pow(b,2) - 4 * c * a;
				if(b2ac < 0) continue;
				var t1 = (-b + Math.sqrt(b2ac))/(2 * a);
				if(0 < t1 && t1 < 1) bounds[j].push(calc(t1));
				var t2 = (-b - Math.sqrt(b2ac))/(2 * a);
				if(0 < t2 && t2 < 1) bounds[j].push(calc(t2));
			}
			P0 = P3;
		} else {
			bounds[0].push(seg.x);
			bounds[1].push(seg.y);
		}
	}

	var x = Math.min.apply(null, bounds[0]);
	var w = Math.max.apply(null, bounds[0]) - x;
	var y = Math.min.apply(null, bounds[1]);
	var h = Math.max.apply(null, bounds[1]) - y;
	return {
		'x': x,
		'y': y,
		'width': w,
		'height': h
	};
};

// Function: groupBBFix
// Get the given/selected element's bounding box object, checking for
// horizontal/vertical lines (see issue 717)
// Note that performance is currently terrible, so some way to improve would
// be great.
//
// Parameters:
// selected - Container or <use> DOM element
function groupBBFix(selected) {
	if(svgedit.browser.supportsHVLineContainerBBox()) {
		try { return selected.getBBox();} catch(e){}
	}
	var ref = $.data(selected, 'ref');
	var matched = null;
	var ret;

	if(ref) {
		var copy = $(ref).children().clone().attr('visibility', 'hidden');
		$(svgroot_).append(copy);
		matched = copy.filter('line, path');
	} else {
		matched = $(selected).find('line, path');
	}

	var issue = false;
	if(matched.length) {
		matched.each(function() {
			var bb = this.getBBox();
			if(!bb.width || !bb.height) {
				issue = true;
			}
		});
		if(issue) {
			var elems = ref ? copy : $(selected).children();
			ret = getStrokedBBox(elems);
		} else {
			ret = selected.getBBox();
		}
	} else {
		ret = selected.getBBox();
	}
	if(ref) {
		copy.remove();
	}
	return ret;
}

// Function: svgedit.utilities.getBBox
// Get the given/selected element's bounding box object, convert it to be more
// usable when necessary
//
// Parameters:
// elem - Optional DOM element to get the BBox for
svgedit.utilities.getBBox = function(elem) {
	var selected = elem || editorContext_.geSelectedElements()[0];
	if (elem.nodeType != 1) return null;
	var ret = null;
	var elname = selected.nodeName;

	switch ( elname ) {
	case 'text':
		if(selected.textContent === '') {
			selected.textContent = 'a'; // Some character needed for the selector to use.
			ret = selected.getBBox();
			selected.textContent = '';
		} else {
			try { ret = selected.getBBox();} catch(e){}
		}
		break;
	case 'path':
		if(!svgedit.browser.supportsPathBBox()) {
			ret = svgedit.utilities.getPathBBox(selected);
		} else {
			try { ret = selected.getBBox();} catch(e){}
		}
		break;
	case 'g':
	case 'a':
		ret = groupBBFix(selected);
		break;
	default:

		if(elname === 'use') {
			ret = groupBBFix(selected, true);
		}
		if(elname === 'use' || ( elname === 'foreignObject' && svgedit.browser.isWebkit() ) ) {
			if(!ret) ret = selected.getBBox();
			// This is resolved in later versions of webkit, perhaps we should
			// have a featured detection for correct 'use' behavior?
			// ——————————
			//if(!svgedit.browser.isWebkit()) {
				var bb = {};
				bb.width = ret.width;
				bb.height = ret.height;
				bb.x = ret.x + parseFloat(selected.getAttribute('x')||0);
				bb.y = ret.y + parseFloat(selected.getAttribute('y')||0);
				ret = bb;
			//}
		} else if(~visElems_arr.indexOf(elname)) {
			try { ret = selected.getBBox();}
			catch(e) {
				// Check if element is child of a foreignObject
				var fo = $(selected).closest('foreignObject');
				if(fo.length) {
					try {
						ret = fo[0].getBBox();
					} catch(e) {
						ret = null;
					}
				} else {
					ret = null;
				}
			}
		}
	}
	if(ret) {
		ret = svgedit.utilities.bboxToObj(ret);
	}

	// get the bounding box from the DOM (which is in that element's coordinate system)
	return ret;
};

// Function: svgedit.utilities.getRotationAngle
// Get the rotation angle of the given/selected DOM element
//
// Parameters:
// elem - Optional DOM element to get the angle for
// to_rad - Boolean that when true returns the value in radians rather than degrees
//
// Returns:
// Float with the angle in degrees or radians
svgedit.utilities.getRotationAngle = function(elem, to_rad) {
	var selected = elem || editorContext_.getSelectedElements()[0];
	// find the rotation transform (if any) and set it
	var tlist = svgedit.transformlist.getTransformList(selected);
	if(!tlist) return 0; // <svg> elements have no tlist
	var N = tlist.numberOfItems;
	for (var i = 0; i < N; ++i) {
		var xform = tlist.getItem(i);
		if (xform.type == 4) {
			return to_rad ? xform.angle * Math.PI / 180.0 : xform.angle;
		}
	}
	return 0.0;
};

// Function getRefElem
// Get the reference element associated with the given attribute value
//
// Parameters:
// attrVal - The attribute value as a string
svgedit.utilities.getRefElem = function(attrVal) {
	return svgedit.utilities.getElem(svgedit.utilities.getUrlFromAttr(attrVal).substr(1));
};

// Function: getElem
// Get a DOM element by ID within the SVG root element.
//
// Parameters:
// id - String with the element's new ID
if (svgedit.browser.supportsSelectors()) {
	svgedit.utilities.getElem = function(id) {
		// querySelector lookup
		return svgroot_.querySelector('#'+id);
	};
} else if (svgedit.browser.supportsXpath()) {
	svgedit.utilities.getElem = function(id) {
		// xpath lookup
		return domdoc_.evaluate(
			'svg:svg[@id="svgroot"]//svg:*[@id="'+id+'"]',
			domcontainer_,
			function() { return svgedit.NS.SVG; },
			9,
			null).singleNodeValue;
	};
} else {
	svgedit.utilities.getElem = function(id) {
		// jQuery lookup: twice as slow as xpath in FF
		return $(svgroot_).find('[id=' + id + ']')[0];
	};
}

// Function: assignAttributes
// Assigns multiple attributes to an element.
//
// Parameters:
// node - DOM element to apply new attribute values to
// attrs - Object with attribute keys/values
// suspendLength - Optional integer of milliseconds to suspend redraw
// unitCheck - Boolean to indicate the need to use svgedit.units.setUnitAttr
svgedit.utilities.assignAttributes = function(node, attrs, suspendLength, unitCheck) {
	if(!suspendLength) suspendLength = 0;
	// Opera has a problem with suspendRedraw() apparently
	var handle = null;
	if (!svgedit.browser.isOpera()) svgroot_.suspendRedraw(suspendLength);

	for (var i in attrs) {
		var ns = (i.substr(0,4) === 'xml:' ? NS.XML :
			i.substr(0,6) === 'xlink:' ? NS.XLINK : null);

		if(ns) {
			node.setAttributeNS(ns, i, attrs[i]);
		} else if(!unitCheck) {
			node.setAttribute(i, attrs[i]);
		} else {
			svgedit.units.setUnitAttr(node, i, attrs[i]);
		}
	}
	if (!svgedit.browser.isOpera()) svgroot_.unsuspendRedraw(handle);
};

// Function: cleanupElement
// Remove unneeded (default) attributes, makes resulting SVG smaller
//
// Parameters:
// element - DOM element to clean up
svgedit.utilities.cleanupElement = function(element) {
	var handle = svgroot_.suspendRedraw(60);
	var defaults = {
		'fill-opacity':1,
		'stop-opacity':1,
		'opacity':1,
		'stroke':'none',
		'stroke-dasharray':'none',
		'stroke-linejoin':'miter',
		'stroke-linecap':'butt',
		'stroke-opacity':1,
		'stroke-width':1,
		'rx':0,
		'ry':0
	};

	for(var attr in defaults) {
		var val = defaults[attr];
		if(element.getAttribute(attr) == val) {
			element.removeAttribute(attr);
		}
	}

	svgroot_.unsuspendRedraw(handle);
};

// Function: snapToGrid
// round value to for snapping
// NOTE: This function did not move to svgutils.js since it depends on curConfig.
svgedit.utilities.snapToGrid = function(value) {
	var stepSize = editorContext_.getSnappingStep();
	var unit = editorContext_.getBaseUnit();
	if (unit !== "px") {
		stepSize *= svgedit.units.getTypeMap()[unit];
	}
	value = Math.round(value/stepSize)*stepSize;
	return value;
};

})();


text:
#import "ViewController.h"

int tip = 0;

@interface ViewController ()<UITextFieldDelegate>

@end

@implementation ViewController

    + (void)initialize
    {
        [super initialize];
        NSLog(@"%d initialized", tip++);
    }

    - (instancetype)init
    {
        self = [super init];
        if (self)
        {

        }
        NSLog(@"%d init", tip++);
        return self;
    }

    - (instancetype)initWithCoder:(NSCoder *)coder
    {
        self = [super initWithCoder:coder];
        if (self)
        {

        }
        NSLog(@"%d initWithCoder", tip++);
        return self;
    }

    - (void)awakeFromNib
    {
        [super awakeFromNib];
        NSLog(@"%d awakeFromNib", tip++);
    }

    - (void)loadView
    {
        [super loadView];
        NSLog(@"%d loadView", tip++);
    }

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        /* Do any additional setup after loading the view, typically from a nib. */
        NSLog(@"%d viewDidLoad", tip++);

        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 50, 300, 50)];

        // Set the label caption
        label.text = @"Hello, welcome to iOS development world.";
        label.backgroundColor = [UIColor grayColor];     // Set the color of background
        label.font = [UIFont systemFontOfSize:15];      // Set the font size
        label.textColor = [UIColor whiteColor];         // Set the color of text in the label
        label.textAlignment = NSTextAlignmentCenter;    // Set the alignment : Center
        label.shadowColor = [UIColor greenColor];       // Set the shadow color
        // label.shadowOffset = CGSizeMake(10, 10);        // Set the offset for shadow.
        label.numberOfLines = 0;                        // Allow to wrap the long text line.
        label.lineBreakMode = NSLineBreakByWordWrapping;
                              // NSLineBreakByCharWrapping;

        [self.view addSubview:label];

    /**********************************************************************************************/

        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setBackgroundImage:[UIImage imageNamed:@"icon.gif"] forState:UIControlStateNormal];
        button.frame = CGRectMake(100, 400, 240, 30);
        button.backgroundColor = [UIColor blueColor];
        [button setTitle:@"Click me" forState:UIControlStateNormal];
        [button addTarget:self
                   action:@selector(changeColor)
         forControlEvents:UIControlEventTouchUpInside];

        [self.view addSubview:button];

    /**********************************************************************************************/

        UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(20, 300, 280, 30)];
        textField.borderStyle = UITextBorderStyleRoundedRect;
        textField.placeholder = @"Please enter your mobile phone number";
        textField.textColor = [UIColor redColor];
        textField.font = [UIFont systemFontOfSize:14];
        textField.textAlignment = NSTextAlignmentLeft;

        UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image"]];
        textField.leftView = imageView;
        textField.leftViewMode = UITextFieldViewModeAlways;

        textField.delegate = self;

        [self.view addSubview:textField];

    /**********************************************************************************************/

        UISwitch *mySwitch = [[UISwitch alloc] initWithFrame:CGRectMake(200, 150, 800, 20)];
        _switchOnLabel  = [[UILabel alloc] initWithFrame:CGRectMake(255, 135, 100, 60)];
        _switchOffLabel = [[UILabel alloc] initWithFrame:CGRectMake(95, 135, 100, 60)];
        _switchOnLabel.text = @"ON";
        _switchOffLabel.text = @"OFF";
        _switchOnLabel.textColor = [UIColor blackColor];
        _switchOffLabel.textColor = [UIColor blackColor];
        _switchOffLabel.textAlignment = NSTextAlignmentRight;
        _switchOnLabel.textAlignment = NSTextAlignmentLeft;

        mySwitch.onTintColor = [UIColor greenColor];
        mySwitch.tintColor = [UIColor redColor];
        mySwitch.thumbTintColor = [UIColor orangeColor];
        [mySwitch addTarget:self
                     action:@selector(changeHint:)
           forControlEvents:(UIControlEventValueChanged)];

        [self.view addSubview:mySwitch];
        [self.view addSubview:_switchOnLabel];
        [self.view addSubview:_switchOffLabel];
    }

    - (void)viewWillLayoutSubviews
    {
        [super viewWillLayoutSubviews];
        NSLog(@"%d viewWillLayoutSubViews", tip++);
    }

    - (void)viewDidLayoutSubviews
    {
        [super viewDidLayoutSubviews];
        NSLog(@"%d viewDidLayoutSubviews", tip++);
    }

    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
        /* Dispose of any resources that can be recreated. */
        NSLog(@"%d didReceiveMemoryWarning", tip++);
    }

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
        NSLog(@"%d viewWillAppear", tip++);
    }

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
        NSLog(@"%d viewDidAppear", tip++);
    }

    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
        NSLog(@"%d viewWillDisappear", tip++);
    }

    - (void)viewDidDisappear:(BOOL)animated
    {
        [super viewDidDisappear:animated];
        NSLog(@"%d viewDidDisappear", tip++);
    }

    - (void)dealloc
    {
        NSLog(@"%d dealloc", tip++);
    }

    - (void)changeColor
    {
        self.view.backgroundColor = [UIColor colorWithRed:arc4random()%0xFF/255.0
                                                    green:arc4random()%0xFF/255.0
                                                     blue:arc4random()%0xFF/255.0
                                                    alpha:1];
    }

    - (void)changeHint:(UISwitch *)userSwitch
    {
        if (userSwitch.isOn)
        {
            _switchOnLabel.text = @"Switch ON";
            _switchOnLabel.textColor = [UIColor greenColor];

            _switchOffLabel.text = @"";
        }
        else
        {
            _switchOffLabel.text = @"Switch OFF";
            _switchOffLabel.textColor = [UIColor redColor];

            _switchOnLabel.text = @"";
        }
    }

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range
                                                           replacementString:(NSString *)string
    {
        if (string.length > 0)
        {
            if (([string characterAtIndex:0] < '0') | ([string characterAtIndex:0] > '9'))
            {
                NSLog(@"Please enter digit");
                return NO;
            }

            if (textField.text.length + string.length > 11)
            {
                NSLog(@"Exceed 11 digits");
                return NO;
            }
        }
        return YES;
    }

@end

redpajama_set_name: RedPajamaGithub


text:
package fr.soreth.VanillaPlus.Command;

import java.util.List;

import org.bukkit.configuration.ConfigurationSection;

import fr.soreth.VanillaPlus.VanillaPlusCore;
import fr.soreth.VanillaPlus.Error;
import fr.soreth.VanillaPlus.ErrorLogger;
import fr.soreth.VanillaPlus.Node;
import fr.soreth.VanillaPlus.PlaceH;
import fr.soreth.VanillaPlus.Message.Message;
import fr.soreth.VanillaPlus.Message.MessageManager;
import fr.soreth.VanillaPlus.Player.Currency;
import fr.soreth.VanillaPlus.Player.VPPlayer;
import fr.soreth.VanillaPlus.Player.VPSender;
import fr.soreth.VanillaPlus.Utils.Utils;

/**
 * This command allow you to give or remove money to player.
 *
 * TYPE: CURRENCY_SET
 * CURRENCY: id of currency // log if invalid, will be the default currency if not specified.
 * REMOVE: true // default false, if true will remove money.
 * SUCCESS: Message's path // default VOID, will send to sender's players as result if successfully executed, 'receiver' for receiver placeholder, '%currency% for currency format.
 * ALREADY: Message's path // default VOID, will send to sender's players as result if set is true and player have already value, 'receiver' for receiver placeholder, '%currency% for currency format.
 *
 * Usage : <label> [receiver] <amount> [currency's alias]
 *
 * @author Soreth.
 */

public class CPCurrencySet extends CPSimple{
	private final Currency defaultCurrency;
	private final Message alreadyOther;
	private final boolean remove, set;
	public CPCurrencySet(ConfigurationSection section, MessageManager manager){
		this(section, manager, section.getName());
	}
	public CPCurrencySet(ConfigurationSection section, MessageManager manager, String name){
		super(section, manager, name);
		defaultCurrency = VanillaPlusCore.getCurrencyManager().get((short) section.getInt(Node.CURRENCY.get()));
		if(defaultCurrency == null){
			ErrorLogger.addError(Node.CURRENCY.get());
			Error.INVALID.add();
		}
		set  = section.getBoolean("SET", false);
		if(!set) remove = section.getBoolean(Node.REMOVE.get(), false);
		else remove = false;
		alreadyOther = manager.get(section.getString(Node.ALREADY.getOther()));
		argumentRequired = 1;
	}
	@Override
	protected CommandResult apply(VPSender receiver, String label, List<String> args) {
		VPPlayer toSend;
		double amount;
		Currency currency;
		if(Utils.isValidDouble(args.get(0))) {
			toSend = (VPPlayer) (( receiver instanceof VPPlayer ) ? receiver : null);
			amount = Utils.parseDouble(args.get(0), 0.0, false);
			currency = args.size() > 1 ? VanillaPlusCore.getCurrencyManager().get(args.get(1)) : defaultCurrency;
		}else if(args.size() > 1) {
			toSend = VanillaPlusCore.getPlayerManager().getPlayer(args.get(0));
			if(toSend == null){
				return CommandResult.FAIL;
			}
			amount = Utils.parseDouble(args.get(1), 0.0, false);
			currency = args.size() > 2 ? VanillaPlusCore.getCurrencyManager().get(args.get(2)) : defaultCurrency;
		}else {
			return CommandResult.FAIL;
		}
		if(amount <= 0){
			return CommandResult.FAIL;
		}
		if(currency == null){
			return CommandResult.FAIL;
		}
		if(set){
			double value = toSend == null ? currency.getServer() : toSend.getCurrency(currency.getID());
			if(value < amount){
				value = ( toSend == null ) ? currency.addServer(amount) : currency.deposit(toSend, amount - value, receiver);
			}else if(value != amount){
				value = ( toSend == null ) ? currency.addServer(amount) : currency.paiement(toSend, value - amount, receiver);
			}else {
				if(toSend == null || receiver.equals(toSend)) {
					already.addCReplacement(PlaceH.CURRENCY.get(), currency.getName(amount))
					.addReplacement("amount", currency.format(amount));
					return CommandResult.CANCELED;
				}else {
					alreadyOther.addCReplacement(PlaceH.CURRENCY.get(), currency.getName(amount))
					.addReplacement("amount", currency.format(amount))
					.addSReplacement(PlaceH.RECEIVER.get(), toSend == null ? VanillaPlusCore.getVPConsole() : toSend)
					.sendTo(receiver);
					return CommandResult.CANCELED_OTHER;
				}
			}
			if(value == 0)
				return CommandResult.CANCELED_OTHER;
		}else if(remove){
			amount = ( toSend == null ) ? currency.addServer(amount) : currency.paiement(toSend, amount, receiver);
		}else{
			amount = ( toSend == null ) ? currency.addServer(amount) : currency.deposit(toSend, amount, receiver);
		}
		if(amount == 0 || receiver.equals(toSend))
			return CommandResult.CANCELED_OTHER;
		success.addCReplacement(PlaceH.CURRENCY.get(), currency.getName(amount))
		.addReplacement("amount", currency.format(amount))
		.addSReplacement(PlaceH.RECEIVER.get(), toSend == null ? VanillaPlusCore.getVPConsole() : toSend);
		return CommandResult.SUCCESS;
	}
	@Override
	public List<String> onTab(VPSender sender, String label, List<String> args) {
		if(args == null || args.isEmpty())
			return null;
		boolean isDouble = Utils.isValidDouble(args.get(0));
		if( ( isDouble && args.size() == 2 ) || ( !isDouble && args.size() == 3 ) ) {
			return VanillaPlusCore.getCurrencyManager().getCurrencyList(args.get( args.size() - 1 ).toLowerCase(), false);
		}else if(!isDouble && args.size() == 1) {
			return VanillaPlusCore.getPlayerManager().getPlayersList(args.get(0), false);
		}else {
			return null;
		}
	}

}


text:
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace Lockstep {
    public static class LSFSettingsModifier {

        internal static void Save () {
            EditorUtility.SetDirty (LSFSettingsManager.GetSettings ());
            AssetDatabase.SaveAssets ();
            AssetDatabase.Refresh ();
        }
    }
}


text:
package com.BeeFramework.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.BeeFramework.model.DebugMessageModel;
import com.external.androidquery.callback.AjaxCallback;

public class DebugMessageListAdapter extends BaseAdapter{
    private Context context;

    public DebugMessageListAdapter( Context context)
    {
        this.context = context;
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return DebugMessageModel.messageList.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        int size = DebugMessageModel.messageList.size();
        AjaxCallback msg = DebugMessageModel.messageList.get(size -1 -position);
        String msgDesc = msg.toString();
        TextView itemView = new TextView(this.context);
        itemView.setText(msgDesc);
        return itemView;
    }
}


text:
'''

  canteen HTTP etag-related logic
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  :author: Sam Gammon <sam@keen.io>
  :copyright: (c) Keen IO, 2013
  :license: This software makes use of the MIT Open Source License.
            A copy of this license is included as ``LICENSE.md`` in
            the root of the project.

'''

# core runtime
from canteen.base import logic
from canteen.core import runtime

# canteen utils
from canteen.util import config
from canteen.util import decorators

# core session API
from canteen.core.api.session import SessionEngine
from canteen.core.api.content import ContentFilter

with runtime.Library('werkzeug', strict=True) as (library, werkzeug):

  @decorators.bind('etags')
  class ETags(logic.Logic):

    '''  '''

    @SessionEngine.configure('etags')
    class ETagSessions(SessionEngine):

      '''  '''

      ## == Session Management == ##
      def load(self, context):

        '''  '''

        pass

      def commit(self, context, session):

        '''  '''

        pass

    ## == Configuration == ##
    @decorators.classproperty
    def config(cls):

      '''  '''

      return config.Config().get('http', {}).get('etags', {'debug': True})

    ## == Non-session Management == ##
    @ContentFilter(request=True)
    def request(self, **context):

      '''  '''

      pass

    @ContentFilter(response=True)
    def response(self, **context):

      '''  '''

      pass

  __all__ = (
    'Etags',
  )


text: window.App = require('./App.js');


text:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE toc
  PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 2.0//EN"
         "http://java.sun.com/products/javahelp/toc_2_0.dtd">

<toc version="2.0">
	<tocitem text="Gabay ng mga Gumagamit ng ZAP" tocid="toplevelitem">
		<tocitem text="Add Ons" tocid="addons">
			<tocitem text="Mga Patakaran sa Aktibong Pag-scan ng DOM XSS" target="domxss">
				<tocitem text="About" target="domxss.about"/>
			</tocitem>
		</tocitem>
	</tocitem>
</toc>


text:
import java.util.HashMap;
import java.util.Map;

public class Cheers {
    @SuppressWarnings("FieldCanBeLocal")
    private final int MAX_PIXELS = 10000;
    HashMap<String, Integer> moteCounts = new HashMap<>();
    HashMap<String, Integer> partMoteCounts = new HashMap<>();
    private int minPixels;

    public String reportCheers(int minPixels, String messages, String[] motes) {
        boolean valid;
        this.minPixels = minPixels;
        initMotes(motes);
        String[] parts = messages.split(",");
        for (String part : parts) {
            partMoteCounts.clear();
            valid = getPartMoteCounts(part);
            if (valid) {
                addPartMoteCounts(partMoteCounts, moteCounts);
            }
        }
        return getReport(moteCounts);
    }

    public boolean getPartMoteCounts(String part) {
        Mote mote;
        String[] words = part.split("[ ,.;:!?]");

        for (String word : words) {
            mote = getMote(word);
            if (mote.count > 0) {
                if (mote.count < minPixels || mote.count > MAX_PIXELS) {
                    return false;
                }
                addPartMoteCount(mote);
            }
        }
        return true;
    }

    public Mote getMote(String word) {
        Mote mote = new Mote();
        int i = word.length() - 1;
        StringBuilder numStr = new StringBuilder();
        while (i >= 0 && word.charAt(i) >= '0' && word.charAt(i) <= '9') {
            numStr.insert(0, word.charAt(i));
            i--;
        }
        if (numStr.length() > 0) {
            mote.count = Integer.parseInt(numStr.toString());
            mote.word = word.substring(0, i + 1);
        }
        return mote;
    }

    public void addPartMoteCount(Mote mote) {
        int newCount;
        if (partMoteCounts.containsKey(mote.word)) {
            newCount = partMoteCounts.get(mote.word) + mote.count;
        } else {
            newCount = mote.count;
        }
        partMoteCounts.put(mote.word, newCount);
    }

    public void addPartMoteCounts(HashMap<String, Integer> partMoteCounts, HashMap<String, Integer> moteCounts) {
        int newCount;
        for (Map.Entry<String, Integer> entry : partMoteCounts.entrySet()) {
            String mote = entry.getKey();
            Integer count = entry.getValue();
            if (moteCounts.containsKey(mote)) {
                newCount = moteCounts.get(mote) + count;
            } else {
                newCount = count;
            }
            moteCounts.put(mote, newCount);
        }
    }

    public void initMotes(String[] motes) {
        for (String mote : motes) {
            moteCounts.put(mote, 0);
        }
    }

    public String getReport(HashMap<String, Integer> moteCounts) {
        StringBuilder report = new StringBuilder();
        boolean first = true;

        for (Map.Entry<String, Integer> entry : moteCounts.entrySet()) {
            Integer count = entry.getValue();
            if (count >  0) {
                if (!first) {
                    report.append(",");
                }
                String mote = entry.getKey();
                report.append(mote).append(":").append(count);
                first = false;
            }
        }
        if (report.toString().equals("")) {
            return("NO CHEERS");
        } else {
            return report.toString();
        }
    }

    static class Mote {
        String word = "";
        int count = 0;

        public Mote(String word, int count) {
            this.word = word;
            this.count = count;
        }

        public Mote() {
        }
    }
}


text:
{% load thumbnail %}{% if object %}

    {% if object.image %}{% endif %}

{{ object.name }}

    {{ object.body|safe }}

{% if object.url and object.url_text %}

    {{ object.url_text }}

{% endif %}
{% endif %}


text:
#include <stdio.h> /* NULL */
#include "common.h"
#include "constants.h"
#include "interpreter-instructions.h"
#include "interpreter-instructions-closure.h"
#include "interpreter-instructions-jump.h"
#include "interpreter-instructions-push.h"
#include "interpreter-instructions-return.h"
#include "interpreter-instructions-send.h"
#include "interpreter-instructions-stack.h"
#include "interpreter-instructions-store.h"

// Bytecode/instruction list:
//  (X, Y, Z means the first, the second and the third argument, respectively)
//
// byte   numArgs   instruction
// ----------------------------------------------------------------------------
// 1        1       push instance variable X
// 2        1       push class variable X
// 3        1       push temporary variable X
// 4        1       push global variable X
// 5        1       push literal constant X from constant pool
// 6        0       push self
// 7        0       push nil
// 8        0       push true
// 9        0       push false
// 10       0       push Smalltalk
// 11       0       push thisContext
// 12       1       store into instance variable X
// 13       1       store into class variable X
// 14       1       store into temporary variable X
// 16       0       pop
// 17       0       duplicate top
// 18       0       return top from method
// 19       0       return top from block
// 20       2       send selector X from constant pool with Y arguments
// 21       2       send selector X from constant pool with Y arguments to superclass
// 22       2       jump (X−128)×256+Y
// 23       2       pop and jump (X−128)×256+Y if true
// 24       2       pop and jump (X−128)×256+Y if false
// 25       2       pop and jump (X−128)×256+Y if nil
// 26       2       pop and jump (X−128)×256+Y if not nil
// 30       3       create block closure with X parameters, Y temporaries and variable offset Z
// 40       1       send special selector X with 0 arguments
// 41       1       send special selector X with 1 argument
// 42       1       send special selector X with 2 arguments
// 43       0       send selector #== with 1 argument
// 44       0       send selector #~~ with 1 argument
// 50       0       push instance variable 0
// 51       0       push instance variable 1
// 52       0       push instance variable 2
// 53       0       push instance variable 3
// 54       0       push instance variable 4
// 55       0       push temporary variable 0
// 56       0       push temporary variable 1
// 57       0       push temporary variable 2
// 58       0       push temporary variable 3
// 59       0       push temporary variable 4
// 60       0       return nil from method
// 61       0       return true from method
// 62       0       return false from method
// 63       0       return self from method
// 64       0       return instance variable 0 from method
// 65       0       return instance variable 1 from method
// 66       0       return instance variable 2 from method
// 67       0       return temporary variable 0 from method
// 68       0       return temporary variable 1 from method
// 69       0       return temporary variable 2 from method
// 70       0       push SmallInteger 1
// 71       0       push SmallInteger 0
// 72       0       push SmallInteger −1

void (* bytecodeInstructions[128])(OP) = {
	// 0
	NULL,
	interpretPushInstanceVariable,
	interpretPushClassVariable,
	interpretPushTemporaryVariable,
	interpretPushGlobalVariable,
	// 5
	interpretPushLiteralConstant,
	interpretPushSelf,
	interpretPushNil,
	interpretPushTrue,
	interpretPushFalse,
	// 10
	interpretPushSmalltalk,
	interpretPushThisContext,
	interpretStoreIntoInstanceVariable,
	interpretStoreIntoClassVariable,
	interpretStoreIntoTemporaryVariable,
	// 15
	NULL,
	interpretPop,
	interpretDuplicateTop,
	interpretReturnTopFromMethod,
	interpretReturnTopFromBlock,
	// 20
	interpretSendSelector,
	interpretSendSelectorToSuper,
	interpretJump,
	interpretPopJumpIfTrue,
	interpretPopJumpIfFalse,
	// 25
	interpretPopJumpIfNil,
	interpretPopJumpIfNotNil,
	NULL,
	NULL,
	NULL,
	// 30
	interpretCreateBlockClosure,
	NULL,
	NULL,
	NULL,
	NULL,
	// 35
	NULL, NULL, NULL, NULL, NULL,
	// 40
	interpretSendSpecialSelectorWith0Arguments,
	interpretSendSpecialSelectorWith1Argument,
	interpretSendSpecialSelectorWith2Arguments,
	interpretSendSelectorIdentical,
	interpretSendSelectorNotIdentical,
	// 45
	NULL, NULL, NULL, NULL, NULL,
	// 50
	interpretPushInstanceVariable0,
	interpretPushInstanceVariable1,
	interpretPushInstanceVariable2,
	interpretPushInstanceVariable3,
	interpretPushInstanceVariable4,
	// 55
	interpretPushTemporaryVariable0,
	interpretPushTemporaryVariable1,
	interpretPushTemporaryVariable2,
	interpretPushTemporaryVariable3,
	interpretPushTemporaryVariable4,
	// 60
	interpretReturnNilFromMethod,
	interpretReturnTrueFromMethod,
	interpretReturnFalseFromMethod,
	interpretReturnSelfFromMethod,
	interpretReturnInstanceVariable0FromMethod,
	// 65
	interpretReturnInstanceVariable1FromMethod,
	interpretReturnInstanceVariable2FromMethod,
	interpretReturnTemporaryVariable0FromMethod,
	interpretReturnTemporaryVariable1FromMethod,
	interpretReturnTemporaryVariable2FromMethod,
	// 70
	interpretPushSmallInteger1,
	interpretPushSmallInteger0,
	interpretPushSmallIntegerNeg1,
};


text:
<div class="col-sm-<?php echo $content_width; ?> search">
  <?php echo $search_box; ?>


text:
#include <math.h>

#include "aom_ports/bitops.h"
#include "av1/common/entropymode.h"
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"

TEST(Log2Test, GetMsb) {
  // Test small numbers exhaustively.
  for (unsigned int n = 1; n < 10000; n++) {
    EXPECT_EQ(get_msb(n), static_cast<int>(floor(log2(n))));
  }

  // Test every power of 2 and the two adjacent numbers.
  for (int exponent = 2; exponent < 32; exponent++) {
    const unsigned int power_of_2 = 1U << exponent;
    EXPECT_EQ(get_msb(power_of_2 - 1), exponent - 1);
    EXPECT_EQ(get_msb(power_of_2), exponent);
    EXPECT_EQ(get_msb(power_of_2 + 1), exponent);
  }
}

TEST(Log2Test, Av1CeilLog2) {
  // Test small numbers exhaustively.
  EXPECT_EQ(av1_ceil_log2(0), 0);
  for (int n = 1; n < 10000; n++) {
    EXPECT_EQ(av1_ceil_log2(n), static_cast<int>(ceil(log2(n))));
  }

  // Test every power of 2 and the two adjacent numbers.
  for (int exponent = 2; exponent < 31; exponent++) {
    const int power_of_2 = 1 << exponent;
    EXPECT_EQ(av1_ceil_log2(power_of_2 - 1), exponent);
    EXPECT_EQ(av1_ceil_log2(power_of_2), exponent);
    // The current implementation of av1_ceil_log2 only works up to 2^30.
    if (exponent < 30) {
      EXPECT_EQ(av1_ceil_log2(power_of_2 + 1), exponent + 1);
    }
  }
}


text:
package lius.index.application;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import lius.config.LiusConfig;
import lius.config.LiusField;
import lius.config.LiusProxyField;
import lius.config.LiusValueProxyField;
import lius.index.BaseIndexer;
import lius.index.ParsingResult;
import lius.index.parser.VCardParser;
import lius.index.util.VCard;

import org.apache.log4j.Logger;
import org.springframework.core.io.Resource;

/**
 * Class: VCardIndexer

 * This Indexer reads .vcf and .vcard files as exported by various email and PIM
 * applications (e.g. Mozilla Mail, Evolution, KMail). Fields which can be
 * indexed are:
 *

 *
name: The contact's full name

 *
title: Title (e.g. 'Dr.')

 *
nickname: nickname

 *
birthday: user notes

 *
email: email addresses

 *
phone: all available phone numbers

 *
homephone: home phone number

 *
workphone: work phone number

 *
cellphone: cell phone number

 *
categories: categories as used by the
 * creator-application

 *
address: all available addresses

 *
homeaddress: the home address

 *
workaddress: the work address

 *
url: the URL (usually an http address)

 *
organization: the organization

 *

 *
 Changelog:
 *

 *
02.06.2005: Initial implementation (jf)

 *

 *
 * @author Jens Fendler
 */
/**
 * Adapted by Rida Benjelloun
 */
public class VCardIndexer extends BaseIndexer {
    static Logger logger = Logger.getLogger(VCardIndexer.class);

    @Override
    public int getType() {
        return 1;
    }

    @Override
    public boolean isConfigured(LiusConfig liusConfig) {
        return liusConfig.getVCardFields() != null;
    }

    @Override
    public Collection getConfigurationFields(LiusConfig liusConfig) {
        return liusConfig.getVCardFields();
    }

    @Override
    public ParsingResult parseResource(LiusConfig liusConfig, Resource resource) {
        Collection c = new ArrayList();
        try {
            VCardParser vcp = new VCardParser(resource);
            for (Iterator i = liusConfig.getVCardFields().iterator(); i
                    .hasNext();) {
                Object next = i.next();
                if (next instanceof LiusField) {
                    LiusField lf = (LiusField) next;
                    addVCardProxyFields(vcp, lf, c);
                } else
                    c.add(next);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return new ParsingResult(c,"");
    }

    private void addVCardProxyFields(VCardParser vcp, LiusField lf, Collection c) {
        if ("name".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "FN", null, lf, c);
        } else if ("title".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "TITLE", null, lf, c);
        } else if ("nickname".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "NICKNAME", null, lf, c);
        } else if ("birthday".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "BDAY", null, lf, c);
        } else if ("notes".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "NOTE", null, lf, c);
        } else if ("email".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "EMAIL", null, lf, c);
        } else if ("phone".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "TEL", null, lf, c);
        } else if ("homephone".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "TEL", "HOME", lf, c);
        } else if ("workphone".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "TEL", "WORK", lf, c);
        } else if ("cellphone".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "TEL", "CELL", lf, c);
        } else if ("categories".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "CATEGORIES", null, lf, c);
        } else if ("address".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "ADR", null, lf, c);
        } else if ("homeaddress".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "ADR", "HOME", lf, c);
        } else if ("workaddress".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "ADR", "WORK", lf, c);
        } else if ("url".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "URL", null, lf, c);
        } else if ("organization".equalsIgnoreCase(lf.getGet())) {
            addElements(vcp, "ORG", null, lf, c);
        }
    }

    private void addElements(VCardParser vcp, String key, String type,
            LiusField realField, Collection c) {
        List cards = vcp.getCards();
        for (int i = 0; i < cards.size(); i++) {
            VCard card = (VCard) cards.get(i);
            String data = (type == null) ? card.getElement(key) : card
                    .getElement(key, type);
            if (data != null) {
                LiusProxyField lpf = new LiusValueProxyField(realField);
                lpf.setValue(data);
                c.add(lpf);
            }
        }
    }
}


text:
package com.vaadin.tests.layouts;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.TextField;

@SuppressWarnings("serial")
public class CssLayoutRemoveComponent extends TestBase {

    @Override
    protected void setup() {
        final CssLayout layout = new CssLayout();
        final TextField tf = new TextField("Caption1");
        Button b = new Button("Remove field ",
                event -> layout.removeComponent(tf));
        layout.addComponent(tf);
        layout.addComponent(b);
        layout.addComponent(new TextField("Caption2"));
        TextField tf3 = new TextField("Caption3");
        layout.addComponent(tf3);

        tf3.focus();

        addComponent(layout);
    }

    @Override
    protected String getDescription() {
        return "Clicking on the button should remove one text field but other textfields and their captions should stay intact.";
    }

    @Override
    protected Integer getTicketNumber() {
        return 5778;
    }

}


text:
<?php

namespace Matrix\Bundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Matrix\Bundle\Entity\Horario;
use Matrix\Bundle\Form\HorarioType;

/**
 * Horario controller.
 *
 * @Route("/horario")
 */
class HorarioController extends Controller
{

    /**
     * Lists all Horario entities.
     *
     * @Route("/", name="horario")
     * @Method("GET")
     * @Template()
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('MatrixBundle:Horario')->findAll();

        return array(
            'entities' => $entities,
        );
    }
    /**
     * Creates a new Horario entity.
     *
     * @Route("/", name="horario_create")
     * @Method("POST")
     * @Template("MatrixBundle:Horario:new.html.twig")
     */
    public function createAction(Request $request)
    {
        $entity = new Horario();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('horario_show', array('id' => $entity->getId())));
        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Creates a form to create a Horario entity.
     *
     * @param Horario $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(Horario $entity)
    {
        $form = $this->createForm(new HorarioType(), $entity, array(
            'action' => $this->generateUrl('horario_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Crear'));

        return $form;
    }

    /**
     * Displays a form to create a new Horario entity.
     *
     * @Route("/new", name="horario_new")
     * @Method("GET")
     * @Template()
     */
    public function newAction()
    {
        $entity = new Horario();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Finds and displays a Horario entity.
     *
     * @Route("/{id}", name="horario_show")
     * @Method("GET")
     * @Template()
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('MatrixBundle:Horario')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Horario entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Displays a form to edit an existing Horario entity.
     *
     * @Route("/{id}/edit", name="horario_edit")
     * @Method("GET")
     * @Template()
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('MatrixBundle:Horario')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Horario entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
    * Creates a form to edit a Horario entity.
    *
    * @param Horario $entity The entity
    *
    * @return \Symfony\Component\Form\Form The form
    */
    private function createEditForm(Horario $entity)
    {
        $form = $this->createForm(new HorarioType(), $entity, array(
            'action' => $this->generateUrl('horario_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Actualizar'));

        return $form;
    }
    /**
     * Edits an existing Horario entity.
     *
     * @Route("/{id}", name="horario_update")
     * @Method("PUT")
     * @Template("MatrixBundle:Horario:edit.html.twig")
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('MatrixBundle:Horario')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Horario entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            return $this->redirect($this->generateUrl('horario_edit', array('id' => $id)));
        }

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
    /**
     * Deletes a Horario entity.
     *
     * @Route("/{id}", name="horario_delete")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('MatrixBundle:Horario')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Horario entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('horario'));
    }

    /**
     * Creates a form to delete a Horario entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('horario_delete', array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', 'submit', array(
            'label' => 'Eliminar',
            'attr' => array('class' => 'button_delete btn btn-primary')))
            ->getForm()
        ;
    }
}


text:
<?php

/**
 * This file is part of symforium
 *
 * (c) Aaron Scherer <aequasi@gmail.com>
 *
 * This source file is subject to the license that is bundled
 * with this source code in the file LICENSE
 */

namespace Symforium\Plugin\CmsPlugin\Menu;

use Knp\Menu\ItemInterface;
use Symfony\Component\HttpFoundation\Request;
use Symforium\Core\MenuInterface;

/**
 * @author Aaron Scherer <aequasi@gmail.com>
 */
class CmsMenu implements MenuInterface
{
    /**
     * {@inheritdoc}
     */
    public function build(Request $request, ItemInterface $menu)
    {
        $cms = $menu->addChild('CMS', ['uri' => '#'])
            ->setAttribute('icon', 'pencil-square');

        $cms->addChild('View Pages', ['route' => 'symforium_plugin_cmsplugin_backend_view'])
            ->setAttribute('icon', 'files-o');

        $add = $cms->addChild('Add a new Page', ['route' => 'symforium_plugin_cmsplugin_backend_add'])
            ->setAttribute('icon', 'plus-square');

        $cmsUrls = ['symforium_plugin_cmsplugin_backend_edit'];
        if (in_array($request->attributes->get('_route'), $cmsUrls)) {
            $cms->setCurrent(true);
        }
    }
}


text:
This file is used to list changes made in each version of the postgresql cookbook.

## v5.0.0 (2016-10-25)

### Breaking changes

- Switched from Librarian to Berkshelf
- Remove support for the following platforms

  - SLES < 12
  - openSUSE < 13
  - Debian < 7
  - Ubuntu < 12.04
  - RHEL < 6
  - Amazon < 2013
  - Unsupported (EOL) Fedora releases

### Other changes

- Added support for Ubuntu 16.04
- Loosened cookbook dependencies to not prevent pulling in the latest community cookbooks
- Added chef_version metadata
- Switched from rubocop to cookstyle and fix all warnings
- Removed minitests and the minitest handler
- Added support for opensuse / opensuseleap
- Added support for Fedora 23/24
- Added a chefignore file to limit the files uploaded to the chef server
- Updated Test Kitchen config to test on modern platform releases
- Added a Rakefile and updated Travis to test with ChefDK and that rakefile
- Avoid installing packages included in build-essential twice in the ruby recipe
- Require at least build-essential 2.0
- Don't cleanup the old PPA files in the apt_pgdg_postgresql recipe anymore. These should be long gone everywhere
- Remove logic in the apt_pgdg_postgresql recipe that made Chef fail when new distro releases came out
- Avoid node.set deprecation warnings
- Avoid managed_home deprecation warnings in server_redhat recipe

## v4.0.6

- Add 16.04 Xenial to the allowed list

## v4.0.4

- Add leading pound symbol on pg_hba.conf template comment line
- Update gem install for compile_time to correct deprication warning
- Add support Ubuntu Wily Werewolf pgdg apt repository
- test-kitchen platforms for Centos 7.2 and Ubuntu 15.04
- Fixes PostgreSQL version & package name defaults for EL7 distros
- Add appropriate systemd unit file overrides for EL7 distros

## v4.0.2

- Add Code of Conduct
- Add Rubocop
- Clean up of syntax in many places as result of adding and evaluating Rubocop
- Updates to test-kitchen.yml
- added additional attribute for people who are importing pgdg packages for internal repositories

  - `default['postgresql']['use_pgdg_packages'] = false`

## v4.0.0

**WARNING: Please read carefully through the stated changes, as they probably will break your current setup and can result in duplicate postgresql versions being installed, configuration corruption and data loss! This list might not be complete, so be careful when using the 4.x version and make sure to test it extensively before production use!**

When in doubt, put the following in your `Berksfile` until you are ready to upgrade:

```ruby
cookbook 'postgresql', '~> 3.4.0'
```

- Potential breaking change: Restructured default attributes to avoid compile time deriving other attribute values from value of the `node['postgresql']['version']` (#313, #302, #295, #288, #280, #261, #260, #254, #248, #217, #214, #167, #143). If you specify a custom postgresql version, make sure to adapt the following attributes as well:

```ruby
default['postgresql']['dir'] = "/etc/postgresql/#{node['postgresql']['version']}/main"
default['postgresql']['client']['packages'] = [ "postgresql-client-#{node['postgresql']['version']}", 'libpq-dev' ]
default['postgresql']['server']['packages'] = [ "postgresql-#{node['postgresql']['version']}" ]
default['postgresql']['contrib']['packages'] = [ "postgresql-contrib-#{node['postgresql']['version']}" ]
```

- Potential breaking change: SSL configuration parameters. Due to the new structuring, make sure you set all SSL attributes to `override` when specifying them in a cookbook:

```ruby
override['postgresql']['config']['ssl'] = true
override['postgresql']['config']['ssl_cert_file'] = "/path/to/cert.crt"
override['postgresql']['config']['ssl_key_file']  = "/path/to/cert.key"
override['postgresql']['config']['ssl_ciphers']  = "<my cipher suite>"
```

- Potential breaking change: Some node attributes are now persistet in your node configuration. This affects the following attributes:

```json
"config": {
  "data_directory": "/var/lib/postgresql/9.4/main",
  "hba_file": "/etc/postgresql/9.4/main/pg_hba.conf",
  "ident_file": "/etc/postgresql/9.4/main/pg_ident.conf",
  "external_pid_file": "/var/run/postgresql/9.4-main.pid",
  "unix_socket_directories": "/var/run/postgresql",
  "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem",
  "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key"
}
```

- Potential breaking change: Parsing of attributes from node/ environment configuration. It has been reported that setting the `node['postgresql']['client']['packages']` attribute in a cookbook might result in the default version of the postgresql client package being installed alongside the required version. This might affect the server packages as well.
- Correct issues which caused the inability to override installation version defaults
- Correct issues which caused configuration file entries with miss matching version numbers and incorrect file system paths being defined
- Remove method pgdgrepo_rpm_info compile time use of derived attributes case many issues
- Use correct directory path and check for the correct not_if condition to determine if the database has been initialized
- Ensure that correct packages are installed in all scenarios where pg gem is compiled
- Fix errors in configuration files for unix_socket_directory and unix_socket_directories
- Updates to test-kitchen suite configuration
- Added more grey hair to my beard

## v3.4.24

- Corrections to address repositories signed with newer certificates that some distributions have in their default ca-certificates package
- Updates to more accurately determine distributions service init systems adds better support for systemd systems
- Correct how version attribute is evaluated in certain places
- test-kitchen suite configuration corrections
- Opensuse support

## v3.4.23

- Skipping 3.4.22 with Develop branch 3.4.23 to return to releasing cookbook from master on even numbers and develop on odd numbers.

## v3.4.21

- Use more optimistic openssl version constraint
- Add Postgresql 9.4 package sources for RHEL platforms
- Update testing infrastructure to address bit rot

## v3.4.20

- Revert [#251](https://github.com/hw-cookbooks/postgresql/pull/251), a change which caused the postgresql service to restart every Chef run.

## v3.4.19

- node.save could better not be run on every chef run since it causes node.default attributes stored to the node objects to differ during a chef run and when
- Missing attribute in docs for yum_pgdg_postgresql
- restart postgres service immediately on config change
- Run restart command right away on the postgresql service.
- Add kitchen test for shared_preload_libraries & extension setup.
- Fix install order of contrib packages to fix pg_stat_statements issues.
- Add Debian Jessie to whitelist for apt.postgresql.org repo
- Install version 9.4 on Debian Jessie
- add amazon 2015
- add rhel7 support

## v3.4.18

- Revert changes from #201 with the intention of revisiting these changes as part of the next major version release.
- Specify version constraint on openssl cookbook due to an upstream release mishap

## v3.4.16

- Changed hard coded value to attribute #219
- Correction for directory creation under debian, etc. #222
- Fedora 20 yum support #223
- Define version-sensitive attributes in a recipe #201

## v3.4.14

- Support apt repository for Ubuntu Utopic 14.10
- Do not try and set password on standby hosts

## v3.4.12

- Create configuration templates at the appropriate time
- If template is updated restart service changed to default of :delayed
- Fix SSL for PostgreSQL versions < 9.2

## v3.4.10

- correct conditional error created in 3.4.8.

## v3.4.8

- Correct scenario where work_mem could be set to 0 if con is greater than mem Issue #185
- Add Centos7 suites to kitchen configuration

## v3.4.6

- Don't include the pgdg recipes on the wrong machine types
- Add missing dir /etc/sysconfig/pgsl for centos7
- CentOS 7 package support

## v3.4.4

- fix packages on SLES11SP2 and higher
- [COOK-4737] Add flag to control database user password behavior
- add amazon platform rpm info
- Fix issues with the server_redhat recipe on Fedora 16 and later
- attribute typo correction
- correctly check and set max_connections to an integer

## v3.4.2

- Changed the Gem::Installer::ExtensionBuildError to a Mixlib::ShellOut::ShellCommandFailed

## v3.4.1

- Added support for Ubuntu 14.04 and Postgresql 9.3
- Fix [COOK-3490] <https://tickets.opscode.com/browse/COOK-3490>

## v3.4.0

Updated CONTRIBUTING document. Refreshed test kitchen configuration. Merged Pull Requests: 122, 116, 104, 102, 99, 96, 93, 90.

## v3.3.4

Testing

## v3.3.2

- Testing maintainer transfer to Heavywater with Opscode as collaborator

## v3.3.0

### Bug

- **[COOK-3851](https://tickets.opscode.com/browse/COOK-3851)** - Postgresql: reload after config change does not pick up certain configuration changes
- **[COOK-3611](https://tickets.opscode.com/browse/COOK-3611)** - unix_socket_directory does not exists in 9.3
- **[COOK-2954](https://tickets.opscode.com/browse/COOK-2954)** - PostgreSQL installation ignores version attribute on CentOS >= 6

## v3.2.0

- [COOK-3717] Pgdg repositories improvements
- [COOK-3756] Change postgresql.conf mode from 0600 to 0644

## v3.1.0

### Improvement

- **[COOK-3685](https://tickets.opscode.com/browse/COOK-3685)** - Upgrade Repo Attributes for Postgresql 9.3
- **[COOK-3597](https://tickets.opscode.com/browse/COOK-3597)** - Fix implementation of `initdb_locale` attribute for RHEL
- **[COOK-3566](https://tickets.opscode.com/browse/COOK-3566)** - Give the user's rules more priority than the default ones in pg_hba
- **[COOK-3553](https://tickets.opscode.com/browse/COOK-3553)** - Remove automatic `apt-get update`

### Bug

- **[COOK-3611](https://tickets.opscode.com/browse/COOK-3611)** - Remove `unix_socket_directory` (it does not exists in 9.3)
- **[COOK-3599](https://tickets.opscode.com/browse/COOK-3599)** - Automatically add PGDG apt repo dependency on PostgreSQL version
- **[COOK-3555](https://tickets.opscode.com/browse/COOK-3555)** - Documentation Fix
- **[COOK-2383](https://tickets.opscode.com/browse/COOK-2383)** - Update Postgres version in attributes

## v3.0.4

### Bug

- **[COOK-3173](https://tickets.opscode.com/browse/COOK-3173)** - Use :reload instead of :restart on conf changes
- **[COOK-2939](https://tickets.opscode.com/browse/COOK-2939)** - Fix RedHat support

## v3.0.2

### Bug

- [COOK-3076]: postgresql::ruby recipe error when using pgdg repositories

## v3.0.0

This is a backwards-incompatible release because the Pitti PPA is deprecated and the recipe removed, replaced with the PGDG apt repository.

### Bug

- [COOK-2571]: Create helper library for pg extension detection
- [COOK-2797]: Contrib extension contianing '-' fails to load.

### Improvement

- [COOK-2387]: Pitti Postgresql PPA is deprecated

### Task

- [COOK-3022]: update baseboxes in .kitchen.yml

## v2.4.0

- [COOK-2163] - Dangerous "assign-postgres-password" in "recipes/server.rb" -- Can lock out dbadmin access
- [COOK-2390] - Recipes to auto-generate many postgresql.conf settings, following "initdb" and "pgtune"
- [COOK-2435] - Foodcritic fixes for postgresql cookbook
- [COOK-2476] - Installation into database of any contrib module extensions listed in a node attribute

## v2.2.2

- [COOK-2232] -Provide PGDG yum repo to install postgresql 9.x on redhat-derived distributions

## v2.2.0

- [COOK-2230] - Careful about Debian minor version numbers
- [COOK-2231] - Fix support for postgresql 9.x in server_redhat recipe
- [COOK-2238] - Postgresql recipe error in password check
- [COOK-2176] - PostgreSQL cookbook in Solo mode can cause "NoMethodError: undefined method `[]' for nil:NilClass"
- [COOK-2233] - Provide postgresql::contrib recipe to install useful server administration tools

## v2.1.0

- [COOK-1872] - Allow latest PostgreSQL deb packages to be installed
- [COOK-1961] - Postgresql config file changes with every Chef run
- [COOK-2041] - Postgres cookbook no longer installs on OpenSuSE 11.4

## v2.0.2

- [COOK-1406] - pg gem compile is unable to find libpq under Chef full stack (omnibus) installation

## v2.0.0

This version is backwards incompatible with previous versions of the cookbook due to use of `platform_family`, and the refactored configuration files using node attributes. See README.md for details on how to modify configuration of PostgreSQL.

- [COOK-1508] - fix mixlib shellout error on SUSE
- [COOK-1744] - Add service enable & start
- [COOK-1779] - Don't run apt-get update and others in ruby recipe if pg is installed
- [COOK-1871] - Attribute driven configuration files for PostgreSQL
- [COOK-1900] - don't assume ssl on all postgresql 8.4+ installs
- [COOK-1901] - fail a chef-solo run when the postgres password attribute is not set

## v1.0.0

**Important note for this release**

This version no longer installs Ruby bindings in the client recipe by default. Use the ruby recipe if you'd like the RubyGem. If you'd like packages for your distribution, use them in your application's specific cookbook/recipe, or modify the client packages attribute.

This resolves the following tickets.

- COOK-1011
- COOK-1534

The following issues are also resolved with this release.

- [COOK-1011] - Don't install postgresql packages during compile phase and remove pg gem installation
- [COOK-1224] - fix undefined variable on Debian
- [COOK-1462] - Add attribute for specifying listen address

## v0.99.4

- [COOK-421] - config template is malformed
- [COOK-956] - add make package on ubuntu/debian

## v0.99.2

- [COOK-916] - use < (with float) for version comparison.

## v0.99.0

- Better support for Red Hat-family platforms
- Integration with database cookbook
- Make sure the postgres role is updated with a (secure) password


text:
package kafka

import scala.collection.JavaConversions._
import joptsimple.OptionParser
import metrics.KafkaMetricsReporter
import server.{KafkaConfig, KafkaServerStartable, KafkaServer}
import kafka.utils.{VerifiableProperties, CommandLineUtils, Utils, Logging}

object Kafka extends Logging {

  def getKafkaConfigFromArgs(args: Array[String]): KafkaConfig = {
    val optionParser = new OptionParser
    val overrideOpt = optionParser.accepts("override", "Optional property that should override values set in server.properties file")
      .withRequiredArg()
      .ofType(classOf[String])

    if (args.length == 0) {
      CommandLineUtils.printUsageAndDie(optionParser, "USAGE: java [options] %s server.properties [--override property=value]*".format(classOf[KafkaServer].getSimpleName()))
    }

    val props = Utils.loadProps(args(0))

    if(args.length > 1) {
      val options = optionParser.parse(args.slice(1, args.length): _*)

      if(options.nonOptionArguments().size() > 0) {
        CommandLineUtils.printUsageAndDie(optionParser, "Found non argument parameters: " + options.nonOptionArguments().toArray.mkString(","))
      }

      props.putAll(CommandLineUtils.parseKeyValueArgs(options.valuesOf(overrideOpt)))
    }

    KafkaConfig.fromProps(props)
  }

  def main(args: Array[String]): Unit = {
    try {
      val serverConfig = getKafkaConfigFromArgs(args)
      KafkaMetricsReporter.startReporters(new VerifiableProperties(serverConfig.toProps))
      val kafkaServerStartable = new KafkaServerStartable(serverConfig)

      // attach shutdown handler to catch control-c
      Runtime.getRuntime().addShutdownHook(new Thread() {
        override def run() = {
          kafkaServerStartable.shutdown
        }
      })

      kafkaServerStartable.startup
      kafkaServerStartable.awaitShutdown
    }
    catch {
      case e: Throwable => fatal(e)
    }
    System.exit(0)
  }
}


text:
from flask import Flask

from flask.ext.assets import Environment, Bundle

from flask_site.helpers import read_yaml, read_env
from flask_site.errors import HTTPMethodNotImplementedError, ControllerNotFoundError, ConfigNotFoundError

import importlib
import os.path

main_config = read_yaml('flask_site/config/config.yml')
environment = main_config.get(read_env())
flask_config = environment.get('flask') if environment else None  # Get config for this environment, if it exists

routes_config = read_yaml('flask_site/config/routes.yml')
bundles_config = read_yaml('flask_site/config/bundles.yml')

def create_app(config=main_config, env=environment):
    if not config:
        raise ConfigNotFoundError('Config is not available')
    if not env:
        raise ConfigNotFoundError('Environment is not set')

    app = Flask(__name__,
                template_folder=os.path.abspath('templates'),
                static_folder=os.path.abspath('static'))

    app.config['DEBUG'] = flask_config.get('debug')
    app.config['ASSETS_DEBUG'] = app.config['DEBUG']

    app.config['SECRET_KEY'] = env['flask'].get('secret_key')
    app.config['ENV'] = env

    create_routes(app)
    compile_assets(app)

    return app

def check_and_compile_bundle(name, settings):
    if len(name) == 0:
        raise ValueError('The bundle name must have a length of more than 0')
    if not isinstance(settings['type'], str):
        raise ValueError('The "%s" bundle must have a string type associated with it' % name)
    if len(settings['type']) == 0:
        raise ValueError('The "%s" bundle type must have a type length of more than 0' % name)
    if len(settings['files']) == 0:
        raise ValueError('The "%s" bundle must have files associated with it' % name)

    # Check each file in bundle to make sure it exists.
    static_abs_path = os.path.abspath('static')
    for filename in settings['files']:
        if not os.path.isfile(os.path.join(static_abs_path, filename)):
            raise IOError('File "%s" in bundle "%s" does not exist.' % (filename, name))

    if settings['filters'] is None:
        filters = None
    else:
        filters = ','.join(settings['filters'])

    if 'output' in settings:
        output = settings['output']
    else:
        output = 'out/' + name + '.%(version)s' + '.' + settings['type']

    return Bundle(*settings['files'], filters=filters, output=output)

def compile_assets(app, bundle_config=bundles_config):
    if not bundle_config:
        raise ConfigNotFoundError('Bundles config is empty')
    assets = Environment(app)

    for name, settings in bundle_config.iteritems():
        bundle = check_and_compile_bundle(name, settings)
        assets.register(name, bundle)

def create_routes(app, app_routes=routes_config):
    if not app_routes:
        raise ConfigNotFoundError('Routes config is empty')

    # Loop over app_routes (probably from a yml file)
    for name, route in app_routes.iteritems():
        # Make sure the route has an associated controller
        try:
            loaded_mod = load_class('flask_site.controllers.%s' % route['controller'])
        except AttributeError:
            raise ControllerNotFoundError('Class %s is not found' % route['controller'])
        # Make sure that the controller implements methods for each defined in the config
        cls_methods = dir(loaded_mod)
        for method in route['methods']:
            method = method.lower()
            if method not in cls_methods:
                raise HTTPMethodNotImplementedError(
                    'Class %s is not implementing method %s' % (route['controller'], method.upper())
                )
        # Finally, add a url rule for this route
        app.add_url_rule(route['uri'],
                         view_func=loaded_mod.as_view(name),
                         methods=route['methods'])

def load_class(full_class_string):
    class_data = full_class_string.split(".")
    module_path = ".".join(class_data[:-1])
    class_str = class_data[-1]

    module = importlib.import_module(module_path)
    return getattr(module, class_str)


text:
import Ember from 'ember';
import PolledModel from 'ui/mixins/polled-model';

export default Ember.Route.extend(PolledModel, {
  queryParams: {
    which: {
      refreshModel: true
    },
  },

  model: function(params) {
    let filters = {
    };

    let now = moment().utc().format('YYYY-MM-DDTHH:mm:ss')+'Z';
    if ( params.which === 'running' ) {
      filters['runningProcessServerId_notnull'] = 'true';
      filters['endTime_null'] = 'true';
    } else if ( params.which === 'delayed' ) {
      filters['runAfter_gt'] = now;
      filters['endTime_null'] = 'true';
      filters['runningProcessServiceId_null'] = 'true';
    } else if ( params.which === 'ready' ) {
      filters['runAfter_lte'] = now;
      filters['endTime_null'] = 'true';
    } else if ( params.which === 'completed' ) {
      filters['endTime_notnull'] = 'true';
    }

    return this.get('userStore').find('processinstance', null, {
      sortBy: 'id',
      sortOrder: 'desc',
      limit: 1000,
      depaginate: false,
      filter: filters,
      forceReload: true
    }).then((response) => {
      return Ember.Object.create({
        processInstances: response,
      });
    });
  },
});


text:
package com.jalat.execution;

/**
 * Runtime properties that available via {@link ExecutionContext}
 *
 * @author Andrey Paslavsky
 * @since 0.1
 */
enum ExecutionProperty {
    SHORT_DESCRIPTION
}


text:
using System;
using System.Collections.Generic;
using FakeItEasy;
using Farada.TestDataGeneration.BaseDomain.ValueProviders;
using Farada.TestDataGeneration.CompoundValueProviders;
using Farada.TestDataGeneration.ValueProviders;
using FluentAssertions;
using TestFx.FakeItEasy;
using TestFx.SpecK;

namespace Farada.TestDataGeneration.UnitTests.BaseDomain.ValueProviders
{
  [Subject (typeof (ChooseSingleItemValueProvider<,>), nameof(String))]
  public class ChooseSingleItemValueProviderSpec : Spec
  {
    static List<int> InputList;
    [Faked] static IRandom Random;
    static TestDataDomainConfiguration TestDataDomainConfiguration;
    static ITestDataGenerator TestDataGenerator;

    public ChooseSingleItemValueProviderSpec ()
    {
      Specify (x => TestDataGenerator.Create<string> ())
          .Case ("when creating", _ => _
              .Given (BaseContext ())
              .Given ("Fake Random", c => SetupFakeRandom ())
              .It ("returns 2", x => x.Result.Should ().Be ("2")));
    }

    void SetupFakeRandom ()
    {
      A.CallTo (() => Random.Next (0, InputList.Count)).ReturnsNextFromSequence (1);
    }

    Context BaseContext ()
    {
      return
          c => c
              .Given ("{0,2,1}", x => InputList = new List<int> { 0, 2, 1 })
              .Given ("Empty domain with value provider", x =>
                  TestDataDomainConfiguration = (context => context
                      .UseDefaults (false)
                      .UseRandom (Random)
                      .For<string> ().AddProvider (new ChooseSingleItemValueProvider<int, string> (InputList, item => item.ToString ()))))
              .Given ("TestDataGenerator", x => TestDataGenerator = TestDataGeneratorFactory.Create (TestDataDomainConfiguration));
    }
  }
}


text:
package org.codelogger.utils;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import org.codelogger.utils.exceptions.BeanInstantiationException;
import org.codelogger.utils.exceptions.FatalBeanException;

/**
 * 处理JavaBean的工具类。 A useful tool to handle beans.
 *
 * @author DengDefei
 *
 */
public abstract class BeanUtils {

    private static final String SOURCE_IS_NULL_MESSAGE = "The source can not be null.";

    private static final String TARGETIS_NULL_MESSAGE = "The target can not be null.";

    private static final String CAN_NOT_COPY_PROPERTIES = "Could not copy properties from source to target";

    private static final String NO_DEFAULT_CONSTRUCTOR_FOUND = "No default constructor found";

    private static final Class<?>[] EMPTY_PARAMETER_CLASSTYPES = {};

    private static final Object[] EMPTY_PARAMETER_VALUES = {};

    /**
     * 浅克隆。Return a shadow cloned object.
     *
     * @param source
     *            源对象。source object
     * @return 新对象,包含源对象的所有非final数据。a new object with shadow cloned.
     * @throws BeanInstantiationException
     */
    public static <T> T clone(final T source) throws BeanInstantiationException {

        if (source == null) {
            return null;
        }
        Class<T> sourceClass = ClassUtils.getClass(source);
        try {
            if (sourceClass.isArray()) {
                Class<?> componentType = sourceClass.getComponentType();
                Object[] array = ArrayUtils.toArray(source,
                        ClassUtils.getWrapperClass(componentType));
                @SuppressWarnings("unchecked")
                T newInstance = (T) Array.newInstance(ClassUtils.getPrimitiveClass(componentType),
                        Array.getLength(source));
                for (int i = 0; i < Array.getLength(source); i++) {
                    Array.set(newInstance, i, array[i]);
                }
                return newInstance;
            }
            if (ClassUtils.isDataClass(sourceClass)) {
                T newInstance = newInstance(sourceClass, ClassUtils.getPrimitiveClass(source),
                        source);
                copyProperties(source, newInstance);
                return newInstance;
            }
            T newInstance = sourceClass.newInstance();
            Field[] fields = sourceClass.getDeclaredFields();
            for (Field field : fields) {
                getAndSetValue(source, field, newInstance, field);
            }
            return newInstance;
        } catch (Exception e) {
            throw new BeanInstantiationException(sourceClass, NO_DEFAULT_CONSTRUCTOR_FOUND, e);
        }
    }

    /**
     * 把相同名称和类型的字段从源对象中复制到目标对象中去(目标对象中final字段除外)。 Copy same name and type field
     * value from source to target(except target final field).
     *
     * @param source
     *            源对象。source object.
     * @param target
     *            目标对象。target object.
     */
    public static void copyProperties(final Object source, final Object target) {

        ExceptionUtils.iae.throwIfNull(source, SOURCE_IS_NULL_MESSAGE);
        ExceptionUtils.iae.throwIfNull(target, TARGETIS_NULL_MESSAGE);
        Class<Object> sourceClass = ClassUtils.getClass(source);
        Class<Object> targetClass = ClassUtils.getClass(target);
        Field[] sourceFields = sourceClass.getDeclaredFields();
        Field[] targetFields = targetClass.getDeclaredFields();
        try {
            for (Field sourceField : sourceFields) {
                Field targetField = getFieldByField(targetFields, sourceField);
                if (targetField != null) {
                    getAndSetValue(source, sourceField, target, targetField);
                }
            }
        } catch (Exception e) {
            throw new FatalBeanException(CAN_NOT_COPY_PROPERTIES, e);
        }
    }

    /**
     * 返回一个给定类型的新实例。 Returns a newly allocated instance of the class represented
     * by this class.
     *
     * @param clazz
     *            想要实例化的类型。want to create instance class.
     * @return 给定类型的新实例。a newly allocated instance of the class represented by
     *         this class.
     */
    public static <T> T newInstance(final Class<T> clazz) {

        return ClassUtils.instantiateClass(clazz);
    }

    /**
     * 根据给定实例化参数类型和数据实例化指定类型的对象。 Returns a newly allocated instance of the class
     * represented by this class use given constructor parameters class type and
     * constructor parameters value.
     *
     * @param clazz
     *            想要实例化的类型。want to create instance class.
     * @param fieldType
     *            构造函数的唯一参数类型。constructor single parameter class type.
     * @param value
     *            构造函数的唯一参数数据。constructor single parameter value.
     * @return 实例化对象。a newly allocated instance of the class represented by this
     *         class.
     */
    public static <T> T newInstance(final Class<T> clazz, final Class<?> fieldType,
            final Object value) {

        return ClassUtils.instantiateClass(clazz, getParameterTypes(fieldType),
                getParameterValues(value));
    }

    /**
     * 根据给定的多个实例化参数类型和对应数据实例化指定类型的对象。Returns a newly allocated instance of the
     * class represented by this class use given constructor parameters class
     * type and constructor parameters value.
     *
     * @param clazz
     *            想要实例化的类型。want to create instance class.
     * @param fieldTypes
     *            、构造函数的参数类型的数组。constructor parameters class type.
     * @param values
     *            、构造函数的参数数值的数组。constructor parameters value.
     * @return 实例化对象。a newly allocated instance of the class represented by this
     *         class.
     */
    public static <T> T newInstance(final Class<T> clazz, final Class<?>[] fieldTypes,
            final Object[] values) {

        return ClassUtils.instantiateClass(clazz, getParameterTypes(fieldTypes),
                getParameterValues(values));
    }

    private static Class<?>[] getParameterTypes(final Class<?>... parameterTypes) {

        if (ArrayUtils.isEmpty(parameterTypes)) {
            return EMPTY_PARAMETER_CLASSTYPES;
        }
        Class<?>[] parameterTypeArray = new Class<?>[parameterTypes.length];
        for (int i = 0; i < parameterTypes.length; i++) {
            parameterTypeArray[i] = parameterTypes[i];
        }
        return parameterTypeArray;
    }

    private static Object[] getParameterValues(final Object... parameterValues) {

        if (ArrayUtils.isEmpty(parameterValues)) {
            return EMPTY_PARAMETER_VALUES;
        }
        Object[] parameterValueArray = new Object[parameterValues.length];
        for (int i = 0; i < parameterValues.length; i++) {
            parameterValueArray[i] = parameterValues[i];
        }
        return parameterValueArray;
    }

    private static void getAndSetValue(final Object source, final Field sourceField,
            final Object target, final Field targetField) throws IllegalAccessException {

        if (Modifier.isFinal(targetField.getModifiers())) {
            return;
        }
        sourceField.setAccessible(true);
        Object value = sourceField.get(source);
        targetField.setAccessible(true);
        targetField.set(target, value);
    }

    private static Field getFieldByField(final Field[] fields, final Field target) {

        for (Field field : fields) {

            String fieldName = field.getName();
            String targetFieldName = target.getName();
            Class<?> fieldType = field.getType();
            Class<?> targetType = target.getType();
            if (fieldName.equals(targetFieldName) && fieldType.equals(targetType)) {
                return field;
            }
        }
        return null;
    }

}


text:
<title>dlib C++ Library - iosockstream.h</title>

// Copyright (C) 2012  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#ifndef DLIB_IOSOCkSTREAM_H_h_
#define DLIB_IOSOCkSTREAM_H_h_

#include "iosockstream/iosockstream.h"

#endif // DLIB_IOSOCkSTREAM_H_h_


text:
using namespace std;

void dumpStationLog(ofstream &staFile, int nodes, double throughput, double col, double timeBSxTx)
{
	staFile << nodes << " " << throughput << " " << col << " " << timeBSxTx << endl;
}


text:
package v23

import (
	"strings"
	"testing"
	"time"

	"github.com/google/uuid"
	"v.io/v23/context"
	"v.io/v23/discovery"
	"v.io/v23/flow"
	"v.io/v23/namespace"
	"v.io/v23/rpc"
	"v.io/v23/security"
	"v.io/v23/security/access"
	"v.io/x/ref/lib/flags"
)

// Create a mock RuntimeFactory.
func MockFactory(ctx *context.T) (Runtime, *context.T, Shutdown, error) {
	return &mockRuntime{}, nil, func() {}, nil
}

type mockRuntime struct{}

func (*mockRuntime) Init(ctx *context.T) error { return nil }
func (*mockRuntime) WithPrincipal(ctx *context.T, principal security.Principal) (*context.T, error) {
	return nil, nil
}
func (*mockRuntime) GetPrincipal(ctx *context.T) security.Principal { return nil }
func (*mockRuntime) WithNewClient(ctx *context.T, opts ...rpc.ClientOpt) (*context.T, rpc.Client, error) {
	return nil, nil, nil
}
func (*mockRuntime) GetClient(ctx *context.T) rpc.Client { return nil }
func (*mockRuntime) WithNewNamespace(ctx *context.T, roots ...string) (*context.T, namespace.T, error) {
	return nil, nil, nil
}
func (*mockRuntime) GetNamespace(ctx *context.T) namespace.T     { return nil }
func (*mockRuntime) GetListenSpec(ctx *context.T) rpc.ListenSpec { return rpc.ListenSpec{} }

func (*mockRuntime) GetPermissionsSpec(ctx *context.T) access.PermissionsSpec {
	return access.PermissionsSpec{}
}
func (*mockRuntime) GetRequestID(ctx *context.T) uuid.UUID {
	return uuid.UUID{}
}
func (*mockRuntime) WithBackgroundContext(ctx *context.T) *context.T { return nil }
func (*mockRuntime) GetBackgroundContext(ctx *context.T) *context.T  { return nil }

func (*mockRuntime) NewDiscovery(ctx *context.T) (discovery.T, error) { return nil, nil }

func (*mockRuntime) WithReservedNameDispatcher(ctx *context.T, d rpc.Dispatcher) *context.T {
	return nil
}

func (*mockRuntime) GetReservedNameDispatcher(ctx *context.T) rpc.Dispatcher    { return nil }
func (*mockRuntime) WithListenSpec(ctx *context.T, _ rpc.ListenSpec) *context.T { return ctx }
func (*mockRuntime) NewFlowManager(ctx *context.T, channelTimeout time.Duration) (flow.Manager, error) {
	return nil, nil
}
func (*mockRuntime) WithNewServer(ctx *context.T, name string, object interface{}, auth security.Authorizer, opts ...rpc.ServerOpt) (*context.T, rpc.Server, error) {
	return nil, nil, nil
}
func (*mockRuntime) WithNewDispatchingServer(ctx *context.T, name string, disp rpc.Dispatcher, opts ...rpc.ServerOpt) (*context.T, rpc.Server, error) {
	return nil, nil, nil
}

func (*mockRuntime) GetFlags() flags.RuntimeFlags {
	return flags.RuntimeFlags{}
}

func TestPanicOnInitWithNoRuntimeFactory(t *testing.T) {
	clear()
	// Calling Init without a registered RuntimeFactory should panic.
	catcher := func() {
		r := recover()
		if r == nil {
			t.Fatalf("recover returned nil")
		}
		err := r.(error)
		str := err.Error()
		if !strings.Contains(str, "No RuntimeFactory has been registered") {
			t.Fatalf("unexpected error: %s", str)
		}
	}
	defer catcher()
	Init()
}

func TestInitWithRegisteredRuntimeFactory(t *testing.T) {
	clear()
	// Calling v23.Init with a RuntimeFactory should succeed.
	RegisterRuntimeFactory(MockFactory)
	Init()
}

func TestPanicOnSecondRuntimeFactoryRegistration(t *testing.T) {
	clear()
	// Registering multiple RuntimeFactory should fail.
	RegisterRuntimeFactory(MockFactory)
	catcher := func() {
		r := recover()
		if r == nil {
			t.Fatalf("recover returned nil")
		}
		str := r.(string)
		if !strings.Contains(str, "A RuntimeFactory has already been registered") {
			t.Fatalf("unexpected error: %s", str)
		}
	}
	defer catcher()
	RegisterRuntimeFactory(MockFactory)
}

func TestPanicOnSecondInit(t *testing.T) {
	clear()
	// Calling Init again before calling shutdown should fail.
	RegisterRuntimeFactory(MockFactory)
	Init()
	catcher := func() {
		r := recover()
		if r == nil {
			t.Fatalf("recover returned nil")
		}
		err := r.(error)
		str := err.Error()
		if !strings.Contains(str, "A runtime has already been initialized") {
			t.Fatalf("unexpected error: %s", str)
		}
	}
	defer catcher()
	Init()
}

func TestSecondInitAfterShutdown(t *testing.T) {
	clear()
	// Calling Init, shutting down, and then calling Init again should succeed.
	RegisterRuntimeFactory(MockFactory)
	_, shutdown := Init()
	shutdown()
	Init()
}

// for tests only
func clear() {
	initState.mu.Lock()
	initState.runtime = nil
	initState.runtimeStack = ""
	initState.runtimeFactory = nil
	initState.runtimeFactoryStack = ""
	initState.mu.Unlock()
}


text:
package views

//--------------------
// IMPORTS
//--------------------

import (
	"github.com/tideland/gocouch/couchdb"
)

//--------------------
// API
//--------------------

// View performs a view request.
func View(cdb couchdb.CouchDB, design, view string, params ...couchdb.Parameter) ViewResultSet {
	rs := cdb.GetOrPost(cdb.DatabasePath("_design", design, "_view", view), nil, params...)
	return newViewResultSet(rs)
}

//--------------------
// VIEW RESULT SET
//--------------------

// RowProcessingFunc is a function processing the content
// of a view row.
type RowProcessingFunc func(id string, key, value, document couchdb.Unmarshable) error

// ViewResultSet contains the result set of a view.
type ViewResultSet interface {
	// IsOK checks the status code if the result is okay.
	IsOK() bool

	// StatusCode returns the status code of the request.
	StatusCode() int

	// Error returns a possible error of a request.
	Error() error

	// TotalRows returns the number of ViewResultSet rows.
	TotalRows() int

	// ReturnedRows returns the nnumber of returned ViewResultSet rows.
	ReturnedRows() int

	// Offset returns the starting offset of the ViewResultSet rows.
	Offset() int

	// RowsDo iterates over the rows of a ViewResultSet and
	// processes the content.
	RowsDo(rpf RowProcessingFunc) error
}

// viewResultSet implements the ViewResultSet interface.
type viewResultSet struct {
	rs couchdb.ResultSet
	vr *couchdbViewResult
}

// newViewResultSet returns a ChangesResultSet.
func newViewResultSet(rs couchdb.ResultSet) ViewResultSet {
	vrs := &viewResultSet{
		rs: rs,
	}
	return vrs
}

// IsOK implements the ViewResultSet interface.
func (vrs *viewResultSet) IsOK() bool {
	return vrs.rs.IsOK()
}

// StatusCode implements the ViewResultSet interface.
func (vrs *viewResultSet) StatusCode() int {
	return vrs.rs.StatusCode()
}

// Error implements the ViewResultSet interface.
func (vrs *viewResultSet) Error() error {
	return vrs.rs.Error()
}

// TotalRows implements the ViewResultSet interface.
func (vrs *viewResultSet) TotalRows() int {
	if err := vrs.readViewResult(); err != nil {
		return -1
	}
	return vrs.vr.TotalRows
}

// ReturnedRows implements the ViewResultSet interface.
func (vrs *viewResultSet) ReturnedRows() int {
	if err := vrs.readViewResult(); err != nil {
		return -1
	}
	return len(vrs.vr.Rows)
}

// Offset implements the ViewResultSet interface.
func (vrs *viewResultSet) Offset() int {
	if err := vrs.readViewResult(); err != nil {
		return -1
	}
	return vrs.vr.Offset
}

// RowsDo implements the View interface.
func (vrs *viewResultSet) RowsDo(rpf RowProcessingFunc) error {
	if err := vrs.readViewResult(); err != nil {
		return err
	}
	for _, row := range vrs.vr.Rows {
		key := couchdb.NewUnmarshableJSON(row.Key)
		value := couchdb.NewUnmarshableJSON(row.Value)
		doc := couchdb.NewUnmarshableJSON(row.Document)
		if err := rpf(row.ID, key, value, doc); err != nil {
			return err
		}
	}
	return nil
}

// readViewResult lazily reads the viewResultSet result.
func (vrs *viewResultSet) readViewResult() error {
	if !vrs.IsOK() {
		return vrs.Error()
	}
	if vrs.vr == nil {
		vr := couchdbViewResult{}
		err := vrs.rs.Document(&vr)
		if err != nil {
			return err
		}
		vrs.vr = &vr
	}
	return nil
}

// EOF


text:
<Type Name="IOBluetoothRFCOMMChannel+DataReceivedEventArgs" FullName="MonoMac.IOBluetooth.IOBluetoothRFCOMMChannel+DataReceivedEventArgs">
  <TypeSignature Language="C#" Value="public class IOBluetoothRFCOMMChannel.DataReceivedEventArgs : EventArgs" />
  <TypeSignature Language="ILAsm" Value=".class nested public auto ansi beforefieldinit IOBluetoothRFCOMMChannel/DataReceivedEventArgs extends System.EventArgs" />
  <AssemblyInfo>
    <AssemblyName>MonoMac</AssemblyName>
    <AssemblyVersion>0.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.EventArgs</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public DataReceivedEventArgs (byte[] data);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] data) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters>
        <Parameter Name="data" Type="System.Byte[]" />
      </Parameters>
      <Docs>
        <param name="data">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Data">
      <MemberSignature Language="C#" Value="public byte[] Data { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance unsigned int8[] Data" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Byte[]</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>