text:
package com.bugil;

import org.andengine.engine.camera.Camera;
import org.andengine.entity.Entity;
import org.andengine.entity.primitive.Rectangle;
import org.andengine.entity.scene.background.AutoParallaxBackground;
import org.andengine.entity.scene.background.ParallaxBackground.ParallaxEntity;
import org.andengine.entity.scene.menu.MenuScene;
import org.andengine.entity.scene.menu.MenuScene.IOnMenuItemClickListener;
import org.andengine.entity.scene.menu.item.IMenuItem;
import org.andengine.entity.scene.menu.item.SpriteMenuItem;
import org.andengine.entity.scene.menu.item.decorator.ScaleMenuItemDecorator;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.util.GLState;

import com.bugil.SceneManager.SceneType;

import android.util.Log;
//import org.andengine.entity.sprite.ButtonSprite;
//import org.andengine.input.touch.TouchEvent;
//import android.view.MotionEvent;

public class MenuMainScene extends BaseScene implements IOnMenuItemClickListener
{
	//---------------------------------------------
	// VARIABLES
	//---------------------------------------------

	private MenuScene menuChildScene;

	private final int MENU_PLAY = 0;
	private final int MENU_HELP = 1;
	private final int MENU_SOUND = 2;

	AutoParallaxBackground pb;
	//---------------------------------------------
	// METHODS FROM SUPERCLASS
	//---------------------------------------------

	@Override
	public void createScene()
	{
		createBackground();
		createMenuChildScene();

        //resourcesManager.music.setLooping(true);
        //resourcesManager.music.play();
	}

	@Override
	public void onBackKeyPressed()
	{
		System.exit(0);
	}

	@Override
	public SceneType getSceneType()
	{
		return SceneType.SCENE_MENU;
	}

	@Override
	public void disposeScene()
	{
		this.detachSelf();
		this.dispose();
	}

	public boolean onMenuItemClicked(MenuScene pMenuScene, IMenuItem pMenuItem, float pMenuItemLocalX, float pMenuItemLocalY)
	{
		switch(pMenuItem.getID())
		{
		case MENU_PLAY:
			//Load Game Scene!
			Log.d("Semua Anggota: ", "aa");

			SceneManager.getInstance().loadGameScene(engine);
			return true;
		case MENU_HELP:
			//Load Game Scene!
			Log.d("Semua Anggota: ", "BB");

			SceneManager.getInstance().createHelpScene();
			return true;
		case MENU_SOUND:
			//Load Game Scene!
			Log.d("Semua Anggota: ", "BB");

			SceneManager.getInstance().createInfoScene();
			return true;
		default:
			return false;
		}
	}

	//---------------------------------------------
	// CLASS LOGIC
	//---------------------------------------------

	private void createBackground()
	{
		pb = new AutoParallaxBackground(0, 0, 0, 40);
		Entity clouds = new Rectangle(0, 0, 1000, 800, vbom);
        clouds.setAnchorCenter(0, 0);
		clouds.setAlpha(0f);
		clouds.attachChild(new Sprite(100, 140, resourcesManager.cloudRegion, vbom));
		clouds.attachChild(new Sprite(300, 350, resourcesManager.cloudRegion, vbom));

		clouds.attachChild(new Sprite(500, 200, resourcesManager.cloudRegion, vbom));
		clouds.attachChild(new Sprite(700, 300, resourcesManager.cloudRegion, vbom));
		clouds.attachChild(new Sprite(900, 170, resourcesManager.cloudRegion, vbom));

		ParallaxEntity pe = new ParallaxEntity(0.2f, clouds);

		pb.attachParallaxEntity(pe);

		setBackground(pb);

		attachChild(new Sprite(240, 400, resourcesManager.menu_background_region, vbom)
		{
    		@Override
            protected void preDraw(GLState pGLState, Camera pCamera)
    		{
                super.preDraw(pGLState, pCamera);
                pGLState.enableDither();
            }
		});
	}

	private void createMenuChildScene()
	{
		menuChildScene = new MenuScene(camera);
		menuChildScene.setPosition(0, 0);

		final IMenuItem playMenuItem = new ScaleMenuItemDecorator(new SpriteMenuItem(MENU_PLAY, resourcesManager.play_region, vbom), 1.2f, 1);
		final IMenuItem helpMenuItem = new ScaleMenuItemDecorator(new SpriteMenuItem(MENU_HELP, resourcesManager.help_region, vbom), 0.8f, 0.7f);
		final IMenuItem soundMenuItem = new ScaleMenuItemDecorator(new SpriteMenuItem(MENU_SOUND, resourcesManager.info_region, vbom), 0.8f, 0.7f);

		menuChildScene.addMenuItem(playMenuItem);
		menuChildScene.addMenuItem(helpMenuItem);
		menuChildScene.addMenuItem(soundMenuItem);

		menuChildScene.buildAnimations();
		menuChildScene.setBackgroundEnabled(false);

		playMenuItem.setPosition(250,240);
		helpMenuItem.setPosition(40,40);
		soundMenuItem.setPosition(444,40);

		menuChildScene.setOnMenuItemClickListener(this);

		setChildScene(menuChildScene);
	}
}


text:
<?php

namespace Terah\Saasu\Interfaces;

use Terah\Saasu\Values\RestableValue;

interface FetchOneInterface
{
    /**
     * @param $id
     * @return RestableValue
     * @throws \Exception
     */
    public function fetchOne($id);
}

redpajama_set_name: RedPajamaGithub


text:
/*!
 * harbor v2.16.0: A free WordPress theme for animal and pet rescue organizations
 * (c) 2016 Chris Ferdinandi
 * MIT License
 * https://github.com/cferdinandi/harbor-wp-theme
 * Open Source Credits: https://github.com/ftlabs/fastclick, https://github.com/toddmotto/fluidvids, http://photoswipe.com, http://masonry.desandro.com, http://imagesloaded.desandro.com
 */

(function (root, factory) {
	if ( typeof define === 'function' && define.amd ) {
		define([], factory(root));
	} else if ( typeof exports === 'object' ) {
		module.exports = factory(root);
	} else {
		root.petfinderSort = factory(root);
	}
})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {

	'use strict';

	//
	// Variables
	//

	var petfinderSort = {}; // Object for public APIs
	var supports = 'querySelector' in document && 'addEventListener' in root && 'classList' in document.createElement('_'); // Feature test
	var sessionID = 'petfinderSortStates'; // sessionStorage ID
	var settings, eventTimeout, states, pets, sortBreeds, sortAttributes, sortToggles, hideAll;

	// Default settings
	var defaults = {
		initClass: 'js-petfinder-sort',
		callback: function () {}
	};

	//
	// Methods
	//

	/**
	 * A simple forEach() implementation for Arrays, Objects and NodeLists.
	 * @private
	 * @author Todd Motto
	 * @link   https://github.com/toddmotto/foreach
	 * @param {Array|Object|NodeList} collection Collection of items to iterate
	 * @param {Function}              callback   Callback function for each iteration
	 * @param {Array|Object|NodeList} scope      Object/NodeList/Array that forEach is iterating over (aka `this`)
	 */
	var forEach = function ( collection, callback, scope ) {
		if ( Object.prototype.toString.call( collection ) === '[object Object]' ) {
			for ( var prop in collection ) {
				if ( Object.prototype.hasOwnProperty.call( collection, prop ) ) {
					callback.call( scope, collection[prop], prop, collection );
				}
			}
		} else {
			for ( var i = 0, len = collection.length; i < len; i++ ) {
				callback.call( scope, collection[i], i, collection );
			}
		}
	};

	/**
	 * Merge two or more objects. Returns a new object.
	 * @private
	 * @param {Boolean}  deep     If true, do a deep (or recursive) merge [optional]
	 * @param {Object}   objects  The objects to merge together
	 * @returns {Object}          Merged values of defaults and options
	 */
	var extend = function () {

		// Variables
		var extended = {};
		var deep = false;
		var i = 0;
		var length = arguments.length;

		// Check if a deep merge
		if ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) {
			deep = arguments[0];
			i++;
		}

		// Merge the object into the extended object
		var merge = function (obj) {
			for ( var prop in obj ) {
				if ( Object.prototype.hasOwnProperty.call( obj, prop ) ) {
					// If deep merge and property is an object, merge properties
					if ( deep && Object.prototype.toString.call(obj[prop]) === '[object Object]' ) {
						extended[prop] = extend( true, extended[prop], obj[prop] );
					} else {
						extended[prop] = obj[prop];
					}
				}
			}
		};

		// Loop through each object and conduct a merge
		for ( ; i < length; i++ ) {
			var obj = arguments[i];
			merge(obj);
		}

		return extended;

	};

	/**
	 * Get the closest matching element up the DOM tree.
	 * @private
	 * @param  {Element} elem     Starting element
	 * @param  {String}  selector Selector to match against (class, ID, data attribute, or tag)
	 * @return {Boolean|Element}  Returns null if not match found
	 */
	var getClosest = function ( elem, selector ) {

		// Variables
		var firstChar = selector.charAt(0);
		var attribute, value;

		// If selector is a data attribute, split attribute from value
		if ( firstChar === '[' ) {
			selector = selector.substr(1, selector.length - 2);
			attribute = selector.split( '=' );

			if ( attribute.length > 1 ) {
				value = true;
				attribute[1] = attribute[1].replace( /"/g, '' ).replace( /'/g, '' );
			}
		}

		// Get closest match
		for ( ; elem && elem !== document; elem = elem.parentNode ) {

			// If selector is a class
			if ( firstChar === '.' ) {
				if ( elem.classList.contains( selector.substr(1) ) ) {
					return elem;
				}
			}

			// If selector is an ID
			if ( firstChar === '#' ) {
				if ( elem.id === selector.substr(1) ) {
					return elem;
				}
			}

			// If selector is a data attribute
			if ( firstChar === '[' ) {
				if ( elem.hasAttribute( attribute[0] ) ) {
					if ( value ) {
						if ( elem.getAttribute( attribute[0] ) === attribute[1] ) {
							return elem;
						}
					} else {
						return elem;
					}
				}
			}

			// If selector is a tag
			if ( elem.tagName.toLowerCase() === selector ) {
				return elem;
			}

		}

		return null;

	};

	/**
	 * Save the current state of a checkbox
	 * @private
	 * @param  {Node} checkbox The checkbox
	 */
	var saveCheckedState = function ( checkbox ) {

		// If sessionStorage isn't supported, end method
		if ( !root.sessionStorage ) return;

		// Get checkbox target
		var name = checkbox.getAttribute( 'data-petfinder-sort-target' );

		// If checkbox isn't checked, save state in sessionStorage
		if ( checkbox.checked === false ) {
			states[name] = 'unchecked';
			sessionStorage.setItem( sessionID, JSON.stringify(states) );
			settings.callback( checkbox ); // Callback
			return;
		}

		// If checkbox is checked, remove state from sessionStorage
		delete states[name];
		sessionStorage.setItem( sessionID, JSON.stringify(states) );
		settings.callback( checkbox ); // Callback

	};

	/**
	 * Set checkbox state based on sessionStorage data
	 * @private
	 * @param  {Node} checkbox The checkbox
	 */
	var setCheckedState = function ( checkbox ) {

		// If sessionStorage isn't supported, end method
		if ( !root.sessionStorage ) return;

		// Get checkbox target and sessionStorage data
		var name = checkbox.getAttribute( 'data-petfinder-sort-target' );

		// If checkbox is in sessionStorage, update it's state
		if ( states && states[name] && states[name] === 'unchecked' ) {
			checkbox.checked = false;
		}

	};

	/**
	 * Get state of all checkboxes
	 * @private
	 */
	var getCheckedStates = function () {
		forEach(sortBreeds, function (checkbox) { setCheckedState( checkbox ); });
		forEach(sortAttributes, function (checkbox) { setCheckedState( checkbox ); });
		forEach(sortToggles, function (checkbox) { setCheckedState( checkbox ); });
	};

	/**
	 * Show or hide a node in the DOM
	 * @private
	 * @param  {Node}    elem  The node to show or hide
	 * @param  {Boolean} hide  If true, hide node. Otherwise show.
	 */
	var toggleVisibility = function ( elem, hide ) {
		if ( hide ) {
			elem.style.display = 'none';
			elem.style.visibility = 'hidden';
			return;
		}
		elem.style.display = 'block';
		elem.style.visibility = 'visible';
	};

	/**
	 * Toggle all checkboxes in a category
	 * @private
	 * @param  {Node} checkbox The checkbox
	 */
	var toggleAll = function ( checkbox ) {

		// Get checkbox targets
		var targets = document.querySelectorAll( checkbox.getAttribute( 'data-petfinder-sort-target' ) );

		// If checkbox is checked, select all checkboxes
		if ( checkbox.checked === true ) {
			forEach(targets, function (target) {
				target.checked = true;
				saveCheckedState( target );
			});
			return;
		}

		// If checkbox is unchecked, unselect all checkboxes
		forEach(targets, function (target) {
			target.checked = false;
			saveCheckedState( target );
		});

	};

	/**
	 * Sort pets based on checkbox selections
	 * @private
	 */
	var sortPets = function () {

		// Hide or show all pets
		forEach(pets, function (pet) {

			// If breed sorting is available, hide all pets by default
			if ( hideAll ) {
				toggleVisibility( pet, true );
				return;
			}

			// Otherwise, show all pets by default
			toggleVisibility( pet );

		});

		// If breed is checked, show matching pets
		forEach(sortBreeds, function (checkbox) {
			if ( checkbox.checked === true ) {
				var targets = document.querySelectorAll( checkbox.getAttribute( 'data-petfinder-sort-target' ) );
				forEach(targets, function (target) {
					toggleVisibility( target );
				});
			}
		});

		// If checkbox is unchecked, hide matching pets
		forEach(sortAttributes, function (checkbox) {
			if ( checkbox.checked === false ) {
				var targets = document.querySelectorAll( checkbox.getAttribute( 'data-petfinder-sort-target' ) );
				forEach(targets, function (target) {
					toggleVisibility( target, true );
				});
			}
		});

	};

	/**
	 * Show all pets and check all checkboxes
	 * @private
	 */
	var resetPets = function () {

		// Show all pets
		forEach(pets, function (pet) {
			toggleVisibility( pet );
		});

		// Check all breed checkboxes
		forEach(sortBreeds, function (checkbox) {
			checkbox.checked = true;
		});

		// Check all attribute checkboxes
		forEach(sortAttributes, function (checkbox) {
			checkbox.checked = true;
		});

		// Check all toggle checkboxes
		forEach(sortToggles, function (checkbox) {
			checkbox.checked = true;
		});

	};

	/**
	 * Handle click events
	 * @private
	 * @param {Event} event The click event
	 */
	var eventHandler = function (event) {

		// Get clicked object
		var toggle = event.target;
		var checkbox = getClosest(toggle, '[data-petfinder-sort]');

		// If a sort checkbox, sort pets
		if ( checkbox ) {

			// Save checkbox state
			saveCheckedState( checkbox );

			// If a toggle checkbox, toggle all
			if ( checkbox.getAttribute( 'data-petfinder-sort' )  === 'toggle' ) {
				toggleAll( checkbox );
			}

			// Sort pets
			sortPets();

		}

	};

	/**
	 * Destroy the current initialization.
	 * @public
	 */
	petfinderSort.destroy = function () {

		// If plugin isn't already initialized, stop
		if ( !settings ) return;

		// Remove init class for conditional CSS
		document.documentElement.classList.remove( settings.initClass );

		resetPets();

		// Remove event listeners
		document.removeEventListener('click', eventHandler, false);

		// Reset variables
		states = null;
		settings = null;
		eventTimeout = null;
		pets = null;
		sortBreeds = null;
		sortAttributes = null;
		sortToggles = null;
		hideAll = null;

	};

	/**
	 * Initialize Plugin
	 * @public
	 * @param {Object} options User settings
	 */
	petfinderSort.init = function ( options ) {

		// feature test
		if ( !supports ) return;

		// Destroy any existing initializations
		petfinderSort.destroy();

		// Variables
		settings = extend( true, defaults, options || {} ); // Merge user options with defaults
		pets = document.querySelectorAll( '.pf-pet' );
		sortBreeds = document.querySelectorAll( '[data-petfinder-sort="breeds"]' );
		sortAttributes = document.querySelectorAll( '[data-petfinder-sort="attributes"]' );
		sortToggles = document.querySelectorAll( '[data-petfinder-sort="toggle"]' );
		hideAll = sortBreeds.length === 0 ? false : true;
		if ( root.sessionStorage ) {
			states = sessionStorage.getItem( sessionID ) ? JSON.parse( sessionStorage.getItem( sessionID ) ) : {};
		}
		states = root.sessionStorage ? JSON.parse( sessionStorage.getItem( sessionID ) ) || {} : {};

		// Add class to HTML element to activate conditional CSS
		document.documentElement.classList.add( settings.initClass );

		// On page load, set checkbox states and run sort
		getCheckedStates();
		sortPets();

		// Listen for click events
		document.addEventListener('click', eventHandler, false);

	};

	//
	// Public APIs
	//

	return petfinderSort;

});
petfinderSort.init();


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

class View
{
	protected $template = null;
	protected $baseTemplate = 'base';

	function __construct() {
		$this->template = new Template( $this->baseTemplate );
	}

	public function render( bool $parse = true, bool $returnHTML = true ): string {
		return $this->template->render( $parse, $returnHTML );
	}

	public function lazyLoad( bool $parse = true ): void {
		$this->template->lazyLoad( $parse );
	}
}
?>


text:
import {isPresent} from './facade/lang';

export class ParseLocation {
  constructor(
      public file: ParseSourceFile, public offset: number, public line: number,
      public col: number) {}

  toString(): string {
    return isPresent(this.offset) ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;
  }
}

export class ParseSourceFile {
  constructor(public content: string, public url: string) {}
}

export class ParseSourceSpan {
  constructor(
      public start: ParseLocation, public end: ParseLocation, public details: string = null) {}

  toString(): string {
    return this.start.file.content.substring(this.start.offset, this.end.offset);
  }
}

export enum ParseErrorLevel {
  WARNING,
  FATAL
}

export class ParseError {
  constructor(
      public span: ParseSourceSpan, public msg: string,
      public level: ParseErrorLevel = ParseErrorLevel.FATAL) {}

  toString(): string {
    var source = this.span.start.file.content;
    var ctxStart = this.span.start.offset;
    var contextStr = '';
    var details = '';
    if (isPresent(ctxStart)) {
      if (ctxStart > source.length - 1) {
        ctxStart = source.length - 1;
      }
      var ctxEnd = ctxStart;
      var ctxLen = 0;
      var ctxLines = 0;

      while (ctxLen < 100 && ctxStart > 0) {
        ctxStart--;
        ctxLen++;
        if (source[ctxStart] == '\n') {
          if (++ctxLines == 3) {
            break;
          }
        }
      }

      ctxLen = 0;
      ctxLines = 0;
      while (ctxLen < 100 && ctxEnd < source.length - 1) {
        ctxEnd++;
        ctxLen++;
        if (source[ctxEnd] == '\n') {
          if (++ctxLines == 3) {
            break;
          }
        }
      }

      let context = source.substring(ctxStart, this.span.start.offset) + '[ERROR ->]' +
          source.substring(this.span.start.offset, ctxEnd + 1);
      contextStr = ` ("${context}")`;
    }
    if (this.span.details) {
      details = `, ${this.span.details}`;
    }
    return `${this.msg}${contextStr}: ${this.span.start}${details}`;
  }
}


text:
<?xml version="1.0"?>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>hc_staff</title>

  EMP0001
  Margaret Martin
  Accountant
  56,000
  <var>Female</var>
  <acronym title="Yes" xsi:noNamespaceSchemaLocation="Yes">1230 North Ave. Dallas, Texas 98551</acronym>

  EMP0002
  Martha Raynolds
<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]>
  Secretary
  35,000
  <var>Female</var>
  <acronym title="Yes" class="Yes" xsi:noNamespaceSchemaLocation="Yes"> Dallas,
 98554</acronym>

  EMP0003
  Roger
 Jones
  Department Manager
  100,000
  <var></var>
  <acronym title="Yes" class="No" id="_98553" xsi:noNamespaceSchemaLocation="Yes">PO Box 27 Irving, texas 98553</acronym>

  EMP0004
  Jeny Oconnor
  Personnel Director
  95,000
  <var>Female</var>
  <acronym title="Yes" class="Y" id="_98556" xsi:noNamespaceSchemaLocation="Yes">27 South Road. Dallas, Texas 98556</acronym>

  EMP0005
  Robert Myers
  Computer Specialist
  90,000
  <var>male</var>
  <acronym title="Yes" class="Yes" xsi:noNamespaceSchemaLocation="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>


text:
$publishVersion=$args[0]
$configDirectory = Split-Path $script:MyInvocation.MyCommand.Path

function substituteVersions($fromFilePath, $toFilePath, $packageId){
$fromFilePathFull = ($configDirectory + $fromFilePath)
[xml]$fromFile = Get-Content $fromFilePathFull
$version = $fromFile.SelectSingleNode("//packages/package[@id='" + $packageId+ "']").version

$toFilePathFull = ($configDirectory + $toFilePath)
[xml]$toFile = Get-Content $toFilePathFull
$toFile.SelectSingleNode("//package/metadata/dependencies/dependency[@id='" + $packageId + "']").version = $version
$toFile.Save($toFilePathFull)
}

function setCorePackageVersion($toFilePath){
  $toFilePathFull = ($configDirectory + $toFilePath)
  [xml]$toFile = Get-Content $toFilePathFull
  $toFile.SelectSingleNode("//package/metadata/dependencies/dependency[@id='Antler.Core']").version = "[" + $publishVersion +"]"
  $toFile.Save($toFilePathFull)
}

#nh
setCorePackageVersion "\nh\Antler.NHibernate.dll.nuspec"
substituteVersions "\..\src\main\Antler-NHibernate\packages.config" "\nh\Antler.NHibernate.dll.nuspec" "NHibernate"
substituteVersions "\..\src\main\Antler-NHibernate\packages.config" "\nh\Antler.NHibernate.dll.nuspec" "Iesi.Collections"
substituteVersions "\..\src\main\Antler-NHibernate\packages.config" "\nh\Antler.NHibernate.dll.nuspec" "FluentNHibernate"

#ef
setCorePackageVersion "\ef\Antler.EntityFramework.dll.nuspec"
substituteVersions "\..\src\main\Antler-EntityFramework\packages.config" "\ef\Antler.EntityFramework.dll.nuspec" "EntityFramework"

#linq2db
setCorePackageVersion "\linq2db\Antler.Linq2Db.dll.nuspec"
substituteVersions "\..\src\main\Antler-Linq2Db\packages.config" "\linq2db\Antler.Linq2Db.dll.nuspec" "linq2db"

#ef-sqlce
setCorePackageVersion "\ef-sqlce\Antler.EntityFramework.SqlCe.dll.nuspec"
substituteVersions "\..\src\main\Antler-EntityFramework-SqlCe\packages.config" "\ef-sqlce\Antler.EntityFramework.SqlCe.dll.nuspec" "EntityFramework"
substituteVersions "\..\src\main\Antler-EntityFramework-SqlCe\packages.config" "\ef-sqlce\Antler.EntityFramework.SqlCe.dll.nuspec" "EntityFramework.SqlServerCompact"
substituteVersions "\..\src\main\Antler-EntityFramework-SqlCe\packages.config" "\ef-sqlce\Antler.EntityFramework.SqlCe.dll.nuspec" "Microsoft.SqlServer.Compact"

#windsor
setCorePackageVersion "\windsor\Antler.Windsor.dll.nuspec"
substituteVersions "\..\src\main\Antler-Windsor\packages.config" "\windsor\Antler.Windsor.dll.nuspec" "Castle.Windsor"

#structuremap
setCorePackageVersion "\structuremap\Antler.StructureMap.dll.nuspec"
substituteVersions "\..\src\main\Antler-StructureMap\packages.config" "\structuremap\Antler.StructureMap.dll.nuspec" "structuremap"


text:
<?php

namespace Tests\Feature;

use Illuminate\Http\Response;
use Tests\TestCase;

/**
 * Class HomePageHandlerTest
 *
 * @group Handlers
 * @package Tests\Feature
 */
final class HomePageHandlerTest extends TestCase
{
    /** @test */
    public function it_shows_home_page()
    {
        $this->get("")
            ->assertStatus(Response::HTTP_OK)
            ->assertViewIs("home");
    }
}


text:
<?php
require '../PHPMailer/PHPMailerAutoload.php';
require '../passwords.php';

$name = $_POST["name"];
$email = $_POST["email"];
$subject = $_POST["subject"];
$message = $_POST["message"];
$mail = new PHPMailer;

// Set mailer to use SMTP
$mail->isSMTP();
// Specify main and backup SMTP servers
$mail->Host = 'mail.veblockparty.com';
// Enable SMTP authentication
$mail->SMTPAuth = true;
// SMTP username
$mail->Username = $webuser;
// SMTP password
$mail->Password = $webpass;
// Enable TLS encryption, `ssl` also accepted
$mail->SMTPSecure = 'tls';
// TCP port to connect to
$mail->Port = 587;

$mail->setFrom('website@veblockparty.com', 'Website Contact Page');

// Set email format to HTML
$mail->isHTML(true);

$mail->addAddress('contact@veblockparty.com');
$mail->Subject = $subject;
$mail->Body = "Message from " . $name . " (". $email . "):

" . $message;

$location = "Location: http://veblockparty.com/contact/index.php?text=";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    if(!$mail->send()) {
        header($location . "Message could not be sent. Mailer Error: " . $mail ->ErrorInfo);
    } else {
        header($location . "Success! Message has been sent.");
    }
}
else{
    header($location . "Please enter a valid email address");
}


text:
package com.palmintelligence.administrator.nethardnewsv001.mvp.bean;

import java.util.List;

/**
 * Created by Administrator on 2017/2/10 0010.
 */
public interface BeanDate<T> {
    void addData(List<T> datas);

    void error();

}


text:
layout: post
microblog: true
date: 2008-06-08 19:00 -0500
guid: http://bdougherty.micro.blog/2008/06/09/t830760483.html
---
I still don't understand why Apple's stock drops after EVERY TIME they announce something good...


text:
flask-apispec: Auto-documenting REST APIs for Flask
===================================================

Release v\ |version|. (:ref:`Changelog <changelog>`)

**flask-apispec** is a lightweight tool for building REST APIs in Flask. **flask-apispec** uses webargs_ for request parsing, marshmallow_ for response formatting, and apispec_ to automatically generate Swagger markup. You can use **flask-apispec** with vanilla Flask or a fuller-featured framework like Flask-RESTful_.

Guide
-----

.. toctree::
   :maxdepth: 2

   install
   usage
   api_reference

Project info
------------

.. toctree::
   :maxdepth: 1

   changelog
   license

.. _webargs: https://webargs.readthedocs.org/
.. _marshmallow: https://marshmallow.readthedocs.org/
.. _apispec: https://apispec.readthedocs.org/
.. _Flask-RESTful: https://flask-restful.readthedocs.org/


text:
"""Error classes for user model audits."""

from __future__ import annotations

from core import feconf
from core.jobs.types import base_validation_errors

class ModelIncorrectKeyError(base_validation_errors.BaseAuditError):
    """Error class for incorrect key in PendingDeletionRequestModel."""

    def __init__(self, model, incorrect_keys):
        message = 'contains keys %s are not allowed' % (incorrect_keys)
        super(ModelIncorrectKeyError, self).__init__(message, model)

class ModelExpiringError(base_validation_errors.BaseAuditError):
    """Error class for models that are expiring."""

    def __init__(self, model):
        message = 'mark model as deleted when older than %s days' % (
            feconf.PERIOD_TO_MARK_MODELS_AS_DELETED.days)
        super(ModelExpiringError, self).__init__(message, model)

class DraftChangeListLastUpdatedNoneError(
        base_validation_errors.BaseAuditError):
    """Error class for models with draft change list but draft change list
    last_updated is None.
    """

    def __init__(self, model):
        message = (
            'draft change list %s exists but draft change list '
            'last updated is None' % model.draft_change_list)
        super(DraftChangeListLastUpdatedNoneError, self).__init__(
            message, model)

class DraftChangeListLastUpdatedInvalidError(
        base_validation_errors.BaseAuditError):
    """Error class for models with invalid draft change list last_updated."""

    def __init__(self, model):
        message = (
            'draft change list last updated %s is greater than the time '
            'when job was run' % model.draft_change_list_last_updated)
        super(DraftChangeListLastUpdatedInvalidError, self).__init__(
            message, model)

class ArchivedModelNotMarkedDeletedError(
        base_validation_errors.BaseAuditError):
    """Error class for models which are archived but not deleted."""

    def __init__(self, model):
        message = 'model is archived but not marked as deleted'
        super(ArchivedModelNotMarkedDeletedError, self).__init__(message, model)


text:
package com.wake_e.adapt;

import java.util.List;
import com.wake_e.model.Location;
import com.wake_e.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ComptesAdapter extends BaseAdapter{

	List<Location> locations;
	LayoutInflater inflater;
	int index;
	ViewHolder holder;

	public ComptesAdapter(Context context, List<Location> locations) {
		super();
		inflater = LayoutInflater.from(context);
		this.locations = locations;
	}

	@Override
	public int getCount() {
		return locations.size();
	}

	@Override
	public Object getItem(int arg0) {
		return locations.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	private class ViewHolder {
		TextView name;
		TextView city;
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null) {
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.location_list, null);
		}

		holder.name = (TextView)convertView.findViewById(R.id.locationName);
		holder.name.setText(locations.get(position).getName());

		holder.city = (TextView)convertView.findViewById(R.id.locationCity);
		holder.city.setText(locations.get(position).getAddress());

		convertView.setTag(holder);
		holder = (ViewHolder) convertView.getTag();
		return convertView;
	}
}


text:
package com.robotium.solo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.regex.Pattern;
import com.robotium.solo.Solo.Config;
import android.app.Activity;
import android.app.Instrumentation;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.TextView;

/**
 * Contains web related methods. Examples are:
 * enterTextIntoWebElement(), getWebTexts(), getWebElements().
 *
 * @author Renas Reda, renas.reda@robotium.com
 *
 */

class WebUtils {

	private ViewFetcher viewFetcher;
	private Instrumentation inst;
	private ActivityUtils activityUtils;
	RobotiumWebClient robotiumWebCLient;
	WebElementCreator webElementCreator;
	WebChromeClient originalWebChromeClient = null;
	private Config config;

	/**
	 * Constructs this object.
	 *
	 * @param config the {@code Config} instance
	 * @param instrumentation the {@code Instrumentation} instance
	 * @param activityUtils the {@code ActivityUtils} instance
	 * @param viewFetcher the {@code ViewFetcher} instance
	 */

	public WebUtils(Config config, Instrumentation instrumentation, ActivityUtils activityUtils, ViewFetcher viewFetcher, Sleeper sleeper){
		this.config = config;
		this.inst = instrumentation;
		this.activityUtils = activityUtils;
		this.viewFetcher = viewFetcher;
		webElementCreator = new WebElementCreator(sleeper);
		robotiumWebCLient = new RobotiumWebClient(instrumentation, webElementCreator);
	}

	/**
	 * Returns {@code TextView} objects based on web elements shown in the present WebViews
	 *
	 * @param onlyFromVisibleWebViews true if only from visible WebViews
	 * @return an {@code ArrayList} of {@code TextViews}s created from the present {@code WebView}s
	 */

	public ArrayList<TextView> getTextViewsFromWebView(){
		boolean javaScriptWasExecuted = executeJavaScriptFunction("allTexts();");

		return createAndReturnTextViewsFromWebElements(javaScriptWasExecuted);
	}

	/**
	 * Creates and returns TextView objects based on WebElements
	 *
	 * @return an ArrayList with TextViews
	 */

	private ArrayList <TextView> createAndReturnTextViewsFromWebElements(boolean javaScriptWasExecuted){
		ArrayList<TextView> webElementsAsTextViews = new ArrayList<TextView>();

		if(javaScriptWasExecuted){
			for(WebElement webElement : webElementCreator.getWebElementsFromWebViews()){
				if(isWebElementSufficientlyShown(webElement)){
					RobotiumTextView textView = new RobotiumTextView(inst.getContext(), webElement.getText(), webElement.getLocationX(), webElement.getLocationY());
					webElementsAsTextViews.add(textView);
				}
			}
		}
		return webElementsAsTextViews;
	}

	/**
	 * Returns an ArrayList of WebElements currently shown in the active WebView.
	 *
	 * @param onlySufficientlyVisible true if only sufficiently visible {@link WebElement} objects should be returned
	 * @return an {@code ArrayList} of the {@link WebElement} objects shown in the active WebView
	 */

	public ArrayList<WebElement> getWebElements(boolean onlySufficientlyVisible){
		boolean javaScriptWasExecuted = executeJavaScriptFunction("allWebElements();");

		return getWebElements(javaScriptWasExecuted, onlySufficientlyVisible);
	}

	/**
	 * Returns an ArrayList of WebElements of the specified By object currently shown in the active WebView.
	 *
	 * @param by the By object. Examples are By.id("id") and By.name("name")
	 * @param onlySufficientlyVisible true if only sufficiently visible {@link WebElement} objects should be returned
	 * @return an {@code ArrayList} of the {@link WebElement} objects currently shown in the active WebView
	 */

	public ArrayList<WebElement> getWebElements(final By by, boolean onlySufficientlyVisbile){
		boolean javaScriptWasExecuted = executeJavaScript(by, false);

		if(config.useJavaScriptToClickWebElements){
			if(!javaScriptWasExecuted){
				return new ArrayList<WebElement>();
			}
			return webElementCreator.getWebElementsFromWebViews();
		}

		return getWebElements(javaScriptWasExecuted, onlySufficientlyVisbile);
	}

	/**
	 * Returns the sufficiently shown WebElements
	 *
	 * @param javaScriptWasExecuted true if JavaScript was executed
	 * @param onlySufficientlyVisible true if only sufficiently visible {@link WebElement} objects should be returned
	 * @return the sufficiently shown WebElements
	 */

	private ArrayList<WebElement> getWebElements(boolean javaScriptWasExecuted, boolean onlySufficientlyVisbile){
		ArrayList<WebElement> webElements = new ArrayList<WebElement>();

		if(javaScriptWasExecuted){
			for(WebElement webElement : webElementCreator.getWebElementsFromWebViews()){
				if(!onlySufficientlyVisbile){
					webElements.add(webElement);
				}
				else if(isWebElementSufficientlyShown(webElement)){
					webElements.add(webElement);
				}
			}
		}
		return webElements;
	}

	/**
	 * Prepares for start of JavaScript execution
	 *
	 * @return the JavaScript as a String
	 */

	private String prepareForStartOfJavascriptExecution(){
		webElementCreator.prepareForStart();

		WebChromeClient currentWebChromeClient = getCurrentWebChromeClient();

		if(currentWebChromeClient != null && !currentWebChromeClient.getClass().isAssignableFrom(RobotiumWebClient.class)){
			originalWebChromeClient = getCurrentWebChromeClient();
		}

		robotiumWebCLient.enableJavascriptAndSetRobotiumWebClient(viewFetcher.getCurrentViews(WebView.class, true), originalWebChromeClient);
		return getJavaScriptAsString();
	}

	/**
	 * Returns the current WebChromeClient through reflection
	 *
	 * @return the current WebChromeClient
	 *
	 */

	private WebChromeClient getCurrentWebChromeClient(){
		WebChromeClient currentWebChromeClient = null;

		Object currentWebView = viewFetcher.getFreshestView(viewFetcher.getCurrentViews(WebView.class, true));

		if (android.os.Build.VERSION.SDK_INT >= 16) {
			try{
				currentWebView = new Reflect(currentWebView).field("mProvider").out(Object.class);
			}catch(IllegalArgumentException ignored) {}
		}

		try{
			if (android.os.Build.VERSION.SDK_INT >= 19) {
				Object mClientAdapter = new Reflect(currentWebView).field("mContentsClientAdapter").out(Object.class);
				currentWebChromeClient = new Reflect(mClientAdapter).field("mWebChromeClient").out(WebChromeClient.class);
			}
			else {
				Object mCallbackProxy = new Reflect(currentWebView).field("mCallbackProxy").out(Object.class);
				currentWebChromeClient = new Reflect(mCallbackProxy).field("mWebChromeClient").out(WebChromeClient.class);
			}
		}catch(Exception ignored){}

		return currentWebChromeClient;
	}

	/**
	 * Enters text into a web element using the given By method
	 *
	 * @param by the By object e.g. By.id("id");
	 * @param text the text to enter
	 */

	public void enterTextIntoWebElement(final By by, final String text){
		if(by instanceof By.Id){
			executeJavaScriptFunction("enterTextById(\""+by.getValue()+"\", \""+text+"\");");
		}
		else if(by instanceof By.Xpath){
			executeJavaScriptFunction("enterTextByXpath(\""+by.getValue()+"\", \""+text+"\");");
		}
		else if(by instanceof By.CssSelector){
			executeJavaScriptFunction("enterTextByCssSelector(\""+by.getValue()+"\", \""+text+"\");");
		}
		else if(by instanceof By.Name){
			executeJavaScriptFunction("enterTextByName(\""+by.getValue()+"\", \""+text+"\");");
		}
		else if(by instanceof By.ClassName){
			executeJavaScriptFunction("enterTextByClassName(\""+by.getValue()+"\", \""+text+"\");");
		}
		else if(by instanceof By.Text){
			executeJavaScriptFunction("enterTextByTextContent(\""+by.getValue()+"\", \""+text+"\");");
		}
		else if(by instanceof By.TagName){
			executeJavaScriptFunction("enterTextByTagName(\""+by.getValue()+"\", \""+text+"\");");
		}
	}

	/**
	 * Executes JavaScript determined by the given By object
	 *
	 * @param by the By object e.g. By.id("id");
	 * @param shouldClick true if click should be performed
	 * @return true if JavaScript function was executed
	 */

	public boolean executeJavaScript(final By by, boolean shouldClick){
		if(by instanceof By.Id){
			return executeJavaScriptFunction("id(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		else if(by instanceof By.Xpath){
			return executeJavaScriptFunction("xpath(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		else if(by instanceof By.CssSelector){
			return executeJavaScriptFunction("cssSelector(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		else if(by instanceof By.Name){
			return executeJavaScriptFunction("name(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		else if(by instanceof By.ClassName){
			return executeJavaScriptFunction("className(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		else if(by instanceof By.Text){
			return executeJavaScriptFunction("textContent(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		else if(by instanceof By.TagName){
			return executeJavaScriptFunction("tagName(\""+by.getValue()+"\", \"" + String.valueOf(shouldClick) + "\");");
		}
		return false;
	}

	/**
	 * Executes the given JavaScript function
	 *
	 * @param function the function as a String
	 * @return true if JavaScript function was executed
	 */

	private boolean executeJavaScriptFunction(final String function){
		final WebView webView = viewFetcher.getFreshestView(viewFetcher.getCurrentViews(WebView.class, true));

		if(webView == null){
			return false;
		}

		final String javaScript = setWebFrame(prepareForStartOfJavascriptExecution());
		Activity activity = activityUtils.getCurrentActivity(false);
		if(activity != null){
		activity.runOnUiThread(new Runnable() {
			public void run() {
				if(webView != null){
					webView.loadUrl("javascript:" + javaScript + function);
				}
			}
		});
		}
		else{
			inst.runOnMainSync(new Runnable() {
			public void run() {
				if(webView != null){
					webView.loadUrl("javascript:" + javaScript + function);
				}
			}
		});
		}
		return true;
	}

	private String setWebFrame(String javascript){
		String frame = config.webFrame;

		if(frame.isEmpty() || frame.equals("document")){
			return javascript;
		}
		javascript = javascript.replaceAll(Pattern.quote("document, "), "document.getElementById(\""+frame+"\").contentDocument, ");
		javascript = javascript.replaceAll(Pattern.quote("document.body, "), "document.getElementById(\""+frame+"\").contentDocument, ");
		return javascript;
	}

	/**
	 * Returns true if the view is sufficiently shown
	 *
	 * @param view the view to check
	 * @return true if the view is sufficiently shown
	 */

	public final boolean isWebElementSufficientlyShown(WebElement webElement){
		final WebView webView = viewFetcher.getFreshestView(viewFetcher.getCurrentViews(WebView.class, true));
		final int[] xyWebView = new int[2];

		if(webView != null && webElement != null){
			webView.getLocationOnScreen(xyWebView);

			if(xyWebView[1] + webView.getHeight() > webElement.getLocationY())
				return true;
		}
		return false;
	}

	/**
	 * Splits a name by upper case.
	 *
	 * @param name the name to split
	 * @return a String with the split name
	 *
	 */

	public String splitNameByUpperCase(String name) {
		String [] texts = name.split("(?=\\p{Upper})");
		StringBuilder stringToReturn = new StringBuilder();

		for(String string : texts){

			if(stringToReturn.length() > 0) {
				stringToReturn.append(" " + string.toLowerCase());
			}
			else {
				stringToReturn.append(string.toLowerCase());
			}
		}
		return stringToReturn.toString();
	}

	/**
	 * Returns the JavaScript file RobotiumWeb.js as a String
	 *
	 * @return the JavaScript file RobotiumWeb.js as a {@code String}
	 */

	private String getJavaScriptAsString() {
		InputStream fis = getClass().getResourceAsStream("RobotiumWeb.js");
		StringBuffer javaScript = new StringBuffer();

		try {
			BufferedReader input =  new BufferedReader(new InputStreamReader(fis));
			String line = null;
			while (( line = input.readLine()) != null){
				javaScript.append(line);
				javaScript.append("\n");
			}
			input.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		return javaScript.toString();
	}
}


text:
package org.microbule.container.api;

public interface PluginListener<P> {
//----------------------------------------------------------------------------------------------------------------------
// Other Methods
//----------------------------------------------------------------------------------------------------------------------

    boolean registerPlugin(P plugin);

    void unregisterPlugin(P bean);
}


text:
/* TODO opencv can do scaling for some cases */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include "gstopencvvideofilter.h"
#include "gstopencvutils.h"
#include <opencv2/core.hpp>

GST_DEBUG_CATEGORY_STATIC (gst_opencv_video_filter_debug);
#define GST_CAT_DEFAULT gst_opencv_video_filter_debug

/* Filter signals and args */
enum
{
  /* FILL ME */
  LAST_SIGNAL
};

enum
{
  PROP_0
};

#define parent_class gst_opencv_video_filter_parent_class
G_DEFINE_ABSTRACT_TYPE (GstOpencvVideoFilter, gst_opencv_video_filter,
    GST_TYPE_VIDEO_FILTER);

static void gst_opencv_video_filter_set_property (GObject * object,
    guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_opencv_video_filter_get_property (GObject * object,
    guint prop_id, GValue * value, GParamSpec * pspec);

static GstFlowReturn gst_opencv_video_filter_transform_frame (GstVideoFilter *
    trans, GstVideoFrame * inframe, GstVideoFrame * outframe);
static GstFlowReturn gst_opencv_video_filter_transform_frame_ip (GstVideoFilter
    * trans, GstVideoFrame * frame);

static gboolean gst_opencv_video_filter_set_info (GstVideoFilter * trans,
    GstCaps * incaps, GstVideoInfo * in_info, GstCaps * outcaps,
    GstVideoInfo * out_info);

/* Clean up */
static void
gst_opencv_video_filter_finalize (GObject * obj)
{
  GstOpencvVideoFilter *transform = GST_OPENCV_VIDEO_FILTER (obj);

  transform->cvImage.release ();
  transform->out_cvImage.release ();

  G_OBJECT_CLASS (parent_class)->finalize (obj);
}

static void
gst_opencv_video_filter_class_init (GstOpencvVideoFilterClass * klass)
{
  GObjectClass *gobject_class;
  GstVideoFilterClass *vfilter_class;

  gobject_class = (GObjectClass *) klass;
  vfilter_class = (GstVideoFilterClass *) klass;

  GST_DEBUG_CATEGORY_INIT (gst_opencv_video_filter_debug,
      "opencvbasetransform", 0, "opencvbasetransform element");

  gobject_class->finalize =
      GST_DEBUG_FUNCPTR (gst_opencv_video_filter_finalize);
  gobject_class->set_property = gst_opencv_video_filter_set_property;
  gobject_class->get_property = gst_opencv_video_filter_get_property;

  vfilter_class->transform_frame = gst_opencv_video_filter_transform_frame;
  vfilter_class->transform_frame_ip =
      gst_opencv_video_filter_transform_frame_ip;
  vfilter_class->set_info = gst_opencv_video_filter_set_info;
}

static void
gst_opencv_video_filter_init (GstOpencvVideoFilter * transform)
{
}

static GstFlowReturn
gst_opencv_video_filter_transform_frame (GstVideoFilter * trans,
    GstVideoFrame * inframe, GstVideoFrame * outframe)
{
  GstOpencvVideoFilter *transform;
  GstOpencvVideoFilterClass *fclass;
  GstFlowReturn ret;

  transform = GST_OPENCV_VIDEO_FILTER (trans);
  fclass = GST_OPENCV_VIDEO_FILTER_GET_CLASS (transform);

  g_return_val_if_fail (fclass->cv_trans_func != NULL, GST_FLOW_ERROR);

  transform->cvImage.data = (unsigned char *) inframe->data[0];
  transform->cvImage.datastart = (unsigned char *) inframe->data[0];
  transform->out_cvImage.data = (unsigned char *) outframe->data[0];
  transform->out_cvImage.datastart = (unsigned char *) outframe->data[0];
  ret = fclass->cv_trans_func (transform, inframe->buffer, transform->cvImage,
      outframe->buffer, transform->out_cvImage);

  return ret;
}

static GstFlowReturn
gst_opencv_video_filter_transform_frame_ip (GstVideoFilter * trans,
    GstVideoFrame * frame)
{
  GstOpencvVideoFilter *transform;
  GstOpencvVideoFilterClass *fclass;
  GstFlowReturn ret;

  transform = GST_OPENCV_VIDEO_FILTER (trans);
  fclass = GST_OPENCV_VIDEO_FILTER_GET_CLASS (transform);

  g_return_val_if_fail (fclass->cv_trans_ip_func != NULL, GST_FLOW_ERROR);

  transform->cvImage.data = (unsigned char *) frame->data[0];
  transform->cvImage.datastart = (unsigned char *) frame->data[0];

  ret = fclass->cv_trans_ip_func (transform, frame->buffer, transform->cvImage);

  return ret;
}

static gboolean
gst_opencv_video_filter_set_info (GstVideoFilter * trans, GstCaps * incaps,
    GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
{
  GstOpencvVideoFilter *transform = GST_OPENCV_VIDEO_FILTER (trans);
  GstOpencvVideoFilterClass *klass =
      GST_OPENCV_VIDEO_FILTER_GET_CLASS (transform);
  gint in_width, in_height;
  int in_cv_type;
  gint out_width, out_height;
  int out_cv_type;
  GError *in_err = NULL;
  GError *out_err = NULL;

  if (!gst_opencv_cv_mat_params_from_video_info (in_info, &in_width,
          &in_height, &in_cv_type, &in_err)) {
    GST_WARNING_OBJECT (transform, "Failed to parse input caps: %s",
        in_err->message);
    g_error_free (in_err);
    return FALSE;
  }

  if (!gst_opencv_cv_mat_params_from_video_info (out_info, &out_width,
          &out_height, &out_cv_type, &out_err)) {
    GST_WARNING_OBJECT (transform, "Failed to parse output caps: %s",
        out_err->message);
    g_error_free (out_err);
    return FALSE;
  }

  if (klass->cv_set_caps) {
    if (!klass->cv_set_caps (transform, in_width, in_height, in_cv_type,
            out_width, out_height, out_cv_type))
      return FALSE;
  }

  transform->cvImage.create (cv::Size (in_width, in_height), in_cv_type);
  transform->out_cvImage.create (cv::Size (out_width, out_height), out_cv_type);

  gst_base_transform_set_in_place (GST_BASE_TRANSFORM (transform),
      transform->in_place);
  return TRUE;
}

static void
gst_opencv_video_filter_set_property (GObject * object, guint prop_id,
    const GValue * value, GParamSpec * pspec)
{
  switch (prop_id) {
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}

static void
gst_opencv_video_filter_get_property (GObject * object, guint prop_id,
    GValue * value, GParamSpec * pspec)
{
  switch (prop_id) {
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}

void
gst_opencv_video_filter_set_in_place (GstOpencvVideoFilter * transform,
    gboolean ip)
{
  transform->in_place = ip;
  gst_base_transform_set_in_place (GST_BASE_TRANSFORM (transform), ip);
}


text:
Nginx (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Window..

> [wikipedia.org/wiki/Nginx](https://en.wikipedia.org/wiki/Nginx)

%%LOGO%%

# How to use this image

## hosting some simple static content

```console
$ docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx
```

Alternatively, a simple `Dockerfile` can be used to generate a new image that includes the necessary content (which is a much cleaner solution than the bind mount above):

```dockerfile
FROM nginx
COPY static-html-directory /usr/share/nginx/html
```

Place this file in the same directory as your directory of content ("static-html-directory"), run `docker build -t some-content-nginx .`, then start your container:

```console
$ docker run --name some-nginx -d some-content-nginx
```

## exposing the port

```console
$ docker run --name some-nginx -d -p 8080:80 some-content-nginx
```

Then you can hit `http://localhost:8080` or `http://host-ip:8080` in your browser.

## complex configuration

```console
$ docker run --name some-nginx -v /some/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
```

For information on the syntax of the Nginx configuration files, see [the official documentation](http://nginx.org/en/docs/) (specifically the [Beginner's Guide](http://nginx.org/en/docs/beginners_guide.html#conf_structure)).

Be sure to include `daemon off;` in your custom configuration to ensure that Nginx stays in the foreground so that Docker can track the process properly (otherwise your container will stop immediately after starting)!

If you wish to adapt the default configuration, use something like the following to copy it from a running Nginx container:

```console
$ docker cp some-nginx:/etc/nginx/nginx.conf /some/nginx.conf
```

As above, this can also be accomplished more cleanly using a simple `Dockerfile`:

```dockerfile
FROM nginx
COPY nginx.conf /etc/nginx/nginx.conf
```

Then, build with `docker build -t some-custom-nginx .` and run:

```console
$ docker run --name some-nginx -d some-custom-nginx
```


text:
#include <debug.h>
#include <platform.h>
#include <qgic.h>
#include <qtimer.h>
#include <board.h>
#include <qpic_nand.h>
#include <mmu.h>
#include <arch/arm/mmu.h>
#include <platform/iomap.h>
#include <target.h>
#include <smem.h>
#include <reg.h>
#include <board.h>
#include <boot_stats.h>

extern struct smem_ram_ptable* target_smem_ram_ptable_init();

#define MB                                  (1024*1024)

#define MSM_IOMAP_SIZE                      ((MSM_IOMAP_END - MSM_IOMAP_BASE)/MB)

/* LK memory - Strongly ordered, executable */
#define LK_MEMORY                             (MMU_MEMORY_TYPE_NORMAL | \
                                              MMU_MEMORY_AP_READ_WRITE)
/* Scratch memory - Strongly ordered, non-executable */
#define SCRATCH_MEMORY                        (MMU_MEMORY_TYPE_NORMAL | \
                                              MMU_MEMORY_AP_READ_WRITE | MMU_MEMORY_XN)
/* Peripherals - shared device */
#define IOMAP_MEMORY                          (MMU_MEMORY_TYPE_DEVICE_SHARED | \
                                              MMU_MEMORY_AP_READ_WRITE | MMU_MEMORY_XN)

#define SCRATCH_REGION1_VIRT_START            (MEMBASE + MEMSIZE)
#define SCRATCH_REGION2_VIRT_START            (SCRATCH_REGION1_VIRT_START + \
                                              (SCRATCH_REGION1_SIZE))

#define SDRAM_BANK0_LAST_FIXED_ADDR           (SCRATCH_REGION2 + SCRATCH_REGION2_SIZE)

/* Map all the accesssible memory according to the following rules:
 * 1. Map 1MB from MSM_SHARED_BASE with 1 -1 mapping.
 * 2. Map MEMBASE - MEMSIZE with 1 -1 mapping.
 * 3. Map all the scratch regions immediately after Appsbl memory.
 *     Virtual addresses start right after Appsbl Virtual address.
 * 4. Map all the IOMAP space with 1 - 1 mapping.
 * 5. Map all the rest of the SDRAM/ IMEM regions as 1 -1.
 */
mmu_section_t mmu_section_table[] = {
/*   Physical addr,         Virtual addr,               Size (in MB),              Flags   */
	{MSM_SHARED_BASE,       MSM_SHARED_BASE,            1,                         SCRATCH_MEMORY},
	{MEMBASE,               MEMBASE,                    MEMSIZE / MB,              LK_MEMORY},
	{SCRATCH_REGION1,       SCRATCH_REGION1_VIRT_START, SCRATCH_REGION1_SIZE / MB, SCRATCH_MEMORY},
	{SCRATCH_REGION2,       SCRATCH_REGION2_VIRT_START, SCRATCH_REGION2_SIZE / MB, SCRATCH_MEMORY},
	{MSM_IOMAP_BASE,        MSM_IOMAP_BASE,             MSM_IOMAP_SIZE,            IOMAP_MEMORY},
};

/* Boot timestamps */
#define BS_INFO_OFFSET     (0x6B0)
#define BS_INFO_ADDR_V1    (MSM_SHARED_IMEM_BASE    + BS_INFO_OFFSET)
#define BS_INFO_ADDR_V2    (MSM_SHARED_IMEM_BASE_V2 + BS_INFO_OFFSET)

void platform_early_init(void)
{
	/* Initialize board identifier data */
	board_init();

	/* Initialize clock driver */
	platform_clock_init();

	/* Initialize interrupt controller */
	qgic_init();

	/* timer */
	qtimer_init();
}

void platform_init(void)
{
	dprintf(INFO, "platform_init()\n");
}

static uint32_t platform_get_sclk_count(void)
{
	return readl(MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL);
}

static uint32_t kernel_load_start;
void bs_set_timestamp(enum bs_entry bs_id)
{
	void *bs_imem;
	uint32_t soc_ver = board_soc_version();

	if (bs_id >= BS_MAX) {
		dprintf(CRITICAL, "bad bs id: %u, max: %u\n", bs_id, BS_MAX);
		ASSERT(0);
	}

	if (bs_id == BS_KERNEL_LOAD_START) {
		kernel_load_start = platform_get_sclk_count();
		return;
	}

	if (soc_ver < BOARD_SOC_VERSION2)
		bs_imem = (void *)BS_INFO_ADDR_V1;
	else
		bs_imem = (void *)BS_INFO_ADDR_V2;

	if(bs_id == BS_KERNEL_LOAD_DONE)
		writel(platform_get_sclk_count() - kernel_load_start,
			   bs_imem + (sizeof(uint32_t) * BS_KERNEL_LOAD_TIME));
	else
		writel(platform_get_sclk_count(),
			   bs_imem + (sizeof(uint32_t) * bs_id));
}

void platform_uninit(void)
{
	qtimer_uninit();
	qpic_nand_uninit();
}

void platform_init_mmu_mappings(void)
{
	struct smem_ram_ptable *ram_ptable;
	uint32_t i;
	uint32_t sections;
	uint32_t table_size = ARRAY_SIZE(mmu_section_table);
	uint32_t last_fixed_addr = SDRAM_BANK0_LAST_FIXED_ADDR;

	ram_ptable = target_smem_ram_ptable_init();

	/* Configure the MMU page entries for SDRAM and IMEM memory read
	   from the smem ram table*/
	for(i = 0; i < ram_ptable->len; i++)
	{
		if((ram_ptable->parts[i].category == IMEM) || (ram_ptable->parts[i].category == SDRAM))
		{
			/* First bank info is added according to the static table - mmu_section_table. */
			if((ram_ptable->parts[i].start <= last_fixed_addr) &&
			   ((ram_ptable->parts[i].start + ram_ptable->parts[i].size) >= last_fixed_addr))
					continue;

			/* Check to ensure that start address is 1MB aligned */
			ASSERT((ram_ptable->parts[i].start & 0xFFFFF) == 0);

			sections = (ram_ptable->parts[i].size) / MB;

			while(sections--)
			{
				arm_mmu_map_section(ram_ptable->parts[i].start + sections * MB,
									ram_ptable->parts[i].start + sections * MB,
									SCRATCH_MEMORY);
			}
		}
    }

	/* Configure the MMU page entries for memory read from the
	   mmu_section_table */
	for (i = 0; i < table_size; i++)
	{
		sections = mmu_section_table[i].num_of_sections;

		while (sections--)
		{
			arm_mmu_map_section(mmu_section_table[i].paddress + sections * MB,
								mmu_section_table[i].vaddress + sections * MB,
								mmu_section_table[i].flags);
		}
	}
}

addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr)
{
	uint32_t paddr;
	uint32_t table_size = ARRAY_SIZE(mmu_section_table);
	uint32_t limit;

	for (uint32_t i = 0; i < table_size; i++)
	{
		limit = (mmu_section_table[i].num_of_sections * MB) - 0x1;

		if (virt_addr >= mmu_section_table[i].vaddress &&
			virt_addr <= (mmu_section_table[i].vaddress + limit))
		{
				paddr = mmu_section_table[i].paddress + (virt_addr - mmu_section_table[i].vaddress);
				return paddr;
		}
	}
	/* No special mapping found.
	 * Assume 1-1 mapping.
	 */
	 paddr = virt_addr;

	return paddr;
}

addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr)
{
	uint32_t vaddr;
	uint32_t table_size = ARRAY_SIZE(mmu_section_table);
	uint32_t limit;

	for (uint32_t i = 0; i < table_size; i++)
	{
		limit = (mmu_section_table[i].num_of_sections * MB) - 0x1;

		if (phys_addr >= mmu_section_table[i].paddress &&
			phys_addr <= (mmu_section_table[i].paddress + limit))
		{
				vaddr = mmu_section_table[i].vaddress + (phys_addr - mmu_section_table[i].paddress);
				return vaddr;
		}
	}

	/* No special mapping found.
	 * Assume 1-1 mapping.
	 */
	 vaddr = phys_addr;

	return vaddr;
}

/* Do not use default identitiy mappings. */
int platform_use_identity_mmu_mappings(void)
{
	return 0;
}


text:
$NEW_PROJECT_SLUG
========================

* [What is this?](#what-is-this)
* [Assumptions](#assumptions)
* [What's in here?](#whats-in-here)
* [Bootstrap the project](#bootstrap-the-project)
* [Hide project secrets](#hide-project-secrets)
* [Save media assets](#save-media-assets)
* [Add a page to the site](#add-a-page-to-the-site)
* [Run the project](#run-the-project)
* [COPY configuration](#copy-configuration)
* [COPY editing](#copy-editing)
* [Open Linked Google Spreadsheet](#open-linked-google-spreadsheet)
* [Arbitrary Google Docs](#arbitrary-google-docs)
* [Deploy to graphics staging server](#deploy-to-graphics-staging-server)
* [Deploy to graphics production server](#deploy-to-graphics-production-server)
* [Install cron jobs](#install-cron-jobs)
* [Install web services](#install-web-services)
* [Run a remote fab command](#run-a-remote-fab-command)
* [Report analytics](#report-analytics)

What is this?
-------------

This is a St. Louis Post-Dispatch interactive project, built using a modified version of NPR's [app template](https://github.com/nprapps/app-template/)

Assumptions
-----------

The following things are assumed to be true in this documentation.

* You are running Mac OS X.
* You have installed Python 3, via Homebrew
* You have installed Node v14, via Homebrew
* You have [virtualenv](https://pypi.python.org/pypi/virtualenv) and [virtualenvwrapper](https://pypi.python.org/pypi/virtualenvwrapper) installed and working.

If you need help to set up your Mac for coding/development, see NPR's [development environment blog post](http://blog.apps.npr.org/2013/06/06/how-to-setup-a-developers-environment.html).

What's in here?
---------------

The project contains the following folders and important files:

* ``confs`` -- Server configuration files for nginx and uwsgi. Edit the templates then ``fab <ENV> servers.render_confs``, don't edit anything in ``confs/rendered`` directly.
* ``data`` -- Data files, such as those used to generate HTML.
* ``fabfile`` -- [Fabric](http://docs.fabfile.org/en/latest/) commands for automating setup, deployment, data processing, etc.
* ``etc`` -- Miscellaneous scripts and metadata for project bootstrapping.
* ``jst`` -- Javascript ([Underscore.js](http://documentcloud.github.com/underscore/#template)) templates.
* ``less`` -- [LESS](http://lesscss.org/) files, will be compiled to CSS and concatenated for deployment.
* ``templates`` -- HTML ([Jinja2](http://jinja.pocoo.org/docs/)) templates, to be compiled locally.
* ``tests`` -- Python unit tests.
* ``www`` -- Static and compiled assets to be deployed. (a.k.a. "the output")
* ``app.py`` -- A [Flask](http://flask.pocoo.org/) app for rendering the project locally.
* ``app_config.py`` -- Global project configuration for scripts, deployment, etc.
* ``crontab`` -- Cron jobs to be installed as part of the project.
* ``public_app.py`` -- A [Flask](http://flask.pocoo.org/) app for running server-side code.
* ``render_utils.py`` -- Code supporting template rendering.
* ``requirements3.txt`` -- Python3 requirements.
* ``static.py`` -- Static Flask views used in both ``app.py`` and ``public_app.py``.

Bootstrap the project
---------------------

Node.js is required for the static asset pipeline. If you don't already have it, get it like this:

```
brew install node
curl https://npmjs.org/install.sh | sh
```

Then bootstrap the project:

```
cd $NEW_PROJECT_SLUG
mkvirtualenv $NEW_PROJECT_SLUG
pip install -r requirements3.txt
npm install
fab update
```

Hide project secrets
--------------------

Project secrets should **never** be stored in ``app_config.py`` or anywhere else in the repository. They will be leaked to the client if you do. Instead, always store passwords, keys, etc. in environment variables and document that they are needed here in the README.

Any environment variable that starts with ``$PROJECT_SLUG_`` will be automatically loaded when ``app_config.get_secrets()`` is called.

Save media assets
-----------------

Large media assets (images, videos, audio) are synced with an Amazon S3 bucket specified in ``app_config.ASSETS_S3_BUCKET`` in a folder with the name of the project. (This bucket should not be the same as any of your ``app_config.PRODUCTION_S3_BUCKETS`` or ``app_config.STAGING_S3_BUCKETS``.) This allows everyone who works on the project to access these assets without storing them in the repo, giving us faster clone times and the ability to open source our work.

Syncing these assets requires running a couple different commands at the right times. When you create new assets or make changes to current assets that need to get uploaded to the server, run ```fab assets.sync```. This will do a few things:

* If there is an asset on S3 that does not exist on your local filesystem it will be downloaded.
* If there is an asset on that exists on your local filesystem but not on S3, you will be prompted to either upload (type "u") OR delete (type "d") your local copy.
* You can also upload all local files (type "la") or delete all local files (type "da"). Type "c" to cancel if you aren't sure what to do.
* If both you and the server have an asset and they are the same, it will be skipped.
* If both you and the server have an asset and they are different, you will be prompted to take either the remote version (type "r") or the local version (type "l").
* You can also take all remote versions (type "ra") or all local versions (type "la"). Type "c" to cancel if you aren't sure what to do.

Unfortunantely, there is no automatic way to know when a file has been intentionally deleted from the server or your local directory. When you want to simultaneously remove a file from the server and your local environment (i.e. it is not needed in the project any longer), run ```fab assets.rm:"www/assets/file_name_here.jpg"```

Adding a page to the site
-------------------------

A site can have any number of rendered pages, each with a corresponding template and view. To create a new one:

* Add a template to the ``templates`` directory. Ensure it extends ``_base.html``.
* Add a corresponding view function to ``app.py``. Decorate it with a route to the page name, i.e. ``@app.route('/filename.html')``
* By convention only views that end with ``.html`` and do not start with ``_``  will automatically be rendered when you call ``fab render``.

Run the project
---------------

A flask app is used to run the project locally. It will automatically recompile templates and assets on demand.

```
workon $PROJECT_SLUG
fab app
```

Visit [localhost:8000](https://localhost:8000) in your browser.

COPY configuration
------------------

This app uses a Google Spreadsheet for a simple key/value store that provides an editing workflow.

To access the Google doc, you'll need to create a Google API project via the [Google developer console](http://console.developers.google.com).

Enable the Drive API for your project and create a "web application" client ID.

For the redirect URIs use:

* `https://localhost:8000/authenticate/`
* `https://127.0.0.1:8000/authenticate`
* `https://localhost:8888/authenticate/`
* `https://127.0.0.1:8888/authenticate`

For the Javascript origins use:

* `https://localhost:8000`
* `https://127.0.0.1:8000`
* `https://localhost:8888`
* `https://127.0.0.1:8888`

You'll also need to set some environment variables:

```
export GOOGLE_OAUTH_CLIENT_ID="something-something.apps.googleusercontent.com"
export GOOGLE_OAUTH_CONSUMER_SECRET="bIgLonGStringOfCharacT3rs"
export AUTHOMATIC_SALT="jAmOnYourKeyBoaRd"
```

Note that `AUTHOMATIC_SALT` can be set to any random string. It's just cryptographic salt for the authentication library we use.

Once set up, run `fab app` and visit `http://localhost:8000` in your browser. If authentication is not configured, you'll be asked to allow the application for read-only access to Google drive, the account profile, and offline access on behalf of one of your Google accounts. This should be a one-time operation across all app-template projects.

It is possible to grant access to other accounts on a per-project basis by changing `GOOGLE_OAUTH_CREDENTIALS_PATH` in `app_config.py`.

COPY editing
------------

View the [sample copy spreadsheet](https://docs.google.com/spreadsheet/pub?key=0AlXMOHKxzQVRdHZuX1UycXplRlBfLVB0UVNldHJYZmc#gid=0).

This document is specified in ``app_config`` with the variable ``COPY_GOOGLE_DOC_KEY``. To use your own spreadsheet, change this value to reflect your document's key. (The long string of random looking characters in your Google Docs URL. For example: ``1DiE0j6vcCm55Dyj_sV5OJYoNXRRhn_Pjsndba7dVljo``)

A few things to note:

* If there is a column called ``key``, there is expected to be a column called ``value`` and rows will be accessed in templates as key/value pairs
* Rows may also be accessed in templates by row index using iterators (see below)
* You may have any number of worksheets
* This document must be "published to the web" using Google Docs' interface

The app template is outfitted with a few ``fab`` utility functions that make pulling changes and updating your local data easy.

To update the latest document, simply run:

```
fab text
```

Note: ``text.update`` runs automatically whenever ``fab render`` is called.

At the template level, Jinja maintains a ``COPY`` object that you can use to access your values in the templates. Using our example sheet, to use the ``byline`` key in ``templates/index.html``:

```
{{ COPY.attribution.byline }}
```

More generally, you can access anything defined in your Google Doc like so:

```
{{ COPY.sheet_name.key_name }}
```

You may also access rows using iterators. In this case, the column headers of the spreadsheet become keys and the row cells values. For example:

```
{% for row in COPY.sheet_name %}
{{ row.column_one_header }}
{{ row.column_two_header }}
{% endfor %}
```

When naming keys in the COPY document, please attempt to group them by common prefixes and order them by appearance on the page. For instance:

```
title
byline
about_header
about_body
about_url
download_label
download_url
```

Open Linked Google Spreadsheet
------------------------------
Want to edit/view the app's linked google spreadsheet, we got you covered.
 We have created a simple Fabric task ```spreadsheet```. It will try to find and open the app's linked google spreadsheet on your default browser.
 ```
fab spreadsheet
```
 If you are working with other arbitraty google docs that are not involved with the COPY rig you can pass a key as a parameter to have that spreadsheet opened instead on your browser
 ```
fab spreadsheet:$GOOGLE_DOC_KEY
```
 For example:
 ```
fab spreadsheet:12_F0yhsXEPN1w3GOlQB4_NKGadXiRLOa9l-HQu5jSL8
// Will open 270 project number-crunching spreadsheet
```

Arbitrary Google Docs
----------------------

Sometimes, our projects need to read data from a Google Doc that's not involved with the COPY rig. In this case, we've got a helper function for you to download an arbitrary Google spreadsheet.

This solution will download the uncached version of the document, unlike those methods which use the "publish to the Web" functionality baked into Google Docs. Published versions can take up to 15 minutes up update!

Make sure you're authenticated, then call `oauth.get_document(key, file_path)`.

Here's an example of what you might do:

```
from copytext import Copy
from oauth import get_document

def read_my_google_doc():
    file_path = 'data/extra_data.xlsx'
    get_document('0AlXMOHKxzQVRdHZuX1UycXplRlBfLVB0UVNldHJYZmc', file_path)
    data = Copy(file_path)

    for row in data['example_list']:
        print '%s: %s' % (row['term'], row['definition'])

read_my_google_doc()
```

Deploy to graphics staging server
---------------------------------

```
fab staging main deploy
```

Deploy to graphics production server
------------------------------------

```
fab production main deploy
```

Install cron jobs
-----------------

Cron jobs are defined in the file `crontab`. Each task should use the `cron.sh` shim to ensure the project's virtualenv is properly activated prior to execution. For example:

```
* * * * * ubuntu bash /home/ubuntu/apps/$NEW_PROJECT_FILENAME/repository/cron.sh fab $DEPLOYMENT_TARGET cron_jobs.test
```

To install your crontab set `INSTALL_CRONTAB` to `True` in `app_config.py`. Cron jobs will be automatically installed each time you deploy to EC2.

The cron jobs themselves should be defined in `fabfile/cron_jobs.py` whenever possible.

Install web services
--------------------

Web services are configured in the `confs/` folder.

Running ``fab servers.setup`` will deploy your confs if you have set ``DEPLOY_TO_SERVERS`` and ``DEPLOY_WEB_SERVICES`` both to ``True`` at the top of ``app_config.py``.

To check that these files are being properly rendered, you can render them locally and see the results in the `confs/rendered/` directory.

```
fab servers.render_confs
```

You can also deploy only configuration files by running (normally this is invoked by `deploy`):

```
fab servers.deploy_confs
```

Run a remote fab command
------------------------

Sometimes it makes sense to run a fabric command on the server, for instance, when you need to render using a production database. You can do this with the `fabcast` fabric command. For example:

```
fab staging main servers.fabcast:deploy
```

If any of the commands you run themselves require executing on the server, the server will SSH into itself to run them.


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.

using System.ComponentModel;
using OpenLiveWriter.ApplicationFramework;
using OpenLiveWriter.Localization;

namespace OpenLiveWriter.PostEditor.PostHtmlEditing
{
    /// <summary>
    /// Summary description for TextContextMenuDefinition.
    /// </summary>
    public class SmartContentContextMenuDefinition : CommandContextMenuDefinition
    {
        public SmartContentContextMenuDefinition()
        {
            Entries.Add(CommandId.Cut, false, false);
            Entries.Add(CommandId.CopyCommand, false, false);
            Entries.Add(CommandId.Paste, false, true);
            /*
            Entries.Add(CommandId.AlignLeft, false, false);
            Entries.Add(CommandId.AlignCenter, false, false);
            Entries.Add(CommandId.AlignRight, false, false);
            */
        }
    }
}


text:
import * as React from 'react';

export interface Props {}

export default class App extends React.Component<Props, {}> {
  render() {
    return (

Welcome to React!

    );
  }
}


text:
package com.libre.om.mock;

import com.libre.om.Friends;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import javax.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * Mocked version of friends.
 *
 * @author Yegor Bugayenko (yegor@teamed.io)
 * @version $Id$
 * @since 0.3
 * @todo #173:30min/DEV This class does not have any tests implemented yet.
 *  Let's implement tests for all existent methods (leader, names, add, eject).
 */
@EqualsAndHashCode(of = { "friends" })
@ToString
public final class MkFriends implements Friends {

    /**
     * Friends folder.
     */
    private final transient File friends;

    /**
     * Ctor.
     * @param file Directory
     * @param urn URN
     * @param name Document name
     */
    public MkFriends(@NotNull final File file, @NotNull final String urn,
    @NotNull final String name) {
        this.friends = Paths.get(
            file.getAbsolutePath(),
            urn.replaceAll("[^a-z0-9]", "/"),
            "friends",
            name
        ).toFile();
        if (!this.friends.exists()) {
            assert this.friends.mkdirs();
        }
    }

    @Override
    public boolean leader() {
        return true;
    }

    @Override
    public Iterable<String> names() {
        final String[] list = this.friends.list();
        final Iterable<String> names;
        if (list == null) {
            names = Collections.emptyList();
        } else {
            names = Arrays.asList(list);
        }
        return names;
    }

    @Override
    public void add(final String name) throws IOException {
        assert Paths.get(this.friends.getAbsolutePath(), name).toFile()
            .createNewFile();
    }

    @Override
    public void eject(final String name) {
        assert Paths.get(this.friends.getAbsolutePath(), name).toFile()
            .delete();
    }

}


text:
// Copyright 2010 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.android.stardroid.activities.util;

import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;

/**
 * Controls an activity's illumination levels.
 *
 * @author John Taylor
 *
 */
public class ActivityLightLevelManager implements OnSharedPreferenceChangeListener {
  private ActivityLightLevelChanger lightLevelChanger;
  private SharedPreferences sharedPreferences;
  private enum LightMode {DAY, NIGHT, AUTO}
  public static final String LIGHT_MODE_KEY = "lightmode";
  public ActivityLightLevelManager(ActivityLightLevelChanger lightLevelChanger,
                                   SharedPreferences sharedPreferences) {
    this.lightLevelChanger = lightLevelChanger;
    this.sharedPreferences = sharedPreferences;
  }

  public void onResume() {
    registerWithPreferences();
    LightMode currentMode = getLightModePreference();
    setActivityMode(currentMode);
  }

  private void setActivityMode(LightMode currentMode) {
    switch(currentMode) {
      case DAY:
        lightLevelChanger.setNightMode(false);
        break;
      case NIGHT:
        lightLevelChanger.setNightMode(true);
        break;
      case AUTO:
        throw new UnsupportedOperationException("not implemented yet");
    }
  }

  private LightMode getLightModePreference() {
    String preference = sharedPreferences.getString(LIGHT_MODE_KEY, LightMode.DAY.name());
    return LightMode.valueOf(preference);
  }

  private void registerWithPreferences() {
    sharedPreferences.registerOnSharedPreferenceChangeListener(this);
  }

  public void onPause() {
    unregisterWithPreferences();
  }

  private void unregisterWithPreferences() {
    sharedPreferences.registerOnSharedPreferenceChangeListener(this);
  }

  @Override
  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
    if (!key.equals(LIGHT_MODE_KEY)) {
      return;
    }
    setActivityMode(getLightModePreference());
  }
}


text:
/*Menu
------------------------------------*/
/*Top Bar*/
.top-v1 .top-v1-data li a:hover i {
	color: #e74c3c;
}

/*Header Default
------------------------------------*/
/*Navbar*/
.header .navbar-default .navbar-nav > .active > a {
	color: #e74c3c;
}

/*Navber Toggle*/
.navbar-toggle,
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
	background: #e74c3c;
}

.navbar-toggle:hover {
	background: #c0392b !important;
}

.navbar-default .navbar-toggle {
	border-color: #c0392b;
}

/*Responsive @Media
------------------------------------*/
@media (min-width: 767px) {
	/*Navbar*/
	.header .navbar-default .navbar-nav > li > a:hover,
	.header .navbar-default .navbar-nav > .active > a {
		color: #fff;
		background: #e74c3c !important;
	}

	.header .navbar-default .navbar-nav > .open > a,
	.header .navbar-default .navbar-nav > .open > a:hover,
	.header .navbar-default .navbar-nav > .open > a:focus {
		background: #e74c3c;
	}

	/*Dropdown Menu*/
	.header .dropdown-menu {
		border-top: solid 2px #e74c3c;
	}
}


text:
class GroveExample
{
public:
    GroveExample(int pinsda, int pinscl);
    bool read_temp(int *temp);
    bool read_uint8_value(uint8_t *value);
    bool read_humidity(float *humidity);
    bool read_acc(float *ax, float *ay, float *az);
    bool read_compass(float *cx, float *cy, float *cz, int *degree);
    bool read_with_arg(float *cx, float *cy, float *cz, int *degree, int arg);
    bool write_acc_mode(uint8_t mode);
    bool write_float_value(float f);
    bool write_multi_value(int a, float b, uint32_t c);
    bool attach_event_handler(CALLBACK_T handler);

private:
    I2C_T *i2c;
};

#endif


text:
package software.amazon.awssdk.core.internal.http;

import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.exception.SdkInterruptedException;
import software.amazon.awssdk.http.SdkHttpFullResponse;

/**
 * A set of utilities for monitoring the status of the currently-executing SDK thread. This is useful for periodically checking
 * whether our thread has been interrupted so that we can abort execution of a request.
 */
@SdkInternalApi
public final class InterruptMonitor {
    private InterruptMonitor() {
    }

    /**
     * Check if the thread has been interrupted. If so throw an {@link InterruptedException}.
     * Long running tasks should be periodically checked if the current thread has been
     * interrupted and handle it appropriately
     *
     * @throws InterruptedException If thread has been interrupted
     */
    public static void checkInterrupted() throws InterruptedException {
        if (Thread.interrupted()) {
            throw new SdkInterruptedException();
        }
    }

    /**
     * Check if the thread has been interrupted. If so throw an {@link InterruptedException}.
     * Long running tasks should be periodically checked if the current thread has been
     * interrupted and handle it appropriately
     *
     * @param response Response to be closed before returning control to the caller to avoid
     *                 leaking the connection.
     * @throws InterruptedException If thread has been interrupted
     */
    public static void checkInterrupted(SdkHttpFullResponse response) throws InterruptedException {
        if (Thread.interrupted()) {
            throw new SdkInterruptedException(response);
        }
    }
}


text:
layout: post
title: BIgNippledSmokingWhore
titleinfo: pornvd
desc: Watch BIgNippledSmokingWhore. Pornhub is the ultimate xxx porn and sex site.
---

BIgNippledSmokingWhore

Watch BIgNippledSmokingWhore. Pornhub is the ultimate xxx porn and sex site.


text:
from typing import Union

from pyannote.core import Annotation, Timeline

class SegmentationErrorAnalysis:

    def __init__(self):
        super().__init__()

    def __call__(self, reference: Union[Timeline, Annotation],
                 hypothesis: Union[Timeline, Annotation]) -> Annotation:

        if isinstance(reference, Annotation):
            reference = reference.get_timeline()

        if isinstance(hypothesis, Annotation):
            hypothesis = hypothesis.get_timeline()

        # over-segmentation
        over = Timeline(uri=reference.uri)
        prev_r = reference[0]
        intersection = []
        for r, h in reference.co_iter(hypothesis):

            if r != prev_r:
                intersection = sorted(intersection)
                for _, segment in intersection[:-1]:
                    over.add(segment)
                intersection = []
                prev_r = r

            segment = r & h
            intersection.append((segment.duration, segment))

        intersection = sorted(intersection)
        for _, segment in intersection[:-1]:
            over.add(segment)

        # under-segmentation
        under = Timeline(uri=reference.uri)
        prev_h = hypothesis[0]
        intersection = []
        for h, r in hypothesis.co_iter(reference):

            if h != prev_h:
                intersection = sorted(intersection)
                for _, segment in intersection[:-1]:
                    under.add(segment)
                intersection = []
                prev_h = h

            segment = h & r
            intersection.append((segment.duration, segment))

        intersection = sorted(intersection)
        for _, segment in intersection[:-1]:
            under.add(segment)

        # extent
        extent = reference.extent()

        # frontier error (both under- and over-segmented)
        frontier = under.crop(over)

        # under-segmented
        not_over = over.gaps(support=extent)
        only_under = under.crop(not_over)

        # over-segmented
        not_under = under.gaps(support=extent)
        only_over = over.crop(not_under)

        status = Annotation(uri=reference.uri)
        for segment in frontier:
            status[segment, '_'] = 'shift'
        for segment in only_over:
            status[segment, '_'] = 'over-segmentation'
        for segment in only_under:
            status[segment, '_'] = 'under-segmentation'

        return status.support()


text:
The Mattermost Notifications Service allows your GitLab project to send events (e.g., `issue created`) to your existing Mattermost team as notifications. This requires configurations in both Mattermost and GitLab.

You can also use Mattermost slash commands to control GitLab inside Mattermost. This is the separately configured [Mattermost slash commands](mattermost_slash_commands.md).

## On Mattermost

To enable Mattermost integration you must create an incoming webhook integration:

1. Sign in to your Mattermost instance.
1. Visit incoming webhooks, that will be something like: `https://mattermost.example.com/your_team_name/integrations/incoming_webhooks/add`.
1. Choose a display name, description and channel, those can be overridden on GitLab.
1. Save it, copy the **Webhook URL**, we'll need this later for GitLab.

Incoming Webhooks might be blocked on your Mattermost instance. Ask your Mattermost admin
to enable it on:

- **Mattermost System Console > Integrations > Integration Management** in Mattermost
  versions 5.12 and later.
- **Mattermost System Console > Integrations > Custom Integrations** in Mattermost
  versions 5.11 and earlier.

Display name override is not enabled by default, you need to ask your admin to enable it on that same section.

## On GitLab

After you set up Mattermost, it's time to set up GitLab.

Navigate to the [Integrations page](project_services.md#accessing-the-project-services)
and select the **Mattermost notifications** service to configure it.
There, you will see a checkbox with the following events that can be triggered:

- Push
- Issue
- Confidential issue
- Merge request
- Note
- Confidential note
- Tag push
- Pipeline
- Wiki page
- Deployment

Below each of these event checkboxes, you have an input field to enter
which Mattermost channel you want to send that event message. Enter your preferred channel handle (the hash sign `#` is optional).

At the end, fill in your Mattermost details:

| Field | Description |
| ----- | ----------- |
| **Webhook**  | The incoming webhook URL which you have to set up on Mattermost, it will be something like: `http://mattermost.example/hooks/5xo…` |
| **Username** | Optional username which can be on messages sent to Mattermost. Fill this in if you want to change the username of the bot. |
| **Notify only broken pipelines** | If you choose to enable the **Pipeline** event and you want to be only notified about failed pipelines. |

![Mattermost configuration](img/mattermost_configuration.png)


text:
nsfw
====
A minimal jQuery library; keep your workspace clean and keep your job!


text:
title: Row Specs
date: 2017-09-06T19:37:21.113Z
description: Intro
image: null
---
### Visual Design
* Border: 2px solid black

### Interaction
* Click to do stuff

![undefined](/img/Sample_IncompatibleUnsavedCell.png)


text:
<?php

use PatternSeek\ComponentView\ExecHelper;
use PatternSeek\ComponentView\Test\ViewState\WorldState;

/** @var WorldState $state */
/** @var ExecHelper $exec */
// Following line's instruction to PHPStorm must be enabled here: Settings -> Editor -> Code style -> Formatter control
// @formatter:off
?>
World. From: <?= $state->name ?>

Exec URL: <?= $exec->url( 'someExec',
[ 'a' => 1 ] ) ?><?php $formBody = "<input type=\"text\" name=\"someInput\" value=\"2\">\n" ?>

Exec Form:
<?= $exec->wrapForm( 'otherExec', 'POST', $formBody ) ?>


text:
<!DOCTYPE html>

  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>hummingbird.ml.operator_converters.sklearn.gbdt — hummingbird  documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/hummingbird.css" type="text/css" />
      <link rel="stylesheet" href="../_static/basic.css" type="text/css" />

    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="hummingbird.ml.operator_converters.sklearn.iforest" href="hummingbird.ml.operator_converters.sklearn.iforest.html" />
    <link rel="prev" title="hummingbird.ml.operator_converters.sklearn.discretizer" href="hummingbird.ml.operator_converters.sklearn.discretizer.html" />

             hummingbird

                0.4.4

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Main website

hummingbird

hummingbird.ml

hummingbird.ml._executor

hummingbird.ml._parse

hummingbird.ml._topology

hummingbird.ml._utils

hummingbird.ml.convert

hummingbird.ml.exceptions

hummingbird.ml.supported

hummingbird.ml.containers

hummingbird.ml.containers._input_containers

hummingbird.ml.containers._sklearn_api_containers

hummingbird.ml.containers.batch_container

hummingbird.ml.containers.sklearn

hummingbird.ml.operator_converters

hummingbird.ml.operator_converters._array_feature_extractor_implementations

hummingbird.ml.operator_converters._decomposition_implementations

hummingbird.ml.operator_converters._discretizer_implementations

hummingbird.ml.operator_converters._gbdt_commons

hummingbird.ml.operator_converters._imputer_implementations

hummingbird.ml.operator_converters._kneighbors_implementations

hummingbird.ml.operator_converters._label_encoder_implementations

hummingbird.ml.operator_converters._linear_implementations

hummingbird.ml.operator_converters._mlp_implementations

hummingbird.ml.operator_converters._nb_implementations

hummingbird.ml.operator_converters._normalizer_implementations

hummingbird.ml.operator_converters._one_hot_encoder_implementations

hummingbird.ml.operator_converters._physical_operator

hummingbird.ml.operator_converters._pipeline_implementations

hummingbird.ml.operator_converters._scaler_implementations

hummingbird.ml.operator_converters._sv_implementations

hummingbird.ml.operator_converters._tree_commons

hummingbird.ml.operator_converters._tree_implementations

hummingbird.ml.operator_converters.constants

hummingbird.ml.operator_converters.lightgbm

hummingbird.ml.operator_converters.prophet

hummingbird.ml.operator_converters.xgb

hummingbird.ml.operator_converters.onnx

hummingbird.ml.operator_converters.sklearn

hummingbird.ml.operator_converters.sparkml

          hummingbird

 »

hummingbird »

hummingbird.ml »

hummingbird.ml.operator_converters »

hummingbird.ml.operator_converters.sklearn »

hummingbird.ml.operator_converters.sklearn.gbdt

             View page source

hummingbird.ml.operator_converters.sklearn.gbdt¶

Converters for Sklearn's GradientBoosting models.

hummingbird.ml.operator_converters.sklearn.gbdt._get_n_features(model)[source]¶

hummingbird.ml.operator_converters.sklearn.gbdt._get_parameters_hist_gbdt(trees, extra_config)[source]¶

Extract the tree parameters from SklearnHistGradientBoostingClassifier trees
Args:

trees: The information representing a tree (ensemble)
Returns: The tree parameters wrapped into an instance of operator_converters._tree_commons_TreeParameters

hummingbird.ml.operator_converters.sklearn.gbdt.convert_sklearn_gbdt_classifier(operator, device, extra_config)[source]¶

Converter for sklearn.ensemble.GradientBoostingClassifier

Args:

operator: An operator wrapping a sklearn.ensemble.GradientBoostingClassifier

or sklearn.ensemble.HistGradientBoostingClassifier model

device: String defining the type of device the converted operator should be run on
extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model

hummingbird.ml.operator_converters.sklearn.gbdt.convert_sklearn_gbdt_regressor(operator, device, extra_config)[source]¶

Converter for sklearn.ensemble.GradientBoostingRegressor.

Args:

operator: An operator wrapping a sklearn.ensemble.GradientBoostingRegressor or
sklearn.ensemble.HistGradientBoostingRegressor model
device: String defining the type of device the converted operator should be run on
extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model

hummingbird.ml.operator_converters.sklearn.gbdt.convert_sklearn_hist_gbdt_classifier(operator, device, extra_config)[source]¶

Converter for sklearn.ensemble.HistGradientBoostingClassifier

Args:

operator: An operator wrapping a sklearn.ensemble.HistGradientBoostingClassifier model
device: String defining the type of device the converted operator should be run on
extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model

hummingbird.ml.operator_converters.sklearn.gbdt.convert_sklearn_hist_gbdt_regressor(operator, device, extra_config)[source]¶

Converter for sklearn.ensemble.HistGradientBoostingRegressor

Args:

operator: An operator wrapping a sklearn.ensemble.HistGradientBoostingRegressor model
device: String defining the type of device the converted operator should be run on
extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model

         Previous
        Next

© Copyright 2020, Microsoft.

  Built with Sphinx using a
    theme
    provided by Read the Docs.


text:
Similardio
==========

![Similardio logo](http://neteril.org/xamarin/logo_similardio2.png)

#### What?

An experiment in bridging [Rdio](http://www.rdio.com/) and [Lastfm](http://last.fm/) together.

The idea is to gather your most listened to artists on Rdio and generously gather similar talents from Lastfm comprehensive database.

All of this straight from your Android phone.

#### What does it look like?

It has pretty animations. It has blurring. It has large images.

![Similardio logo](http://neteril.org/xamarin/fresque.png)

A video of the app working is on [the blog post](http://blog.neteril.org/blog/2013/08/16/similardio-rdio-meets-lastfm/).

#### What should I do with it

Use it as an example for [bduncavage/RdioSdkBindings](https://github.com/bduncavage/RdioSdkBindings) or scavenge any other part of it.


text:
CAFFE2_DECLARE_string(caffe_test_root);

namespace caffe2 {

static void AddConstInput(const vector<TIndex>& shape, const float value,
                          const string& name, Workspace* ws) {
  DeviceOption option;
  option.set_device_type(CUDA);
  CUDAContext context(option);
  Blob* blob = ws->CreateBlob(name);
  auto* tensor = blob->GetMutable<Tensor<CUDAContext>>();
  tensor->Resize(shape);
  math::Set<float, CUDAContext>(tensor->size(), value,
                                tensor->mutable_data<float>(),
                                &context);
  return;
}

TEST(FullyConnectedGPUTest, Test) {
  if (!HasCudaGPU()) return;
  Workspace ws;
  OperatorDef def;
  def.set_name("test");
  def.set_type("FC");
  def.add_input("X");
  def.add_input("W");
  def.add_input("B");
  def.add_output("Y");
  def.mutable_device_option()->set_device_type(CUDA);
  AddConstInput(vector<TIndex>{5, 10}, 1., "X", &ws);
  AddConstInput(vector<TIndex>{6, 10}, 1., "W", &ws);
  AddConstInput(vector<TIndex>{6}, 0.1, "B", &ws);
  unique_ptr<OperatorBase> op(CreateOperator(def, &ws));
  EXPECT_NE(nullptr, op.get());
  EXPECT_TRUE(op->Run());
  Blob* Yblob = ws.GetBlob("Y");
  EXPECT_NE(nullptr, Yblob);
  auto& Y = Yblob->Get<Tensor<CUDAContext>>();
  TensorCPU Y_cpu(Y);
  EXPECT_EQ(Y.size(), 5 * 6);
  for (int i = 0; i < Y.size(); ++i) {
    EXPECT_LT(Y_cpu.data<float>()[i], 10.11);
    EXPECT_GT(Y_cpu.data<float>()[i], 10.09);
  }
}

}  // namespace caffe2


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width,minimum-scale=1">

touch-action:none

touch-action:pan-y

touch-action:pan-x

touchstart adds touch-action:none

first touchmove adds touch-action:none

fifth touchmove adds touch-action:none

touchstart removes touch-action:none

first touchmove removes touch-action:none

fifth touchmove removes touch-action:none

Scrolling Test

            Test scrolling on the left pane - event details will be printed in the log below.

            Hover over options below for details (Coming Soon!)

        <button id="toggle-options">Toggle Options</button>

*move preventDefaults in:

              <input type="radio" id="moveCancelAll" name="moveCancellation" checked>All
              <input type="radio" id="moveCancelFirst" name="moveCancellation">First
              <input type="radio" id="moveCancelSecond" name="moveCancellation"><input id="moveCancelNumber" type="number" min="2" max="9" value="2">+

            <input type="checkbox" id="alternatePreventDefaults">Alternate every <input id="alternateNumber" type="number" min="1" max="100" value="10">

Force Compositing:

              <input type="radio" id="compositingAuto" name="forceCompositing" checked>auto
              <input type="radio" id="compositingOn" name="forceCompositing">on
              <input type="radio" id="compositingOff" name="forceCompositing">off

Event Log:

            <button id="clear-log-button">Clear</button>
            <input type="checkbox" id="clear-on-touch">ClearOnTouch

          <textarea id="log" readonly></textarea>