text:
CKEDITOR.dialog.add( 'cellProperties', function( editor )
	{
		var langTable = editor.lang.table,
			langCell = langTable.cell,
			langCommon = editor.lang.common,
			validate = CKEDITOR.dialog.validate,
			widthPattern = /^(\d+(?:\.\d+)?)(px|%)$/,
			heightPattern = /^(\d+(?:\.\d+)?)px$/,
			bind = CKEDITOR.tools.bind,
			spacer = { type : 'html', html : ' ' },
			rtl = editor.lang.dir == 'rtl';

		/**
		 *
		 * @param dialogName
		 * @param callback [ childDialog ]
		 */
		function getDialogValue( dialogName, callback )
		{
			var onOk = function()
			{
				releaseHandlers( this );
				callback( this, this._.parentDialog );
				this._.parentDialog.changeFocus( true );
			};
			var onCancel = function()
			{
				releaseHandlers( this );
				this._.parentDialog.changeFocus();
			};
			var releaseHandlers = function( dialog )
			{
				dialog.removeListener( 'ok', onOk );
				dialog.removeListener( 'cancel', onCancel );
			};
			var bindToDialog = function( dialog )
			{
				dialog.on( 'ok', onOk );
				dialog.on( 'cancel', onCancel );
			};
			editor.execCommand( dialogName );
			if ( editor._.storedDialogs.colordialog )
				bindToDialog( editor._.storedDialogs.colordialog );
			else
			{
				CKEDITOR.on( 'dialogDefinition', function( e )
				{
					if ( e.data.name != dialogName )
						return;

					var definition = e.data.definition;

					e.removeListener();
					definition.onLoad = CKEDITOR.tools.override( definition.onLoad, function( orginal )
					{
						return function()
						{
							bindToDialog( this );
							definition.onLoad = orginal;
							if ( typeof orginal == 'function' )
								orginal.call( this );
						};
					} );
				});
			}
		}

		return {
			title : langCell.title,
			minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks? 450 : 410,
			minHeight : CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks )?  230 : 200,
			contents : [
				{
					id : 'info',
					label : langCell.title,
					accessKey : 'I',
					elements :
					[
						{
							type : 'hbox',
							widths : [ '40%', '5%', '40%' ],
							children :
							[
								{
									type : 'vbox',
									padding : 0,
									children :
									[
										{
											type : 'hbox',
											widths : [ '70%', '30%' ],
											children :
											[
												{
													type : 'text',
													id : 'width',
													width: '100px',
													label : langCommon.width,
													validate : validate[ 'number' ]( langCell.invalidWidth ),

													// Extra labelling of width unit type.
													onLoad : function()
													{
														var widthType = this.getDialog().getContentElement( 'info', 'widthType' ),
															labelElement = widthType.getElement(),
															inputElement = this.getInputElement(),
															ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );

														inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
													},

													setup : function( element )
													{
														var widthAttr = parseInt( element.getAttribute( 'width' ), 10 ),
																widthStyle = parseInt( element.getStyle( 'width' ), 10 );

														!isNaN( widthAttr ) && this.setValue( widthAttr );
														!isNaN( widthStyle ) && this.setValue( widthStyle );
													},
													commit : function( element )
													{
														var value = parseInt( this.getValue(), 10 ),
																unit = this.getDialog().getValueOf( 'info', 'widthType' );

														if ( !isNaN( value ) )
															element.setStyle( 'width', value + unit );
														else
															element.removeStyle( 'width' );

														element.removeAttribute( 'width' );
													},
													'default' : ''
												},
												{
													type : 'select',
													id : 'widthType',
													label : editor.lang.table.widthUnit,
													labelStyle: 'visibility:hidden',
													'default' : 'px',
													items :
													[
														[ langTable.widthPx, 'px' ],
														[ langTable.widthPc, '%' ]
													],
													setup : function( selectedCell )
													{
														var widthMatch = widthPattern.exec( selectedCell.getStyle( 'width' ) || selectedCell.getAttribute( 'width' ) );
														if ( widthMatch )
															this.setValue( widthMatch[2] );
													}
												}
											]
										},
										{
											type : 'hbox',
											widths : [ '70%', '30%' ],
											children :
											[
												{
													type : 'text',
													id : 'height',
													label : langCommon.height,
													width: '100px',
													'default' : '',
													validate : validate[ 'number' ]( langCell.invalidHeight ),

													// Extra labelling of height unit type.
													onLoad : function()
													{
														var heightType = this.getDialog().getContentElement( 'info', 'htmlHeightType' ),
															labelElement = heightType.getElement(),
															inputElement = this.getInputElement(),
															ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );

														inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
													},

													setup : function( element )
													{
														var heightAttr = parseInt( element.getAttribute( 'height' ), 10 ),
																heightStyle = parseInt( element.getStyle( 'height' ), 10 );

														!isNaN( heightAttr ) && this.setValue( heightAttr );
														!isNaN( heightStyle ) && this.setValue( heightStyle );
													},
													commit : function( element )
													{
														var value = parseInt( this.getValue(), 10 );

														if ( !isNaN( value ) )
															element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
														else
															element.removeStyle( 'height' );

														element.removeAttribute( 'height' );
													}
												},
												{
													id : 'htmlHeightType',
													type : 'html',
													html : '<br />'+ langTable.widthPx
												}
											]
										},
										spacer,
										{
											type : 'select',
											id : 'wordWrap',
											label : langCell.wordWrap,
											'default' : 'yes',
											items :
											[
												[ langCell.yes, 'yes' ],
												[ langCell.no, 'no' ]
											],
											setup : function( element )
											{
												var wordWrapAttr = element.getAttribute( 'noWrap' ),
														wordWrapStyle = element.getStyle( 'white-space' );

												if ( wordWrapStyle == 'nowrap' || wordWrapAttr )
													this.setValue( 'no' );
											},
											commit : function( element )
											{
												if ( this.getValue() == 'no' )
													element.setStyle( 'white-space', 'nowrap' );
												else
													element.removeStyle( 'white-space' );

												element.removeAttribute( 'noWrap' );
											}
										},
										spacer,
										{
											type : 'select',
											id : 'hAlign',
											label : langCell.hAlign,
											'default' : '',
											items :
											[
												[ langCommon.notSet, '' ],
												[ langCommon.alignLeft, 'left' ],
												[ langCommon.alignCenter, 'center' ],
												[ langCommon.alignRight, 'right' ]
											],
											setup : function( element )
											{
												var alignAttr = element.getAttribute( 'align' ),
														textAlignStyle = element.getStyle( 'text-align');

												this.setValue(  textAlignStyle || alignAttr || '' );
											},
											commit : function( selectedCell )
											{
												var value = this.getValue();

												if ( value )
													selectedCell.setStyle( 'text-align', value );
												else
													selectedCell.removeStyle( 'text-align' );

												selectedCell.removeAttribute( 'align' );
											}
										},
										{
											type : 'select',
											id : 'vAlign',
											label : langCell.vAlign,
											'default' : '',
											items :
											[
												[ langCommon.notSet, '' ],
												[ langCommon.alignTop, 'top' ],
												[ langCommon.alignMiddle, 'middle' ],
												[ langCommon.alignBottom, 'bottom' ],
												[ langCell.alignBaseline, 'baseline' ]
											],
											setup : function( element )
											{
												var vAlignAttr = element.getAttribute( 'vAlign' ),
														vAlignStyle = element.getStyle( 'vertical-align' );

												switch( vAlignStyle )
												{
													// Ignore all other unrelated style values..
													case 'top':
													case 'middle':
													case 'bottom':
													case 'baseline':
														break;
													default:
														vAlignStyle = '';
												}

												this.setValue( vAlignStyle || vAlignAttr || '' );
											},
											commit : function( element )
											{
												var value = this.getValue();

												if ( value )
													element.setStyle( 'vertical-align', value );
												else
													element.removeStyle( 'vertical-align' );

												element.removeAttribute( 'vAlign' );
											}
										}
									]
								},
								spacer,
								{
									type : 'vbox',
									padding : 0,
									children :
									[
										{
											type : 'select',
											id : 'cellType',
											label : langCell.cellType,
											'default' : 'td',
											items :
											[
												[ langCell.data, 'td' ],
												[ langCell.header, 'th' ]
											],
											setup : function( selectedCell )
											{
												this.setValue( selectedCell.getName() );
											},
											commit : function( selectedCell )
											{
												selectedCell.renameNode( this.getValue() );
											}
										},
										spacer,
										{
											type : 'text',
											id : 'rowSpan',
											label : langCell.rowSpan,
											'default' : '',
											validate : validate.integer( langCell.invalidRowSpan ),
											setup : function( selectedCell )
											{
												var attrVal = parseInt( selectedCell.getAttribute( 'rowSpan' ), 10 );
												if ( attrVal && attrVal  != 1 )
												 	this.setValue(  attrVal );
											},
											commit : function( selectedCell )
											{
												var value = parseInt( this.getValue(), 10 );
												if ( value && value != 1 )
													selectedCell.setAttribute( 'rowSpan', this.getValue() );
												else
													selectedCell.removeAttribute( 'rowSpan' );
											}
										},
										{
											type : 'text',
											id : 'colSpan',
											label : langCell.colSpan,
											'default' : '',
											validate : validate.integer( langCell.invalidColSpan ),
											setup : function( element )
											{
												var attrVal = parseInt( element.getAttribute( 'colSpan' ), 10 );
												if ( attrVal && attrVal  != 1 )
												 	this.setValue(  attrVal );
											},
											commit : function( selectedCell )
											{
												var value = parseInt( this.getValue(), 10 );
												if ( value && value != 1 )
													selectedCell.setAttribute( 'colSpan', this.getValue() );
												else
													selectedCell.removeAttribute( 'colSpan' );
											}
										},
										spacer,
										{
											type : 'hbox',
											padding : 0,
											widths : [ '60%', '40%' ],
											children :
											[
												{
													type : 'text',
													id : 'bgColor',
													label : langCell.bgColor,
													'default' : '',
													setup : function( element )
													{
														var bgColorAttr = element.getAttribute( 'bgColor' ),
																bgColorStyle = element.getStyle( 'background-color' );

														this.setValue( bgColorStyle || bgColorAttr );
													},
													commit : function( selectedCell )
													{
														var value = this.getValue();

														if ( value )
															selectedCell.setStyle( 'background-color', this.getValue() );
														else
															selectedCell.removeStyle( 'background-color' );

														selectedCell.removeAttribute( 'bgColor');
													}
												},
												{
													type : 'button',
													id : 'bgColorChoose',
													"class" : 'colorChooser',
													label : langCell.chooseColor,
													onLoad : function()
													{
														// Stick the element to the bottom (#5587)
														this.getElement().getParent().setStyle( 'vertical-align', 'bottom' );
													},
													onClick : function()
													{
														var self = this;
														getDialogValue( 'colordialog', function( colorDialog )
														{
															self.getDialog().getContentElement( 'info', 'bgColor' ).setValue(
																colorDialog.getContentElement( 'picker', 'selectedColor' ).getValue()
															);
														} );
													}
												}
											]
										},
										spacer,
										{
											type : 'hbox',
											padding : 0,
											widths : [ '60%', '40%' ],
											children :
											[
												{
													type : 'text',
													id : 'borderColor',
													label : langCell.borderColor,
													'default' : '',
													setup : function( element )
													{
														var borderColorAttr = element.getAttribute( 'borderColor' ),
																borderColorStyle = element.getStyle( 'border-color' );

														this.setValue( borderColorStyle || borderColorAttr );
													},
													commit : function( selectedCell )
													{
														var value = this.getValue();
														if ( value )
															selectedCell.setStyle( 'border-color', this.getValue() );
														else
															selectedCell.removeStyle( 'border-color' );

														selectedCell.removeAttribute( 'borderColor');
													}
												},
												{
													type : 'button',
													id : 'borderColorChoose',
													"class" : 'colorChooser',
													label : langCell.chooseColor,
													style : ( rtl ? 'margin-right' : 'margin-left' ) + ': 10px',
													onLoad : function()
													{
														// Stick the element to the bottom (#5587)
														this.getElement().getParent().setStyle( 'vertical-align', 'bottom' );
													},
													onClick : function()
													{
														var self = this;
														getDialogValue( 'colordialog', function( colorDialog )
														{
															self.getDialog().getContentElement( 'info', 'borderColor' ).setValue(
																colorDialog.getContentElement( 'picker', 'selectedColor' ).getValue()
															);
														} );
													}
												}
											]
										}
									]
								}
							]
						}
					]
				}
			],
			onShow : function()
			{
				this.cells = CKEDITOR.plugins.tabletools.getSelectedCells(
					this._.editor.getSelection() );
				this.setupContent( this.cells[ 0 ] );
			},
			onOk : function()
			{
				var selection = this._.editor.getSelection(),
					bookmarks = selection.createBookmarks();

				var cells = this.cells;
				for ( var i = 0 ; i < cells.length ; i++ )
					this.commitContent( cells[ i ] );

				selection.selectBookmarks( bookmarks );

				// Force selectionChange event because of alignment style.
				var firstElement = selection.getStartElement();
				var currentPath = new CKEDITOR.dom.elementPath( firstElement );

				this._.editor._.selectionPreviousPath = currentPath;
				this._.editor.fire( 'selectionChange', { selection : selection, path : currentPath, element : firstElement } );
			}
		};
	} );


text:
"""
States Directory
"""

redpajama_set_name: RedPajamaGithub


text:
function replace(string, a, b) {
  let results = [];

  let tmp, start = 0;
  while ((tmp = string.substr(start).indexOf(a)) !== -1) {
    results.push(string.substr(0, start + tmp) + b + string.substr(start + tmp + a.length));
    start += tmp + 1;
  }

  return results;
}

export function run(data) {
  let lines = data.split(/[\r\n]+/).filter(r => r.length);

  const formula = lines.pop();
  const replacers = lines.map(line => line.split(' => '));

  let variants = [];
  replacers.forEach(replacer => {
    variants = variants.concat(replace(formula, replacer[0], replacer[1]));
  });

  variants = variants.filter((value, index, self) => self.indexOf(value) === index);
  return variants.length;
};


text:
=========
Changelog
=========

This changelog only contains information that might be useful to end users and
package maintainers. For further info, see the git commit log.

Package maintainers and users who have to manually update their installation
may want to subscribe to `GitHub's tag feed
<https://github.com/untitaker/vdirsyncer/tags.atom>`_.

Version 0.6.0
=============

- ``password_command`` invocations with non-zero exit code are now fatal (and
  will abort synchronization) instead of just producing a warning.
- Vdirsyncer is now able to synchronize metadata of collections. Set ``metadata
  = ["displayname"]`` and run ``vdirsyncer metasync``.
- **Packagers:** Don't use the GitHub tarballs, but the PyPI ones.
- **Packagers:** ``build.sh`` is gone, and ``Makefile`` is included in
  tarballs. See the content of ``Makefile`` on how to run tests post-packaging.

Version 0.5.2
=============

*released on 15 June 2015*

- Vdirsyncer now checks and corrects the permissions of status files.
- Vdirsyncer is now more robust towards changing UIDs inside items.
- Vdirsyncer is now handling unicode hrefs and UIDs correctly. Software that
  produces non-ASCII UIDs is broken, but apparently it exists.

Version 0.5.1
=============

*released on 29 May 2015*

- **N.b.: The PyPI upload of 0.5.0 is completely broken.**
- Raise version of required requests-toolbelt to ``0.4.0``.
- Command line should be a lot faster when no work is done, e.g. for help
  output.
- Fix compatibility with iCloud again.
- Use only one worker if debug mode is activated.
- ``verify=false`` is now disallowed in vdirsyncer, please use
  ``verify_fingerprint`` instead.
- Fixed a bug where vdirsyncer's DAV storage was not using the configured
  useragent for collection discovery.

Version 0.4.4
=============

*released on 12 March 2015*

- Support for client certificates via the new ``auth_cert``
  parameter, see :gh:`182` and :ghpr:`183`.
- The ``icalendar`` package is no longer required.
- Several bugfixes related to collection creation.

Version 0.4.3
=============

*released on 20 February 2015*

- More performance improvements to ``singlefile``-storage.
- Add ``post_hook`` param to ``filesystem``-storage.
- Collection creation now also works with SabreDAV-based servers, such as
  Baikal or ownCloud.
- Removed some workarounds for Radicale. Upgrading to the latest Radicale will
  fix the issues.
- Fixed issues with iCloud discovery.
- Vdirsyncer now includes a simple ``repair`` command that seeks to fix some
  broken items.

Version 0.4.2
=============

*released on 30 January 2015*

- Vdirsyncer now respects redirects when uploading and updating items. This
  might fix issues with Zimbra.
- Relative ``status_path`` values are now interpreted as relative to the
  configuration file's directory.
- Fixed compatibility with custom SabreDAV servers. See :gh:`166`.
- Catch harmless threading exceptions that occur when shutting down vdirsyncer.
  See :gh:`167`.
- Vdirsyncer now depends on ``atomicwrites``.
- Massive performance improvements to ``singlefile``-storage.
- Items with extremely long UIDs should now be saved properly in
  ``filesystem``-storage. See :gh:`173`.

Version 0.4.1
=============

*released on 05 January 2015*

- All ``create`` arguments from all storages are gone. Vdirsyncer now asks if
  it should try to create collections.
- The old config values ``True``, ``False``, ``on``, ``off`` and ``None`` are
  now invalid.
- UID conflicts are now properly handled instead of ignoring one item. Card-
  and CalDAV servers are already supposed to take care of those though.
- Official Baikal support added.

Version 0.4.0
=============

*released on 31 December 2014*

- The ``passwordeval`` parameter has been renamed to ``password_command``.
- The old way of writing certain config values such as lists is now gone.
- Collection discovery has been rewritten. Old configuration files should be
  compatible with it, but vdirsyncer now caches the results of the collection
  discovery. You have to run ``vdirsyncer discover`` if collections were added
  or removed on one side.
- Pair and storage names are now restricted to certain characters. Vdirsyncer
  will issue a clear error message if your configuration file is invalid in
  that regard.
- Vdirsyncer now supports the XDG-Basedir specification. If the
  ``VDIRSYNCER_CONFIG`` environment variable isn't set and the
  ``~/.vdirsyncer/config`` file doesn't exist, it will look for the
  configuration file at ``$XDG_CONFIG_HOME/vdirsyncer/config``.
- Some improvements to CardDAV and CalDAV discovery, based on problems found
  with FastMail. Support for ``.well-known``-URIs has been added.

Version 0.3.4
=============

*released on 8 December 2014*

- Some more bugfixes to config handling.

Version 0.3.3
=============

*released on 8 December 2014*

- Vdirsyncer now also works with iCloud. Particularly collection discovery and
  etag handling were fixed.
- Vdirsyncer now encodes Cal- and CardDAV requests differently. This hasn't
  been well-tested with servers like Zimbra or SoGo, but isn't expected to
  cause any problems.
- Vdirsyncer is now more robust regarding invalid responses from CalDAV
  servers. This should help with future compatibility with Davmail/Outlook.
- Fix a bug when specifying ``item_types`` of
  :py:class:`vdirsyncer.storage.CaldavStorage` in the deprecated config format.
- Fix a bug where vdirsyncer would ignore all but one character specified in
  ``unsafe_href_chars`` of :py:class:`vdirsyncer.storage.CaldavStorage` and
  :py:class:`vdirsyncer.storage.CarddavStorage`.

Version 0.3.2
=============

*released on 3 December 2014*

- The current config format has been deprecated, and support for it will be
  removed in version 0.4.0. Vdirsyncer warns about this now.

Version 0.3.1
=============

*released on 24 November 2014*

- Fixed a bug where vdirsyncer would delete items if they're deleted on side A
  but modified on side B. Instead vdirsyncer will now upload the new items to
  side A. See :gh:`128`.

- Synchronization continues with the remaining pairs if one pair crashes, see
  :gh:`121`.

- The ``processes`` config key is gone. There is now a ``--max-workers`` option
  on the CLI which has a similar purpose. See :ghpr:`126`.

- The Read The Docs-theme is no longer required for building the docs. If it is
  not installed, the default theme will be used. See :gh:`134`.

Version 0.3.0
=============

*released on 20 September 2014*

- Add ``verify_fingerprint`` parameter to
  :py:class:`vdirsyncer.storage.HttpStorage`,
  :py:class:`vdirsyncer.storage.CaldavStorage` and
  :py:class:`vdirsyncer.storage.CarddavStorage`,
  see :gh:`99` and :ghpr:`106`.

- Add ``passwordeval`` parameter to :ref:`general_config`, see :gh:`108` and
  :ghpr:`117`.

- Emit warnings (instead of exceptions) about certain invalid responses from
  the server, see :gh:`113`.  This is apparently required for compatibility
  with Davmail.

Version 0.2.5
=============

*released on 27 August 2014*

- Don't ask for the password of one server more than once and fix multiple
  concurrency issues, see :gh:`101`.

- Better validation of DAV endpoints.

Version 0.2.4
=============

*released on 18 August 2014*

- Include workaround for collection discovery with latest version of Radicale.

- Include metadata files such as the changelog or license in source
  distribution, see :gh:`97` and :gh:`98`.

Version 0.2.3
=============

*released on 11 August 2014*

- Vdirsyncer now has a ``--version`` flag, see :gh:`92`.

- Fix a lot of bugs related to special characters in URLs, see :gh:`49`.

Version 0.2.2
=============

*released on 04 August 2014*

- Remove a security check that caused problems with special characters in DAV
  URLs and certain servers. On top of that, the security check was nonsensical.
  See :gh:`87` and :gh:`91`.

- Change some errors to warnings, see :gh:`88`.

- Improve collection autodiscovery for servers without full support.

Version 0.2.1
=============

*released on 05 July 2014*

- Fix bug where vdirsyncer shows empty addressbooks when using CardDAV with
  Zimbra.

- Fix infinite loop when password doesn't exist in system keyring.

- Colorized errors, warnings and debug messages.

- vdirsyncer now depends on the ``click`` package instead of argvard.

Version 0.2.0
=============

*released on 12 June 2014*

- vdirsyncer now depends on the ``icalendar`` package from PyPI, to get rid of
  its own broken parser.

- vdirsyncer now also depends on ``requests_toolbelt``. This makes it possible
  to guess the authentication type instead of blankly assuming ``basic``.

- Fix a semi-bug in caldav and carddav storages where a tuple (href, etag)
  instead of the proper etag would have been returned from the upload method.
  vdirsyncer might do unnecessary copying when upgrading to this version.

- Add the storage :py:class:`vdirsyncer.storage.SingleFileStorage`. See
  :gh:`48`.

- The ``collections`` parameter for pair sections now accepts the special
  values ``from a`` and ``from b`` for automatically discovering collections.
  See :ref:`pair_config`.

- The ``read_only`` parameter was added to storage sections. See
  :ref:`storage_config`.

Version 0.1.5
=============

*released on 14 May 2014*

- Introduced changelogs

- Many bugfixes

- Many doc fixes

- vdirsyncer now doesn't necessarily need UIDs anymore for synchronization.

- vdirsyncer now aborts if one collection got completely emptied between
  synchronizations. See :gh:`42`.


text:
package com.example.deneme;

import android.view.View;

import com.nineoldandroids.view.ViewHelper;

/**
 * Created by HASAN TEKGÜL on 12/5/2014.
 */
public class CustomPageTransformer implements CustomViewPager.PageTransformer {
    private static final float MIN_SCALE = 0.85f;

    @Override
    public void transformPage(View page, float position) {
        int pageWidth = page.getWidth();

        if (position < -1) {
            // For pages out of screen:
            // Make them disappear
            ViewHelper.setAlpha(page, 0);
        }
        else if(position <= 0) {
            // For pages going out of screen:
            // Make them stay where they are and scale them down
            // as if they are going back in Z direction
            float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position));
            ViewHelper.setAlpha(page, 1 - position);
            ViewHelper.setTranslationX(page, pageWidth * -position);
            ViewHelper.setScaleX(page, scaleFactor);
            ViewHelper.setScaleY(page, scaleFactor);
        }
        else if(position <= 1) {
            // For pages coming into the screen:
            // Make them come in as usual but should be on top
            ViewHelper.setAlpha(page, 1);
            ViewHelper.setTranslationX(page, 0);
            ViewHelper.setScaleX(page, 1);
            ViewHelper.setScaleX(page, 1);
        }
        else {
            ViewHelper.setAlpha(page, 0);
        }
    }
}


text:
// Flags: --expose-debug-as debug
// Test the mirror object for unresolved functions.

function MirrorRefCache(json_refs) {
  var tmp = eval('(' + json_refs + ')');
  this.refs_ = [];
  for (var i = 0; i < tmp.length; i++) {
    this.refs_[tmp[i].handle] = tmp[i];
  }
}

MirrorRefCache.prototype.lookup = function(handle) {
  return this.refs_[handle];
}

var mirror = new debug.UnresolvedFunctionMirror("f");
var serializer = debug.MakeMirrorSerializer();
var json = JSON.stringify(serializer.serializeValue(mirror));
var refs = new MirrorRefCache(
    JSON.stringify(serializer.serializeReferencedObjects()));

// Check the mirror hierachy for unresolved functions.
assertTrue(mirror instanceof debug.Mirror);
assertTrue(mirror instanceof debug.ValueMirror);
assertTrue(mirror instanceof debug.ObjectMirror);
assertTrue(mirror instanceof debug.FunctionMirror);

// Check the mirror properties for unresolved functions.
assertTrue(mirror.isUnresolvedFunction());
assertEquals('function', mirror.type());
assertFalse(mirror.isPrimitive());
assertEquals("Function", mirror.className());
assertEquals("f", mirror.name());
assertEquals('undefined', typeof mirror.inferredName());
assertFalse(mirror.resolved());
assertEquals(void 0, mirror.source());
assertEquals('undefined', mirror.constructorFunction().type());
assertEquals('undefined', mirror.protoObject().type());
assertEquals('undefined', mirror.prototypeObject().type());

// Parse JSON representation of unresolved functions and check.
var fromJSON = eval('(' + json + ')');
assertEquals('function', fromJSON.type, 'Unexpected mirror type in JSON');
assertEquals('Function', fromJSON.className, 'Unexpected mirror class name in JSON');
assertEquals(mirror.constructorFunction().handle(), fromJSON.constructorFunction.ref, 'Unexpected constructor function handle in JSON');
assertEquals('undefined', refs.lookup(fromJSON.constructorFunction.ref).type, 'Unexpected constructor function type in JSON');
assertEquals(mirror.protoObject().handle(), fromJSON.protoObject.ref, 'Unexpected proto object handle in JSON');
assertEquals('undefined', refs.lookup(fromJSON.protoObject.ref).type, 'Unexpected proto object type in JSON');
assertEquals(mirror.prototypeObject().handle(), fromJSON.prototypeObject.ref, 'Unexpected prototype object handle in JSON');
assertEquals('undefined', refs.lookup(fromJSON.prototypeObject.ref).type, 'Unexpected prototype object type in JSON');
assertFalse(fromJSON.resolved);
assertEquals("f", fromJSON.name);
assertFalse('inferredName' in fromJSON);
assertEquals(void 0, fromJSON.source);


text:
taskBoardControllers.controller('HeaderCtrl',
['$scope', '$window', '$location', 'UserService', 'AuthenticationService', 'AlertService',
function ($scope, $window, $location, UserService, AuthenticationService, AlertService) {
    UserService.validateToken()
    .error($scope.logout);

    $scope.display = {
        username: '',
        smallText: ' - Settings'
    };
    $scope.$parent.display = $scope.display;
    $scope.$watch('currentUser', function(newValue, oldValue) {
        if (undefined !== newValue && undefined !== newValue.username) {
            $scope.display.username = '(' + newValue.username + ')';
        }
    });

    $scope.page = {
        boards: false,
        settings: true
    };

    if ($location.path().indexOf('boards') > -1) {
        $scope.page.boards = true;
        $scope.page.settings = false;
        $scope.$watch('currentBoard.name', function(newValue, oldValue) {
            $scope.display.smallText = ' - ' + newValue;
        });
    }
    if ($location.path().indexOf('files') > -1) {
        $scope.page.boards = false;
        $scope.page.settings = false;
        $scope.display.smallText = ' - File Viewer';
    }

    try {
        $.noty.closeAll(); // Clear any alerts on page load.
    } catch(e) {}

    $scope.logout = function() {
        UserService.logOut()
        .then(function(data) {
            AuthenticationService.reset();
            delete $window.localStorage.token;
            $location.path('/');
        });
    };
}]);


text:
$:.unshift File.dirname(__FILE__) + "/../lib"

ENV['RACK_ENV'] ||= "test"

require 'yarf'
require 'rack/test'

def session
  last_request.env['rack.session']
end

class TestApp < Yarf
  layout :none

  get '/go/to/main' do
    redirect_to '/'
  end

  get '/' do
    render 'get'
  end

  post "/" do
    render "post"
  end

  put "/" do
    render "put"
  end

  delete "/" do
    render "delete"
  end

  get '/params' do
    render params.inspect
  end

  get '/params/:path' do
    render params.inspect
  end

  with '/nested' do
    get '/get' do
      render "get"
    end

    with 'double' do
      get '/get' do
        render "again"
      end
    end
  end

  with "/session" do
    get "/clear" do
      session.clear
      redirect_to "/"
    end

    get "/:value" do
      session[:yarf] = params[:value]
      render "session"
    end
  end
end


text:
cask 'box-edit' do
  version :latest
  sha256 :no_check

  url 'https://app.box.com/static/BoxEdit/BoxEditInstaller.dmg'
  name 'Box Edit'
  homepage 'https://app.box.com/download-box-edit/'
  license :gratis

  app 'Install Box Edit.app/Contents/Resources/Box Edit.app',
      :target => "#{ENV['HOME']}/Library/Application Support/Box/Box Edit/Box Edit.app"
  internet_plugin 'Install Box Edit.app/Contents/Resources/Box Edit.plugin'

  uninstall :quit => [
                       'com.Box.Box-Edit',
                       'com.box.Box-Local-Com-Server',
                     ]

  zap :delete => '~/Library/Application Support/Box/Box Edit',
      :rmdir  => '~/Library/Application Support/Box'

  caveats <<-EOS.undent
    Box Edit currently only works with Safari and Firefox.
    Restart your browser to load the plugin.
  EOS
end


text:
package org.apache.mesos.elasticsearch.scheduler.matcher;

import org.apache.mesos.Protos;
import org.apache.mesos.elasticsearch.common.Configuration;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;

import java.util.ArrayList;
import java.util.List;

/**
 * Matcher for {@link org.apache.mesos.Protos.TaskInfo}s
 */
public class TaskInfoMatcher extends BaseMatcher<Protos.TaskInfo> {

    private String id;
    private Protos.SlaveID slaveId;
    private Double cpus;
    private Double mem;
    private Double disk;

    public TaskInfoMatcher(String id) {
        this.id = id;
    }

    @Override
    public boolean matches(Object o) {
        Protos.TaskInfo taskInfo = (Protos.TaskInfo) o;

        List<Protos.Resource> resources = new ArrayList<>();
        if (cpus != null) {
            resources.add(newResource("cpus", cpus));
        }

        if (mem != null) {
            resources.add(newResource("mem", mem));
        }

        if (disk != null) {
            resources.add(newResource("disk", disk));
        }

        return taskInfo.getResourcesList().containsAll(resources) &&
                taskInfo.getSlaveId().equals(slaveId) &&
                taskInfo.getTaskId().getValue().equals(id) &&
                taskInfo.getName().equals(Configuration.TASK_NAME);
    }

    private Protos.Resource newResource(String name, Double value) {
        return Protos.Resource.newBuilder()
                .setName(name)
                .setType(Protos.Value.Type.SCALAR)
                .setScalar(Protos.Value.Scalar.newBuilder().setValue(value).build())
                .build();
    }

    @Override
    public void describeTo(Description description) {
        if (cpus != null) {
            description.appendText("(cpu:" + cpus + ")");
        }
        if (mem != null) {
            description.appendText("(mem: " + mem + ")");
        }
        if (disk != null) {
            description.appendText("(disk: " + disk + ")");
        }
    }

    public TaskInfoMatcher slaveId(String slaveId) {
        this.slaveId = Protos.SlaveID.newBuilder().setValue(slaveId).build();
        return this;
    }

    public TaskInfoMatcher cpus(double cpus) {
        this.cpus = cpus;
        return this;
    }

    public TaskInfoMatcher mem(double mem) {
        this.mem = mem;
        return this;
    }

    public TaskInfoMatcher disk(double disk) {
        this.disk = disk;
        return this;
    }

}


text:
<?php
namespace Grav;

use Codeception\Util\Fixtures;
use Faker\Factory;
use Grav\Common\Grav;

ini_set('error_log', __DIR__ . '/error.log');

$grav = function () {
    Grav::resetInstance();
    $grav = Grav::instance();
    $grav['config']->init();

    // This must be set first before the other init
    $grav['config']->set('system.languages.supported', ['en', 'fr', 'vi']);
    $grav['config']->set('system.languages.default_lang', 'en');

    foreach (array_keys($grav['setup']->getStreams()) as $stream) {
        @stream_wrapper_unregister($stream);
    }

    $grav['streams'];

    $grav['uri']->init();
    $grav['debugger']->init();
    $grav['assets']->init();

    $grav['config']->set('system.cache.enabled', false);
    $grav['locator']->addPath('tests', '', 'tests', false);

    return $grav;
};

Fixtures::add('grav', $grav);


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM e:/builds/tinderbox/XR-Trunk/WINNT_5.2_Depend/mozilla/modules/plugin/base/public/nsIPluginInstanceOwner.idl
 */

#ifndef __gen_nsIPluginInstanceOwner_h__
#define __gen_nsIPluginInstanceOwner_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#ifndef __gen_nspluginroot_h__
#include "nspluginroot.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
#include "nsplugin.h"
class nsIPluginInstance; /* forward declaration */

class nsIDocument; /* forward declaration */

/* starting interface:    nsIPluginInstanceOwner */
#define NS_IPLUGININSTANCEOWNER_IID_STR "2e6cc23b-7d4e-4b0a-ad45-f2281c937f5c"

#define NS_IPLUGININSTANCEOWNER_IID \
  {0x2e6cc23b, 0x7d4e, 0x4b0a, \
    { 0xad, 0x45, 0xf2, 0x28, 0x1c, 0x93, 0x7f, 0x5c }}

class nsIPluginInstanceOwner : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPLUGININSTANCEOWNER_IID)

  /**
   * Let the owner know that an instance has been created
   */
  /* void setInstance (in nsIPluginInstance aInstance); */
  NS_IMETHOD SetInstance(nsIPluginInstance *aInstance) = 0;

  /**
   * Get the instance associated with this owner.
   */
  /* void getInstance (in nsIPluginInstanceRef aInstance); */
  NS_IMETHOD GetInstance(nsIPluginInstance * & aInstance) = 0;

  /**
   * Get a handle to the window structure of the owner.
   * This pointer cannot be made persistent by the caller.
   */
  /* void getWindow (in nsPluginWindowStarRef aWindow); */
  NS_IMETHOD GetWindow(nsPluginWindow * & aWindow) = 0;

  /**
   * Get the display mode for the plugin instance.
   */
  /* readonly attribute nsPluginMode mode; */
  NS_IMETHOD GetMode(nsPluginMode *aMode) = 0;

  /**
   * Create a place for the plugin to live in the owner's
   * environment. this may or may not create a window
   * depending on the windowless state of the plugin instance.
   */
  /* void createWidget (); */
  NS_IMETHOD CreateWidget(void) = 0;

  /**
   * Called when there is a valid target so that the proper
   * frame can be updated with new content. will not be called
   * with nsnull aTarget.
   */
  NS_IMETHOD
  GetURL(const char *aURL, const char *aTarget,
         void *aPostData, PRUint32 aPostDataLen,
         void *aHeadersData, PRUint32 aHeadersDataLen,
         PRBool aIsFile = PR_FALSE) = 0;
  /**
   * Show a status message in the host environment.
   */
  /* void showStatus (in string aStatusMsg); */
  NS_IMETHOD ShowStatus(const char *aStatusMsg) = 0;

  NS_IMETHOD
  ShowStatus(const PRUnichar *aStatusMsg) = 0;
  /**
   * Get the associated document.
   */
  /* readonly attribute nsIDocument document; */
  NS_IMETHOD GetDocument(nsIDocument * *aDocument) = 0;

  /**
   * Invalidate the rectangle
   */
  /* void invalidateRect (in nsPluginRectPtr aRect); */
  NS_IMETHOD InvalidateRect(nsPluginRect * aRect) = 0;

  /**
   * Invalidate the region
   */
  /* void invalidateRegion (in nsPluginRegion aRegion); */
  NS_IMETHOD InvalidateRegion(nsPluginRegion aRegion) = 0;

  /**
   * Force a redraw
   */
  /* void forceRedraw (); */
  NS_IMETHOD ForceRedraw(void) = 0;

  /**
   * Get the specified variable
   */
  /* void getValue (in nsPluginInstancePeerVariable aVariable, in voidPtr aValue); */
  NS_IMETHOD GetValue(nsPluginInstancePeerVariable aVariable, void * aValue) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPluginInstanceOwner, NS_IPLUGININSTANCEOWNER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPLUGININSTANCEOWNER \
  NS_IMETHOD SetInstance(nsIPluginInstance *aInstance); \
  NS_IMETHOD GetInstance(nsIPluginInstance * & aInstance); \
  NS_IMETHOD GetWindow(nsPluginWindow * & aWindow); \
  NS_IMETHOD GetMode(nsPluginMode *aMode); \
  NS_IMETHOD CreateWidget(void); \
  NS_IMETHOD ShowStatus(const char *aStatusMsg); \
  NS_IMETHOD GetDocument(nsIDocument * *aDocument); \
  NS_IMETHOD InvalidateRect(nsPluginRect * aRect); \
  NS_IMETHOD InvalidateRegion(nsPluginRegion aRegion); \
  NS_IMETHOD ForceRedraw(void); \
  NS_IMETHOD GetValue(nsPluginInstancePeerVariable aVariable, void * aValue);

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPLUGININSTANCEOWNER(_to) \
  NS_IMETHOD SetInstance(nsIPluginInstance *aInstance) { return _to SetInstance(aInstance); } \
  NS_IMETHOD GetInstance(nsIPluginInstance * & aInstance) { return _to GetInstance(aInstance); } \
  NS_IMETHOD GetWindow(nsPluginWindow * & aWindow) { return _to GetWindow(aWindow); } \
  NS_IMETHOD GetMode(nsPluginMode *aMode) { return _to GetMode(aMode); } \
  NS_IMETHOD CreateWidget(void) { return _to CreateWidget(); } \
  NS_IMETHOD ShowStatus(const char *aStatusMsg) { return _to ShowStatus(aStatusMsg); } \
  NS_IMETHOD GetDocument(nsIDocument * *aDocument) { return _to GetDocument(aDocument); } \
  NS_IMETHOD InvalidateRect(nsPluginRect * aRect) { return _to InvalidateRect(aRect); } \
  NS_IMETHOD InvalidateRegion(nsPluginRegion aRegion) { return _to InvalidateRegion(aRegion); } \
  NS_IMETHOD ForceRedraw(void) { return _to ForceRedraw(); } \
  NS_IMETHOD GetValue(nsPluginInstancePeerVariable aVariable, void * aValue) { return _to GetValue(aVariable, aValue); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPLUGININSTANCEOWNER(_to) \
  NS_IMETHOD SetInstance(nsIPluginInstance *aInstance) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetInstance(aInstance); } \
  NS_IMETHOD GetInstance(nsIPluginInstance * & aInstance) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInstance(aInstance); } \
  NS_IMETHOD GetWindow(nsPluginWindow * & aWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWindow(aWindow); } \
  NS_IMETHOD GetMode(nsPluginMode *aMode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMode(aMode); } \
  NS_IMETHOD CreateWidget(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateWidget(); } \
  NS_IMETHOD ShowStatus(const char *aStatusMsg) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowStatus(aStatusMsg); } \
  NS_IMETHOD GetDocument(nsIDocument * *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocument(aDocument); } \
  NS_IMETHOD InvalidateRect(nsPluginRect * aRect) { return !_to ? NS_ERROR_NULL_POINTER : _to->InvalidateRect(aRect); } \
  NS_IMETHOD InvalidateRegion(nsPluginRegion aRegion) { return !_to ? NS_ERROR_NULL_POINTER : _to->InvalidateRegion(aRegion); } \
  NS_IMETHOD ForceRedraw(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ForceRedraw(); } \
  NS_IMETHOD GetValue(nsPluginInstancePeerVariable aVariable, void * aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aVariable, aValue); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsPluginInstanceOwner : public nsIPluginInstanceOwner
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPLUGININSTANCEOWNER

  nsPluginInstanceOwner();

private:
  ~nsPluginInstanceOwner();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsPluginInstanceOwner, nsIPluginInstanceOwner)

nsPluginInstanceOwner::nsPluginInstanceOwner()
{
  /* member initializers and constructor code */
}

nsPluginInstanceOwner::~nsPluginInstanceOwner()
{
  /* destructor code */
}

/* void setInstance (in nsIPluginInstance aInstance); */
NS_IMETHODIMP nsPluginInstanceOwner::SetInstance(nsIPluginInstance *aInstance)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getInstance (in nsIPluginInstanceRef aInstance); */
NS_IMETHODIMP nsPluginInstanceOwner::GetInstance(nsIPluginInstance * & aInstance)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getWindow (in nsPluginWindowStarRef aWindow); */
NS_IMETHODIMP nsPluginInstanceOwner::GetWindow(nsPluginWindow * & aWindow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsPluginMode mode; */
NS_IMETHODIMP nsPluginInstanceOwner::GetMode(nsPluginMode *aMode)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void createWidget (); */
NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void showStatus (in string aStatusMsg); */
NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const char *aStatusMsg)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIDocument document; */
NS_IMETHODIMP nsPluginInstanceOwner::GetDocument(nsIDocument * *aDocument)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void invalidateRect (in nsPluginRectPtr aRect); */
NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(nsPluginRect * aRect)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void invalidateRegion (in nsPluginRegion aRegion); */
NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRegion(nsPluginRegion aRegion)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void forceRedraw (); */
NS_IMETHODIMP nsPluginInstanceOwner::ForceRedraw()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getValue (in nsPluginInstancePeerVariable aVariable, in voidPtr aValue); */
NS_IMETHODIMP nsPluginInstanceOwner::GetValue(nsPluginInstancePeerVariable aVariable, void * aValue)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIPluginInstanceOwner_h__ */


text:
package org.apache.axis2.transport.base;

import org.apache.axis2.transport.TransportListener;
import org.apache.axis2.transport.TransportSender;

import java.util.Map;

public class TransportView implements TransportViewMBean {

    private ManagementSupport managementSupport = null;

    private TransportListener listener = null;

    private TransportSender sender = null;

    public TransportView(TransportListener listener, TransportSender sender) {
        if (listener != null) {
            this.listener = listener;
            if (listener instanceof  ManagementSupport) {
                managementSupport = (ManagementSupport) listener;
            }
        }
        if (sender != null) {
            this.sender = sender;
            if (sender instanceof ManagementSupport) {
                managementSupport = (ManagementSupport) sender;
            }
        }
    }

    // JMX Attributes
    public long getMessagesReceived() {
        if (managementSupport != null) {
            return managementSupport.getMessagesReceived();
        }
        return -1;
    }

    public long getFaultsReceiving() {
        if (managementSupport != null) {
            return managementSupport.getFaultsReceiving();
        }
        return -1;
    }

    public long getTimeoutsReceiving() {
        if (managementSupport != null) {
            return managementSupport.getTimeoutsReceiving();
        }
        return -1;
    }

    public long getTimeoutsSending() {
        if (managementSupport != null) {
            managementSupport.getTimeoutsSending();
        }
        return -1;
    }

    public long getBytesReceived() {
        if (managementSupport != null) {
            return managementSupport.getBytesReceived();
        }
        return -1;
    }

    public long getMessagesSent() {
        if (managementSupport != null) {
            return managementSupport.getMessagesSent();
        }
        return -1;
    }

    public long getFaultsSending() {
        if (managementSupport != null) {
            return managementSupport.getFaultsSending();
        }
        return -1;
    }

    public long getBytesSent() {
        if (managementSupport != null) {
            return managementSupport.getBytesSent();
        }
        return -1;
    }

    public long getMinSizeReceived() {
        if (managementSupport != null) {
            return managementSupport.getMinSizeReceived();
        }
        return -1;
    }

    public long getMaxSizeReceived() {
        if (managementSupport != null) {
            return managementSupport.getMaxSizeReceived();
        }
        return -1;
    }

    public double getAvgSizeReceived() {
        if (managementSupport != null) {
            return managementSupport.getAvgSizeReceived();
        }
        return -1;
    }

    public long getMinSizeSent() {
        if (managementSupport != null) {
            return managementSupport.getMinSizeSent();
        }
        return -1;
    }

    public long getMaxSizeSent() {
        if (managementSupport != null) {
            return managementSupport.getMaxSizeSent();
        }
        return -1;
    }

    public double getAvgSizeSent() {
        if (managementSupport != null) {
            return managementSupport.getAvgSizeSent();
        }
        return -1;
    }

    public Map getResponseCodeTable() {
        if (managementSupport != null ) {
            return managementSupport.getResponseCodeTable();
        }
        return null;
    }

    public int getActiveThreadCount() {
        if (managementSupport != null) {
            return managementSupport.getActiveThreadCount();
        }
        return -1;
    }

    public int getQueueSize() {
        if (managementSupport != null) {
            return managementSupport.getQueueSize();
        }
        return -1;
    }

    // JMX Operations
    public void start() throws Exception{
        if (listener != null) {
            listener.start();
        }
    }

    public void stop() throws Exception {
        if (listener != null) {
            listener.stop();
        } else if (sender != null) {
            sender.stop();
        }
    }

    public void pause() throws Exception {
        if (managementSupport != null) {
            managementSupport.pause();
        }
    }

    public void resume() throws Exception {
        if (managementSupport != null) {
            managementSupport.resume();
        }
    }

    public void maintenenceShutdown(long seconds) throws Exception {
        if (managementSupport != null) {
            managementSupport.maintenenceShutdown(seconds * 1000);
        }
    }

    public void resetStatistics() {
        if (managementSupport != null) {
            managementSupport.resetStatistics();
        }
    }

    public long getLastResetTime() {
        if (managementSupport != null) {
            return managementSupport.getLastResetTime();
        }
        return -1;
    }

    public long getMetricsWindow() {
        if (managementSupport != null) {
            return System.currentTimeMillis() - managementSupport.getLastResetTime();
        }
        return -1;
    }
}


text:
<?php
declare(strict_types=1);

namespace jvwag\AdventOfCode\Year2018;

use jvwag\AdventOfCode\Assignment;

/**
 * Class
 *
 * @package jvwag\AdventOfCode\Year2018
 */
class Day6 extends Assignment
{
    private const MAX_DISTANCE = 10000;

    /** @var int Max Distance */
    private $max_distance = self::MAX_DISTANCE;

    /**
     * @return array
     */
    public function run(): array
    {
        // get input
        $input = $this->getInput();

        // parse input and create array of x,y coordinates
        $coordinates = [];
        foreach (explode("\n", trim($input)) as $line) {
            if (preg_match("/^(\d+)\s*,\s*(\d+)$/", $line, $match)) {
                $coordinates[] = [(int)$match[1], (int)$match[2]];
            }
        }

        // determine min and max x in coordinates array
        $x_list = array_column($coordinates, 0);
        $min_x = min($x_list) - 1;
        $max_x = max($x_list) + 1;

        // determine min and max y in coordinates array
        $y_list = array_column($coordinates, 1);
        $min_y = min($y_list) - 1;
        $max_y = max($y_list) + 1;

        // get the max distance (default 10000, but can me different for unit-tests)
        $max_distance = $this->getMaxDistance();

        // init vars
        $grid = [];
        $excluded = [];
        $count_total_distances_less_than_max = 0;

        // loop over complete grid
        for ($y = $min_y; $y < $max_y; $y++) {
            for ($x = $min_x; $x <= $max_x; $x++) {

                // init vars for this iteration
                $distances_per_coordinate = [];
                $distances_sum = 0;

                // calculate distance between grid location and all given coordinates
                foreach ($coordinates as [$loc_x, $loc_y]) {
                    // manhattan distance
                    $d = abs($x - $loc_x) + abs($y - $loc_y);

                    // store distance for each coordinate
                    $distances_per_coordinate[$loc_x . "x" . $loc_y] = $d;

                    // make sum of distances
                    $distances_sum += $d;
                }

                // if the sum of distances is more than the given maximum, add it to a total
                if ($distances_sum < $max_distance) {
                    $count_total_distances_less_than_max++;
                }

                // determine the minimal distance
                $minimal_distance = min($distances_per_coordinate);
                // and see if there is just one minimal distance
                if (array_count_values($distances_per_coordinate)[$minimal_distance] === 1) {
                    // find the closest coordinate, and add it to the grid
                    $grid[] = $closest_coordinate = array_search($minimal_distance, $distances_per_coordinate, true);

                    // if the closest_coordinate is on the outskirts of our grid, it must be infinite, so we
                    // mark the coordinate to be excluded later
                    if ($x === $min_x || $x === $max_x || $y === $min_y || $y === $max_y) {
                        $excluded[$closest_coordinate] = $closest_coordinate;
                    }
                }

            }
        }

        // remove excluded coordinate from grid
        $grid = array_diff($grid, $excluded);

        // determine which coordinate has the most occurrences in the grid
        $largest_area = max(array_count_values($grid));

        // return answers
        return
            [
                $largest_area,
                $count_total_distances_less_than_max
            ];
    }

    /**
     * @return int
     */
    public function getMaxDistance(): int
    {
        return $this->max_distance;
    }

    /**
     * @param int $max_distance
     */
    public function setMaxDistance(int $max_distance): void
    {
        $this->max_distance = $max_distance;
    }
}


text:
Issues and pull requests on this repository may not be acted on in a timely
manner, or at all.  You are of course welcome to use it anyway. You are even
more welcome to fork it and maintain the results.

![Unmaintained](https://nym.se/img/unmaintained.jpg)

cube-eds-poller
===============

Extract temperature, power consumption or whatever other data from an EDS
1-Wire server such as OW-SERVER-ENET.

Installation
------------

    npm install -g cube-eds-poller

Configuration
-------------

This assumes a node installation in `/opt/local`. Adjust accordingly.

    cp /opt/local/lib/node_modules/cube-eds-poller/config.json /etc/eds-poller.json
    vi /etc/eds-poller.json

Running
-------

    eds-poller /etc/eds-poller.json

There's also an SMF manifest included in the directory. Tweak it for your paths
and `svccfg import` it to start eds-poller.

License
-------

MIT


text:
package command

import (
	"errors"
	"os"

	"github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli"
	"github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
)

// NewUpdateCommand returns the CLI command for "update".
func NewUpdateCommand() cli.Command {
	return cli.Command{
		Name:  "update",
		Usage: "update an existing key with a given value",
		Flags: []cli.Flag{
			cli.IntFlag{Name: "ttl", Value: 0, Usage: "key time-to-live"},
		},
		Action: func(c *cli.Context) {
			handleKey(c, updateCommandFunc)
		},
	}
}

// updateCommandFunc executes the "update" command.
func updateCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) {
	if len(c.Args()) == 0 {
		return nil, errors.New("Key required")
	}
	key := c.Args()[0]
	value, err := argOrStdin(c.Args(), os.Stdin, 1)
	if err != nil {
		return nil, errors.New("Value required")
	}

	ttl := c.Int("ttl")

	return client.Update(key, value, uint64(ttl))
}


text:
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'cgi'
require File.dirname(__FILE__) + "/fixtures/common"

describe "CGI::HtmlExtension#img" do
  before(:each) do
    @html = CGISpecs::HtmlExtension.new
  end

  describe "when passed no arguments" do
    it "returns an 'img'-element without an src-url or alt-text" do
      output = @html.img
      output.should equal_element("IMG", { "SRC" => "", "ALT" => "" }, "", :not_closed => true)
    end

    it "ignores a passed block" do
      output = @html.img { "test" }
      output.should equal_element("IMG", { "SRC" => "", "ALT" => "" }, "", :not_closed => true)
    end
  end

  describe "when passed src" do
    it "returns an 'img'-element with the passed src-url" do
      output = @html.img("/path/to/some/image.png")
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "" }, "", :not_closed => true)
    end

    it "ignores a passed block" do
      output = @html.img("/path/to/some/image.png")
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "" }, "", :not_closed => true)
    end
  end

  describe "when passed src, alt" do
    it "returns an 'img'-element with the passed src-url and the passed alt-text" do
      output = @html.img("/path/to/some/image.png", "Alternative")
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative" }, "", :not_closed => true)
    end

    it "ignores a passed block" do
      output = @html.img("/path/to/some/image.png", "Alternative") { "test" }
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative" }, "", :not_closed => true)
    end
  end

  describe "when passed src, alt, width" do
    it "returns an 'img'-element with the passed src-url, the passed alt-text and the passed width" do
      output = @html.img("/path/to/some/image.png", "Alternative", 40)
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative", "WIDTH" => "40" }, "", :not_closed => true)
    end

    it "ignores a passed block" do
      output = @html.img("/path/to/some/image.png", "Alternative", 40) { "test" }
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative", "WIDTH" => "40" }, "", :not_closed => true)
    end
  end

  describe "when passed src, alt, width, height" do
    it "returns an 'img'-element with the passed src-url, the passed alt-text, the passed width and the passed height" do
      output = @html.img("/path/to/some/image.png", "Alternative", 40, 60)
      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative", "WIDTH" => "40", "HEIGHT" => "60" }, "", :not_closed => true)
    end

    it "ignores a passed block" do
      output = @html.img { "test" }
      output.should equal_element("IMG", { "SRC" => "", "ALT" => "" }, "", :not_closed => true)
    end
  end

  describe "when passed Hash" do
    ruby_bug "http://redmine.ruby-lang.org/issues/show/255", "1.8.7" do
      it "returns an 'img'-element with the passed Hash as attributes" do
        attributes = { "SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50 }
        output = @html.img(attributes)
        output.should equal_element("IMG", attributes, "", :not_closed => true)
      end

      it "ignores a passed block" do
        attributes = { "SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50 }
        output = @html.img(attributes) { "test" }
        output.should equal_element("IMG", attributes, "", :not_closed => true)
      end
    end
  end
end


text:
//
//  PxSuperViewController.h
//  PxUIKit
//
//  Created by Jonathan Cichon on 30.01.14.
//  Copyright (c) 2014 pixelflut GmbH. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 Empty Subclass for the sole purpose of having a class below _UIViewController_ you can add categories at. This can be espacialy usefull for overwritting methods in categories.
 */
@interface PxSuperViewController : UIViewController

@end


text:
![Arch Linux](https://www.archlinux.org/static/logos/archlinux-logo-dark-scalable.518881f04ca9.svg)

This page is the starting point for all installation and configuration documentation of my [Arch Linux] setup.
There's already some great [documentation regarding Arch Linux], so please consult that for background information. My focus will be on the bare minimum of necessities to achieve a specific goal and therefor:

* The number of explicitly installed packages will be kept to a minimum
  > since [`base`] is now a metapackage instead of a group[[1]], all required top-level packages (except [`linux`]) are now implicit dependencies of [`base`]
* For filling configuration files, the command `tee` is used instead of a command line editor (like [`vi`] or [`nano`]), mostly because:
  * it's part of package [`coreutils`] which is already pulled in by mandatory packages like [`linux`] and [`systemd`]
  * to execute the command using `tee`, it can be copied on the command line or in scripts
  * the part of the command between the `EOF` tags (the [here document]) can still be copied into an editor to your taste
    > to prevent expansion of variables, tags of those [here document]s can be quoted like `'EOF'`

## Installation

* [Basic Installation]
  * **...or** [Minimal Installation using systemd-boot]
* [Essential configuration]
* [Recommended supplements]
* [Possible optimizations]

## Knowledge base

* [Using pacman]
* [Udev rules]
* [Polkit]
* [Systemd-nspawn containers]
* [Using rsync]

### Maintaining the docs

Please see [Maintaining GitHub Pages](GitHubPages.md) for more info.

[Arch Linux]: https://www.archlinux.org/
[documentation regarding Arch Linux]: https://wiki.archlinux.org/
[`base`]: https://www.archlinux.org/packages/core/x86_64/base/
[`vi`]: https://www.archlinux.org/packages/core/x86_64/vi/
[`nano`]: https://www.archlinux.org/packages/core/x86_64/nano/
[`coreutils`]: https://www.archlinux.org/packages/core/x86_64/coreutils/
[`linux`]: https://www.archlinux.org/packages/core/x86_64/linux/
[`systemd`]: https://www.archlinux.org/packages/core/x86_64/systemd/

[Basic Installation]: installation/basic-installation.md
[Minimal Installation using systemd-boot]: installation/minimal_installation.md
[Essential configuration]: installation/essentials-installation.md
[Recommended supplements]: installation/recommended-installation.md
[Possible optimizations]: installation/optimizations.md
[Using pacman]: using-pacman.md
[Udev rules]: udev-rules.md
[Polkit]: polkit.md
[Systemd-nspawn containers]: systemd-nspawn-containers.md
[Using rsync]: using-rsync.md

[1]: https://www.archlinux.org/news/base-group-replaced-by-mandatory-base-package-manual-intervention-required/
[here document]: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Here-Documents


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.11.14 at 08:41:30 AM CET
//

package iso.std.iso._20022.tech.xsd.pain_008_001_02;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for TaxAmount1 complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="TaxAmount1">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Rate" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.001.02}PercentageRate" minOccurs="0"/>
 *         <element name="TaxblBaseAmt" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.001.02}ActiveOrHistoricCurrencyAndAmount" minOccurs="0"/>
 *         <element name="TtlAmt" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.001.02}ActiveOrHistoricCurrencyAndAmount" minOccurs="0"/>
 *         <element name="Dtls" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.001.02}TaxRecordDetails1" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TaxAmount1", propOrder = {
    "rate",
    "taxblBaseAmt",
    "ttlAmt",
    "dtls"
})
public class TaxAmount1 {

    @XmlElement(name = "Rate")
    protected BigDecimal rate;
    @XmlElement(name = "TaxblBaseAmt")
    protected ActiveOrHistoricCurrencyAndAmount taxblBaseAmt;
    @XmlElement(name = "TtlAmt")
    protected ActiveOrHistoricCurrencyAndAmount ttlAmt;
    @XmlElement(name = "Dtls")
    protected List<TaxRecordDetails1> dtls;

    /**
     * Gets the value of the rate property.
     *
     * @return
     *     possible object is
     *     {@link BigDecimal }
     *
     */
    public BigDecimal getRate() {
        return rate;
    }

    /**
     * Sets the value of the rate property.
     *
     * @param value
     *     allowed object is
     *     {@link BigDecimal }
     *
     */
    public void setRate(BigDecimal value) {
        this.rate = value;
    }

    /**
     * Gets the value of the taxblBaseAmt property.
     *
     * @return
     *     possible object is
     *     {@link ActiveOrHistoricCurrencyAndAmount }
     *
     */
    public ActiveOrHistoricCurrencyAndAmount getTaxblBaseAmt() {
        return taxblBaseAmt;
    }

    /**
     * Sets the value of the taxblBaseAmt property.
     *
     * @param value
     *     allowed object is
     *     {@link ActiveOrHistoricCurrencyAndAmount }
     *
     */
    public void setTaxblBaseAmt(ActiveOrHistoricCurrencyAndAmount value) {
        this.taxblBaseAmt = value;
    }

    /**
     * Gets the value of the ttlAmt property.
     *
     * @return
     *     possible object is
     *     {@link ActiveOrHistoricCurrencyAndAmount }
     *
     */
    public ActiveOrHistoricCurrencyAndAmount getTtlAmt() {
        return ttlAmt;
    }

    /**
     * Sets the value of the ttlAmt property.
     *
     * @param value
     *     allowed object is
     *     {@link ActiveOrHistoricCurrencyAndAmount }
     *
     */
    public void setTtlAmt(ActiveOrHistoricCurrencyAndAmount value) {
        this.ttlAmt = value;
    }

    /**
     * Gets the value of the dtls property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the dtls property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getDtls().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link TaxRecordDetails1 }
     *
     *
     */
    public List<TaxRecordDetails1> getDtls() {
        if (dtls == null) {
            dtls = new ArrayList<TaxRecordDetails1>();
        }
        return this.dtls;
    }

}


text:
using System.Configuration;

using Clifton.Core.ModuleManagement;
using Clifton.Core.ServiceInterfaces;
using Clifton.Core.ServiceManagement;

namespace Clifton.Cores.Services.AppConfigService
{
    public class AppConfigModule : IModule
    {
        public void InitializeServices(IServiceManager serviceManager)
        {
            serviceManager.RegisterSingleton<IAppConfigService, ConfigService>();
        }
    }

    public class ConfigService : ServiceBase, IEncryptedAppConfigService
    {
        public virtual string GetConnectionString(string key)
        {
            string enc = ConfigurationManager.ConnectionStrings[key].ConnectionString;

            return Decrypt(enc);
        }

        public virtual string GetValue(string key)
        {
            string enc = ConfigurationManager.AppSettings[key];

            return Decrypt(enc);
        }

        protected string Decrypt(string enc)
        {
            return ServiceManager.Get<IAppConfigDecryptionService>().Decrypt(enc);
        }
    }
}


text:
using System;
using System.ComponentModel;
using System.Globalization;
using Newtonsoft.Json;

namespace Org.OpenAPITools.Converters
{
    /// <summary>
    /// Custom string to enum converter
    /// </summary>
    public class CustomEnumConverter<T> : TypeConverter
    {
        /// <summary>
        /// Determine if we can convert a type to an enum
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sourceType"></param>
        /// <returns></returns>
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
        }

        /// <summary>
        /// Convert from a type value to an enum
        /// </summary>
        /// <param name="context"></param>
        /// <param name="culture"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            var s = value as string;
            if (string.IsNullOrEmpty(s))
            {
                return null;
            }

            return JsonConvert.DeserializeObject<T>(@"""" + value.ToString() + @"""");
        }
    }
}


text:
This is a program for some research regarding self-deception.

## License

MIT (see LICENSE file)


text:
from django import forms
from django.forms.widgets import Textarea, HiddenInput

class CreateZNodeForm(forms.Form):
  name = forms.CharField(max_length=64)
  data = forms.CharField(required=False, widget=Textarea)
  sequence = forms.BooleanField(required=False)

class EditZNodeForm(forms.Form):
  data = forms.CharField(required=False, widget=Textarea)
  version = forms.IntegerField(required=False, widget=HiddenInput)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
J. Jap. Bot. 30: 215 (1959)

#### Original name
Hygrocybe imazekii Hongo

### Remarks
null


text:
package net.codebox.javabeantester.beans;

/**
 * Created by rob on 13/08/2017.
 */
public class BrokenBeanInt extends Bean {
    @Override
    public void setIntValue(int intValue) {
        // broken
    }
}


text:
<?php

/**
 * Interface to abstract an implementation of the
 * signature verification algorithm
 *
 */
interface VerifySignature
{
    /**
     * Verify that the signature is correct for the given data and
     * public key
     *
     * @param string $data            data to validate
     * @param string $signature       decoded signature to compare against
     * @param string $certificatePath path to certificate, can be file or url
     *
     * @throws OffAmazonPaymentsNotifications_InvalidMessageException if there
     *                                                                is an error
     *                                                                with the call
     *
     * @return bool true if valid
     */
    function verifySignatureIsCorrect($data, $signature, $certificatePath);
}


text:
<?php

namespace PhpUnitGen\Parser\NodeParser;

use PhpParser\Node;
use PhpUnitGen\Exception\Exception;
use PhpUnitGen\Model\ModelInterface\FunctionModelInterface;
use PhpUnitGen\Model\ParameterModel;
use PhpUnitGen\Model\PropertyInterface\NodeInterface;

/**
 * Class ParameterNodeParser.
 *
 * @author     Paul Thébaud <paul.thebaud29@gmail.com>.
 * @copyright  2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>.
 * @license    https://opensource.org/licenses/MIT The MIT license.
 * @link       https://github.com/paul-thebaud/phpunit-generator
 * @since      Class available since Release 2.0.0.
 */
class ParameterNodeParser extends AbstractNodeParser
{
    /**
     * @var TypeNodeParser $typeNodeParser The type node parser.
     */
    protected $typeNodeParser;

    /**
     * @var ValueNodeParser $valueNodeParser The value node parser.
     */
    protected $valueNodeParser;

    /**
     * AttributeNodeParser constructor.
     *
     * @param TypeNodeParser  $typeNodeParser  The type node parser.
     * @param ValueNodeParser $valueNodeParser The value node parser.
     */
    public function __construct(TypeNodeParser $typeNodeParser, ValueNodeParser $valueNodeParser)
    {
        $this->typeNodeParser  = $typeNodeParser;
        $this->valueNodeParser = $valueNodeParser;
    }

    /**
     * Parse a node to update the parent node model.
     *
     * @param mixed         $node   The node to parse.
     * @param NodeInterface $parent The parent node.
     */
    public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Param || ! $parent instanceof FunctionModelInterface) {
            throw new Exception('ParameterNodeParser is made to parse a function parameter node');
        }

        $parameter = new ParameterModel();
        $parameter->setParentNode($parent);
        $parameter->setName($node->var->name);
        $parameter->setIsVariadic($node->variadic);

        if ($node->type !== null) {
            $this->typeNodeParser->invoke($node->type, $parameter);
        }
        if ($node->default !== null) {
            $this->valueNodeParser->invoke($node->default, $parameter);
        }

        $parent->addParameter($parameter);
    }
}


text:
tinyMCE.addI18n('gl.style_dlg',{
title:"Editar Estilo CSS",
apply:"Aplicar",
text_tab:"Texto",
background_tab:"Fondo",
block_tab:"Bloque",
box_tab:"Caixa",
border_tab:"Borde",
list_tab:"Lista",
positioning_tab:"Posici\u00F3n",
text_props:"Texto",
text_font:"Fonte",
text_size:"Tama\u00F1o",
text_weight:"Peso",
text_style:"Estilo",
text_variant:"Variante",
text_lineheight:"Ancho da fila",
text_case:"Min\u00FAs./May\u00FAs.",
text_color:"Cor",
text_decoration:"Decorativos",
text_overline:"Li\u00F1a superior",
text_underline:"Suli\u00F1ado",
text_striketrough:"Tachado",
text_blink:"Parpadeo",
text_none:"Neng\u00FAn",
background_color:"Cor de fondo",
background_image:"Imaxe de fondo",
background_repeat:"Repetir",
background_attachment:"Adxunto",
background_hpos:"Posici\u00F3n horizontal",
background_vpos:"Posici\u00F3n vertical",
block_wordspacing:"Espacio entre verbas",
block_letterspacing:"Espacio entre letras",
block_vertical_alignment:"Ali\u00F1aci\u00F3n vertical",
block_text_align:"Ali\u00F1aci\u00F3n do texto",
block_text_indent:"Sangr\u00EDa",
block_whitespace:"Espacio en branco",
block_display:"Display",
box_width:"Ancho",
box_height:"Alto",
box_float:"Float",
box_clear:"Limpar",
padding:"Recheo",
same:"O mesmo en todos",
top:"Arriba",
right:"Dereita",
bottom:"Abaixo",
left:"Esquerda",
margin:"Marxe",
style:"Estilo",
width:"Ancho",
height:"Alto",
color:"Cor",
list_type:"Tipo",
bullet_image:"Imaxe da vi\u00F1eta",
position:"Posici\u00F3n",
positioning_type:"Tipo",
visibility:"Visibilidade",
zindex:"\u00CDndize Z",
overflow:"Desbodramento",
placement:"Colocaci\u00F3n",
clip:"Clip"
});


text:
#include <string>
#include <vector>
#include <iostream>

#include "Poco/Util/ServerApplication.h"
#include "Poco/Net/HTTPServer.h"
#include "Poco/Util/HelpFormatter.h"
#include "Poco/Net/DNS.h"
#include "Poco/String.h"
#include "Poco/FileStream.h"
#include "Poco/LineEndingConverter.h"
#include "Poco/StringTokenizer.h"
#include "Poco/URI.h"
#include "Poco/Path.h"

#include "IndigoFiler.h"
#include "IndigoConfiguration.h"
#include "IndigoRequestHandler.h"
#include "ThreadPoolCollector.h"

using namespace std;

using namespace Poco;
using namespace Poco::Util;
using namespace Poco::Net;

class IndigoRequestHandlerFactory: public HTTPRequestHandlerFactory
{
public:
	HTTPRequestHandler *createRequestHandler(const HTTPServerRequest &request)
	{
		return new IndigoRequestHandler();
	}
};

class IndigoFiler: public ServerApplication
{
public:
	IndigoFiler(): helpRequested(false), versionRequested(false)
	{
	}

protected:
	void initialize(Application &self)
	{
		ServerApplication::initialize(self);

		string configPath = locateConfiguration(APP_NAME_UNIX "." "ini");
		loadConfiguration(configPath);
	}

	void uninitialize()
	{
		ServerApplication::uninitialize();
	}

	void defineOptions(OptionSet &options)
	{
		ServerApplication::defineOptions(options);

		options.addOption(
			Option("help", "h", "display help information on command line arguments")
				.required(false)
				.repeatable(false));

		options.addOption(
			Option("version", "v", "display version information")
				.required(false)
				.repeatable(false));
	}

	void handleOption(const string &name, const string &value)
	{
		ServerApplication::handleOption(name, value);

		if (name == "help")
			helpRequested = true;
		else if (name == "version")
			versionRequested = true;
	}

	int main(const vector<string> &args)
	{
		if (helpRequested)
		{
			displayHelp();
		}
		else if (versionRequested)
		{
			displayVersion();
		}
		else
		{
			const string serverSection = "Server";

			string serverName = config().getString(serverSection + "." + "name", "");
			if (serverName.empty())
				serverName = DNS::hostName();

			string root = config().getString(serverSection + "." + "root", "virtual");
			if (root == "virtual")
				root = "";

			string index = config().getString(serverSection + "." + "index", "index.html");

			const IndigoConfiguration &configuration = IndigoConfiguration::init(
				serverName,
				config().getString(serverSection + "." + "address", "0.0.0.0"),
				config().getInt(serverSection + "." + "port", 80),
				config().getInt(serverSection + "." + "backlog", 64),
				config().getInt(serverSection + "." + "minThreads", 2),
				config().getInt(serverSection + "." + "maxThreads", 16),
				config().getInt(serverSection + "." + "maxQueued", 64),
				config().getInt(serverSection + "." + "timeout", 60),
				config().getBool(serverSection + "." + "keepalive", true),
				config().getInt(serverSection + "." + "keepaliveTimeout", 15),
				config().getInt(serverSection + "." + "maxKeepaliveRequests", 0),
				config().getInt(serverSection + "." + "idleTime", 60),
				config().getInt(serverSection + "." + "threadIdleTime", 10),
				config().getBool(serverSection + "." + "collectIdleThreads", false),
				root,
				readIndexes(index),
				config().getBool(serverSection + "." + "autoIndex", true),
				readShares(),
				readMimeTypes()
				);
			configuration.validate();

			HTTPServerParams::Ptr params = new HTTPServerParams;
			params->setMaxThreads(configuration.getMaxThreads());
			params->setMaxQueued(configuration.getMaxQueued());
			params->setServerName(configuration.getServerName());
			params->setSoftwareVersion(SERVER_FIELD_VALUE);
			params->setTimeout(configuration.getTimeout() * 1000000);
			params->setKeepAlive(configuration.getKeepalive());
			params->setKeepAliveTimeout(configuration.getKeepaliveTimeout() * 1000000);
			params->setMaxKeepAliveRequests(configuration.getMaxKeepaliveRequests());
			params->setThreadIdleTime(configuration.getThreadIdleTime() * 1000000);

			HTTPRequestHandlerFactory::Ptr factory = new IndigoRequestHandlerFactory();

			ThreadPool pool("workers", configuration.getMinThreads(), configuration.getMaxThreads(), configuration.getIdleTime());

			SocketAddress saddr(configuration.getAddress(), configuration.getPort());
			ServerSocket sock;
			sock.bind(saddr, false);
			sock.listen(configuration.getBacklog());
			sock.setSendTimeout(configuration.getTimeout() * 1000000); // not done in POCO

			ThreadPoolCollector collector(pool);

			HTTPServer srv(factory, pool, sock, params);

			if (configuration.getCollectIdleThreads())
				collector.startCollecting();

			srv.start();

			waitForTerminationRequest();

			srv.stop();

			collector.stopCollecting();
		}

		return EXIT_OK;
	}

private:
	void displayHelp()
	{
		HelpFormatter helpFormatter(options());
		helpFormatter.setCommand(commandName());
		helpFormatter.setUsage("[options]");
		helpFormatter.setHeader("A simple web server for static content.");
		helpFormatter.format(cout);
	}

	void displayVersion()
	{
		cout << APP_NAME " " APP_VERSION << endl;
		cout << APP_COPYRIGHT_NOTICE;
	}

	vector<string> readIndexes(const string &index)
	{
		vector<string> indexes;

		StringTokenizer tok(index, " \t", StringTokenizer::TOK_IGNORE_EMPTY);
		int cnt = tok.count();
		for (int i = 0; i < cnt; i++)
		{
			string idx;
			URI::decode(tok[i], idx);
			poco_assert(idx.empty() == false);

			indexes.push_back(idx);
		}

		return indexes;
	}

	unordered_map<string, string> readShares()
	{
		const string sharesSection = "VirtualRoot";

		unordered_map<string, string> shares;

		AbstractConfiguration::Keys keys;
		config().keys(sharesSection, keys);

		for (size_t i = 0; i < keys.size(); i++)
		{
			const string &shareName = keys[i];
			if (shareName.empty())
				continue;

			string sharePath = config().getString(sharesSection + "." + shareName, "");
			if (sharePath.empty())
				continue;

			string decodedShareName;
			URI::decode(shareName, decodedShareName);
			string decodedSharePath;
			URI::decode(sharePath, decodedSharePath);

			shares[decodedShareName] = decodedSharePath;
		}

		return shares;
	}

	void readMimeTypes(string filename, unordered_map<string, string> &mimeTypes)
	{
		string filepath = locateConfiguration(filename);

		FileInputStream fin(filepath);
		InputLineEndingConverter in(fin, LineEnding::NEWLINE_LF);

		string line;
		while (getline(in, line))
		{
			line = line.substr(0, line.find('#'));

			StringTokenizer tok(line, " \t", StringTokenizer::TOK_IGNORE_EMPTY);
			int cnt = tok.count();
			if (cnt >= 2)
			{
				const string &type = tok[0];
				poco_assert(type.empty() == false);

				for (int i = 1; i < cnt; i++)
				{
					const string &ext = tok[i];
					poco_assert(ext.empty() == false);

					mimeTypes[ext] = type;
				}
			}
		}
	}

	unordered_map<string, string> readMimeTypes()
	{
		unordered_map<string, string> mimeTypes;

		readMimeTypes("mime.types", mimeTypes);
		readMimeTypes("mime.types.extra", mimeTypes);
		readMimeTypes("mime.types.user", mimeTypes);

		return mimeTypes;
	}

	string locateConfiguration(const string &filename)
	{
		string dir = config().getString("application.dir");
		Path path(dir);
		path.makeDirectory().setFileName(filename);
		return path.toString();
	}

	bool helpRequested;
	bool versionRequested;
};

int main(int argc, char **argv)
{
	IndigoFiler indigo;
	return indigo.run(argc, argv);
}


text:
layout: component
title: Exponential Moving Average
component: indicator/algorithm/exponentialMovingAverage.js
tags:
  - playground
namespace: indicator

example-code: |
  // Create the point series
  var point = fc.series.point()
      .xScale(xScale)
      .yScale(yScale);

  container.append('g')
      .datum(data)
      .call(point);

  // Create and apply the EMA
  var movingAverage = fc.indicator.algorithm.exponentialMovingAverage()
  movingAverage(data);

  // Create a line that renders the result
  var ma = fc.series.line()
      .yValue(function(d) { return d.exponentialMovingAverage; })
      .xScale(xScale)
      .yScale(yScale);

  // Add it to the container
  container.append('g')
      .datum(data)
      .call(ma);
---

An [Exponential Moving Average](https://en.wikipedia.org/?title=Moving_average#Exponential_moving_average) (EMA) is an indicator that smooths out fluctuations in data.

The example below creates a point series and an EMA:

```js
{{{example-code}}}
```

{{>example-fixture}}

You can configure the number of datapoints that are included in the moving average via the `windowSize` property, you can also change the object property that is averaged via the `yValue` property.


text:
package com.fsck.k9.mail.store.imap;

import java.util.List;

import org.junit.Test;

import static org.junit.Assert.assertArrayEquals;

public class ImapUtilityTest  {
    @Test
    public void testGetImapSequenceValues() {
        String[] expected;
        List<String> actual;

        // Test valid sets
        expected = new String[] {"1"};
        actual = ImapUtility.getImapSequenceValues("1");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"2147483648"};     // Integer.MAX_VALUE + 1
        actual = ImapUtility.getImapSequenceValues("2147483648");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"4294967295"};     // 2^32 - 1
        actual = ImapUtility.getImapSequenceValues("4294967295");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"1", "3", "2"};
        actual = ImapUtility.getImapSequenceValues("1,3,2");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"4", "5", "6"};
        actual = ImapUtility.getImapSequenceValues("4:6");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"9", "8", "7"};
        actual = ImapUtility.getImapSequenceValues("9:7");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"1", "2", "3", "4", "9", "8", "7"};
        actual = ImapUtility.getImapSequenceValues("1,2:4,9:7");
        assertArrayEquals(expected, actual.toArray());

        // Test numbers larger than Integer.MAX_VALUE (2147483647)
        expected = new String[] {"2147483646", "2147483647", "2147483648"};
        actual = ImapUtility.getImapSequenceValues("2147483646:2147483648");
        assertArrayEquals(expected, actual.toArray());

        // Test partially invalid sets
        expected = new String[] { "1", "5" };
        actual = ImapUtility.getImapSequenceValues("1,x,5");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] { "1", "2", "3" };
        actual = ImapUtility.getImapSequenceValues("a:d,1:3");
        assertArrayEquals(expected, actual.toArray());

        // Test invalid sets
        expected = new String[0];
        actual = ImapUtility.getImapSequenceValues("");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapSequenceValues(null);
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapSequenceValues("a");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapSequenceValues("1:x");
        assertArrayEquals(expected, actual.toArray());

        // Test values larger than 2^32 - 1
        expected = new String[0];
        actual = ImapUtility.getImapSequenceValues("4294967296:4294967297");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapSequenceValues("4294967296");     // 2^32
        assertArrayEquals(expected, actual.toArray());
    }

    @Test public void testGetImapRangeValues() {
        String[] expected;
        List<String> actual;

        // Test valid ranges
        expected = new String[] {"1", "2", "3"};
        actual = ImapUtility.getImapRangeValues("1:3");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[] {"16", "15", "14"};
        actual = ImapUtility.getImapRangeValues("16:14");
        assertArrayEquals(expected, actual.toArray());

        // Test in-valid ranges
        expected = new String[0];
        actual = ImapUtility.getImapRangeValues("");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapRangeValues(null);
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapRangeValues("a");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapRangeValues("6");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapRangeValues("1:3,6");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapRangeValues("1:x");
        assertArrayEquals(expected, actual.toArray());

        expected = new String[0];
        actual = ImapUtility.getImapRangeValues("1:*");
        assertArrayEquals(expected, actual.toArray());
    }
}


text:
<?php

/**
 * album actions.
 *
 * @package    sfSocial
 * @subpackage imagen
 * @author     Adrian Baez
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class BaseAlbumActions extends sfActions {
    public function executeShow(sfWebRequest $request) {
        $user = $this->getUser();
        if ($user->isAuthenticated()) {
            $this->album = Doctrine::getTable('Album_photo')->find($request->getParameter('id'));
            $this->forward404Unless($this->album, 'This album not exists');
            $this->user = $this->album->getUser();
            $this->sesUser = $user->getGuardUser();
        } else {
            return $this->redirect('@homepage');
        }
    }
    public function executeOrd(sfWebRequest $request) {
        $this->forward404Unless($request->isMethod(sfRequest::POST) || !$this->getUser()->isAuthenticated());
        $userId = $request->getParameter('userId');
        if ($userId == $this->getUser()->getGuardUser()->getId()) {
            $temp = explode(',', $request->getParameter('ord'));
            foreach ($temp as $value) {
                $value = explode('=', $value);
                $id = $value[0];
                $ord = $value[1];
                $album = Doctrine::getTable('Album_photo')->find($id);
                $album->set('ord', $ord);
                $album->save();
            }
            return $this->renderText('ok');
        } else {
            return $this->renderText('You do not have permission to do that');
        }
    }
    public function executeEditTitle(sfWebRequest $request) {
        $title =            $request->getParameter('value');
        $albumId =          $request->getParameter('albumId');
        $album =            Doctrine::getTable('Album_photo')->find($albumId);
        $albumProfileName = Album_photo::getProfileAlbumName();

        if ($this->getUser()->isAuthenticated() && $album->getUserId() == $this->getUser()->getGuardUser()->getId()) {
            if ($album->getName() != $albumProfileName && $title != $albumProfileName) {
                $album->name = $title;
                $album->save();
            }
        }
        return $this->renderText($album->getName());
    }
    public function executeDelete(sfWebRequest $request) {
        $albumId = $request->getParameter('albumId', false);
        $this->forward404Unless($albumId);
        $album = Doctrine::getTable('Album_photo')->find($albumId);
        $this->forward404Unless($album->exists());
        if ($this->getUser()->isAuthenticated() && $album->getUserId() == $this->getUser()->getGuardUser()->getId()) {
            return $this->renderText($album->delete());
        }
        return $this->renderText('You do not have permission to do that');
    }
}


text:
package won.bot.framework.extensions.textmessagecommand.command;

import won.protocol.model.Connection;

import java.util.function.BiConsumer;

/**
 * TextMessageCommand that checks if a message startsWith a certain String
 */
public final class StartsWithTextMessageCommand extends TextMessageCommand {
    private final String startsWithString;
    private final boolean trim;
    private final BiConsumer<Connection, String> action;

    /**
     * Creates a TextMessageCommand that checks if messages startWith the given
     * startsWithString (with trimming whitespace)
     *
     * @param commandSyntax syntax string for super.getUsageCommandMessage()
     * @param infoMessage info string for super.getUsageCommandMessage()
     * @param startsWithString commandString to check
     * @param action to execute if matchesCommmand is true
     */
    public StartsWithTextMessageCommand(String commandSyntax, String infoMessage, String startsWithString,
                    BiConsumer<Connection, String> action) {
        this(commandSyntax, infoMessage, startsWithString, true, action);
    }

    /**
     * Creates a TextMessageCommand that checks if messages startWith the given
     * startsWithString (trim whitespace depending on trim parameter)
     *
     * @param commandSyntax syntax string for super.getUsageCommandMessage()
     * @param infoMessage info string for super.getUsageCommandMessage()
     * @param startsWithString commandString to check
     * @param trim if whitespace should be trimmed or not
     * @param action to execute if matchesCommmand is true
     */
    public StartsWithTextMessageCommand(String commandSyntax, String infoMessage, String startsWithString, boolean trim,
                    BiConsumer<Connection, String> action) {
        super(commandSyntax, infoMessage);
        this.startsWithString = startsWithString;
        this.trim = trim;
        this.action = action;
    }

    /**
     * Check if message startsWith the startsWithString
     *
     * @param message message to check
     * @return true if the message startsWith the startsWithString (trim depending
     * on the state of the trim flag)
     */
    @Override
    public boolean matchesCommand(String message) {
        return message != null
                        && (trim ? message.trim().startsWith(startsWithString) : message.startsWith(startsWithString));
    }

    /**
     * Executes the Consumer method stored in action
     *
     * @param con connection that the message was sent in
     * @param message the whole message that matched the startsWithString so it is
     * possible to extract parts of the message string within the Consumer if need
     * be
     */
    public void execute(Connection con, String message) {
        if (this.action != null) {
            this.action.accept(con, message);
        } else {
            throw new UnsupportedOperationException(
                            "StartsWithTextMessageCommand is non executable, no BiConsumer action set");
        }
    }
}


text:
angular.module('Starscream.Controllers').controller('parentController', function ($scope, userService, $location, loginService, menuService) {
        var user = userService.GetUser();
        if (user) {
            loginService.SetLoggedIn(true);
        }

        $scope.userMenuBar = [];
        $scope.user = user;
        $scope.title = "Welcome";
        $scope.logout = function() {
            userService.RemoveUser();
            $scope.user = false;
            $location.path("/login");
            $scope.menu = [];
        };

  //  $scope.menu = menuService.menu;
         $scope.menu = menuService.getMenuForUser(user.claims || []);
});


text:
class WeNeedThings < ActiveRecord::Migration::Current
  def self.up
    create_table("things") do |t|
      t.column :content, :text
    end
  end

  def self.down
    drop_table "things"
  end
end


text:
package org.apache.tomcat.util.http.parser;

enum SkipResult {
    FOUND,
    NOT_FOUND,
    EOF
}


text:
<?php
/**
 * 统计controller
 *
 * @author zhaoguang
 * @version 1.0
 */
final class statistics_controller extends \base_controller
{
    /**
     * 统计model
     * @var statistics_model
     */
    private $statisticsModel;

    public function __construct()
    {
        parent::__construct();
        $this->statisticsModel = F::load_model('statistics');
    }

    function __destruct()
    {
        parent::__destruct();
        unset($this->statisticsModel);
    }

    /**
     * 获取使用CRM系统产生信息概况
     *
     * @param string $type 统计信息类型
     * @return array
     */
    public function overview() {
        $this->params = $this->require_params(array('type'));
        $callFunctionName = $this->params['type'];

        if (method_exists($this->statisticsModel, $callFunctionName)) {
            $this->returnData = $this->statisticsModel->$callFunctionName();
        }else throw new Exception('统计信息类型'.$this->params['type'].'无法识别', 110);

        F::rest()->show_result($this->returnData);
    }

    /**
     * 每日凌晨统计使用非法维修记录信息
     * @return void
     */
    public function illegalAccountCount() {
        #获取起至时间
        $date = date('Y-m-d');
        $startTime = strtotime($date);
        $endTime = strtotime('+1day', $startTime);

        #获取违规数据
        $list = F::db()->fetch_all('select count(id) as num, create_user_id from event where content like "%#维修%" and type != 3 and create_time between ? and ? and status = 1 group by create_user_id',
            array(date(TIMESTYLE, $startTime), date(TIMESTYLE, $endTime-1)));
        foreach ($list as $value) {
            $username = F::db()->query('select nickname from user_profile where user_id = ? limit 1', array($value['create_user_id']))->fetch_column('nickname');
            #写入错误日志文件
            file_put_contents('/home/wwwlogs/errorData/'.date('Y-m-d'), $username.' 违规书写维修记录'.$value['num'].'个'."\r\n", FILE_APPEND );
        }

        unset($list);
        F::rest()->show_result();
    }
}

?>


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Gibberidea zizyphi Tilak & Jadhav

### Remarks
null