text:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <display-name>Archetype Created Web Application</display-name>

    <context-param>
        <param-name>oauth.provider.provider-class</param-name>
        <param-value>org.jboss.resteasy.examples.oauth.provider.OAuthDBProvider</param-value>
    </context-param>

    <context-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>
           org.jboss.resteasy.examples.oauth.OAuthApplication
        </param-value>
    </context-param>

    <context-param>
       <param-name>resteasy.servlet.mapping.prefix</param-name>
       <param-value>/rest</param-value>
    </context-param>

    <context-param>
        <param-name>resteasy.role.based.security</param-name>
        <param-value>true</param-value>
    </context-param>

    <filter>
		<filter-name>OAuth Filter</filter-name>
		<!-- Enable this filter when deploying to JBoss only -->
        <!--
        <filter-class>org.jboss.resteasy.examples.oauth.OAuthBasicAuthenticationFilter</filter-class>
        -->
        <filter-class>org.jboss.resteasy.examples.oauth.OAuthDBFilter</filter-class>

	</filter>

    <filter-mapping>
        <filter-name>OAuth Filter</filter-name>
        <url-pattern>/rest/server/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
    </listener>

	<servlet>
        <servlet-name>OAuth</servlet-name>
        <servlet-class>org.jboss.resteasy.auth.oauth.OAuthServlet</servlet-class>
    </servlet>

    <servlet>
        <servlet-name>Resteasy</servlet-name>
        <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>OAuth</servlet-name>
        <url-pattern>/oauth/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Resteasy</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>

    <security-constraint>
      <web-resource-collection>
         <web-resource-name>OAuth</web-resource-name>
         <url-pattern>/oauth/authorization/*</url-pattern>
      </web-resource-collection>
       <auth-constraint>
         <role-name>JBossAdmin</role-name>
      </auth-constraint>
    </security-constraint>

    <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>TokenAuthorization</realm-name>
    </login-config>

    <security-role>
      <role-name>JBossAdmin</role-name>
    </security-role>

</web-app>


text:
Caches and offline mode
=======================

Since retrieving and transforming operating system image files, git
repositories, Python or Ruby packages, and so on can be a significant overhead,
we cache many of the inputs to the build process in ~/.cache/image-create/. The
writing an element documention describes the interface within
disk-image-builder for caching. When invoking disk-image-builder the --offline
option will instruct disk-image-builder to not refresh cached resources.

Note that we don't maintain operating system package caches, instead depending
on your local infrastructure (e.g. Squid cache, or an APT or Yum proxy) to
facilitate caching of that layer, so you need to arrange independently for
offline mode.

Base images
-----------

These are cached by the standard elements - fedora, redhat, ubuntu,
debian and opensuse.

source-repositories
-------------------

Git repositories and tarballs obtained via the source-repositories element will
be cached.

C and C++ compilation
---------------------

Ccache is configured by the base element. Any compilation that honours ccache
will be cached.

PyPI
----

The pypi element will bind mount a PyPI mirror from the cache dir and configure
pip and easy-install to use it.

redpajama_set_name: RedPajamaGithub


text:
mkdir -p generated/files/a/b/c/d/e/f/g
yes "nano-backup" | head -c 185000 > generated/files/foo.txt
yes "nano-backup" | head -c 185000 > generated/files/bar.txt
yes "nano-backup" | head -c 185000 > generated/files/a/b/c/file
yes "nano-backup" | head -c 185000 > generated/files/a/b/dummy
yes "nano"        | head -c 185000 > generated/files/a/b/text


text:
// UMD module definition
// From: https://github.com/umdjs/umd/blob/master/templates/jqueryPlugin.js

(function (factory) {
	if (typeof define === 'function' && define.amd) {
			// AMD. Register as an anonymous module.
			define(['jquery'], factory);
	} else if (typeof module === 'object' && module.exports) {
		// Node/CommonJS
		module.exports = function( root, jQuery ) {
			if ( jQuery === undefined ) {
				// require('jQuery') returns a factory that requires window to
				// build a jQuery instance, we normalize how we use modules
				// that require this pattern but the window provided is a noop
				// if it's defined (how jquery works)
				if ( typeof window !== 'undefined' ) {
					jQuery = require('jquery');
				} else {
					jQuery = require('jquery')(root);
				}
			}
			factory(jQuery);
			return jQuery;
		};
	} else {
		// Browser globals
		factory(jQuery);
	}
}(function ($) {
	"use strict";

	var win = typeof window !== "undefined" ? window : this;

var Tablesaw = {
	i18n: {
		modes: [ 'Stack', 'Swipe', 'Toggle' ],
		columns: 'Columns',
		columnBtnText: 'Columns',
		columnsDialogError: 'No eligible columns.',
		sort: 'Sort'
	},
	// cut the mustard
	mustard: ( 'head' in document ) && // IE9+, Firefox 4+, Safari 5.1+, Mobile Safari 4.1+, Opera 11.5+, Android 2.3+
		( !window.blackberry || window.WebKitPoint ) && // only WebKit Blackberry (OS 6+)
		!window.operamini
};

if( Tablesaw.mustard ) {
	$( document.documentElement ).addClass( 'tablesaw-enhanced' );
}

(function() {
	var pluginName = "tablesaw";
	var classes = {
		toolbar: "tablesaw-bar"
	};
	var events = {
		create: "tablesawcreate",
		destroy: "tablesawdestroy",
		refresh: "tablesawrefresh",
		resize: "tablesawresize"
	};
	var defaultMode = "stack";
	var initSelector = "table";
	var initFilterSelector = "[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]";
	var defaultConfig = {
		getHeaderCells: function() {
			return this.$table.find( "thead" ).children().filter( "tr" ).eq( 0 ).find( "th" );
		}
	};

	Tablesaw.events = events;

	var Table = function( element ) {
		if( !element ) {
			throw new Error( "Tablesaw requires an element." );
		}

		this.table = element;
		this.$table = $( element );

		this.mode = this.$table.attr( "data-tablesaw-mode" ) || defaultMode;

		this.init();
	};

	Table.prototype.init = function() {
		// assign an id if there is none
		if ( !this.$table.attr( "id" ) ) {
			this.$table.attr( "id", pluginName + "-" + Math.round( Math.random() * 10000 ) );
		}

		this.createToolbar();

		// TODO this is used inside stack table init for some reason? what does it do?
		this._initCells();

		this.$table.trigger( events.create, [ this ] );
	};

	Table.prototype.getConfig = function( pluginSpecificConfig ) {
		// shoestring extend doesn't support arbitrary args
		var configs = $.extend( defaultConfig, pluginSpecificConfig || {} );
		return $.extend( configs, typeof TablesawConfig !== "undefined" ? TablesawConfig : {} );
	};

	Table.prototype._getPrimaryHeaderCells = function() {
		return this.getConfig().getHeaderCells.call( this );
	};

	Table.prototype._findHeadersForCell = function( cell ) {
		var $headers = this._getPrimaryHeaderCells();
		var results = [];

		for( var rowNumber = 1; rowNumber < this.headerMapping.length; rowNumber++ ) {
			for( var colNumber = 0; colNumber < this.headerMapping[ rowNumber ].length; colNumber++ ) {
				if( this.headerMapping[ rowNumber ][ colNumber ] === cell ) {
					results.push( $headers[ colNumber ] );
				}
			}
		}
		return results;
	};

	Table.prototype._initCells = function() {
		var $rows = this.$table.find( "tr" );
		var columnLookup = [];

		$rows.each(function( rowNumber ) {
			columnLookup[ rowNumber ] = [];
		});

		$rows.each(function( rowNumber ) {
			var coltally = 0;
			var $t = $( this );
			var children = $t.children();
			// var isInHeader = $t.closest( "thead" ).length;

			children.each(function() {
				var colspan = parseInt( this.getAttribute( "colspan" ), 10 );
				var rowspan = parseInt( this.getAttribute( "rowspan" ), 10 );

				// set in a previous rowspan
				while( columnLookup[ rowNumber ][ coltally ] ) {
					coltally++;
				}

				columnLookup[ rowNumber ][ coltally ] = this;

				// TODO both colspan and rowspan
				if( colspan ) {
					for( var k = 0; k < colspan - 1; k++ ){
						coltally++;
						columnLookup[ rowNumber ][ coltally ] = this;
					}
				}
				if( rowspan ) {
					for( var j = 1; j < rowspan; j++ ){
						columnLookup[ rowNumber + j ][ coltally ] = this;
					}
				}

				coltally++;
			});
		});

		for( var colNumber = 0; colNumber < columnLookup[ 0 ].length; colNumber++ ) {
			var headerCol = columnLookup[ 0 ][ colNumber ];
			var rowNumber = 0;
			var rowCell;

			if( !headerCol.cells ) {
				headerCol.cells = [];
			}

			while( rowNumber < columnLookup.length ) {
				rowCell = columnLookup[ rowNumber ][ colNumber ];

				if( headerCol !== rowCell ) {
					headerCol.cells.push( rowCell );
					rowCell.headerCell = headerCol;
				}

				rowNumber++;
			}
		}

		this.headerMapping = columnLookup;
	};

	Table.prototype.refresh = function() {
		this._initCells();

		this.$table.trigger( events.refresh, [ this ] );
	};

	Table.prototype.createToolbar = function() {
		// Insert the toolbar
		// TODO move this into a separate component
		var $toolbar = this.$table.prev().filter( '.' + classes.toolbar );
		if( !$toolbar.length ) {
			$toolbar = $( '
' )
				.addClass( classes.toolbar )
				.insertBefore( this.$table );
		}
		this.$toolbar = $toolbar;

		if( this.mode ) {
			this.$toolbar.addClass( 'tablesaw-mode-' + this.mode );
		}
	};

	Table.prototype.destroy = function() {
		// Don't remove the toolbar. Some of the table features are not yet destroy-friendly.
		this.$table.prev().filter( '.' + classes.toolbar ).each(function() {
			this.className = this.className.replace( /\btablesaw-mode\-\w*\b/gi, '' );
		});

		var tableId = this.$table.attr( 'id' );
		$( document ).off( "." + tableId );
		$( window ).off( "." + tableId );

		// other plugins
		this.$table.trigger( events.destroy, [ this ] );

		this.$table.removeData( pluginName );
	};

	// Collection method.
	$.fn[ pluginName ] = function() {
		return this.each( function() {
			var $t = $( this );

			if( $t.data( pluginName ) ){
				return;
			}

			var table = new Table( this );
			$t.data( pluginName, table );
		});
	};

	var $doc = $( win.document );
	$doc.on( "enhance.tablesaw", function( e ) {
		// Cut the mustard
		if( Tablesaw.mustard ) {
			$( e.target ).find( initSelector ).filter( initFilterSelector )[ pluginName ]();
		}
	});

	// Avoid a resize during scroll:
	// Some Mobile devices trigger a resize during scroll (sometimes when
	// doing elastic stretch at the end of the document or from the
	// location bar hide)
	var isScrolling = false;
	var scrollTimeout;
	$doc.on( "scroll.tablesaw", function() {
		isScrolling = true;

		win.clearTimeout( scrollTimeout );
		scrollTimeout = win.setTimeout(function() {
			isScrolling = false;
		}, 300 ); // must be greater than the resize timeout below
	});

	var resizeTimeout;
	$( win ).on( "resize", function() {
		if( !isScrolling ) {
			win.clearTimeout( resizeTimeout );
			resizeTimeout = win.setTimeout(function() {
				$doc.trigger( events.resize );
			}, 150 ); // must be less than the scrolling timeout above.
		}
	});

}());

(function(){

	var classes = {
		stackTable: 'tablesaw-stack',
		cellLabels: 'tablesaw-cell-label',
		cellContentLabels: 'tablesaw-cell-content'
	};

	var data = {
		key: 'tablesaw-stack'
	};

	var attrs = {
		labelless: 'data-tablesaw-no-labels',
		hideempty: 'data-tablesaw-hide-empty'
	};

	var Stack = function( element, tablesaw ) {

		this.tablesaw = tablesaw;
		this.$table = $( element );

		this.labelless = this.$table.is( '[' + attrs.labelless + ']' );
		this.hideempty = this.$table.is( '[' + attrs.hideempty + ']' );

		this.$table.data( data.key, this );
	};

	Stack.prototype.init = function() {
		this.$table.addClass( classes.stackTable );

		if( this.labelless ) {
			return;
		}

		var self = this;

		this.$table.find( "th, td" ).filter(function() {
			return !$( this ).closest( "thead" ).length;
		}).filter(function() {
			return !$( this ).closest( "tr" ).is( "[" + attrs.labelless + "]" ) &&
				( !self.hideempty || !!$( this ).html() );
		}).each(function() {
			var $newHeader = $( document.createElement( "b" ) ).addClass( classes.cellLabels );
			var $cell = $( this );

			// headers
			$( self.tablesaw._findHeadersForCell( this ) ).each(function( index ) {
				var $header = $( this.cloneNode( true ) );
				// TODO decouple from sortable better
				// Changed from .text() in https://github.com/filamentgroup/tablesaw/commit/b9c12a8f893ec192830ec3ba2d75f062642f935b
				// to preserve structural html in headers, like
				var $sortableButton = $header.find( ".tablesaw-sortable-btn" );
				$header.find( ".tablesaw-sortable-arrow" ).remove();

				// TODO decouple from checkall better
				var $checkall = $header.find( "[data-tablesaw-checkall]" );
				$checkall.closest( "label" ).remove();
				if( $checkall.length ) {
					$newHeader = $([]);
					return;
				}

				if( index > 0 ) {
					$newHeader.append( document.createTextNode( ", " ) );
				}
				$newHeader.append( $sortableButton.length ? $sortableButton[ 0 ].childNodes : $header[ 0 ].childNodes );
			});

			if( $newHeader.length && !$cell.find( "." + classes.cellContentLabels ).length ) {
				$cell.wrapInner( "" );
			}

			// Update if already exists.
			var $label = $cell.find( "." + classes.cellLabels );
			if( !$label.length ) {
				$cell.prepend( $newHeader );
			} else { // only if changed
				$label.replaceWith( $newHeader );
			}
		});
	};

	Stack.prototype.destroy = function() {
		this.$table.removeClass( classes.stackTable );
		this.$table.find( '.' + classes.cellLabels ).remove();
		this.$table.find( '.' + classes.cellContentLabels ).each(function() {
			$( this ).replaceWith( this.childNodes );
		});
	};

	// on tablecreate, init
	$( document ).on( Tablesaw.events.create, function( e, tablesaw ){
		if( tablesaw.mode === 'stack' ){
			var table = new Stack( tablesaw.table, tablesaw );
			table.init();
		}
	}).on( Tablesaw.events.refresh, function( e, tablesaw ){
		if( tablesaw.mode === 'stack' ){
			$( tablesaw.table ).data( data.key ).init();
		}
	}).on( Tablesaw.events.destroy, function( e, tablesaw ){
		if( tablesaw.mode === 'stack' ){
			$( tablesaw.table ).data( data.key ).destroy();
		}
	});

}());
(function() {
	var pluginName = "tablesawbtn",
		methods = {
			_create: function(){
				return $( this ).each(function() {
					$( this )
						.trigger( "beforecreate." + pluginName )[ pluginName ]( "_init" )
						.trigger( "create." + pluginName );
				});
			},
			_init: function(){
				var oEl = $( this ),
					sel = this.getElementsByTagName( "select" )[ 0 ];

				if( sel ) {
					$( this )
						.addClass( "btn-select" )[ pluginName ]( "_select", sel );
				}
				return oEl;
			},
			_select: function( sel ) {
				var update = function( oEl, sel ) {
					var opts = $( sel ).find( "option" );
					var label = document.createElement( "span" );
					var el;
					var children;
					var found = false;

					label.setAttribute( "aria-hidden", "true" );
					label.innerHTML = " ";

					opts.each(function() {
						var opt = this;
						if( opt.selected ) {
							label.innerHTML = opt.text;
						}
					});

					children = oEl.childNodes;
					if( opts.length > 0 ){
						for( var i = 0, l = children.length; i < l; i++ ) {
							el = children[ i ];

							if( el && el.nodeName.toUpperCase() === "SPAN" ) {
								oEl.replaceChild( label, el );
								found = true;
							}
						}

						if( !found ) {
							oEl.insertBefore( label, oEl.firstChild );
						}
					}
				};

				update( this, sel );
				$( this ).on( "change refresh", function() {
					update( this, sel );
				});
			}
		};

	// Collection method.
	$.fn[ pluginName ] = function( arrg, a, b, c ) {
		return this.each(function() {

			// if it's a method
			if( arrg && typeof( arrg ) === "string" ){
				return $.fn[ pluginName ].prototype[ arrg ].call( this, a, b, c );
			}

			// don't re-init
			if( $( this ).data( pluginName + "active" ) ){
				return $( this );
			}

			$( this ).data( pluginName + "active", true );

			$.fn[ pluginName ].prototype._create.call( this );
		});
	};

	// add methods
	$.extend( $.fn[ pluginName ].prototype, methods );

}());
(function(){

	var data = {
		key: "tablesaw-coltoggle"
	};

	var ColumnToggle = function( element ) {

		this.$table = $( element );

		if( !this.$table.length ) {
			return;
		}

		this.classes = {
			columnToggleTable: 'tablesaw-columntoggle',
			columnBtnContain: 'tablesaw-columntoggle-btnwrap tablesaw-advance',
			columnBtn: 'tablesaw-columntoggle-btn tablesaw-nav-btn down',
			popup: 'tablesaw-columntoggle-popup',
			priorityPrefix: 'tablesaw-priority-',
			// TODO duplicate class, also in tables.js
			toolbar: 'tablesaw-bar'
		};

		// Expose headers and allHeaders properties on the widget
		// headers references the THs within the first TR in the table
		this.headers = this.$table.find( "tr" ).eq( 0 ).find( "th" );

		this.$table.data( data.key, this );
	};

	ColumnToggle.prototype.init = function() {

		if( !this.$table.length ) {
			return;
		}

		var tableId,
			id,
			$menuButton,
			$popup,
			$menu,
			$btnContain,
			self = this;

		this.$table.addClass( this.classes.columnToggleTable );

		tableId = this.$table.attr( "id" );
		id = tableId + "-popup";
		$btnContain = $( "

" );
		$menuButton = $( "" +
										"" + Tablesaw.i18n.columnBtnText + "" );
		$popup = $( "

" );
		$menu = $( "

" );

		var hasNonPersistentHeaders = false;
		$( this.headers ).not( "td" ).each( function() {
			var $this = $( this ),
				priority = $this.attr("data-tablesaw-priority"),
				$cells = self.$getCells( this );

			if( priority && priority !== "persist" ) {
				$cells.addClass( self.classes.priorityPrefix + priority );

				$("<input type='checkbox' checked>" + $this.text() + "" )
					.appendTo( $menu )
					.children()
					.first()
					.data( "tablesaw-header", this );

				hasNonPersistentHeaders = true;
			}
		});

		if( !hasNonPersistentHeaders ) {
			$menu.append( '' + Tablesaw.i18n.columnsDialogError + '' );
		}

		$menu.appendTo( $popup );

		// bind change event listeners to inputs - TODO: move to a private method?
		$menu.find( 'input[type="checkbox"]' ).on( "change", function(e) {
			var checked = e.target.checked;

			var $cells = self.$getCellsFromCheckbox( e.target );

			$cells[ !checked ? "addClass" : "removeClass" ]( "tablesaw-cell-hidden" );
			$cells[ checked ? "addClass" : "removeClass" ]( "tablesaw-cell-visible" );

			self.$table.trigger( 'tablesawcolumns' );
		});

		$menuButton.appendTo( $btnContain );
		$btnContain.appendTo( this.$table.prev().filter( '.' + this.classes.toolbar ) );

		function closePopup( event ) {
			// Click came from inside the popup, ignore.
			if( event && $( event.target ).closest( "." + self.classes.popup ).length ) {
				return;
			}

			$( document ).off( 'click.' + tableId );
			$menuButton.removeClass( 'up' ).addClass( 'down' );
			$btnContain.removeClass( 'visible' );
		}

		var closeTimeout;
		function openPopup() {
			$btnContain.addClass( 'visible' );
			$menuButton.removeClass( 'down' ).addClass( 'up' );

			$( document ).off( 'click.' + tableId, closePopup );

			window.clearTimeout( closeTimeout );
			closeTimeout = window.setTimeout(function() {
				$( document ).on( 'click.' + tableId, closePopup );
			}, 15 );
		}

		$menuButton.on( "click.tablesaw", function( event ) {
			event.preventDefault();

			if( !$btnContain.is( ".visible" ) ) {
				openPopup();
			} else {
				closePopup();
			}
		});

		$popup.appendTo( $btnContain );

		this.$menu = $menu;

		$(window).on( Tablesaw.events.resize + "." + tableId, function(){
			self.refreshToggle();
		});

		this.refreshToggle();
	};

	ColumnToggle.prototype.$getCells = function( th ) {
		return $( th ).add( th.cells );
	};

	ColumnToggle.prototype.$getCellsFromCheckbox = function( checkbox ) {
		var th = $( checkbox ).data( "tablesaw-header" );
		return this.$getCells( th );
	};

	ColumnToggle.prototype.refreshToggle = function() {
		var self = this;
		this.$menu.find( "input" ).each( function() {
			this.checked = self.$getCellsFromCheckbox( this ).eq( 0 ).css( "display" ) === "table-cell";
		});
	};

	ColumnToggle.prototype.refreshPriority = function(){
		var self = this;
		$(this.headers).not( "td" ).each( function() {
			var $this = $( this ),
				priority = $this.attr("data-tablesaw-priority"),
				$cells = $this.add( this.cells );

			if( priority && priority !== "persist" ) {
				$cells.addClass( self.classes.priorityPrefix + priority );
			}
		});
	};

	ColumnToggle.prototype.destroy = function() {
		this.$table.removeClass( this.classes.columnToggleTable );
		this.$table.find( 'th, td' ).each(function() {
			var $cell = $( this );
			$cell.removeClass( 'tablesaw-cell-hidden' )
				.removeClass( 'tablesaw-cell-visible' );

			this.className = this.className.replace( /\bui\-table\-priority\-\d\b/g, '' );
		});
	};

	// on tablecreate, init
	$( document ).on( Tablesaw.events.create, function( e, tablesaw ){

		if( tablesaw.mode === 'columntoggle' ){
			var table = new ColumnToggle( tablesaw.table );
			table.init();
		}

	} );

	$( document ).on( Tablesaw.events.destroy, function( e, tablesaw ){
		if( tablesaw.mode === 'columntoggle' ){
			$( tablesaw.table ).data( data.key ).destroy();
		}
	} );

}());
;(function() {
	function getSortValue( cell ) {
		var text = [];

		$( cell.childNodes ).each(function() {
			var $el = $( this );
			if( $el.is( 'input, select' ) ) {
				text.push( $el.val() );
			} else if( $el.is( '.tablesaw-cell-label' ) ) {
			} else {
				text.push( ( $el.text() || '' ).replace(/^\s+|\s+$/g, '') );
			}
		});

		return text.join( '' );
	}

	var pluginName = "tablesaw-sortable",
		initSelector = "table[data-" + pluginName + "]",
		sortableSwitchSelector = "[data-" + pluginName + "-switch]",
		attrs = {
			defaultCol: "data-tablesaw-sortable-default-col",
			numericCol: "data-tablesaw-sortable-numeric"
		},
		classes = {
			head: pluginName + "-head",
			ascend: pluginName + "-ascending",
			descend: pluginName + "-descending",
			switcher: pluginName + "-switch",
			tableToolbar: 'tablesaw-toolbar',
			sortButton: pluginName + "-btn"
		},
		methods = {
			_create: function( o ){
				return $( this ).each(function() {
					var init = $( this ).data( pluginName + "-init" );
					if( init ) {
						return false;
					}
					$( this )
						.data( pluginName + "-init", true )
						.trigger( "beforecreate." + pluginName )
						[ pluginName ]( "_init" , o )
						.trigger( "create." + pluginName );
				});
			},
			_init: function(){
				var el = $( this ),
					heads,
					$switcher;

				var addClassToTable = function(){
						el.addClass( pluginName );
					},
					addClassToHeads = function( h ){
						$.each( h , function( i , v ){
							$( v ).addClass( classes.head );
						});
					},
					makeHeadsActionable = function( h , fn ){
						$.each( h , function( i , col ){
							var b = $( "<button class='" + classes.sortButton + "'/>" );
							b.on( "click" , { col: col } , fn );
							$( col ).wrapInner( b ).find( "button" ).append( "" );
						});
					},
					clearOthers = function( sibs ){
						$.each( sibs , function( i , v ){
							var col = $( v );
							col.removeAttr( attrs.defaultCol );
							col.removeClass( classes.ascend );
							col.removeClass( classes.descend );
						});
					},
					headsOnAction = function( e ){
						if( $( e.target ).is( 'a[href]' ) ) {
							return;
						}

						e.stopPropagation();
						var head = $( this ).parent(),
							v = e.data.col,
							newSortValue = heads.index( head[0] );

						clearOthers( head.siblings() );
						if( head.is( "." + classes.descend ) || !head.is( "." + classes.ascend ) ){
							el[ pluginName ]( "sortBy" , v , true);
							newSortValue += '_asc';
						} else {
							el[ pluginName ]( "sortBy" , v );
							newSortValue += '_desc';
						}
						if( $switcher ) {
							$switcher.find( 'select' ).val( newSortValue ).trigger( 'refresh' );
						}

						e.preventDefault();
					},
					handleDefault = function( heads ){
						$.each( heads , function( idx , el ){
							var $el = $( el );
							if( $el.is( "[" + attrs.defaultCol + "]" ) ){
								if( !$el.is( "." + classes.descend ) ) {
									$el.addClass( classes.ascend );
								}
							}
						});
					},
					addSwitcher = function( heads ){
						$switcher = $( '
' ).addClass( classes.switcher ).addClass( classes.tableToolbar );

						var html = [ '' + Tablesaw.i18n.sort + ':' ];

						html.push( '<select>' );
						heads.each(function( j ) {
							var $t = $( this );
							var isDefaultCol = $t.is( "[" + attrs.defaultCol + "]" );
							var isDescending = $t.is( "." + classes.descend );

							var hasNumericAttribute = $t.is( '[' + attrs.numericCol + ']' );
							var numericCount = 0;
							// Check only the first four rows to see if the column is numbers.
							var numericCountMax = 5;
							$( this.cells.slice( 0, numericCountMax ) ).each(function() {
								if( !isNaN( parseInt( getSortValue( this ), 10 ) ) ) {
									numericCount++;
								}
							});
							var isNumeric = numericCount === numericCountMax;
							if( !hasNumericAttribute ) {
								$t.attr( attrs.numericCol, isNumeric ? "" : "false" );
							}

							html.push( '<option' + ( isDefaultCol && !isDescending ? ' selected' : '' ) + ' value="' + j + '_asc">' + $t.text() + ' ' + ( isNumeric ? '↑' : '(A-Z)' ) + '</option>' );
							html.push( '<option' + ( isDefaultCol && isDescending ? ' selected' : '' ) + ' value="' + j + '_desc">' + $t.text() + ' ' + ( isNumeric ? '↓' : '(Z-A)' ) + '</option>' );
						});
						html.push( '</select>' );

						$switcher.html( html.join('') );

						var $toolbar = el.prev().filter( '.tablesaw-bar' ),
							$firstChild = $toolbar.children().eq( 0 );

						if( $firstChild.length ) {
							$switcher.insertBefore( $firstChild );
						} else {
							$switcher.appendTo( $toolbar );
						}
						$switcher.find( '.btn' ).tablesawbtn();
						$switcher.find( 'select' ).on( 'change', function() {
							var val = $( this ).val().split( '_' ),
								head = heads.eq( val[ 0 ] );

							clearOthers( head.siblings() );
							el[ pluginName ]( 'sortBy', head.get( 0 ), val[ 1 ] === 'asc' );
						});
					};

					addClassToTable();
					heads = el.find( "thead th[data-" + pluginName + "-col]" );
					addClassToHeads( heads );
					makeHeadsActionable( heads , headsOnAction );
					handleDefault( heads );

					if( el.is( sortableSwitchSelector ) ) {
						addSwitcher( heads, el.find('tbody tr:nth-child(-n+3)') );
					}
			},
			getColumnNumber: function( col ){
				return $( col ).prevAll().length;
			},
			getTableRows: function(){
				return $( this ).find( "tbody tr" );
			},
			sortRows: function( rows , colNum , ascending, col ){
				var cells, fn, sorted;
				var getCells = function( rows ){
						var cells = [];
						$.each( rows , function( i , r ){
							var element = $( r ).children().get( colNum );
							cells.push({
								element: element,
								cell: getSortValue( element ),
								rowNum: i
							});
						});
						return cells;
					},
					getSortFxn = function( ascending, forceNumeric ){
						var fn,
							regex = /[^\-\+\d\.]/g;
						if( ascending ){
							fn = function( a , b ){
								if( forceNumeric ) {
									return parseFloat( a.cell.replace( regex, '' ) ) - parseFloat( b.cell.replace( regex, '' ) );
								} else {
									return a.cell.toLowerCase() > b.cell.toLowerCase() ? 1 : -1;
								}
							};
						} else {
							fn = function( a , b ){
								if( forceNumeric ) {
									return parseFloat( b.cell.replace( regex, '' ) ) - parseFloat( a.cell.replace( regex, '' ) );
								} else {
									return a.cell.toLowerCase() < b.cell.toLowerCase() ? 1 : -1;
								}
							};
						}
						return fn;
					},
					applyToRows = function( sorted , rows ){
						var newRows = [], i, l, cur;
						for( i = 0, l = sorted.length ; i < l ; i++ ){
							cur = sorted[ i ].rowNum;
							newRows.push( rows[cur] );
						}
						return newRows;
					};

				cells = getCells( rows );
				var customFn = $( col ).data( 'tablesaw-sort' );
				fn = ( customFn && typeof customFn === "function" ? customFn( ascending ) : false ) ||
					getSortFxn( ascending, $( col ).is( '[' + attrs.numericCol + ']' ) && !$( col ).is( '[' + attrs.numericCol + '="false"]' ) );

				sorted = cells.sort( fn );
				rows = applyToRows( sorted , rows );
				return rows;
			},
			replaceTableRows: function( rows ){
				var el = $( this ),
					body = el.find( "tbody" );

				for( var j = 0, k = rows.length; j < k; j++ ) {
					body.append( rows[ j ] );
				}
			},
			makeColDefault: function( col , a ){
				var c = $( col );
				c.attr( attrs.defaultCol , "true" );
				if( a ){
					c.removeClass( classes.descend );
					c.addClass( classes.ascend );
				} else {
					c.removeClass( classes.ascend );
					c.addClass( classes.descend );
				}
			},
			sortBy: function( col , ascending ){
				var el = $( this ), colNum, rows;

				colNum = el[ pluginName ]( "getColumnNumber" , col );
				rows = el[ pluginName ]( "getTableRows" );
				rows = el[ pluginName ]( "sortRows" , rows , colNum , ascending, col );
				el[ pluginName ]( "replaceTableRows" , rows );
				el[ pluginName ]( "makeColDefault" , col , ascending );
				el.trigger( "tablesaw-sorted" );
			}
		};

	// Collection method.
	$.fn[ pluginName ] = function( arrg ) {
		var args = Array.prototype.slice.call( arguments , 1),
			returnVal;

		// if it's a method
		if( arrg && typeof( arrg ) === "string" ){
			returnVal = $.fn[ pluginName ].prototype[ arrg ].apply( this[0], args );
			return (typeof returnVal !== "undefined")? returnVal:$(this);
		}
		// check init
		if( !$( this ).data( pluginName + "-active" ) ){
			$( this ).data( pluginName + "-active", true );
			$.fn[ pluginName ].prototype._create.call( this , arrg );
		}
		return $(this);
	};
	// add methods
	$.extend( $.fn[ pluginName ].prototype, methods );

	$( document ).on( Tablesaw.events.create, function( e, Tablesaw ) {
		if( Tablesaw.$table.is( initSelector ) ) {
			Tablesaw.$table[ pluginName ]();
		}
	});

}());

(function(){

	var classes = {
		// TODO duplicate class, also in tables.js
		toolbar: "tablesaw-bar",
		hideBtn: "disabled",
		persistWidths: "tablesaw-fix-persist",
		allColumnsVisible: 'tablesaw-all-cols-visible'
	};
	var attrs = {
		disableTouchEvents: "data-tablesaw-no-touch"
	};

	function createSwipeTable( tbl, $table ){
		var $btns = $( "

" );
		var $prevBtn = $( "" ).appendTo( $btns );
		var $nextBtn = $( "" ).appendTo( $btns );

		var $headerCells = tbl._getPrimaryHeaderCells();
		var $headerCellsNoPersist = $headerCells.not( '[data-tablesaw-priority="persist"]' );
		var headerWidths = [];
		var $head = $( document.head || 'head' );
		var tableId = $table.attr( 'id' );

		if( !$headerCells.length ) {
			throw new Error( "tablesaw swipe: no header cells found. Are you using  inside of
?" );
		}

		$table.addClass( "tablesaw-swipe" );

		// Calculate initial widths
		$headerCells.each(function() {
			var width = this.offsetWidth;
			headerWidths.push( width );
		});

		$btns.appendTo( $table.prev().filter( '.tablesaw-bar' ) );

		if( !tableId ) {
			tableId = 'tableswipe-' + Math.round( Math.random() * 10000 );
			$table.attr( 'id', tableId );
		}

		function $getCells( headerCell ) {
			return $( headerCell.cells ).add( headerCell );
		}

		function showColumn( headerCell ) {
			$getCells( headerCell ).removeClass( 'tablesaw-cell-hidden' );
		}

		function hideColumn( headerCell ) {
			$getCells( headerCell ).addClass( 'tablesaw-cell-hidden' );
		}

		function persistColumn( headerCell ) {
			$getCells( headerCell ).addClass( 'tablesaw-cell-persist' );
		}

		function isPersistent( headerCell ) {
			return $( headerCell ).is( '[data-tablesaw-priority="persist"]' );
		}

		function unmaintainWidths() {
			$table.removeClass( classes.persistWidths );
			$( '#' + tableId + '-persist' ).remove();
		}

		function maintainWidths() {
			var prefix = '#' + tableId + '.tablesaw-swipe ',
				styles = [],
				tableWidth = $table.width(),
				hash = [],
				newHash;

			// save persistent column widths (as long as they take up less than 75% of table width)
			$headerCells.each(function( index ) {
				var width;
				if( isPersistent( this ) ) {
					width = this.offsetWidth;

					if( width < tableWidth * 0.75 ) {
						hash.push( index + '-' + width );
						styles.push( prefix + ' .tablesaw-cell-persist:nth-child(' + ( index + 1 ) + ') { width: ' + width + 'px; }' );
					}
				}
			});
			newHash = hash.join( '_' );

			if( styles.length ) {
				$table.addClass( classes.persistWidths );
				var $style = $( '#' + tableId + '-persist' );
				// If style element not yet added OR if the widths have changed
				if( !$style.length || $style.data( 'tablesaw-hash' ) !== newHash ) {
					// Remove existing
					$style.remove();

					$( '' )
						.attr( 'id', tableId + '-persist' )
						.data( 'tablesaw-hash', newHash )
						.appendTo( $head );
				}
			}
		}

		function getNext(){
			var next = [],
				checkFound;

			$headerCellsNoPersist.each(function( i ) {
				var $t = $( this ),
					isHidden = $t.css( "display" ) === "none" || $t.is( ".tablesaw-cell-hidden" );

				if( !isHidden && !checkFound ) {
					checkFound = true;
					next[ 0 ] = i;
				} else if( isHidden && checkFound ) {
					next[ 1 ] = i;

					return false;
				}
			});

			return next;
		}

		function getPrev(){
			var next = getNext();
			return [ next[ 1 ] - 1 , next[ 0 ] - 1 ];
		}

		function nextpair( fwd ){
			return fwd ? getNext() : getPrev();
		}

		function canAdvance( pair ){
			return pair[ 1 ] > -1 && pair[ 1 ] < $headerCellsNoPersist.length;
		}

		function matchesMedia() {
			var matchMedia = $table.attr( "data-tablesaw-swipe-media" );
			return !matchMedia || ( "matchMedia" in win ) && win.matchMedia( matchMedia ).matches;
		}

		function fakeBreakpoints() {
			if( !matchesMedia() ) {
				return;
			}

			var	containerWidth = $table.parent().width(),
				persist = [],
				sum = 0,
				sums = [],
				visibleNonPersistantCount = $headerCells.length;

			$headerCells.each(function( index ) {
				var $t = $( this ),
					isPersist = $t.is( '[data-tablesaw-priority="persist"]' );

				persist.push( isPersist );
				sum += headerWidths[ index ];
				sums.push( sum );

				// is persistent or is hidden
				if( isPersist || sum > containerWidth ) {
					visibleNonPersistantCount--;
				}
			});

			// We need at least one column to swipe.
			var needsNonPersistentColumn = visibleNonPersistantCount === 0;

			$headerCells.each(function( index ) {
				if( persist[ index ] ) {

					// for visual box-shadow
					persistColumn( this );
					return;
				}

				if( sums[ index ] <= containerWidth || needsNonPersistentColumn ) {
					needsNonPersistentColumn = false;
					showColumn( this );
				} else {
					hideColumn( this );
				}
			});

			unmaintainWidths();
			$table.trigger( 'tablesawcolumns' );
		}

		function advance( fwd ){
			var pair = nextpair( fwd );
			if( canAdvance( pair ) ){
				if( isNaN( pair[ 0 ] ) ){
					if( fwd ){
						pair[0] = 0;
					}
					else {
						pair[0] = $headerCellsNoPersist.length - 1;
					}
				}

				maintainWidths();

				hideColumn( $headerCellsNoPersist.get( pair[ 0 ] ) );
				showColumn( $headerCellsNoPersist.get( pair[ 1 ] ) );

				$table.trigger( 'tablesawcolumns' );
			}
		}

		$prevBtn.add( $nextBtn ).on( "click", function( e ){
			advance( !!$( e.target ).closest( $nextBtn ).length );
			e.preventDefault();
		});

		function getCoord( event, key ) {
			return ( event.touches || event.originalEvent.touches )[ 0 ][ key ];
		}

		if( !$table.is( "[" + attrs.disableTouchEvents + "]" ) ) {

			$table
				.on( "touchstart.swipetoggle", function( e ){
					var originX = getCoord( e, 'pageX' );
					var originY = getCoord( e, 'pageY' );
					var x;
					var y;
					var scrollTop = window.pageYOffset;

					$( win ).off( Tablesaw.events.resize, fakeBreakpoints );

					$( this )
						.on( "touchmove.swipetoggle", function( e ){
							x = getCoord( e, 'pageX' );
							y = getCoord( e, 'pageY' );
						})
						.on( "touchend.swipetoggle", function() {
							var cfg = tbl.getConfig({
								swipeHorizontalThreshold: 30,
								swipeVerticalThreshold: 30
							});

							// This config code is a little awkward because shoestring doesn't support deep $.extend
							// Trying to work around when devs only override one of (not both) horizontalThreshold or
							// verticalThreshold in their TablesawConfig.
							var verticalThreshold = cfg.swipe ? cfg.swipe.verticalThreshold : cfg.swipeVerticalThreshold;
							var horizontalThreshold = cfg.swipe ? cfg.swipe.horizontalThreshold : cfg.swipeHorizontalThreshold;

							var isPageScrolled = Math.abs( window.pageYOffset - scrollTop ) >= verticalThreshold;
							var isVerticalSwipe = Math.abs( y - originY ) >= verticalThreshold;

							if( !isVerticalSwipe && !isPageScrolled ) {
								if( x - originX < -1 * horizontalThreshold ){
									advance( true );
								}
								if( x - originX > horizontalThreshold ){
									advance( false );
								}
							}

							window.setTimeout(function() {
								$( win ).on( Tablesaw.events.resize, fakeBreakpoints );
							}, 300);

							$( this ).off( "touchmove.swipetoggle touchend.swipetoggle" );
						});
				});
		}

		$table
			.on( "tablesawcolumns.swipetoggle", function(){
				var canGoPrev = canAdvance( getPrev() );
				var canGoNext = canAdvance( getNext() );
				$prevBtn[ canGoPrev ? "removeClass" : "addClass" ]( classes.hideBtn );
				$nextBtn[ canGoNext ? "removeClass" : "addClass" ]( classes.hideBtn );

				$prevBtn.closest( "." + classes.toolbar )[ !canGoPrev && !canGoNext ? 'addClass' : 'removeClass' ]( classes.allColumnsVisible );
			})
			.on( "tablesawnext.swipetoggle", function(){
				advance( true );
			} )
			.on( "tablesawprev.swipetoggle", function(){
				advance( false );
			} )
			.on( Tablesaw.events.destroy + ".swipetoggle", function(){
				var $t = $( this );

				$t.removeClass( 'tablesaw-swipe' );
				$t.prev().filter( '.tablesaw-bar' ).find( '.tablesaw-advance' ).remove();
				$( win ).off( Tablesaw.events.resize, fakeBreakpoints );

				$t.off( ".swipetoggle" );
			})
			.on( Tablesaw.events.refresh, function() {
				// manual refresh
				headerWidths = [];
				$headerCells.each(function() {
					var width = this.offsetWidth;
					headerWidths.push( width );
				});

				fakeBreakpoints();
			});

		fakeBreakpoints();
		$( win ).on( Tablesaw.events.resize, fakeBreakpoints );
	}

	// on tablecreate, init
	$( document ).on( Tablesaw.events.create, function( e, tablesaw ){
		if( tablesaw.mode === 'swipe' ){
			createSwipeTable( tablesaw, tablesaw.$table );
		}

	} );

}());

;(function(){

	var MiniMap = {
		attr: {
			init: 'data-tablesaw-minimap'
		}
	};

	function createMiniMap( $table ){

		var $btns = $( '
' ),
			$dotNav = $( '
' ).appendTo( $btns ),
			hideDot = 'tablesaw-advance-dots-hide',
			$headerCells = $table.find( 'thead th' );

		// populate dots
		$headerCells.each(function(){
			$dotNav.append( '

' );
		});

		$btns.appendTo( $table.prev().filter( '.tablesaw-bar' ) );

		function showMinimap( $table ) {
			var mq = $table.attr( MiniMap.attr.init );
			return !mq || win.matchMedia && win.matchMedia( mq ).matches;
		}

		function showHideNav(){
			if( !showMinimap( $table ) ) {
				$btns.css( "display", "none" );
				return;
			}
			$btns.css( "display", "block" );

			// show/hide dots
			var dots = $dotNav.find( "li" ).removeClass( hideDot );
			$table.find( "thead th" ).each(function(i){
				if( $( this ).css( "display" ) === "none" ){
					dots.eq( i ).addClass( hideDot );
				}
			});
		}

		// run on init and resize
		showHideNav();
		$( win ).on( Tablesaw.events.resize, showHideNav );

		$table
			.on( "tablesawcolumns.minimap", function(){
				showHideNav();
			})
			.on( Tablesaw.events.destroy + ".minimap", function(){
				var $t = $( this );

				$t.prev().filter( '.tablesaw-bar' ).find( '.tablesaw-advance' ).remove();
				$( win ).off( Tablesaw.events.resize, showHideNav );

				$t.off( ".minimap" );
			});
	}

	// on tablecreate, init
	$( document ).on( Tablesaw.events.create, function( e, tablesaw ){

		if( ( tablesaw.mode === 'swipe' || tablesaw.mode === 'columntoggle' ) && tablesaw.$table.is( '[ ' + MiniMap.attr.init + ']' ) ){
			createMiniMap( tablesaw.$table );
		}

	} );

}());

;(function() {

	var S = {
		selectors: {
			init: 'table[data-tablesaw-mode-switch]'
		},
		attributes: {
			excludeMode: 'data-tablesaw-mode-exclude'
		},
		classes: {
			main: 'tablesaw-modeswitch',
			toolbar: 'tablesaw-toolbar'
		},
		modes: [ 'stack', 'swipe', 'columntoggle' ],
		init: function( table ) {
			var $table = $( table ),
				ignoreMode = $table.attr( S.attributes.excludeMode ),
				$toolbar = $table.prev().filter( '.tablesaw-bar' ),
				modeVal = '',
				$switcher = $( '
' ).addClass( S.classes.main + ' ' + S.classes.toolbar );

			var html = [ '' + Tablesaw.i18n.columns + ':' ],
				dataMode = $table.attr( 'data-tablesaw-mode' ),
				isSelected;

			html.push( '<select>' );
			for( var j=0, k = S.modes.length; j<k; j++ ) {
				if( ignoreMode && ignoreMode.toLowerCase() === S.modes[ j ] ) {
					continue;
				}

				isSelected = dataMode === S.modes[ j ];

				if( isSelected ) {
					modeVal = S.modes[ j ];
				}

				html.push( '<option' +
					( isSelected ? ' selected' : '' ) +
					' value="' + S.modes[ j ] + '">' + Tablesaw.i18n.modes[ j ] + '</option>' );
			}
			html.push( '</select>' );

			$switcher.html( html.join( '' ) );

			var $otherToolbarItems = $toolbar.find( '.tablesaw-advance' ).eq( 0 );
			if( $otherToolbarItems.length ) {
				$switcher.insertBefore( $otherToolbarItems );
			} else {
				$switcher.appendTo( $toolbar );
			}

			$switcher.find( '.btn' ).tablesawbtn();
			$switcher.find( 'select' ).on( 'change', S.onModeChange );
		},
		onModeChange: function() {
			var $t = $( this ),
				$switcher = $t.closest( '.' + S.classes.main ),
				$table = $t.closest( '.tablesaw-bar' ).next().eq( 0 ),
				val = $t.val();

			$switcher.remove();
			$table.data( 'tablesaw' ).destroy();

			$table.attr( 'data-tablesaw-mode', val );
			$table.tablesaw();
		}
	};

	$( win.document ).on( Tablesaw.events.create, function( e, Tablesaw ) {
		if( Tablesaw.$table.is( S.selectors.init ) ) {
			S.init( Tablesaw.table );
		}
	});

})();
(function(){
	var pluginName = "tablesawCheckAll";

	function CheckAll( tablesaw ) {
		this.tablesaw = tablesaw;
		this.$table = tablesaw.$table;
		this.checkboxAllSelector = "input[type=\"checkbox\"][data-tablesaw-checkall]";
		this.checkboxSelector = "input[type=\"checkbox\"]";

		this.$checkbox = null;

		if( this.$table.data( pluginName ) ) {
			return;
		}
		this.$table.data( pluginName, this );
		this.init();
	}

	CheckAll.prototype.init = function() {
		this.$checkbox = this.$table.find( "thead" ).find( this.checkboxAllSelector );

		if( this.$checkbox.length ) {
			this.addEvents();
		}
	};

	CheckAll.prototype.addEvents = function() {
		var self = this;
		// Update body checkboxes when header checkbox is changed
		this.$checkbox.on( "change", function() {
			var setChecked = this.checked;
			var $th = $( this ).closest( "th" );
			if( $th.length ) {
				$( $th[ 0 ].cells ).find( self.checkboxSelector ).each(function() {
					this.checked = setChecked;
				});
			}
		});

		// Update header checkbox when body checkboxes are changed
		this.$table.find( "tbody " + this.checkboxSelector ).on( "change", function() {
			var cells;
			var checkedCount = 0;

			var $td = $( this ).closest( "th,td" );
			if( $td.length ) {
				cells = $td[ 0 ].headerCell.cells;

				$( cells ).find( self.checkboxSelector ).not( self.checkboxAllSelector ).each(function() {
					if( this.checked ) {
						checkedCount++;
					}
				});

				$( $td[ 0 ].headerCell ).find( self.checkboxSelector ).each(function() {
					var allSelected = checkedCount === cells.length;
					this.checked = allSelected;

					// only indeterminate if some are selected (not all and not none)
					this.indeterminate = checkedCount !== 0 && !allSelected;
				});
			}
		});
	};

	// on tablecreate, init
	$( document ).on( Tablesaw.events.create, function( e, tablesaw ){
		new CheckAll( tablesaw );
	});

}());

}));


text:
This file is for the developers.

Clay setup will be hosted at the repo.
Version is major.middle.minor-build. Major will be only changed on stage changes (Alpha -> Beta -> Release).
Middle will be changed when we add a bunch of features
Minor will be changed when we add a feature or a couple.
Build will be the same from start, and will not be reset to 0 at anytime.
A new build is made when you complete all the changes.

###Filesystem###
This OS will have a new fs API.
/foo/bar is absolute
foo/bar is relative
!/foo/bar means that ! is equal to the user's data folder
?top/foo/bar means the disk on the top of the computer.

###Structure###

* Root
  * Users
    * Default
    * (user name here)
      * Programs
      * Documents
      * Images
      * Config
      * Downloads
      * Desktop
  * Clay
    * lua
    * config
    * debug (crash dumps)


text:
{-# LANGUAGE Trustworthy #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  Data.Foldable
-- Copyright   :  Ross Paterson 2005
-- License     :  BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer  :  libraries@haskell.org
-- Stability   :  experimental
-- Portability :  portable
--
-- Class of data structures that can be folded to a summary value.
--
-- Many of these functions generalize "Prelude", "Control.Monad" and
-- "Data.List" functions of the same names from lists to any 'Foldable'
-- functor.  To avoid ambiguity, either import those modules hiding
-- these names or qualify uses of these function names with an alias
-- for this module.
--
-----------------------------------------------------------------------------

module Data.Foldable (
    -- * Folds
    Foldable(..),
    -- ** Special biased folds
    foldrM,
    foldlM,
    -- ** Folding actions
    -- *** Applicative actions
    traverse_,
    for_,
    sequenceA_,
    asum,
    -- *** Monadic actions
    mapM_,
    forM_,
    sequence_,
    msum,
    -- ** Specialized folds
    toList,
    concat,
    concatMap,
    and,
    or,
    any,
    all,
    sum,
    product,
    maximum,
    maximumBy,
    minimum,
    minimumBy,
    -- ** Searches
    elem,
    notElem,
    find
    ) where

import Prelude hiding (foldl, foldr, foldl1, foldr1, mapM_, sequence_,
                elem, notElem, concat, concatMap, and, or, any, all,
                sum, product, maximum, minimum)
import qualified Prelude (foldl, foldr, foldl1, foldr1)
import qualified Data.List as List (foldl')
import Control.Applicative
import Control.Monad (MonadPlus(..))
import Data.Maybe (fromMaybe, listToMaybe)
import Data.Monoid
import Data.Proxy

import GHC.Exts (build)
import GHC.Arr

-- | Data structures that can be folded.
--
-- Minimal complete definition: 'foldMap' or 'foldr'.
--
-- For example, given a data type
--
-- > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
--
-- a suitable instance would be
--
-- > instance Foldable Tree where
-- >    foldMap f Empty = mempty
-- >    foldMap f (Leaf x) = f x
-- >    foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r
--
-- This is suitable even for abstract types, as the monoid is assumed
-- to satisfy the monoid laws.  Alternatively, one could define @foldr@:
--
-- > instance Foldable Tree where
-- >    foldr f z Empty = z
-- >    foldr f z (Leaf x) = f x z
-- >    foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l
--
class Foldable t where
    -- | Combine the elements of a structure using a monoid.
    fold :: Monoid m => t m -> m
    fold = foldMap id

    -- | Map each element of the structure to a monoid,
    -- and combine the results.
    foldMap :: Monoid m => (a -> m) -> t a -> m
    foldMap f = foldr (mappend . f) mempty

    -- | Right-associative fold of a structure.
    --
    -- @'foldr' f z = 'Prelude.foldr' f z . 'toList'@
    foldr :: (a -> b -> b) -> b -> t a -> b
    foldr f z t = appEndo (foldMap (Endo . f) t) z

    -- | Right-associative fold of a structure,
    -- but with strict application of the operator.
    foldr' :: (a -> b -> b) -> b -> t a -> b
    foldr' f z0 xs = foldl f' id xs z0
      where f' k x z = k $! f x z

    -- | Left-associative fold of a structure.
    --
    -- @'foldl' f z = 'Prelude.foldl' f z . 'toList'@
    foldl :: (b -> a -> b) -> b -> t a -> b
    foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z

    -- | Left-associative fold of a structure.
    -- but with strict application of the operator.
    --
    -- @'foldl' f z = 'List.foldl'' f z . 'toList'@
    foldl' :: (b -> a -> b) -> b -> t a -> b
    foldl' f z0 xs = foldr f' id xs z0
      where f' x k z = k $! f z x

    -- | A variant of 'foldr' that has no base case,
    -- and thus may only be applied to non-empty structures.
    --
    -- @'foldr1' f = 'Prelude.foldr1' f . 'toList'@
    foldr1 :: (a -> a -> a) -> t a -> a
    foldr1 f xs = fromMaybe (error "foldr1: empty structure")
                    (foldr mf Nothing xs)
      where
        mf x Nothing = Just x
        mf x (Just y) = Just (f x y)

    -- | A variant of 'foldl' that has no base case,
    -- and thus may only be applied to non-empty structures.
    --
    -- @'foldl1' f = 'Prelude.foldl1' f . 'toList'@
    foldl1 :: (a -> a -> a) -> t a -> a
    foldl1 f xs = fromMaybe (error "foldl1: empty structure")
                    (foldl mf Nothing xs)
      where
        mf Nothing y = Just y
        mf (Just x) y = Just (f x y)
    {-# MINIMAL foldMap | foldr #-}

-- instances for Prelude types

instance Foldable Maybe where
    foldr _ z Nothing = z
    foldr f z (Just x) = f x z

    foldl _ z Nothing = z
    foldl f z (Just x) = f z x

instance Foldable [] where
    foldr = Prelude.foldr
    foldl = Prelude.foldl
    foldl' = List.foldl'
    foldr1 = Prelude.foldr1
    foldl1 = Prelude.foldl1

instance Foldable (Either a) where
    foldMap _ (Left _) = mempty
    foldMap f (Right y) = f y

    foldr _ z (Left _) = z
    foldr f z (Right y) = f y z

instance Foldable ((,) a) where
    foldMap f (_, y) = f y

    foldr f z (_, y) = f y z

instance Ix i => Foldable (Array i) where
    foldr f z = Prelude.foldr f z . elems
    foldl f z = Prelude.foldl f z . elems
    foldr1 f = Prelude.foldr1 f . elems
    foldl1 f = Prelude.foldl1 f . elems

instance Foldable Proxy where
    foldMap _ _ = mempty
    {-# INLINE foldMap #-}
    fold _ = mempty
    {-# INLINE fold #-}
    foldr _ z _ = z
    {-# INLINE foldr #-}
    foldl _ z _ = z
    {-# INLINE foldl #-}
    foldl1 _ _ = error "foldl1: Proxy"
    {-# INLINE foldl1 #-}
    foldr1 _ _ = error "foldr1: Proxy"
    {-# INLINE foldr1 #-}

instance Foldable (Const m) where
    foldMap _ _ = mempty

-- | Monadic fold over the elements of a structure,
-- associating to the right, i.e. from right to left.
foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
foldrM f z0 xs = foldl f' return xs z0
  where f' k x z = f x z >>= k

-- | Monadic fold over the elements of a structure,
-- associating to the left, i.e. from left to right.
foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldlM f z0 xs = foldr f' return xs z0
  where f' x k z = f z x >>= k

-- | Map each element of a structure to an action, evaluate
-- these actions from left to right, and ignore the results.
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
traverse_ f = foldr ((*>) . f) (pure ())

-- | 'for_' is 'traverse_' with its arguments flipped.
for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
{-# INLINE for_ #-}
for_ = flip traverse_

-- | Map each element of a structure to a monadic action, evaluate
-- these actions from left to right, and ignore the results.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
mapM_ f = foldr ((>>) . f) (return ())

-- | 'forM_' is 'mapM_' with its arguments flipped.
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
{-# INLINE forM_ #-}
forM_ = flip mapM_

-- | Evaluate each action in the structure from left to right,
-- and ignore the results.
sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
sequenceA_ = foldr (*>) (pure ())

-- | Evaluate each monadic action in the structure from left to right,
-- and ignore the results.
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
sequence_ = foldr (>>) (return ())

-- | The sum of a collection of actions, generalizing 'concat'.
asum :: (Foldable t, Alternative f) => t (f a) -> f a
{-# INLINE asum #-}
asum = foldr (<|>) empty

-- | The sum of a collection of actions, generalizing 'concat'.
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
{-# INLINE msum #-}
msum = foldr mplus mzero

-- These use foldr rather than foldMap to avoid repeated concatenation.

-- | List of elements of a structure.
toList :: Foldable t => t a -> [a]
{-# INLINE toList #-}
toList t = build (\ c n -> foldr c n t)

-- | The concatenation of all the elements of a container of lists.
concat :: Foldable t => t [a] -> [a]
concat = fold

-- | Map a function over all the elements of a container and concatenate
-- the resulting lists.
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
concatMap = foldMap

-- | 'and' returns the conjunction of a container of Bools.  For the
-- result to be 'True', the container must be finite; 'False', however,
-- results from a 'False' value finitely far from the left end.
and :: Foldable t => t Bool -> Bool
and = getAll . foldMap All

-- | 'or' returns the disjunction of a container of Bools.  For the
-- result to be 'False', the container must be finite; 'True', however,
-- results from a 'True' value finitely far from the left end.
or :: Foldable t => t Bool -> Bool
or = getAny . foldMap Any

-- | Determines whether any element of the structure satisfies the predicate.
any :: Foldable t => (a -> Bool) -> t a -> Bool
any p = getAny . foldMap (Any . p)

-- | Determines whether all elements of the structure satisfy the predicate.
all :: Foldable t => (a -> Bool) -> t a -> Bool
all p = getAll . foldMap (All . p)

-- | The 'sum' function computes the sum of the numbers of a structure.
sum :: (Foldable t, Num a) => t a -> a
sum = getSum . foldMap Sum

-- | The 'product' function computes the product of the numbers of a structure.
product :: (Foldable t, Num a) => t a -> a
product = getProduct . foldMap Product

-- | The largest element of a non-empty structure.
maximum :: (Foldable t, Ord a) => t a -> a
maximum = foldr1 max

-- | The largest element of a non-empty structure with respect to the
-- given comparison function.
maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
maximumBy cmp = foldr1 max'
  where max' x y = case cmp x y of
                        GT -> x
                        _  -> y

-- | The least element of a non-empty structure.
minimum :: (Foldable t, Ord a) => t a -> a
minimum = foldr1 min

-- | The least element of a non-empty structure with respect to the
-- given comparison function.
minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
minimumBy cmp = foldr1 min'
  where min' x y = case cmp x y of
                        GT -> y
                        _  -> x

-- | Does the element occur in the structure?
elem :: (Foldable t, Eq a) => a -> t a -> Bool
elem = any . (==)

-- | 'notElem' is the negation of 'elem'.
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
notElem x = not . elem x

-- | The 'find' function takes a predicate and a structure and returns
-- the leftmost element of the structure matching the predicate, or
-- 'Nothing' if there is no such element.
find :: Foldable t => (a -> Bool) -> t a -> Maybe a
find p = listToMaybe . concatMap (\ x -> if p x then [x] else [])


text:
package org.beetl.performance.lab;

public class NodeCopy {

	public NodeCopy() {
		// TODO Auto-generated constructor stub
	}

	public static void main(String[] args) {

	}

}


text:
package org.robotbrains.support.web.server.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpRequest;

import java.io.IOException;
import java.net.HttpCookie;
import java.util.Set;

import org.robotbrains.support.web.server.HttpFileUpload;

/**
 * Handle HTTP POST requests from Netty.
 *
 * @author Keith M. Hughes
 */
public interface NettyHttpPostRequestHandler {

  /**
   * Is the request handled by this handler?
   *
   * @param nettyRequest
   *          the Netty HTTP request
   *
   * @return {@code true} if the request is handled by this handler
   */
  boolean isHandledBy(HttpRequest nettyRequest);

  /**
   * Handle the web request.
   *
   * @param ctx
   *          the channel handler context
   * @param nettyRequest
   *          the Netty HTTP request
   * @param upload
   *          the HTTP file upload
   * @param cookiesToAdd
   *          cookies to be set on the response
   *
   * @throws IOException
   *           something bad happened
   */
  void handleWebRequest(ChannelHandlerContext ctx, HttpRequest nettyRequest, HttpFileUpload upload,
      Set<HttpCookie> cookiesToAdd) throws IOException;
}


text:
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: like.php 25510 2011-11-14 02:22:26Z yexinhao $
 */

define('IN_API', true);
define('CURSCRIPT', 'api');

require_once '../../source/class/class_core.php';

$cachelist = array();
$discuz = C::app();
$discuz->init_setting = true;
$discuz->init();

$body = '';
$style = 'body { background: transparent; color: '.$_G['style']['tabletext'].'; font: '.$_G['style']['fontsize'].' '.$_G['style']['font'].'; margin:0; }'.
	'a { color: '.$_G['style']['link'].'; text-decoration: none; } a:hover { text-decoration: underline; }';

if($_G['setting']['connect']['like_allow'] && $_G['setting']['connect']['like_url']) {
	$style .= '#txQZ { border: medium none; float: left; height:21px; margin-top: 4px; overflow: hidden; width: 110px; }'.
		'.vm { vertical-align: middle; }';
	$body .= '';
}

if($_G['setting']['connect']['turl_allow'] && $_G['setting']['connect']['turl_code']) {
	$style .= '#txWB_W1 { background: url("../../static/image/common/weibo.png") no-repeat scroll 0 50% transparent; float: left; line-height: 28px; padding: 0 5px 0 20px; }'.
		'#txWB_W1 img { display: none; }'.
		'#txWB_W1 b { font-weight: 400; }'.
		'#txWB_W1 a { color: '.$_G['style']['highlightlink'].'; }';
	$body .= $_G['setting']['connect']['turl_code'];
}

if($style && $body) {
	echo ''.$body.'';
}


text:
require 'kramdown/parser/kramdown/extensions'
require 'kramdown/parser/kramdown/blank_line'
require 'kramdown/parser/kramdown/codeblock'

module Kramdown
  module Parser
    class Kramdown

      FOOTNOTE_DEFINITION_START = /^#{OPT_SPACE}\[\^(#{ALD_ID_NAME})\]:\s*?(.*?\n#{CODEBLOCK_MATCH})/

      # Parse the foot note definition at the current location.
      def parse_footnote_definition
        start_line_number = @src.current_line_number
        @src.pos += @src.matched_size

        el = Element.new(:footnote_def, nil, nil, :location => start_line_number)
        parse_blocks(el, @src[2].gsub(INDENT, ''))
        warning("Duplicate footnote name '#{@src[1]}' on line #{start_line_number} - overwriting") if @footnotes[@src[1]]
        (@footnotes[@src[1]] = {})[:content] = el
        @tree.children << Element.new(:eob, :footnote_def, nil, :location => start_line_number)
        true
      end
      define_parser(:footnote_definition, FOOTNOTE_DEFINITION_START)

      FOOTNOTE_MARKER_START = /\[\^(#{ALD_ID_NAME})\]/

      # Parse the footnote marker at the current location.
      def parse_footnote_marker
        start_line_number = @src.current_line_number
        @src.pos += @src.matched_size
        fn_def = @footnotes[@src[1]]
        if fn_def
          fn_def[:marker] ||= []
          fn_def[:marker].push(Element.new(:footnote, fn_def[:content], nil, :name => @src[1], :location => start_line_number))
          fn_def[:stack] = [@stack.map {|s| s.first}, @tree, fn_def[:marker]].flatten.compact
          @tree.children << fn_def[:marker].last
        else
          warning("Footnote definition for '#{@src[1]}' not found on line #{start_line_number}")
          add_text(@src.matched)
        end
      end
      define_parser(:footnote_marker, FOOTNOTE_MARKER_START, '\[')

    end
  end
end


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

        <title>OR-Tools</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>

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

                Google OR-Tools 9.4

C++ Reference

Algorithms

CP-SAT

Graph

Routing

Linear solver

C++ Reference: Routing

DecisionVisitor Member List

This is the complete list of members for DecisionVisitor, including all inherited members.

BaseObject()	BaseObject	inline

DebugString() const	BaseObject	inlinevirtual

DecisionVisitor()	DecisionVisitor	inline

VisitRankFirstInterval(SequenceVar *const sequence, int index)	DecisionVisitor	virtual

VisitRankLastInterval(SequenceVar *const sequence, int index)	DecisionVisitor	virtual

VisitScheduleOrExpedite(IntervalVar *const var, int64_t est)	DecisionVisitor	virtual

VisitScheduleOrPostpone(IntervalVar *const var, int64_t est)	DecisionVisitor	virtual

VisitSetVariableValue(IntVar *const var, int64_t value)	DecisionVisitor	virtual

VisitSplitVariableDomain(IntVar *const var, int64_t value, bool start_with_lower_half)	DecisionVisitor	virtual

VisitUnknownDecision()	DecisionVisitor	virtual

~BaseObject()	BaseObject	inlinevirtual

~DecisionVisitor() override	DecisionVisitor	inline


text:
class mappy_state : public driver_device
{
public:
	mappy_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag) { }

	UINT8 *m_videoram;
	UINT8 *m_spriteram;
	tilemap_t *m_bg_tilemap;
	bitmap_t *m_sprite_bitmap;

	UINT8 m_scroll;
	int m_mux;
};

/*----------- defined in video/mappy.c -----------*/

VIDEO_START( phozon );
PALETTE_INIT( phozon );
SCREEN_UPDATE( phozon );

PALETTE_INIT( superpac );
PALETTE_INIT( mappy );
VIDEO_START( superpac );
VIDEO_START( mappy );
SCREEN_UPDATE( superpac );
SCREEN_UPDATE( mappy );
WRITE8_HANDLER( superpac_videoram_w );
WRITE8_HANDLER( mappy_videoram_w );
WRITE8_HANDLER( mappy_scroll_w );
READ8_HANDLER( superpac_flipscreen_r );
WRITE8_HANDLER( superpac_flipscreen_w );


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.Security.KeyVault.Secrets;
using NUnit.Framework;

namespace Azure.Identity.Tests
{
    public class ManagedIdentityCredentialSFLiveTests : ManagedIdentityCredentialLiveTestBase
    {
        public ManagedIdentityCredentialSFLiveTests(bool isAsync) : base(isAsync)
        {
        }

        [NonParallelizable]
        [Test]
        public async Task ValidateSystemAssignedIdentity()
        {
            if (string.IsNullOrEmpty(TestEnvironment.SFEnable) || !string.IsNullOrEmpty(TestEnvironment.UserAssignedVault))
            {
                Assert.Ignore();
            }

            using (ReadOrRestoreManagedIdentityEnvironment())
            {
                var vaultUri = new Uri(TestEnvironment.SystemAssignedVault);

                CredentialPipeline pipeline = CredentialPipeline.GetInstance(InstrumentClientOptions(new TokenCredentialOptions { Transport = ServiceFabricManagedIdentitySource.GetServiceFabricMITransport() }));

                var cred = new ManagedIdentityCredential(new ManagedIdentityClient(new ManagedIdentityClientOptions { Pipeline = pipeline, PreserveTransport = true }));

                // Hard code service version or recorded tests will fail: https://github.com/Azure/azure-sdk-for-net/issues/10432
                var kvoptions = InstrumentClientOptions(new SecretClientOptions(SecretClientOptions.ServiceVersion.V7_0));

                var kvclient = InstrumentClient(new SecretClient(vaultUri, cred, kvoptions));

                KeyVaultSecret secret = await kvclient.SetSecretAsync("identitytestsecret", "value");

                Assert.IsNotNull(secret);
            }
        }

        [NonParallelizable]
        [Test]
        public async Task ValidateUserAssignedIdentity()
        {
            if (string.IsNullOrEmpty(TestEnvironment.SFEnable) || string.IsNullOrEmpty(TestEnvironment.UserAssignedVault))
            {
                Assert.Ignore();
            }

            using (ReadOrRestoreManagedIdentityEnvironment())
            {
                var vaultUri = new Uri(TestEnvironment.UserAssignedVault);

                var clientId = TestEnvironment.IMDSClientId;

                CredentialPipeline pipeline = CredentialPipeline.GetInstance(InstrumentClientOptions(new TokenCredentialOptions { Transport = ServiceFabricManagedIdentitySource.GetServiceFabricMITransport() }));

                var cred = new ManagedIdentityCredential(new ManagedIdentityClient(new ManagedIdentityClientOptions { Pipeline = pipeline, ClientId = clientId, PreserveTransport = true }));

                // Hard code service version or recorded tests will fail: https://github.com/Azure/azure-sdk-for-net/issues/10432
                var kvoptions = InstrumentClientOptions(new SecretClientOptions(SecretClientOptions.ServiceVersion.V7_0));

                var kvclient = InstrumentClient(new SecretClient(vaultUri, cred, kvoptions));

                KeyVaultSecret secret = await kvclient.SetSecretAsync("identitytestsecret", "value");

                Assert.IsNotNull(secret);
            }
        }
    }
}


text:
package com.nhinds.lastpass.impl;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.io.ByteStreams;
import com.nhinds.lastpass.LastPassException;
import com.nhinds.lastpass.encryption.EncryptionProvider;

public class PasswordStoreReader {
	private static final Logger LOGGER = LoggerFactory.getLogger(PasswordStoreReader.class);

	private static final String END_MARKER_CHUNK_ID = "ENDM";
	private static final String ACCT_CHUNK_ID = "ACCT";
	private static final String EQDN_CHUNK_ID = "EQDN";

	private final EncryptionProvider decryptionProvider;
	private final Map<Long, AccountData> accounts = new HashMap<Long, AccountData>();
	private final Map<String, Collection<String>> domains = new HashMap<String, Collection<String>>();

	public PasswordStoreReader(final InputStream accountsStream, final EncryptionProvider decryptionProvider) {
		this.decryptionProvider = decryptionProvider;
		try {
			parseChunks(accountsStream);
		} catch (final IOException e) {
			throw new LastPassException("Error parsing blob", e);
		} finally {
			try {
				accountsStream.close();
			} catch (final IOException ignore) {
			}
		}
	}

	public Map<Long, AccountData> getAccounts() {
		return this.accounts;
	}

	public Map<String, Collection<String>> getDomains() {
		return this.domains;
	}

	private void parseChunks(final InputStream accountsStream) throws IOException {
		LOGGER.debug("Start parsing blob");
		final Map<Long, Collection<String>> domainsById = new HashMap<Long, Collection<String>>();
		// # LastPass blob chunk is made up of 4-byte ID, 4-byte size and payload of that size
		// # Example:
		// # 0000: 'IDID'
		// # 0004: 4
		// # 0008: 0xDE 0xAD 0xBE 0xEF
		// # 000C: --- Next chunk ---
		final DataInputStream in = new DataInputStream(accountsStream);
		while (true) {
			final byte[] idBytes = new byte[4];
			in.readFully(idBytes);
			final String id = new String(idBytes);
			LOGGER.trace("Parsing chunk {}", id);

			if (END_MARKER_CHUNK_ID.equals(id)) {
				LOGGER.debug("End of blob");
				// End of stream
				break;
			} else {
				// Create a new child DataInputStream for the next item in the stream.
				final int size = in.readInt();
				final DataInputStream chunkInputStream = new DataInputStream(ByteStreams.limit(in, size));
				if (ACCT_CHUNK_ID.equals(id)) {
					parseAccountData(chunkInputStream);
				} else if (EQDN_CHUNK_ID.equals(id)) {
					parseEquivalentDomain(chunkInputStream, domainsById);
				}
				// Skip over any remaining bytes in the child input stream so that the parent stream is ready to read the next chunk
				chunkInputStream.skipBytes(size);
			}
		}

		for (final Collection<String> equivalentDomains : domainsById.values()) {
			for (final String domain : equivalentDomains) {
				this.domains.put(domain, equivalentDomains);
			}
		}
	}

	private static byte[] readItem(final DataInputStream in) throws IOException {
		final int size = in.readInt();
		final byte[] payload = new byte[size];
		in.readFully(payload);
		return payload;
	}

	private static String readStringItem(final DataInputStream in) throws IOException {
		return new String(readItem(in));
	}

	private static long readLongItem(final DataInputStream acctIn) throws IOException {
		return Long.parseLong(readStringItem(acctIn));
	}

	private static String readHexItem(final DataInputStream in) throws IOException {
		final String item = readStringItem(in);
		try {
			return new String(Hex.decodeHex(item.toCharArray()));
		} catch (final DecoderException e) {
			throw new IOException("Error decoding as hex: " + item, e);
		}
	}

	private void parseAccountData(final DataInputStream acctIn) throws IOException {
		// TODO how many of these "strings" are not strings?
		final long id = readLongItem(acctIn);
		LOGGER.trace("Parsing account data {}", id);
		final byte[] name = readItem(acctIn);
		final byte[] group = readItem(acctIn);
		final String url = readHexItem(acctIn);
		final byte[] extra = readItem(acctIn);
		final String favourite = readStringItem(acctIn);
		final String sharedFromId = readStringItem(acctIn);
		final byte[] username = readItem(acctIn);
		final byte[] password = readItem(acctIn);
		final String passwordProtected = readStringItem(acctIn);
		final String sn = readStringItem(acctIn);
		final String lastTouched = readStringItem(acctIn);
		final String autoLogin = readStringItem(acctIn);
		final String neverAutofill = readStringItem(acctIn);
		final String realmData = readStringItem(acctIn);
		final byte[] fiid = readItem(acctIn);
		final String customJs = readStringItem(acctIn);
		final String submitId = readStringItem(acctIn);
		final String captchaId = readStringItem(acctIn);
		final String urid = readStringItem(acctIn);
		final String basicAuthorization = readStringItem(acctIn);
		final String method = readStringItem(acctIn);
		final String action = readStringItem(acctIn);
		final String groupId = readStringItem(acctIn);
		final String deleted = readStringItem(acctIn);
		final String attachKey = readStringItem(acctIn);
		final String attachPresent = readStringItem(acctIn);
		final String individualShare = readStringItem(acctIn);
		final String unknown1 = readStringItem(acctIn);
		this.accounts.put(id, new AccountData(id, name, group, url, extra, favourite, sharedFromId, username, password, passwordProtected,
				sn, lastTouched, autoLogin, neverAutofill, realmData, fiid, customJs, submitId, captchaId, urid, basicAuthorization,
				method, action, groupId, deleted, attachKey, attachPresent, individualShare, unknown1, this.decryptionProvider));
	}

	private static void parseEquivalentDomain(final DataInputStream eqdnIn, final Map<Long, Collection<String>> domainsById)
			throws IOException {
		final long id = readLongItem(eqdnIn);
		LOGGER.trace("Parsing equivalent domain {}", id);
		final String domain = readHexItem(eqdnIn);
		Collection<String> domainsForId = domainsById.get(id);
		if (domainsForId == null) {
			domainsForId = new ArrayList<String>();
			domainsById.put(id, domainsForId);
		}
		domainsForId.add(domain);
	}

}


text:
package org.pro.jpa.eamples.chapter8.entity;

public class EmployeeDetails {
    private String name;
    private long salary;
    private String deptName;

    public EmployeeDetails(String name, long salary, String deptName) {
        this.name = name;
        this.salary = salary;
        this.deptName = deptName;
    }

    public String toString() {
        return "EmployeeDetails name: " + name +
               ", salary: " + salary +
               ", deptName: " + deptName;
    }
}


text:
from plugin.NetEase.normalize import NetEaseAPI as Api

"""
class Api(object):

    interfaces = ('netease', )

    def __init__(self):
        super().__init__()
        self.ne = NetEaseAPI()

    def login(self, username, pw, phone=False, is_remember=True):
        return self.ne.login(username, pw, phone)

    def get_song_detail(self, mid):
        return self.ne.song_detail(mid)

    def get_playlist_detail(self, pid):
        return self.ne.playlist_detail(pid)

"""


text:
title: Greatest Common Factor
---
## Greatest Common Factor

This is a stub. Help our community expand it.

This quick style guide will help ensure your pull request gets accepted.

#### More Information:


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Fusarium roseum var. cucubali-bacciferi Sacc.

### Remarks
null


text:
namespace app {
namespace Uno {

::uDelegateType* Action__Fuse_Controls_TextInput__bool__typeof();

}}

#endif


text:
var Console = new Object();
Console.initialized = 0;

Console.initializeDragresize = function () {
	var dragresize = new DragResize('dragresize',
	 { minWidth: 100, minHeight: 100, minLeft: 20, minTop: 20 });

	// determine which elements are the draggable elements
	dragresize.isElement = function(elm)
	{
		if (elm.className && elm.className.indexOf('drsElement') > -1) return true;
	};
	dragresize.isHandle = function(elm)
	{
		if (elm.className && elm.className.indexOf('drsMoveHandle') > -1) return true;
	};

	// apply dragsize to document to make nodes draggable
	dragresize.apply(document);
}

Console.initializeConsole = function () {
	if (Console.initialized) {
		return;
	}
	Console.initializeDragresize();
	Console.initialized = 1;

	// set up the console div
	var wrapperDiv = document.body.appendChild(document.createElement('div'));
	wrapperDiv.id = "consoleWrapper";
	wrapperDiv.className = 'drsElement';
	wrapperDiv.style.cssText = 'left: 200px; top: 200px; width: 500px; height: 400px; padding-bottom: 21px; display: none; z-index: 10; background-color: white;';

	Console.window = wrapperDiv;

	var moveDiv = wrapperDiv.appendChild(document.createElement('div'));
	moveDiv.className = 'drsMoveHandle';
	moveDiv.style.cssText = 'text-align: center; font-weight: bold;';
	moveDiv.appendChild(document.createTextNode('Console'));
	var close = moveDiv.appendChild(document.createElement('div'));
	close.style.cssText = 'position: absolute; top: 0px; right: 0px;';
	var img = close.appendChild(document.createElement('img'));
	img.src = './Html/fancy_closebox.png';
	img.height = 20;
	img.width = 20;
	img.onclick = Console.hide;
	img.style.cssText = 'cursor: pointer';

	var console = wrapperDiv.appendChild(document.createElement('div'));
	console.style.cssText = 'overflow: auto; white-space: nowrap; height: 100%';

	Console.console = console;
}

Console.print = function (m) {
	m = translateWhitespace(m);
	var lines = m.split("\n");
	Console.console.appendChild(document.createTextNode(lines[0]));
	for (var i=1; i<lines.length; i++) {
		Console.console.appendChild(document.createElement('br'));
		Console.console.appendChild(document.createTextNode(lines[i]));
	}
	Console.console.scrollTop = Console.console.scrollHeight;
}

Console.println = function (m) {
	m = translateWhitespace(m);
	var lines = m.split("\n");
	for (var i=0; i<lines.length; i++) {
		Console.console.appendChild(document.createTextNode(lines[i]));
		Console.console.appendChild(document.createElement('br'));
	}
	Console.console.scrollTop = Console.console.scrollHeight;
	};

Console.printHtml = function (m) {
	var span = Console.console.appendChild(document.createElement('span'));
	Console.console.appendChild(document.createElement('br'));
	span.innerHTML = m;
	Console.console.scrollTop = Console.console.scrollHeight;
};

Console.show = function () {
	Console.window.style.display = "";
	Console.console.scrollTop = Console.console.scrollHeight;
};

Console.hide = function() {
	Console.window.style.display = "none";
};

function translateWhitespace (string) {
	string = string.replace(/ /g, "\u00a0");
	string = string.replace(/\t/g, "\u00a0\u00a0\u00a0\u00a0");

	return string;
}


text:
<?php

class Mymodules_Google_Model_Calendar
    extends Mage_Core_Model_Abstract
{

    /* @var $_acl Mymodules_Google_Model_Resource_Calendar_Acl_Collection */
    protected $_acl;
    /* @var $_apiObject Google_Service_Calendar_CalendarListEntry|Google_Service_Calendar_Calendar */
    protected $_apiObject;
    /* @var $_colorScheme array */
    protected $_colorScheme;
    /* @var $_events Mymodules_Google_Model_Resource_Calendar_Event_Collection */
    protected $_events;
    protected $_quickEventCache = array();

    /**
     * Initialize model.
     *
     * @return void
     */
    public function _construct()
    {
        $this->_init('google/calendar');
    }

    /**
     * After-save implementation.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    protected function _afterSave()
    {
        // Publish any quick events
        foreach ($this->_quickEventCache as $event) {
            $this->_getResource()
                ->addQuickEvent($this, $event[0], $event[1]);
        }

        $this->_quickEventCache = array();

        // Save events
        // Will only update modified or new events
        $this->getEvents()->save();

        // Save ACL entries
        // Will only update modified or new ACL entries
        $this->getAcl()->save();

        return $this;
    }

    /**
     * Add an event to the calendar. Attempts to convert input times
     * to RFC 3339 format automatically.
     *
     * @param string $summary The event summary.
     * @param string $start   The event start time.
     * @param string $end     The event end time.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function addEvent($summary = '', $start = null, $end = null)
    {
        $event  = Mage::getModel('google/calendar_event')
            ->setCalendarId($this->getId());

        $helper = Mage::getSingleton('google/resource_helper_calendar');

        // Use current time if start is not given
        if (is_null($start)) {
            $start = date('Y-m-d h:i:s', time());
        }

        $start = $helper->convertDatetime($start);

        // Use start + 1 hour if end is not given
        if (is_null($end)) {
            $end = date('Y-m-d h:i:s', strtotime($start) + 3600);
        }

        $end = $helper->convertDatetime($end);

        $event->setSummary($summary)
            ->setStart($start)
            ->setEnd($end);

        $this->addEventByObject($event);

        return $this;
    }

    /**
     * Add an event model to the internal collection.
     *
     * @param Mymodules_Google_Model_Calendar_Event $event The event model.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function addEventByObject(Mymodules_Google_Model_Calendar_Event $event)
    {
        $this->getEvents()->addItem($event);

        return $this;
    }

    /**
     * Add a notification option to the calendar.
     *
     * @param string  $method  The reminder method (email|sms[read-only]).
     * @param integer $type    The type of notification, can be:
     *                             eventCreation
     *                             eventChange
     *                             eventCancellation
     *                             eventResponse
     *                             agenda
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function addNotification($method = 'email', $type = null)
    {
        $reminder = Mage::getModel(
            'google/calendar_event_notification',
            array(
                'method' => $method,
                'type'   => $type,
            )
        );

        $this->getNotificationSettings()->addItem($reminder);

        return $this;
    }

    /**
     * Shorthand method to add an event to the calendar.
     *
     * @param string  $text              The text describing the event.
     * @param boolean $sendNotifications Whether to send notifications about
     *                                   the creation of the event.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function addQuickEvent($text = '', $sendNotifications = false)
    {
        $this->_quickEventCache[] = array($text, $sendNotifications);

        return $this;
    }

    /**
     * Add a default reminder to the calendar.
     *
     * @param string  $method  The reminder method (email|sms|popup).
     * @param integer $minutes The number of minutes before the start of the event
     *                         when reminder should trigger.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function addReminder($method = 'email', $minutes = null)
    {
        $reminder = Mage::getModel(
            'google/calendar_event_reminder',
            array(
                'method'    => $method,
                'minutes'   => $minutes,
            )
        );

        $this->getDefaultReminders()->addItem($reminder);

        return $this;
    }

    /**
     * Get the ACL entries for the calendar.
     *
     * @return Mymodules_Google_Model_Resource_Calendar_Acl_Collection
     */
    public function getAcl()
    {
        if (!$this->_acl) {
            $this->_acl = Mage::getModel('google/calendar_acl')->getCollection()
                ->addFilter('calendar_id', $this->getId());
        }

        return $this->_acl;
    }

    /**
     * Get the color scheme.
     *
     * @return array
     */
    public function getColorScheme()
    {
        if (!$this->_colorScheme) {
            $schemes = $this->_getResource()
                ->getColorSchemes('calendar');

            if (isset($schemes[$this->getColorId()])) {
                $this->_colorScheme = new Varien_Object($schemes[$this->getColorId()]);
            }
        }

        return $this->_colorScheme;
    }

    /**
     * Get all default calendar reminders.
     *
     * @return Varien_Data_Collection
     */
    public function getDefaultReminders()
    {
        if ( !($this->getData('default_reminders') instanceof Varien_Data_Collection) ) {
            $this->setData('default_reminders', Mage::getModel('google/calendar_event_reminder')->getCollection());
        }

        return $this->getData('default_reminders');
    }

    /**
     * Get the events for this calendar.
     *
     * @return Mymodules_Google_Model_Resource_Calendar_Event_Collection
     */
    public function getEvents($timeMin = null, $timeMax = null)
    {
        if (!$this->_events) {
            // Use start of today if not given
            if (is_null($timeMin)) {
                $timeMin = date('Y-m-d 00:00:00', time());
            }

            // Use end of today if not given
            if (is_null($timeMax)) {
                $timeMax = date('Y-m-d 23:59:59', time());
            }

            $this->_events = Mage::getModel('google/calendar_event')->getCollection()
                ->addFilter('calendar_id', $this->getId())
                ->addFilter('time_min', $timeMin)
                ->addFilter('time_max', $timeMax);
        }

        return $this->_events;
    }

    /**
     * Get all calendar notifications.
     *
     * @return Varien_Data_Collection
     */
    public function getNotificationSettings()
    {
        if ( !($this->getData('notification_settings') instanceof Varien_Data_Collection) ) {
            $this->setData('notification_settings', Mage::getModel('google/calendar_event_notification')->getCollection());
        }

        return $this->getData('notification_settings');
    }

    /**
     * Set the calendar notification settings. Enforces strict type.
     *
     * @param Mymodules_Google_Model_Resource_Calender_Event_Notification_Collection $notifications The notifications collection.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function setNotificationSettings(Mymodules_Google_Model_Resource_Calender_Event_Notification_Collection $notifications)
    {
        $this->setData('notification_settings', $notifications);

        return $this;
    }

    /**
     * Set the default calendar reminders. Enforces strict type.
     *
     * @param Mymodules_Google_Model_Resource_Calender_Event_Reminder_Collection $reminders The reminders collection.
     *
     * @return Mymodules_Google_Model_Calendar
     */
    public function setDefaultReminders(Mymodules_Google_Model_Resource_Calender_Event_Reminder_Collection $reminders)
    {
        $this->setData('default_reminders', $reminders);

        return $this;
    }

    /**
     * Convert the data to an API-compatible object.
     *
     * @param string $type The API object type, accepts CalendarListEntry|Calendar.
     *
     * @return mixed
     */
    public function toApiObject($type = 'Calendar')
    {
        // Re-build existing instance
        if ($this->_apiObject) {
            unset($this->_apiObject);
            $this->_apiObject = null;
        }

        if (is_null($this->_apiObject)) {
            $data           = Mage::getSingleton('google/resource_helper_calendar')->translateFields($this->getData());
            $objectClass    = "Google_Service_Calendar_{$type}";

            if (class_exists($objectClass)) {
                $this->_apiObject = new $objectClass($data);
            }

            unset($data);
        }

        return $this->_apiObject;
    }

}


text:
<title>Clear Visualization</title>

<link rel="stylesheet" type="text/css" href="./DataTables-1.10.0/media/css/jquery.dataTables.css">

Clear Visualization

Search your tasks

    Search tasks: <input type="search" class="search" id="filter_cleardata"></input>

    ⏰
    Search reminders: <input type="search" class="search" id="reminder_cleardata"></input>

    <input type="checkbox" class="completed_toggle" id="completed_cleardata">Completed Tasks</input>

    <input type="checkbox" class="index_toggle" id="index_column_cleardata">Index Column</input>

    <input type="checkbox" class="task_counts_toggle" id="task_counts_cleardata">Task Counts</input>

    <input type="checkbox" class="statistics_toggle" id="statistics_cleardata">Statistics</input>


text:
package j2html.tags.specialized;

import j2html.tags.ContainerTag;
import j2html.tags.attributes.*;

public final class ScriptTag extends ContainerTag<ScriptTag>
    implements IAsync<ScriptTag>, ICharset<ScriptTag>, IDefer<ScriptTag>, IOnerror<ScriptTag>, IOnload<ScriptTag>, ISrc<ScriptTag>, IType<ScriptTag> {
    public ScriptTag() {
        super("script");
    }
}


text:
package org.ofbiz.service.engine;

import static org.ofbiz.base.util.UtilGenerics.cast;
import groovy.lang.Script;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import javax.script.ScriptContext;

import org.codehaus.groovy.runtime.InvokerHelper;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.GroovyUtil;
import org.ofbiz.base.util.ScriptHelper;
import org.ofbiz.base.util.ScriptUtil;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.ServiceDispatcher;
import org.ofbiz.service.ServiceUtil;

/**
 * Groovy Script Service Engine
 */
public final class GroovyEngine extends GenericAsyncEngine {

    public static final String module = GroovyEngine.class.getName();
    protected static final Object[] EMPTY_ARGS = {};
    private static final Set<String> protectedKeys = createProtectedKeys();

    private static Set<String> createProtectedKeys() {
        Set<String> newSet = new HashSet<String>();
        /* Commenting out for now because some scripts write to the parameters Map - which should not be allowed.
        newSet.add(ScriptUtil.PARAMETERS_KEY);
        */
        newSet.add("dctx");
        newSet.add("dispatcher");
        newSet.add("delegator");
        return Collections.unmodifiableSet(newSet);
    }

    public GroovyEngine(ServiceDispatcher dispatcher) {
        super(dispatcher);
    }

    /**
     * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map)
     */
    @Override
    public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
        runSync(localName, modelService, context);
    }

    /**
     * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map)
     */
    @Override
    public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
        return serviceInvoker(localName, modelService, context);
    }

    private Map<String, Object> serviceInvoker(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
        if (UtilValidate.isEmpty(modelService.location)) {
            throw new GenericServiceException("Cannot run Groovy service with empty location");
        }
        Map<String, Object> params = new HashMap<String, Object>();
        params.putAll(context);

        Map<String, Object> gContext = new HashMap<String, Object>();
        gContext.putAll(context);
        gContext.put(ScriptUtil.PARAMETERS_KEY, params);

        DispatchContext dctx = dispatcher.getLocalContext(localName);
        gContext.put("dctx", dctx);
        gContext.put("dispatcher", dctx.getDispatcher());
        gContext.put("delegator", dispatcher.getDelegator());
        try {
            ScriptContext scriptContext = ScriptUtil.createScriptContext(gContext, protectedKeys);
            ScriptHelper scriptHelper = (ScriptHelper)scriptContext.getAttribute(ScriptUtil.SCRIPT_HELPER_KEY);
            if (scriptHelper != null) {
                gContext.put(ScriptUtil.SCRIPT_HELPER_KEY, scriptHelper);
            }
            Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(this.getLocation(modelService)), GroovyUtil.getBinding(gContext));
            Object resultObj = null;
            if (UtilValidate.isEmpty(modelService.invoke)) {
                resultObj = script.run();
            } else {
                resultObj = script.invokeMethod(modelService.invoke, EMPTY_ARGS);
            }
            if (resultObj == null) {
                resultObj = scriptContext.getAttribute(ScriptUtil.RESULT_KEY);
            }
            if (resultObj != null && resultObj instanceof Map<?, ?>) {
                return cast(resultObj);
            }
            Map<String, Object> result = ServiceUtil.returnSuccess();
            result.putAll(modelService.makeValid(scriptContext.getBindings(ScriptContext.ENGINE_SCOPE), "OUT"));
            return result;
        } catch (GeneralException ge) {
            throw new GenericServiceException(ge);
        } catch (Exception e) {
            return ServiceUtil.returnError(e.getMessage());
        }
    }
}