text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.marshalchen.common.demoofui"
          android:versionCode="1"
          android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8"/>
    <application android:label="@string/app_name" android:name="com.marshalchen.common.demoofui.CommonApplication"
                 android:theme="@style/AppTheme"
                 android:icon="@drawable/launcher">
        <activity android:name=".DemoOfUiActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name=".MaterialActivity" android:theme="@style/Theme.MaterialTheme"></activity>
        <activity android:name=".SmoothProgressBarActivity"></activity>
        <activity android:name=".dynamicgrid.example.DynamicGridActivity"></activity>
        <activity android:name=".cooldraganddrop.CoolDragAndDropActivity"></activity>
        <activity android:name=".stickygridheadersexample.StickGridItemListActivity"></activity>
        <activity android:name=".listviewfilter.ui.ListViewFilterActivity"></activity>
        <activity android:name=".sampleModules.FlipViewActivity"></activity>
        <activity android:name=".sampleModules.PhotoViewActivity"></activity>
        <activity android:name=".sampleModules.SquareProgressBarActivity"></activity>
        <activity android:name=".sampleModules.CircularBarActivity"></activity>
        <activity android:name=".foldingDrawer.FoldingActivitys"></activity>
        <activity android:name=".foldingDrawer.FoldingDrawerLayoutActivity"></activity>
        <activity android:name=".foldingDrawer.FoldingLayoutActivity"></activity>
        <activity android:name=".foldingDrawer.FoldingPaneLayoutActivity"></activity>
        <activity android:name=".foldableLayout.activities.FoldableListActivity"></activity>
        <activity android:name=".foldableLayout.activities.UnfoldableDetailsActivity"></activity>
        <activity android:name=".sampleModules.CalendarSquareActivity"></activity>
        <activity android:name=".sampleModules.KenBurnsViewActivity"></activity>
        <activity android:name=".discrollview.DiscrollActivity"></activity>
        <activity android:name=".sampleModules.PanningViewActivity"></activity>
        <activity android:name=".parallaxscrollexample.ParallaxScrollActivity"></activity>
        <activity android:name=".parallaxscrollexample.SingleParallaxExpandableListView"></activity>
        <activity android:name=".parallaxscrollexample.SingleParallaxListView"></activity>
        <activity android:name=".parallaxscrollexample.SingleParallaxScrollView"></activity>
        <activity android:name=".parallaxscrollexample.MultipleParallaxExpandableListView"></activity>
        <activity android:name=".parallaxscrollexample.MultipleParallaxListView"></activity>
        <activity android:name=".parallaxscrollexample.MultipleParallaxScrollView"></activity>
        <activity android:name=".sampleModules.ProgressbarWheelActivity"></activity>
        <activity android:name=".viewpagerSlidingTab.ViewpagerSlidingTabsActivity"></activity>
        <activity android:name=".rebound.ReboundActivity"></activity>
        <activity android:name=".rebound.ReboundActivitySimple"></activity>
        <activity android:name=".sampleModules.FaceCropActivity"></activity>
        <activity android:name=".listviewanimations.ListAnimationActivity"
                  android:theme="@style/Widget.AppCompat.Light.ActionBar.Solid"></activity>
        <activity android:name=".listviewanimations.ListAnimationListActivity"></activity>
        <activity android:name=".listviewanimations.GoogleCardsActivity"></activity>
        <activity android:name=".listviewanimations.GridViewActivity"></activity>
        <activity android:name=".listviewanimations.itemmanipulationexamples.AnimateAdditionActivity"></activity>
        <activity android:name=".listviewanimations.itemmanipulationexamples.DragAndDropActivity"></activity>
        <activity android:name=".listviewanimations.appearanceexamples.AppearanceExamplesActivity"></activity>
        <activity
                android:name=".listviewanimations.itemmanipulationexamples.ItemManipulationsExamplesActivity"></activity>

        <activity android:name=".listviewanimations.itemmanipulationexamples.ExpandableListItemActivity"></activity>
        <activity android:name=".listviewanimations.itemmanipulationexamples.SwipeDismissActivity"></activity>
        <activity android:name=".listviewanimations.itemmanipulationexamples.AnimateDismissActivity"></activity>
        <activity android:name=".sampleModules.PullSplashActivity"></activity>

        <activity android:name=".jsoup.UtilsDemoActivity"></activity>

        <activity android:name=".sampleModules.ViewServerActivity"></activity>
        <activity android:name=".activitytransition.ActivityTransitionActivity"></activity>
        <activity android:name=".activitytransition.ActivityTransitiorSecond"></activity>

        <activity android:name=".sampleModules.JazzyViewActivity"></activity>
        <activity android:name=".imageprocessingexample.ImageProcessingActivity"></activity>
        <activity android:name=".imageprocessingexample.ImageProcessingGenericFilterExample"></activity>
        <activity android:name=".imageprocessingexample.ImageProcessingTwoInputfilterActivity"></activity>
        <activity android:name=".imageprocessingexample.ImageProcessingVideotoImageActivity"></activity>
        <activity android:name=".sampleModules.TestHTML5WebView"></activity>
        <activity android:name=".sampleModules.CropExample"></activity>
        <activity android:name="com.marshalchen.common.uimodule.cropimage.CropImageActivity"></activity>
        <activity android:name=".sampleModules.CropperSample"></activity>
        <activity android:name=".sampleModules.ImageFilterActivity"></activity>
        <activity android:name=".sampleModules.MotionSampleActivity"></activity>
        <activity android:name=".shapeimageview.ShapeImageViewActivity"></activity>
        <activity android:name=".sampleModules.CustomShapeImageViewActivity"></activity>
        <activity android:name=".sampleModules.MarqueeViewSample"></activity>
        <activity android:name=".sampleModules.SignaturePadActivity"></activity>
        <activity android:name=".sampleModules.DrawableActivity"></activity>
        <activity android:name=".sampleModules.AndroidWeekViewActivity"></activity>
        <activity android:name=".sampleModules.FilckerAnimationListActivity"></activity>
        <activity android:name=".sampleModules.ArcMenuActivity"></activity>
        <activity android:name=".sampleModules.ExpandCircleProgressExampleActivity"></activity>
        <activity android:name=".artbook.FreeFlowArtbookActivity"></activity>
        <activity android:name=".sampleModules.FreeFlowPhotoGridActivity"></activity>
        <activity android:name=".sampleModules.RecyclerViewSample"></activity>
        <activity android:name=".recyclerviewitemanimator.RecyclerViewItemAnimatorActivity"></activity>
        <activity android:name=".sampleModules.RippleEffectActivity"></activity>
        <activity android:name=".sampleModules.FloatingActionButtonActivity"></activity>
        <activity android:name=".sampleModules.FloatingActionButtonDemo"></activity>
        <activity android:name=".circularfloatingactionmenu.MenuInScrollViewActivity"></activity>
        <activity android:name=".circularfloatingactionmenu.CircularFloatingActivity"></activity>
        <activity android:name=".circularfloatingactionmenu.MenuWithCustomActionButtonActivity"></activity>
        <activity android:name=".circularfloatingactionmenu.MenuWithCustomAnimationActivity"></activity>
        <activity android:name=".circularfloatingactionmenu.MenuWithFABActivity"></activity>
        <activity android:name=".materialmenu.MaterialMenuToolbarActivity"
                  android:theme="@style/Theme.MaterialTheme"></activity>
        <activity android:name=".materialmenu.HomeIconActivity" android:theme="@style/MaterialMenuTheme"></activity>
        <activity android:name=".materialmenu.MaterialMenuAppcompatActivity"
                  android:theme="@style/MaterialMenuTheme"></activity>
        <activity android:name=".pulltozoomview.PullToZoomActivity"></activity>
        <activity android:name=".pulltozoomview.PullToZoomListActivity"></activity>
        <activity android:name=".pulltozoomview.PullToZoomScrollActivity"></activity>
        <activity android:name=".twowayview.TwoWayViewActivity"></activity>
        <activity android:name=".recyclerplayground.RecyclerViewPlayGroundActivity"></activity>
        <activity android:name=".recyclerviewstickyheaders.RecyclerViewStickyHeadersActivity"
                  android:theme="@style/Theme.MaterialTheme"></activity>
        <provider
                android:name="android.support.v4.content.FileProvider"
                android:authorities="com.marshalchen.common.demoofui.fileprovider"
                android:grantUriPermissions="true"
                android:exported="false">
            <meta-data
                    android:name="android.support.FILE_PROVIDER_PATHS"
                    android:resource="@xml/filepaths"/>
        </provider>

        <activity
                android:name="com.marshalchen.common.uimodule.passcodelock.PasscodeUnlockActivity"
                android:screenOrientation="portrait"
                android:windowSoftInputMode="stateHidden">
        </activity>
        <activity
                android:name="com.marshalchen.common.uimodule.passcodelock.PasscodePreferencesActivity"
                android:configChanges="orientation|keyboardHidden|screenSize"
                android:screenOrientation="portrait"
                android:windowSoftInputMode="stateHidden">
        </activity>
        <activity
                android:name="com.marshalchen.common.uimodule.passcodelock.PasscodeManagePasswordActivity"
                android:screenOrientation="portrait"
                android:windowSoftInputMode="stateHidden">
        </activity>
        <activity android:name=".sampleModules.GestureTouchActivity"></activity>
        <activity android:name=".activityanimation.ActivityAnimationsActivity"
                  android:theme="@style/AppTheme.Transparent"></activity>
        <activity android:name=".activityanimation.SecondActivity"
                  android:theme="@style/AppTheme.Transparent"></activity>
        <activity android:name=".activityanimation.ThirdActivity"
                  android:theme="@style/AppTheme.Transparent"></activity>
        <activity android:name=".activityanimation.DoorActivity" android:theme="@style/AppTheme.Transparent"></activity>
        <activity android:name=".pullscrollview.PulldownViewActivity"></activity>
        <activity android:name=".pullscrollview.PullScrollViewActivity"></activity>
        <activity android:name=".pullscrollview.StretchViewActivity"></activity>
        <activity android:name=".sampleModules.CardsSwipedActivity"></activity>
        <activity android:name=".showcaseview.ShowCaseSampleActivity"></activity>
        <activity android:name=".showcaseview.animations.AnimationSampleActivity"></activity>
        <activity android:name=".showcaseview.legacy.MultipleShowcaseSampleActivity"></activity>
        <activity android:name=".showcaseview.SingleShotActivity"></activity>
        <activity android:name=".showcaseview.MemoryManagementTesting"></activity>
        <activity android:name=".listbuddies.ListBuddiesActivity"></activity>
        <activity android:name=".ResideMenuDemo.ResideMenuActivity"></activity>

        <activity android:name=".sampleModules.AutofitTextViewActivity"></activity>
        <activity android:name=".sampleModules.DraggableGridViewPagerTestActivity"></activity>
        <activity android:name=".sampleModules.FloatLabelActivity"></activity>
        <activity android:name=".sampleModules.WireFrameActivity"></activity>
        <activity android:name=".sampleModules.TriangleFrameActivity"></activity>
        <activity android:name=".sampleModules.RiseNumberActivity"></activity>
        <activity android:name=".sampleModules.NiftyDialogActivity"></activity>
        <activity android:name=".sampleModules.DifferentIconsActivity"></activity>

        <activity android:name=".edgeeffectoverride.EdgeEffectActivity"></activity>
        <activity android:name=".edgeeffectoverride.ExpandableListViewActivity"></activity>
        <activity android:name=".edgeeffectoverride.ListViewActivity"></activity>
        <activity android:name=".edgeeffectoverride.ScrollViewActivity"></activity>
        <activity android:name=".edgeeffectoverride.ViewPagerActivity"></activity>
        <activity android:name=".edgeeffectoverride.WebViewActivity"></activity>
        <activity android:name=".edgeeffectoverride.GridViewActivity"></activity>
        <activity android:name=".sampleModules.ViewPagerTransformerActivity"></activity>

        <activity android:name=".standUpTimer.ConfigureStandupTimer"></activity>
        <activity android:name=".standUpTimer.Help"></activity>
        <activity android:name=".standUpTimer.MeetingDetails"></activity>
        <activity android:name=".standUpTimer.Prefs"></activity>
        <activity android:name=".standUpTimer.StandupTimer"></activity>
        <activity android:name=".standUpTimer.TeamDetails"></activity>
        <activity android:name=".standUpTimer.TeamList"></activity>
        <activity android:name=".circularProgressButton.Sample1Activity"></activity>
        <activity android:name=".circularProgressButton.Sample2Activity"></activity>
        <activity android:name=".circularProgressButton.Sample3Activity"></activity>
        <activity android:name=".circularProgressButton.Sample4Activity"></activity>
        <activity android:name=".circularProgressButton.Sample5Activity"></activity>
        <activity android:name=".circularProgressButton.CircularProgressButtonActivity"></activity>
        <activity android:name=".sampleModules.PulltoZoomListViewActivity"></activity>
        <activity android:name=".quickreturnlistview.QuickReturnListViewActivity"></activity>
        <activity android:name=".superlistview.SuperListViewActivity"></activity>
        <activity android:name=".superlistview.ListSample"></activity>
        <activity android:name=".superlistview.GridSample"></activity>
        <activity android:name=".staggeredgridview.StaggeredGridActivity"></activity>
        <activity android:name=".staggeredgridview.ListViewActivity"></activity>
        <activity android:name=".staggeredgridview.StaggeredGridActivityFragment"></activity>
        <activity android:name=".staggeredgridview.StaggeredGridEmptyViewActivity"></activity>
        <activity android:name=".staggeredgridview.StaggeredGridViewActivity"></activity>

        <activity android:name=".sampleModules.DropDownListViewDemo"></activity>
        <activity android:name=".sampleModules.FlowTextViewActivity"></activity>
        <activity android:name=".sampleModules.GoogleProgressBarActivity"></activity>
        <activity android:name=".sampleModules.NumberProgressBarActivity"></activity>

        <activity android:name=".fancyCoverFlow.FancyCoverFlowActivity"></activity>
        <activity android:name=".fancyCoverFlow.example.SimpleExample"></activity>
        <activity android:name=".fancyCoverFlow.example.ViewGroupExample"></activity>
        <activity android:name=".fancyCoverFlow.example.ViewGroupReflectionExample"></activity>
        <activity android:name=".fancyCoverFlow.example.XmlInflateExample"></activity>

        <activity android:name=".dragSortListview.ArbItemSizeDSLV"></activity>
        <activity android:name=".dragSortListview.Launcher"></activity>
        <activity android:name=".dragSortListview.MultipleChoiceListView"></activity>
        <activity android:name=".dragSortListview.Sections"></activity>
        <activity android:name=".dragSortListview.BGHandle"></activity>
        <activity android:name=".dragSortListview.CursorDSLV"></activity>
        <activity android:name=".dragSortListview.SingleChoiceListView"></activity>
        <activity android:name=".dragSortListview.TestBedDSLV"></activity>
        <activity android:name=".dragSortListview.WarpDSLV"></activity>

        <activity android:name=".fadingactionbar.HeaderOverlayActivity"></activity>
        <activity android:name=".fadingactionbar.HomeActivity"></activity>
        <activity android:name=".fadingactionbar.LightActionBarActivity"></activity>
        <activity android:name=".fadingactionbar.ListViewActivity"></activity>
        <activity android:name=".fadingactionbar.LightBackgroundActivity"></activity>
        <activity android:name=".fadingactionbar.NavigationDrawerActivity"></activity>
        <activity android:name=".fadingactionbar.NoParallaxActivity"></activity>
        <activity android:name=".fadingactionbar.SampleFragmentActivity"></activity>
        <activity android:name=".fadingactionbar.ScrollViewActivity"></activity>
        <activity android:name=".fadingactionbar.ShortContentActivity"></activity>
        <activity android:name=".fadingactionbar.WebViewActivity"></activity>
        <activity android:name=".sampleModules.SwipeRefreshLayoutDemo"></activity>

        <activity android:name=".sampleModules.UltimateListviewActivity"></activity>

        <activity android:name=".swipelayoutdemo.SwipeLayoutActivity"></activity>
        <activity android:name=".swipelayoutdemo.GridViewExample"></activity>
        <activity android:name=".swipelayoutdemo.ListViewExample"></activity>
        <activity android:name=".swipelayoutdemo.NestedExample"></activity>

        <activity android:name=".androidanimationsdemo.AndroidAnimationsDemoActivity"></activity>
        <activity android:name=".androidanimationsdemo.ExampleActivity"></activity>

        <activity android:name=".easingDemo.EasingActivity"></activity>
        <activity android:name=".sampleModules.JumpingBeansActivity"></activity>
        <activity android:name=".sampleModules.AndroidViewHoverActivity"></activity>
        <activity android:name=".slider.SliderActivity"></activity>

        <activity android:name=".sampleModules.CalendarListViewActivity"></activity>
        <activity android:name=".easyandroidanimations.EasyAnimationListActivity"></activity>
        <activity android:name=".easyandroidanimations.AnimationDetailActivity"></activity>
        <activity android:name=".roundedimageview.RoundedImageViewActivity"
                  android:theme="@style/android:Theme.Holo.Light.DarkActionBar"></activity>
        <activity android:name=".BlurNavigationDrawer.BlurNavigationDrawerActivity"></activity>

        <activity android:name=".blurdialogfragment.BlurDialogActivity"></activity>
        <activity android:name=".blurdialogfragment.SampleActionBarActivity"></activity>
        <activity android:name=".blurdialogfragment.SampleFullScreenActivity"></activity>
        <activity android:name=".sampleModules.CustomPullToRefreshActivity" android:theme="@style/android:Theme.Holo.Light.DarkActionBar"></activity>
    </application>

    <!--<uses-configuration android:reqTouchScreen="finger"/>-->

    <!--<uses-feature-->
    <!--android:name="android.hardware.touchscreen"-->
    <!--android:required="true"/>-->
    <!--<uses-feature-->
    <!--android:name="android.hardware.touchscreen.multitouch"-->
    <!--android:required="true"/>-->

    <uses-permission android:name="com.android.vending.BILLING"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <!-- 读取电话状态的权限 -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <!-- 访问网络的权限 -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <!-- 读写存储卡的权限 -->
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
    <!-- 文件系统的权限 -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <!-- 访问网络状态的权限 -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <!-- 访问精确位置的权限 -->
    <uses-permission android:name="android.permission.READ_LOGS"/>
    <!-- 读取日志的权限 -->
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
    <!-- Icon安装的权限 -->
    <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
    <!-- Icon卸载的权限 -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <!-- 访问WIFI网络状态的权限 -->
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <!-- 改变WIFI网络状态的权限 -->
    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.BAIDU_LOCATION_SERVICE">
    </uses-permission>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION">
    </uses-permission>
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION">
    </uses-permission>
    <uses-permission android:name="android.permission.ACCESS_GPS"/>

    <uses-permission android:name="android.permission.NFC"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>


text:
<? include("../function/db.php");?>
<?include("../../members/payments_settings.php");?>
<?
//Check access
admin_panel_access("settings_payments");

$activ=0;
if(isset($_POST["enable"])){$activ=1;}

$ipn=0;
if(isset($_POST["ipn"])){$ipn=1;}

$sql="update gateway_myvirtualmerchant set account='".result($_POST["account"])."',account2='".result($_POST["account2"])."',password='".result($_POST["password"])."',activ=".$activ.",ipn=".$ipn;
$db->execute($sql);

$db->close();

header("location:payments.php");
?>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection" />
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="icon" href="https://docs.google.com/uc?id=0B34Vvn653iTiRTBzVXh1WlAxeVE">
    <title> Ben Burdess </title>
    <link rel="stylesheet" type="text/css" href="/Users/rps/Documents/materialize/css/style.css" />

Triangles

For Robotics

Msc.

About Me

Contact Me

Designsarrow_drop_down

Email: benburdess@yahoo.com

Discord: Benji#3021

Follow Me!

   thumbs_up_down

   </row>

Goodbye

About

Fulltime Student and Person.

 Follow Me:

                thumbs_up_down


text:
using ExifProcessLib.Helpers;
using System.Collections.Generic;

namespace ExifProcessLib.Models.Mp4Atoms
{
	public class Dref : Atom
	{
		public byte Version { get; set; }
		public byte[] Flags { get; set; }
		public uint NumberOfEntries { get; set; }
		public List<Atom> DataReferences { get; set; }

		public Dref(byte[] data) : base(data)
		{
			Version = data.ReadByte(8);
			Flags = data.ReadData(9, 3, Endianess.Big);
			NumberOfEntries = data.ReadUInt(12, Endianess.Big);

			DataReferences = new List<Atom>();
			var referenceData = data.ReadData(16, data.Length - 16, Endianess.Big);

			DataReferences.AddRange(Atom.Decode(referenceData));
		}
	}
}


text:
import Frame from 'texture/Frame.js';
import SetTrim from 'texture/SetTrim.js';

//  source = image / canvas reference
//  json = Texture Packer JSON data

export default function TexturePackerJSONArray (source, json, output = []) {

    if (!json['frames'])
    {
        console.warn('Invalid JSON');
        return output;
    }

    for (let i = 0; i < json.frames.length; i++)
    {
        let data = json.frames[i];
        let frame = Frame(data.filename, source, data.frame.x, data.frame.y, data.frame.w, data.frame.h);

        if (data.trimmed)
        {
            let trim = data.spriteSourceSize;

            SetTrim(frame, data.sourceSize.w, data.sourceSize.h, trim.x, trim.y, trim.w, trim.h);
        }

        output.push(frame);
    }

    return output;

}


text:
from .responses import RDSResponse

url_bases = [r"https?://rds\.(.+)\.amazonaws\.com", r"https?://rds\.amazonaws\.com"]

url_paths = {"{0}/$": RDSResponse.dispatch}


text:
<?php
/**
 * @author Stanislav Ivanov <resha.ru@gmail.com>
 */

namespace Omt\TodoBundle\Model\Todo;

use Doctrine\Common\Persistence\ObjectManager;
use Omt\TodoBundle\Entity\Todo;
use Omt\TodoBundle\Entity\User;

/**
 * To-do validator
 */
class Validator
{

    const TASK_IS_NOT_SET_ERROR = 'task_is_not_defined';
    const PRIORITY_IS_NOT_SET_ERROR = 'priority_is_not_defined';
    const INVALID_PRIORITY_ERROR = 'invalid_priority_provided';

    /**
     * @var array
     */
    private $validPriorities = array('high', 'medium', 'low');

    /**
     * @var string
     */
    private $task;

    /**
     * @var string
     */
    private $priority;

    /**
     * @var bool
     */
    private $filledOnly;

    /**
     * @var string
     */
    private $error;

    /**
     * @param string $task
     * @param string $priority
     * @param bool $filledOnly
     */
    public function __construct($task, $priority, $filledOnly)
    {
        $this->task = $task;
        $this->priority = $priority;
        $this->filledOnly = $filledOnly;
    }

    /**
     * @return bool
     */
    public function validate()
    {
        $valid = true;
        if (($this->filledOnly && $this->task !== null || !$this->filledOnly)) {
            if (!$this->validateTask()) {
                $valid = false;
            }
        }
        if ($valid
            && ($this->filledOnly && $this->priority !== null || !$this->filledOnly)) {
            if (!$this->validatePriority()) {
                $valid = false;
            }
        }

        return $valid;
    }

    /**
     * @return bool
     */
    private function validateTask()
    {
        if (empty($this->task)) {
            $this->error = self::TASK_IS_NOT_SET_ERROR;
            $valid = false;
        } else {
            $valid = true;
        }

        return $valid;
    }

    /**
     * @return bool
     */
    private function validatePriority()
    {
        if (empty($this->priority)) {
            $this->error = self::PRIORITY_IS_NOT_SET_ERROR;
            $valid = false;
        } elseif (!in_array($this->priority, $this->validPriorities)) {
            $this->error = self::INVALID_PRIORITY_ERROR;
            $valid = false;
        } else {
            $valid = true;
        }

        return $valid;
    }

    /**
     * @return string
     */
    public function getError()
    {
        return $this->error;
    }

}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LineNumbers
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] allLines = File.ReadAllLines("input.txt");

            List<string> numeratedLines = new List<string>();

            for (int i = 0; i < allLines.Length; i++)
            {
                numeratedLines.Add($"{i + 1}. {allLines[i]}");
            }

            File.WriteAllLines("numeratedLines.txt", numeratedLines);
        }
    }
}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ConnectionPoolTestFactory_1 = require("../config/ConnectionPoolTestFactory");
const OrdersProductsGateway_1 = require("./OrdersProductsGateway");
class OrdersProductsGatewayFactory {
    static create() {
        const pool = ConnectionPoolTestFactory_1.ConnectionPoolTestFactory.create();
        const gateway = new OrdersProductsGateway_1.OrdersProductsGateway(pool);
        return gateway;
    }
}
exports.OrdersProductsGatewayFactory = OrdersProductsGatewayFactory;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT3JkZXJzUHJvZHVjdHNHYXRld2F5RmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIk9yZGVyc1Byb2R1Y3RzR2F0ZXdheUZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtRkFBOEU7QUFDOUUsbUVBQThEO0FBRTlELE1BQWEsNEJBQTRCO0lBQzlCLE1BQU0sQ0FBQyxNQUFNO1FBQ2hCLE1BQU0sSUFBSSxHQUFNLHFEQUF5QixDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQ25ELE1BQU0sT0FBTyxHQUFHLElBQUksNkNBQXFCLENBQUMsSUFBSSxDQUFDLENBQUM7UUFFaEQsT0FBTyxPQUFPLENBQUM7SUFDbkIsQ0FBQztDQUNKO0FBUEQsb0VBT0MifQ==


text:
package ch.hearc.gotit.daos.impl;

import ch.hearc.gotit.daos.AssessmentDao;
import ch.hearc.gotit.entities.AssessmentEntity;

import org.springframework.stereotype.Repository;

@Repository("assessmentDao")
public class AssessmentDaoImpl extends BasicDaoImpl<AssessmentEntity, Integer> implements AssessmentDao {

	public AssessmentDaoImpl() {
		super(AssessmentEntity.class);
	}
}


text:
package com.logginghub.logging.frontend.configuration;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;

import com.logginghub.utils.VLPorts;

@XmlAccessorType(XmlAccessType.FIELD) public class HubConfiguration {
    @XmlAttribute private String name;
    @XmlAttribute private String host;
    @XmlAttribute private int port = VLPorts.getSocketHubDefaultPort();
    @XmlAttribute private boolean overrideTime = false;
    @XmlAttribute private boolean debug = false;
    @XmlAttribute private String channel;

    public HubConfiguration() {}

    public HubConfiguration(String name, String host, int port) {
        this.name = name;
        this.host = host;
        this.port = port;
    }

    public HubConfiguration(String name) {
        this.name = name;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getChannel() {
        return channel;
    }

    public boolean isDebug() {
        return debug;
    }

    public void setDebug(boolean debug) {
        this.debug = debug;
    }

    public boolean getOverrideTime() {
        return overrideTime;
    }

    public void setOverrideTime(boolean overrideTime) {
        this.overrideTime = overrideTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @Override public String toString() {
        return "HubConfiguration [name=" + name + ", host=" + host + ", port=" + port + "]";
    }

}


text:
"""Provide data sources of common CourseBuilder items.

If you are adding an extension module to CourseBuilder and you wish to include
a data source as part of that extension, you should add that class in the
directory specific to your module, rather than registering it here.  That way,
if your module needs to be disabled, that can be done all at once.

This module provides data sources for common CourseBuilder entites using the
framework defined in models/data_sources.  The name of this module differs
both to reflect the concrete/abstract disctintion as well as to avoid module
naming conflicts.
"""

__author__ = 'Mike Gainer (mgainer@google.com)'

from models import custom_modules
from models import data_sources
from modules.data_source_providers import rest_providers
from modules.data_source_providers import synchronous_providers

custom_module = None
MODULE_NAME = 'Data Source Providers'

def _notify_module_enabled():
    data_sources.Registry.register(synchronous_providers.QuestionStatsSource)
    data_sources.Registry.register(
        synchronous_providers.StudentEnrollmentAndScoresSource)
    data_sources.Registry.register(
        synchronous_providers.StudentProgressStatsSource)
    data_sources.Registry.register(rest_providers.AssessmentsDataSource)
    data_sources.Registry.register(rest_providers.UnitsDataSource)
    data_sources.Registry.register(rest_providers.LessonsDataSource)
    data_sources.Registry.register(
        rest_providers.StudentAssessmentScoresDataSource)
    data_sources.Registry.register(rest_providers.LabelsDataSource)
    data_sources.Registry.register(rest_providers.StudentsDataSource)
    data_sources.Registry.register(rest_providers.LabelsOnStudentsDataSource)

def _notify_module_disabled():
    raise NotImplementedError(
        'Data sources may not be un-registered; disabling this module '
        'is not supported.')

def register_module():
    global custom_module  # pylint: disable=global-statement
    custom_module = custom_modules.Module(
        MODULE_NAME,
        'Implementations of specific data sources.',
        [], [], _notify_module_enabled, _notify_module_disabled)
    return custom_module


text:
{-# OPTIONS_GHC -fno-cse #-}  -- to protect unsafePerformIO hack

module Control.Parallel.HdpH.Internal.State.Location
  ( -- * reference to this node's ID
    myNodeRef,    -- :: IORef NodeId

    -- * reference to IDs of all nodes
    allNodesRef,  -- :: IORef [NodeId]

    -- * reference to system debug level
    debugRef      -- :: IORef Int
  ) where

import Prelude
import Control.Exception (throw)
import Data.IORef (IORef, newIORef)
import System.IO.Unsafe (unsafePerformIO)

import Control.Parallel.HdpH.Internal.Type.Location
       (NodeId, MyNodeException(NodeIdUnset))

-----------------------------------------------------------------------------
-- reference to ID of this node;
-- will be set in module HdpH.Internal.Comm;
-- if unset, access will raise a 'MyNodeException'

myNodeRef :: IORef NodeId
myNodeRef = unsafePerformIO $ newIORef $ throw NodeIdUnset
{-# NOINLINE myNodeRef #-}    -- required to protect unsafePerformIO hack

-----------------------------------------------------------------------------
-- reference to list of IDs of all nodes;
-- will be set (to non-empty list) in module HdpH_IO

allNodesRef :: IORef [NodeId]
allNodesRef = unsafePerformIO $ newIORef $ []
{-# NOINLINE allNodesRef #-}  -- required to protect unsafePerformIO hack

-----------------------------------------------------------------------------
-- reference to system debug level;
-- may be set in module HdpH.Internal.Comm;
-- referenced value must be non-negative (0 means no debug output)

debugRef :: IORef Int
debugRef  = unsafePerformIO $ newIORef $ 0
{-# NOINLINE debugRef #-}     -- required to protect unsafePerformIO hack


text:
from codetalker.pgm import Grammar, Translator
from codetalker.pgm.special import star, plus, _or
from codetalker.pgm.tokens import *

def start(rule):
    rule | star(_or(section, NEWLINE))
    rule.astAttrs = {'sections':[section]}

def section(rule):
    rule | (head, star(_or(define, NEWLINE)))
    rule.astAttrs = {'head':head, 'body':[define]}

def head(rule):
    rule | ('[', name, ']')
    rule.pass_single = True

def define(rule):
    rule | (name, _or(':', '='), value)
    rule.astAttrs = {'name':name, 'value':value}

def name(rule):
    rule | plus(_or(ID, NUMBER, WHITE))
    rule.astAttrs = {'words':[ID, NUMBER, WHITE]}

not_newline = (ANY, WHITE, ID, NUMBER)

def value(rule):
    rule | (star(_or(*not_newline)), _or(EOF, (NEWLINE, [INDENT, star(star(_or(*not_newline)), _or(NEWLINE, EOF)), _or(DEDENT, EOF)])))
    rule.astAttrs = {'text':list(not_newline)+[NEWLINE]}

grammar = Grammar(start=start, indent=True, tokens=[ID, NUMBER, NEWLINE, WHITE, ANY], idchars='-')

class RecursionError(Exception):pass

class Config:
    def __init__(self, sections={}):
        self.sections = sections

    def add_section(self, name, vbls):
        self.sections[name] = vbls

    def get_item(self, section, name, check=()):
        if not section in self.sections:
            raise KeyError('invalid section: %s' % section)
        elif name not in self.sections[section]:
            raise KeyError('undefined vbl: %s for section %s' % (name, section))
        elif name in check:
            raise RecursionError('recursive interpolation detected %s' % (check + (name,),))
        value = self.sections[section][name]
        if '%' not in value: # no need to interpolate
            return value
        vbls = {}
        for i in xrange(1000): # just in case something goes wrong...
            try:
                return value % vbls
            except KeyError, e:
                vbls[e.args[0]] = self.get_item(section, e.args[0], check + (name,))
        raise RecursionError('resursive interpolation...')

ast = grammar.ast_classes

t = Translator(grammar)

@t.translates(ast.Start)
def _start(node):
    return Config(dict(t.translate(section) for section in node.sections))

@t.translates(ast.Section)
def _section(node):
    return t.translate(node.head), dict(t.translate(line) for line in node.body)

@t.translates(ast.Define)
def _define(node):
    return t.translate(node.name), t.translate(node.value)

@t.translates(ast.Name)
def _name(node):
    return ''.join(tok.value for tok in node.words).strip()

@t.translates(ast.Value)
def _value(node):
    return ''.join(tok.value for tok in node.text).strip()

parse = t.from_string

# vim: et sw=4 sts=4


text:
<?php

namespace app\modules\admin\controllers;

use app\base\Model;
use app\modules\company\models\CompanyContact;
use Exception;
use Yii;
use app\modules\company\models\Company;
use app\modules\admin\models\CompanySearch;
use yii\helpers\ArrayHelper;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\Response;
use yii\widgets\ActiveForm;

/**
 * CompanyController implements the CRUD actions for Company model.
 */
class CompanyController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * Lists all Company models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new CompanySearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single Company model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new Company model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Company();

        $contact[] = new CompanyContact();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
                'contact' => $contact,
            ]);
        }
    }

    /**
     * Updates an existing Company model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        $contacts = $model->contacts;

        if ($model->load(Yii::$app->request->post())) {
            $oldIDs = ArrayHelper::map($contacts, 'id', 'id');
            $contacts = Model::createMultiple(CompanyContact::classname(), $contacts);
            Model::loadMultiple($contacts, Yii::$app->request->post());
            $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($contacts, 'id', 'id')));

            // ajax validation
            if (Yii::$app->request->isAjax) {
                Yii::$app->response->format = Response::FORMAT_JSON;
                return ArrayHelper::merge(
                    ActiveForm::validateMultiple($contacts),
                    ActiveForm::validate($model)
                );
            }

            // validate all models
            $valid = $model->validate();
            $valid = Model::validateMultiple($contacts) && $valid;

            if ($valid) {
                $transaction = \Yii::$app->db->beginTransaction();
                try {
                    if ($flag = $model->save(false)) {
                        if (!empty($deletedIDs)) {
                            CompanyContact::deleteAll(['id' => $deletedIDs]);
                        }
                        foreach ($contacts as $item) {
                            /** @var CompanyContact $item */
                            $item->company_id = $model->id;
                            if (! ($flag = $item->save(false))) {
                                $transaction->rollBack();
                                break;
                            }
                        }
                    }
                    if ($flag) {
                        $transaction->commit();
                        return $this->redirect(['view', 'id' => $model->id]);
                    }
                } catch (Exception $e) {
                    $transaction->rollBack();
                }
            }
        }

        return $this->render('update', [
            'model' => $model,
            'contacts' => (empty($contacts)) ? [new CompanyContact] : $contacts
        ]);
    }

    /**
     * Deletes an existing Company model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Company model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Company the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Company::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
package org.genericsystem.common;

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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.http.ServerWebSocket;

/**
 * @author Nicolas Feybesse
 *
 * @param <T>
 */
public abstract class AbstractWebSocketsServer {
	protected static Logger log = LoggerFactory.getLogger(AbstractWebSocketsServer.class);
	private List<HttpServer> httpServers = new ArrayList<>();
	private final int port;
	private final String host;

	public AbstractWebSocketsServer(String host, int port) {
		this.port = port;
		this.host = host;
	}

	public abstract Handler<Buffer> getHandler(String path, ServerWebSocket socket);

	public abstract Handler<Void> getCloseHandler(ServerWebSocket socket);

	public abstract void addHttpHandler(HttpServer httpServer);

	public void start() {
		log.info("Generic System Server is starting...!");
		Vertx vertx = GSVertx.vertx().getVertx();

		for (int i = 0; i < 2 * Runtime.getRuntime().availableProcessors(); i++) {
			// SLE
			// cmd line : keytool -genkey -keyalg RSA -alias genericsystem -keystore keystore.jks -storepass middleware -validity 360
			// url doc : https://www.javacodegeeks.com/2014/07/java-keystore-tutorial.html
			// HttpServer httpServer = vertx.createHttpServer(new HttpServerOptions().setPort(port).setHost(host).setSsl(true)
			// .setKeyStoreOptions(new JksOptions().setPath("keystore.jks").setPassword(new String("middleware"))));

			HttpServer httpServer = vertx.createHttpServer(new HttpServerOptions().setPort(port).setHost(host));

			httpServer.websocketHandler(webSocket -> {

				String path = webSocket.path();
				webSocket.handler(getHandler(path, webSocket));
				webSocket.exceptionHandler(e -> {
					log.error("Exception on websocket.", e);
					throw new IllegalStateException(e);
				});

				webSocket.closeHandler(getCloseHandler(webSocket));
			});

			addHttpHandler(httpServer);

			AbstractBackEnd.<HttpServer> synchronizeTask(handler -> httpServer.listen(handler));
			httpServers.add(httpServer);
		}
	}

	public void stop(Map<String, Root> roots) {
		log.info("Generic System Server is stopping...");
		httpServers.forEach(httpServer -> AbstractBackEnd.<Void> synchronizeTask(handler -> httpServer.close(handler)));
		roots.values().forEach(root -> root.close());
		roots = null;
		log.info("Generic System Server is stopped");
	}
}


text:
/*************************************************************************/
/*  viewport.cpp                                                         */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                    http://www.godotengine.org                         */
/*************************************************************************/
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                 */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
#include "viewport.h"
#include "os/os.h"
#include "scene/3d/spatial.h"
//#include "scene/3d/camera.h"

#include "servers/spatial_sound_server.h"
#include "servers/spatial_sound_2d_server.h"
#include "scene/gui/control.h"
#include "scene/3d/camera.h"
#include "scene/3d/spatial_indexer.h"
#include "scene/3d/collision_object.h"

int RenderTargetTexture::get_width() const {

	ERR_FAIL_COND_V(!vp,0);
	return vp->rect.size.width;
}
int RenderTargetTexture::get_height() const{

	ERR_FAIL_COND_V(!vp,0);
	return vp->rect.size.height;
}
Size2 RenderTargetTexture::get_size() const{

	ERR_FAIL_COND_V(!vp,Size2());
	return vp->rect.size;
}
RID RenderTargetTexture::get_rid() const{

	ERR_FAIL_COND_V(!vp,RID());
	return vp->render_target_texture_rid;
}

bool RenderTargetTexture::has_alpha() const{

	return false;
}

void RenderTargetTexture::set_flags(uint32_t p_flags){

	ERR_FAIL_COND(!vp);
	if (p_flags&FLAG_FILTER)
		flags=FLAG_FILTER;
	else
		flags=0;

	VS::get_singleton()->texture_set_flags(vp->render_target_texture_rid,flags);

}

uint32_t RenderTargetTexture::get_flags() const{

	return flags;
}

RenderTargetTexture::RenderTargetTexture(Viewport *p_vp){

	vp=p_vp;
	flags=0;
}

void Viewport::_update_stretch_transform() {

	if (size_override_stretch && size_override) {

		print_line("sive override size "+size_override_size);
		print_line("rect size "+rect.size);
		stretch_transform=Matrix32();
		Size2 scale = rect.size/(size_override_size+size_override_margin*2);
		stretch_transform.scale(scale);
		stretch_transform.elements[2]=size_override_margin*scale;

	} else {

		stretch_transform=Matrix32();
	}

	_update_global_transform();

}

void Viewport::_update_rect() {

	if (!is_inside_scene())
		return;

	Node *parent = get_parent();

	if (!render_target && parent && parent->cast_to<Control>()) {

		Control *c = parent->cast_to<Control>();

		rect.pos=Point2();
		rect.size=c->get_size();
	}

	VisualServer::ViewportRect vr;
	vr.x=rect.pos.x;
	vr.y=rect.pos.y;
	if (render_target) {
		vr.x=0;
		vr.y=0;
	}
	vr.width=rect.size.width;
	vr.height=rect.size.height;
	VisualServer::get_singleton()->viewport_set_rect(viewport,vr);

	if (canvas_item.is_valid()) {
		VisualServer::get_singleton()->canvas_item_set_custom_rect(canvas_item,true,rect);
	}

	emit_signal("size_changed");
	render_target_texture->emit_changed();

}

void Viewport::_parent_resized() {

	_update_rect();
}

void Viewport::_parent_draw() {

}

void Viewport::_parent_visibility_changed() {

	Node *parent = get_parent();

	if (parent && parent->cast_to<Control>()) {

		Control *c = parent->cast_to<Control>();
		VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,c->is_visible());

		_update_listener();
		_update_listener_2d();
	}

}

void Viewport::_vp_enter_scene() {

	Node *parent = get_parent();
		//none?
	if (parent && parent->cast_to<Control>()) {

		Control *cparent=parent->cast_to<Control>();
		RID parent_ci = cparent->get_canvas_item();
		ERR_FAIL_COND(!parent_ci.is_valid());
		canvas_item = VisualServer::get_singleton()->canvas_item_create();

		VisualServer::get_singleton()->canvas_item_set_parent(canvas_item,parent_ci);
		VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false);
		VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport);
		parent->connect("resized",this,"_parent_resized");
		parent->connect("visibility_changed",this,"_parent_visibility_changed");
	} else if (!parent){

		VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0);

	}

}

void Viewport::_vp_exit_scene() {

	Node *parent = get_parent();
	if (parent && parent->cast_to<Control>()) {

		parent->disconnect("resized",this,"_parent_resized");
	}

	if (parent && parent->cast_to<Control>()) {

		parent->disconnect("visibility_changed",this,"_parent_visibility_changed");
	}

	if (canvas_item.is_valid()) {

		VisualServer::get_singleton()->free(canvas_item);
		canvas_item=RID();

	}

	if (!parent) {

		VisualServer::get_singleton()->viewport_detach(viewport);

	}

}

void Viewport::update_worlds() {

	if (!is_inside_scene())
		return;

	Rect2 xformed_rect = (global_canvas_transform * canvas_transform).affine_inverse().xform(get_visible_rect());
	find_world_2d()->_update_viewport(this,xformed_rect);
	find_world_2d()->_update();

	find_world()->_update(get_scene()->get_frame());
}

void Viewport::_test_new_mouseover(ObjectID new_collider) {

	if (new_collider!=physics_object_over) {

		if (physics_object_over) {
			Object *obj = ObjectDB::get_instance(physics_object_over);
			if (obj) {
				CollisionObject *co = obj->cast_to<CollisionObject>();
				if (co) {
					co->_mouse_exit();
				}
			}
		}

		if (new_collider) {
			Object *obj = ObjectDB::get_instance(new_collider);
			if (obj) {
				CollisionObject *co = obj->cast_to<CollisionObject>();
				if (co) {
					co->_mouse_enter();

				}
			}

		}

		physics_object_over=new_collider;

	}

}

void Viewport::_notification(int p_what) {

	switch( p_what ) {

		case NOTIFICATION_ENTER_SCENE: {

			if (!render_target)
				_vp_enter_scene();

			this->parent=NULL;
			Node *parent=get_parent();

			if (parent) {

				while(parent && !(this->parent=parent->cast_to<Viewport>())) {

					parent=parent->get_parent();
				}
			}

			current_canvas=find_world_2d()->get_canvas();
			VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario());
			VisualServer::get_singleton()->viewport_attach_canvas(viewport,current_canvas);

			_update_listener();
			_update_listener_2d();
			_update_rect();

			if (world_2d.is_valid()) {
				find_world_2d()->_register_viewport(this,Rect2());
//best to defer this and not do it here, as it can annoy a lot of setup logic if user
//adds a node and then moves it, will get enter/exit screen/viewport notifications
//unnecesarily
//				update_worlds();
			}

			add_to_group("_viewports");

		} break;
		case NOTIFICATION_READY: {
#ifndef _3D_DISABLED
			if (cameras.size() && !camera) {
				//there are cameras but no current camera, pick first in tree and make it current
				Camera *first=NULL;
				for(Set<Camera*>::Element *E=cameras.front();E;E=E->next()) {

					if (first==NULL || first->is_greater_than(E->get())) {
						first=E->get();
					}
				}

				if (first)
					first->make_current();
			}
#endif
		} break;
		case NOTIFICATION_EXIT_SCENE: {

			if (world_2d.is_valid())
				world_2d->_remove_viewport(this);

			if (!render_target)
				_vp_exit_scene();

			VisualServer::get_singleton()->viewport_set_scenario(viewport,RID());
			SpatialSoundServer::get_singleton()->listener_set_space(listener,RID());
			VisualServer::get_singleton()->viewport_remove_canvas(viewport,current_canvas);
			remove_from_group("_viewports");

		} break;
		case NOTIFICATION_FIXED_PROCESS: {

			if (physics_object_picking) {

				Vector2 last_pos(1e20,1e20);
				CollisionObject *last_object;
				ObjectID last_id=0;
				PhysicsDirectSpaceState::RayResult result;

				bool motion_tested=false;

				while(physics_picking_events.size()) {

					InputEvent ev = physics_picking_events.front()->get();
					physics_picking_events.pop_front();

					Vector2 pos;
					switch(ev.type) {
						case InputEvent::MOUSE_MOTION: {
							pos.x=ev.mouse_motion.x;
							pos.y=ev.mouse_motion.y;
							motion_tested=true;
							physics_last_mousepos=pos;
						} break;
						case InputEvent::MOUSE_BUTTON: {
							pos.x=ev.mouse_button.x;
							pos.y=ev.mouse_button.y;

						} break;
						case InputEvent::SCREEN_DRAG: {
							pos.x=ev.screen_drag.x;
							pos.y=ev.screen_drag.y;
						} break;
						case InputEvent::SCREEN_TOUCH: {
							pos.x=ev.screen_touch.x;
							pos.y=ev.screen_touch.y;
						} break;

					}

					bool captured=false;

					if (physics_object_capture!=0) {

						Object *obj = ObjectDB::get_instance(physics_object_capture);
						if (obj) {
							CollisionObject *co = obj->cast_to<CollisionObject>();
							if (co) {
								co->_input_event(camera,ev,Vector3(),Vector3(),0);
								captured=true;
								if (ev.type==InputEvent::MOUSE_BUTTON && ev.mouse_button.button_index==1 && !ev.mouse_button.pressed) {
									physics_object_capture=0;
								}

							} else {
								physics_object_capture=0;
							}
						} else {
							physics_object_capture=0;
						}
					}

					if (captured) {
						//none
					} else if (pos==last_pos) {

						if (last_id) {
							if (ObjectDB::get_instance(last_id)) {
								//good, exists
								last_object->_input_event(camera,ev,result.position,result.normal,result.shape);
								if (last_object->get_capture_input_on_drag() && ev.type==InputEvent::MOUSE_BUTTON && ev.mouse_button.button_index==1 && ev.mouse_button.pressed) {
									physics_object_capture=last_id;
								}

							}
						}
					} else {

						if (camera) {

							Vector3 from = camera->project_ray_origin(pos);
							Vector3 dir = camera->project_ray_normal(pos);

							PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
							if (space) {

								bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
								ObjectID new_collider=0;
								if (col) {

									if (result.collider) {

										CollisionObject *co = result.collider->cast_to<CollisionObject>();
										if (co) {

											co->_input_event(camera,ev,result.position,result.normal,result.shape);
											last_object=co;
											last_id=result.collider_id;
											new_collider=last_id;
											if (co->get_capture_input_on_drag() && ev.type==InputEvent::MOUSE_BUTTON && ev.mouse_button.button_index==1 && ev.mouse_button.pressed) {
												physics_object_capture=last_id;
											}

										}
									}
								}

								if (ev.type==InputEvent::MOUSE_MOTION) {
									_test_new_mouseover(new_collider);
								}
							}

							last_pos=pos;
						}
					}
				}

				if (!motion_tested && camera && physics_last_mousepos!=Vector2(1e20,1e20)) {

					//test anyway for mouseenter/exit because objects might move
					Vector3 from = camera->project_ray_origin(physics_last_mousepos);
					Vector3 dir = camera->project_ray_normal(physics_last_mousepos);

					PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
					if (space) {

						bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
						ObjectID new_collider=0;
						if (col) {
							if (result.collider) {
								CollisionObject *co = result.collider->cast_to<CollisionObject>();
								if (co) {
									new_collider=result.collider_id;

								}
							}
						}

						_test_new_mouseover(new_collider);

					}

				}
			}

		} break;
	}
}

RID Viewport::get_viewport() const {

	return viewport;
}

void Viewport::set_rect(const Rect2& p_rect) {

	if (rect==p_rect)
		return;
	rect=p_rect;
	_update_rect();
	_update_stretch_transform();

}

Rect2 Viewport::get_visible_rect() const {

	Rect2 r;

	if (rect.pos==Vector2() && rect.size==Size2()) {

		r=Rect2( Point2(), Size2( OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height ) );
	} else {

		r=Rect2( rect.pos , rect.size );
	}

	if (size_override) {
		r.size=size_override_size;
	}

	return r;
}

Rect2 Viewport::get_rect() const {

	return rect;
}

void Viewport::_update_listener() {

	if (is_inside_scene() && audio_listener && camera && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible())))  {
		SpatialSoundServer::get_singleton()->listener_set_space(listener,find_world()->get_sound_space());
	} else {
		SpatialSoundServer::get_singleton()->listener_set_space(listener,RID());
	}

}

void Viewport::_update_listener_2d() {

	if (is_inside_scene() && audio_listener && camera && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible())))
		SpatialSound2DServer::get_singleton()->listener_set_space(listener_2d,find_world_2d()->get_sound_space());
	else
		SpatialSound2DServer::get_singleton()->listener_set_space(listener_2d,RID());

}

void Viewport::set_as_audio_listener(bool p_enable) {

	if (p_enable==audio_listener)
		return;

	audio_listener=p_enable;
	_update_listener();

}

bool Viewport::is_audio_listener() const {

	return  audio_listener;
}

void Viewport::set_as_audio_listener_2d(bool p_enable) {

	if (p_enable==audio_listener_2d)
		return;

	audio_listener_2d=p_enable;

	_update_listener_2d();

}

bool Viewport::is_audio_listener_2d() const {

	return  audio_listener_2d;
}

void Viewport::set_canvas_transform(const Matrix32& p_transform) {

	canvas_transform=p_transform;
	VisualServer::get_singleton()->viewport_set_canvas_transform(viewport,find_world_2d()->get_canvas(),canvas_transform);

	Matrix32 xform = (global_canvas_transform * canvas_transform).affine_inverse();
	Size2 ss = get_visible_rect().size;
	SpatialSound2DServer::get_singleton()->listener_set_transform(listener_2d,Matrix32(0,xform.xform(ss*0.5)));
	Vector2 ss2 = ss*xform.get_scale();
	float panrange = MAX(ss2.x,ss2.y);

	SpatialSound2DServer::get_singleton()->listener_set_param(listener_2d,SpatialSound2DServer::LISTENER_PARAM_PAN_RANGE,panrange);

}

Matrix32 Viewport::get_canvas_transform() const{

	return canvas_transform;
}

void Viewport::_update_global_transform() {

	Matrix32 sxform = stretch_transform * global_canvas_transform;

	VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport,sxform);

	Matrix32 xform = (sxform * canvas_transform).affine_inverse();
	Size2 ss = get_visible_rect().size;
	SpatialSound2DServer::get_singleton()->listener_set_transform(listener_2d,Matrix32(0,xform.xform(ss*0.5)));
	Vector2 ss2 = ss*xform.get_scale();
	float panrange = MAX(ss2.x,ss2.y);

	SpatialSound2DServer::get_singleton()->listener_set_param(listener_2d,SpatialSound2DServer::LISTENER_PARAM_PAN_RANGE,panrange);

}

void Viewport::set_global_canvas_transform(const Matrix32& p_transform) {

	global_canvas_transform=p_transform;

	_update_global_transform();

}

Matrix32 Viewport::get_global_canvas_transform() const{

	return global_canvas_transform;
}

void Viewport::_camera_transform_changed_notify() {

#ifndef _3D_DISABLED
	if (camera)
		SpatialSoundServer::get_singleton()->listener_set_transform(listener,camera->get_camera_transform());
#endif
}

void Viewport::_set_camera(Camera* p_camera) {

#ifndef _3D_DISABLED

	if (camera==p_camera)
		return;

	if (camera && find_world().is_valid()) {
		camera->notification(Camera::NOTIFICATION_LOST_CURRENT);
	}
	camera=p_camera;
	if (camera)
		VisualServer::get_singleton()->viewport_attach_camera(viewport,camera->get_camera());
	else
		VisualServer::get_singleton()->viewport_attach_camera(viewport,RID());

	if (camera && find_world().is_valid()) {
		camera->notification(Camera::NOTIFICATION_BECAME_CURRENT);
	}

	_update_listener();
	_camera_transform_changed_notify();
#endif
}

void Viewport::set_transparent_background(bool p_enable) {

	transparent_bg=p_enable;
	VS::get_singleton()->viewport_set_transparent_background(viewport,p_enable);

}

bool Viewport::has_transparent_background() const {

	return transparent_bg;
}

#if 0
void Viewport::set_world_2d(const Ref<World2D>& p_world_2d) {

	world_2d=p_world_2d;
	_update_listener_2d();

	if (is_inside_scene()) {
		if (current_canvas.is_valid())
			VisualServer::get_singleton()->viewport_remove_canvas(viewport,current_canvas);
		current_canvas=find_world_2d()->get_canvas();
		VisualServer::get_singleton()->viewport_attach_canvas(viewport,current_canvas);
	}

}

Ref<World2D> Viewport::find_world_2d() const{

	if (world_2d.is_valid())
		return world_2d;
	else if (parent)
		return parent->find_world_2d();
	else
		return Ref<World2D>();
}
#endif

Ref<World2D> Viewport::find_world_2d() const{

	return world_2d;
}

void Viewport::_propagate_enter_world(Node *p_node) {

	if (p_node!=this) {

		if (!p_node->is_inside_scene()) //may not have entered scene yet
			return;

		Spatial *s = p_node->cast_to<Spatial>();
		if (s) {

			s->notification(Spatial::NOTIFICATION_ENTER_WORLD);
		} else {
			Viewport *v = p_node->cast_to<Viewport>();
			if (v) {

				if (v->world.is_valid())
					return;
			}
		}
	}

	for(int i=0;i<p_node->get_child_count();i++) {

		_propagate_enter_world(p_node->get_child(i));
	}
}

void Viewport::_propagate_exit_world(Node *p_node) {

	if (p_node!=this) {

		if (!p_node->is_inside_scene()) //may have exited scene already
			return;

		Spatial *s = p_node->cast_to<Spatial>();
		if (s) {

			s->notification(Spatial::NOTIFICATION_EXIT_WORLD,false);
		} else {
			Viewport *v = p_node->cast_to<Viewport>();
			if (v) {

				if (v->world.is_valid())
					return;
			}
		}
	}

	for(int i=0;i<p_node->get_child_count();i++) {

		_propagate_exit_world(p_node->get_child(i));
	}

}

void Viewport::set_world(const Ref<World>& p_world) {

	if (world==p_world)
		return;

	if (is_inside_scene())
		_propagate_exit_world(this);

#ifndef _3D_DISABLED
	if (find_world().is_valid() && camera)
		camera->notification(Camera::NOTIFICATION_LOST_CURRENT);
#endif

	world=p_world;

	if (is_inside_scene())
		_propagate_enter_world(this);

#ifndef _3D_DISABLED
	if (find_world().is_valid() && camera)
		camera->notification(Camera::NOTIFICATION_BECAME_CURRENT);
#endif

	//propagate exit

	if (is_inside_scene()) {
		VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario());
	}

	_update_listener();

}

Ref<World> Viewport::get_world() const{

	return world;
}

Ref<World> Viewport::find_world() const{

	if (own_world.is_valid())
		return own_world;
	else if (world.is_valid())
		return world;
	else if (parent)
		return parent->find_world();
	else
		return Ref<World>();
}

Camera* Viewport::get_camera() const {

	return camera;
}

Matrix32 Viewport::get_final_transform() const {

	return stretch_transform * global_canvas_transform;
}

void Viewport::set_size_override(bool p_enable, const Size2& p_size, const Vector2 &p_margin) {

	if (size_override==p_enable && p_size==size_override_size)
		return;

	size_override=p_enable;
	if (p_size.x>=0 || p_size.y>=0) {
		size_override_size=p_size;
	}
	size_override_margin=p_margin;
	_update_rect();
	_update_stretch_transform();

}

Size2 Viewport::get_size_override() const {

	return size_override_size;
}
bool Viewport::is_size_override_enabled() const {

	return size_override;
}
void Viewport::set_size_override_stretch(bool p_enable) {

	if (p_enable==size_override_stretch)
		return;

	size_override_stretch=p_enable;
	if (size_override) {
		_update_rect();
	}

	_update_stretch_transform();
}

bool Viewport::is_size_override_stretch_enabled() const {

	return size_override;
}

void Viewport::set_as_render_target(bool p_enable){

	if (render_target==p_enable)
		return;

	render_target=p_enable;

	VS::get_singleton()->viewport_set_as_render_target(viewport,p_enable);
	if (is_inside_scene()) {

		if (p_enable)
			_vp_exit_scene();
		else
			_vp_enter_scene();
	}

	if (p_enable) {

		render_target_texture_rid = VS::get_singleton()->viewport_get_render_target_texture(viewport);
	} else {

		render_target_texture_rid=RID();
	}

	render_target_texture->set_flags(render_target_texture->flags);
	render_target_texture->emit_changed();
}

bool Viewport::is_set_as_render_target() const{

	return render_target;
}
void Viewport::set_render_target_update_mode(RenderTargetUpdateMode p_mode){

	render_target_update_mode=p_mode;
	VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RenderTargetUpdateMode(p_mode));

}
Viewport::RenderTargetUpdateMode Viewport::get_render_target_update_mode() const{

	return render_target_update_mode;
}
//RID get_render_target_texture() const;

void Viewport::queue_screen_capture(){

	VS::get_singleton()->viewport_queue_screen_capture(viewport);
}
Image Viewport::get_screen_capture() const {

	return VS::get_singleton()->viewport_get_screen_capture(viewport);
}

Ref<RenderTargetTexture> Viewport::get_render_target_texture() const {

	return render_target_texture;
}

void Viewport::set_render_target_vflip(bool p_enable) {

	render_target_vflip=p_enable;
	VisualServer::get_singleton()->viewport_set_render_target_vflip(viewport,p_enable);
}

bool Viewport::get_render_target_vflip() const{

	return render_target_vflip;
}

void Viewport::set_render_target_filter(bool p_enable) {

	render_target_texture->set_flags(p_enable?int(Texture::FLAG_FILTER):int(0));

}

bool Viewport::get_render_target_filter() const{

	return (render_target_texture->get_flags()&Texture::FLAG_FILTER)!=0;
}

void Viewport::set_render_target_gen_mipmaps(bool p_enable) {

	//render_target_texture->set_flags(p_enable?int(Texture::FLAG_FILTER):int(0));
	render_target_gen_mipmaps=p_enable;

}

bool Viewport::get_render_target_gen_mipmaps() const{

	//return (render_target_texture->get_flags()&Texture::FLAG_FILTER)!=0;
	return render_target_gen_mipmaps;
}

Matrix32 Viewport::_get_input_pre_xform() const {

	Matrix32 pre_xf;
	if (render_target) {

		ERR_FAIL_COND_V(to_screen_rect.size.x==0,pre_xf);
		ERR_FAIL_COND_V(to_screen_rect.size.y==0,pre_xf);
		pre_xf.scale(rect.size/to_screen_rect.size);
		pre_xf.elements[2]=-to_screen_rect.pos;
	} else {

		pre_xf.elements[2]=-rect.pos;
	}

	return pre_xf;
}

void Viewport::_make_input_local(InputEvent& ev) {

	switch(ev.type) {

		case InputEvent::MOUSE_BUTTON: {

			Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
			Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y));
			Vector2 l = ai.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y));
			ev.mouse_button.x=l.x;
			ev.mouse_button.y=l.y;
			ev.mouse_button.global_x=g.x;
			ev.mouse_button.global_y=g.y;

		} break;
		case InputEvent::MOUSE_MOTION: {

			Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
			Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y));
			Vector2 l = ai.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y));
			Vector2 r = ai.xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y));
			ev.mouse_motion.x=l.x;
			ev.mouse_motion.y=l.y;
			ev.mouse_motion.global_x=g.x;
			ev.mouse_motion.global_y=g.y;
			ev.mouse_motion.relative_x=r.x;
			ev.mouse_motion.relative_y=r.y;

		} break;
		case InputEvent::SCREEN_TOUCH: {

			Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
			Vector2 t = ai.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y));
			ev.screen_touch.x=t.x;
			ev.screen_touch.y=t.y;

		} break;
		case InputEvent::SCREEN_DRAG: {

			Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
			Vector2 t = ai.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y));
			Vector2 r = ai.xform(Vector2(ev.screen_drag.relative_x,ev.screen_drag.relative_y));
			Vector2 s = ai.xform(Vector2(ev.screen_drag.speed_x,ev.screen_drag.speed_y));
			ev.screen_drag.x=t.x;
			ev.screen_drag.y=t.y;
			ev.screen_drag.relative_x=r.x;
			ev.screen_drag.relative_y=r.y;
			ev.screen_drag.speed_x=s.x;
			ev.screen_drag.speed_y=s.y;
		} break;
	}

}

void Viewport::_vp_input(const InputEvent& p_ev) {

	if (render_target && to_screen_rect==Rect2())
		return; //if render target, can't get input events

	//this one handles system input, p_ev are in system coordinates
	//they are converted to viewport coordinates

	InputEvent ev = p_ev;
	_make_input_local(ev);
	input(ev);

}

void Viewport::_vp_unhandled_input(const InputEvent& p_ev) {

	if (render_target && to_screen_rect==Rect2())
		return; //if render target, can't get input events

	//this one handles system input, p_ev are in system coordinates
	//they are converted to viewport coordinates

	InputEvent ev = p_ev;
	_make_input_local(ev);
	unhandled_input(ev);

}

void Viewport::input(const InputEvent& p_event) {

	ERR_FAIL_COND(!is_inside_scene());
	get_scene()->_call_input_pause(input_group,"_input",p_event);
	get_scene()->call_group(SceneMainLoop::GROUP_CALL_REVERSE|SceneMainLoop::GROUP_CALL_REALTIME|SceneMainLoop::GROUP_CALL_MULIILEVEL,gui_input_group,"_gui_input",p_event); //special one for GUI, as controls use their own process check
}

void Viewport::unhandled_input(const InputEvent& p_event) {

	ERR_FAIL_COND(!is_inside_scene());

	get_scene()->_call_input_pause(unhandled_input_group,"_unhandled_input",p_event);
	//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_input","_unhandled_input",ev);
	if (!get_scene()->input_handled && p_event.type==InputEvent::KEY) {
		get_scene()->_call_input_pause(unhandled_key_input_group,"_unhandled_key_input",p_event);
		//call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_key_input","_unhandled_key_input",ev);
	}

	if (physics_object_picking && !get_scene()->input_handled) {

		if (p_event.type==InputEvent::MOUSE_BUTTON || p_event.type==InputEvent::MOUSE_MOTION || p_event.type==InputEvent::SCREEN_DRAG || p_event.type==InputEvent::SCREEN_TOUCH) {
			physics_picking_events.push_back(p_event);
		}
	}

}

void Viewport::set_use_own_world(bool p_world) {

	if (p_world==own_world.is_valid())
		return;

	if (is_inside_scene())
		_propagate_exit_world(this);

#ifndef _3D_DISABLED
	if (find_world().is_valid() && camera)
		camera->notification(Camera::NOTIFICATION_LOST_CURRENT);
#endif

	if (!p_world)
		own_world=Ref<World>();
	else
		own_world=Ref<World>( memnew( World ));

	if (is_inside_scene())
		_propagate_enter_world(this);

#ifndef _3D_DISABLED
	if (find_world().is_valid() && camera)
		camera->notification(Camera::NOTIFICATION_BECAME_CURRENT);
#endif

	//propagate exit

	if (is_inside_scene()) {
		VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario());
	}

	_update_listener();

}

bool Viewport::is_using_own_world() const {

	return own_world.is_valid();
}

void Viewport::set_render_target_to_screen_rect(const Rect2& p_rect) {

	to_screen_rect=p_rect;
	VisualServer::get_singleton()->viewport_set_render_target_to_screen_rect(viewport,to_screen_rect);
}

Rect2 Viewport::get_render_target_to_screen_rect() const{

	return to_screen_rect;
}

void Viewport::set_physics_object_picking(bool p_enable) {

	physics_object_picking=p_enable;
	set_fixed_process(physics_object_picking);
	if (!physics_object_picking)
		physics_picking_events.clear();

}

bool Viewport::get_physics_object_picking() {

	return physics_object_picking;
}

void Viewport::_bind_methods() {

	ObjectTypeDB::bind_method(_MD("set_rect","rect"), &Viewport::set_rect);
	ObjectTypeDB::bind_method(_MD("get_rect"), &Viewport::get_rect);
	//ObjectTypeDB::bind_method(_MD("set_world_2d","world_2d:World2D"), &Viewport::set_world_2d);
	//ObjectTypeDB::bind_method(_MD("get_world_2d:World2D"), &Viewport::get_world_2d);
	ObjectTypeDB::bind_method(_MD("find_world_2d:World2D"), &Viewport::find_world_2d);
	ObjectTypeDB::bind_method(_MD("set_world","world:World"), &Viewport::set_world);
	ObjectTypeDB::bind_method(_MD("get_world:World"), &Viewport::get_world);
	ObjectTypeDB::bind_method(_MD("find_world:World"), &Viewport::find_world);

	ObjectTypeDB::bind_method(_MD("set_canvas_transform","xform"), &Viewport::set_canvas_transform);
	ObjectTypeDB::bind_method(_MD("get_canvas_transform"), &Viewport::get_canvas_transform);

	ObjectTypeDB::bind_method(_MD("set_global_canvas_transform","xform"), &Viewport::set_global_canvas_transform);
	ObjectTypeDB::bind_method(_MD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform);
	ObjectTypeDB::bind_method(_MD("get_final_transform"), &Viewport::get_final_transform);

	ObjectTypeDB::bind_method(_MD("get_visible_rect"), &Viewport::get_visible_rect);
	ObjectTypeDB::bind_method(_MD("set_transparent_background","enable"), &Viewport::set_transparent_background);
	ObjectTypeDB::bind_method(_MD("has_transparent_background"), &Viewport::has_transparent_background);

	ObjectTypeDB::bind_method(_MD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed);

	ObjectTypeDB::bind_method(_MD("_parent_resized"), &Viewport::_parent_resized);
	ObjectTypeDB::bind_method(_MD("_vp_input"), &Viewport::_vp_input);
	ObjectTypeDB::bind_method(_MD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input);

	ObjectTypeDB::bind_method(_MD("set_size_override","enable","size","margin"), &Viewport::set_size_override,DEFVAL(Size2(-1,-1)),DEFVAL(Size2(0,0)));
	ObjectTypeDB::bind_method(_MD("get_size_override"), &Viewport::get_size_override);
	ObjectTypeDB::bind_method(_MD("is_size_override_enabled"), &Viewport::is_size_override_enabled);
	ObjectTypeDB::bind_method(_MD("set_size_override_stretch","enabled"), &Viewport::set_size_override_stretch);
	ObjectTypeDB::bind_method(_MD("is_size_override_stretch_enabled"), &Viewport::is_size_override_stretch_enabled);
	ObjectTypeDB::bind_method(_MD("queue_screen_capture"), &Viewport::queue_screen_capture);
	ObjectTypeDB::bind_method(_MD("get_screen_capture"), &Viewport::get_screen_capture);

	ObjectTypeDB::bind_method(_MD("set_as_render_target","enable"), &Viewport::set_as_render_target);
	ObjectTypeDB::bind_method(_MD("is_set_as_render_target"), &Viewport::is_set_as_render_target);

	ObjectTypeDB::bind_method(_MD("set_render_target_vflip","enable"), &Viewport::set_render_target_vflip);
	ObjectTypeDB::bind_method(_MD("get_render_target_vflip"), &Viewport::get_render_target_vflip);

	ObjectTypeDB::bind_method(_MD("set_render_target_filter","enable"), &Viewport::set_render_target_filter);
	ObjectTypeDB::bind_method(_MD("get_render_target_filter"), &Viewport::get_render_target_filter);

	ObjectTypeDB::bind_method(_MD("set_render_target_gen_mipmaps","enable"), &Viewport::set_render_target_gen_mipmaps);
	ObjectTypeDB::bind_method(_MD("get_render_target_gen_mipmaps"), &Viewport::get_render_target_gen_mipmaps);

	ObjectTypeDB::bind_method(_MD("set_render_target_update_mode","mode"), &Viewport::set_render_target_update_mode);
	ObjectTypeDB::bind_method(_MD("get_render_target_update_mode"), &Viewport::get_render_target_update_mode);

	ObjectTypeDB::bind_method(_MD("get_render_target_texture:RenderTargetTexture"), &Viewport::get_render_target_texture);

	ObjectTypeDB::bind_method(_MD("set_physics_object_picking","enable"), &Viewport::set_physics_object_picking);
	ObjectTypeDB::bind_method(_MD("get_physics_object_picking"), &Viewport::get_physics_object_picking);

	ObjectTypeDB::bind_method(_MD("get_viewport"), &Viewport::get_viewport);
	ObjectTypeDB::bind_method(_MD("input","local_event"), &Viewport::input);
	ObjectTypeDB::bind_method(_MD("unhandled_input","local_event"), &Viewport::unhandled_input);

	ObjectTypeDB::bind_method(_MD("update_worlds"), &Viewport::update_worlds);

	ObjectTypeDB::bind_method(_MD("set_use_own_world","enable"), &Viewport::set_use_own_world);
	ObjectTypeDB::bind_method(_MD("is_using_own_world"), &Viewport::is_using_own_world);

	ObjectTypeDB::bind_method(_MD("get_camera:Camera"), &Viewport::get_camera);

	ObjectTypeDB::bind_method(_MD("set_as_audio_listener","enable"), &Viewport::set_as_audio_listener);
	ObjectTypeDB::bind_method(_MD("is_audio_listener","enable"), &Viewport::is_audio_listener);

	ObjectTypeDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d);
	ObjectTypeDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d);
	ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect"), &Viewport::set_render_target_to_screen_rect);

	ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"), _SCS("set_rect"), _SCS("get_rect") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"own_world"), _SCS("set_use_own_world"), _SCS("is_using_own_world") );
	ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world",PROPERTY_HINT_RESOURCE_TYPE,"World"), _SCS("set_world"), _SCS("get_world") );
//	ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), _SCS("set_world_2d"), _SCS("get_world_2d") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transparent_bg"), _SCS("set_transparent_background"), _SCS("has_transparent_background") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/enabled"), _SCS("set_as_render_target"), _SCS("is_set_as_render_target") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/v_flip"), _SCS("set_render_target_vflip"), _SCS("get_render_target_vflip") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/filter"), _SCS("set_render_target_filter"), _SCS("get_render_target_filter") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/gen_mipmaps"), _SCS("set_render_target_gen_mipmaps"), _SCS("get_render_target_gen_mipmaps") );
	ADD_PROPERTY( PropertyInfo(Variant::INT,"render_target/update_mode",PROPERTY_HINT_ENUM,"Disabled,Once,When Visible,Always"), _SCS("set_render_target_update_mode"), _SCS("get_render_target_update_mode") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener/enable_2d"), _SCS("set_as_audio_listener_2d"), _SCS("is_audio_listener_2d") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener/enable_3d"), _SCS("set_as_audio_listener"), _SCS("is_audio_listener") );
	ADD_PROPERTY( PropertyInfo(Variant::BOOL,"physics/object_picking"), _SCS("set_physics_object_picking"), _SCS("get_physics_object_picking") );

	ADD_SIGNAL(MethodInfo("size_changed"));

	BIND_CONSTANT( RENDER_TARGET_UPDATE_DISABLED );
	BIND_CONSTANT( RENDER_TARGET_UPDATE_ONCE  );
	BIND_CONSTANT( RENDER_TARGET_UPDATE_WHEN_VISIBLE  );
	BIND_CONSTANT( RENDER_TARGET_UPDATE_ALWAYS  );

}

Viewport::Viewport() {

	world_2d = Ref<World2D>( memnew( World2D ));

	viewport = VisualServer::get_singleton()->viewport_create();
	listener=SpatialSoundServer::get_singleton()->listener_create();
	audio_listener=false;
	listener_2d=SpatialSound2DServer::get_singleton()->listener_create();
	audio_listener_2d=false;
	transparent_bg=false;
	parent=NULL;
	camera=NULL;
	size_override=false;
	size_override_stretch=false;
	size_override_size=Size2(1,1);
	render_target_gen_mipmaps=false;
	render_target=false;
	render_target_vflip=false;
	render_target_update_mode=RENDER_TARGET_UPDATE_WHEN_VISIBLE;
	render_target_texture = Ref<RenderTargetTexture>( memnew( RenderTargetTexture(this) ) );

	physics_object_picking=false;
	physics_object_capture=0;
	physics_object_over=0;
	physics_last_mousepos=Vector2(1e20,1e20);

	String id=itos(get_instance_ID());
	input_group = "_vp_input"+id;
	gui_input_group = "_vp_gui_input"+id;
	unhandled_input_group = "_vp_unhandled_input"+id;
	unhandled_key_input_group = "_vp_unhandled_key_input"+id;

}

Viewport::~Viewport() {

	VisualServer::get_singleton()->free( viewport );
	SpatialSoundServer::get_singleton()->free(listener);
	if (render_target_texture.is_valid())
		render_target_texture->vp=NULL; //so if used, will crash
}


text:
namespace Line.Messaging
{
    public enum NumberOfSentMessagesStatus
    {
        Ready,
        Unready,
        out_of_service
    }
}


text:
class MockMediaGalleriesDialog : public MediaGalleriesDialog {
 public:
  typedef base::Callback<void(int update_count)> DialogDestroyedCallback;

  explicit MockMediaGalleriesDialog(const DialogDestroyedCallback& callback);
  virtual ~MockMediaGalleriesDialog();

  // MediaGalleriesDialog implementation.
  virtual void UpdateGalleries() OVERRIDE;

  // Number up times UpdateResults has been called.
  int update_count() const;

 private:
  // MediaGalleriesDialog implementation.
  virtual void AcceptDialogForTesting() OVERRIDE;

  int update_count_;

  DialogDestroyedCallback dialog_destroyed_callback_;

  DISALLOW_COPY_AND_ASSIGN(MockMediaGalleriesDialog);
};

#endif  // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_TEST_UTIL_H_


text:
package br.com.objectos.way.xls;

/**
 * @author Marcio Endo
 */
public interface XlsRow extends IsXlsSerializable {}


text:
import { Logger } from '.';
declare const setup: (factory?: () => Logger) => void;
declare const rootLogger: Logger;
export { rootLogger, setup };


text:
//
//  AKBandRejectButterworthFilterDSPKernel.hpp
//  AudioKit
//
//  Created by Aurelius Prochazka, revision history on Github.
//  Copyright (c) 2016 Aurelius Prochazka. All rights reserved.
//

#ifndef AKBandRejectButterworthFilterDSPKernel_hpp
#define AKBandRejectButterworthFilterDSPKernel_hpp

#import "DSPKernel.hpp"
#import "ParameterRamper.hpp"

#import <AudioKit/AudioKit-Swift.h>

extern "C" {
#include "soundpipe.h"
}

enum {
    centerFrequencyAddress = 0,
    bandwidthAddress = 1
};

class AKBandRejectButterworthFilterDSPKernel : public DSPKernel {
public:
    // MARK: Member Functions

    AKBandRejectButterworthFilterDSPKernel() {}

    void init(int channelCount, double inSampleRate) {
        channels = channelCount;

        sampleRate = float(inSampleRate);

        sp_create(&sp);
        sp->sr = sampleRate;
        sp->nchan = channels;
        sp_butbr_create(&butbr);
        sp_butbr_init(sp, butbr);
        butbr->freq = 3000;
        butbr->bw = 2000;
    }

    void start() {
        started = true;
    }

    void stop() {
        started = false;
    }

    void destroy() {
        sp_butbr_destroy(&butbr);
        sp_destroy(&sp);
    }

    void reset() {
        resetted = true;
    }

    void setCenterFrequency(float freq) {
        centerFrequency = freq;
        centerFrequencyRamper.setImmediate(freq);
    }

    void setBandwidth(float bw) {
        bandwidth = bw;
        bandwidthRamper.setImmediate(bw);
    }

    void setParameter(AUParameterAddress address, AUValue value) {
        switch (address) {
            case centerFrequencyAddress:
                centerFrequencyRamper.setUIValue(clamp(value, (float)12.0, (float)20000.0));
                break;

            case bandwidthAddress:
                bandwidthRamper.setUIValue(clamp(value, (float)0.0, (float)20000.0));
                break;

        }
    }

    AUValue getParameter(AUParameterAddress address) {
        switch (address) {
            case centerFrequencyAddress:
                return centerFrequencyRamper.getUIValue();

            case bandwidthAddress:
                return bandwidthRamper.getUIValue();

            default: return 0.0f;
        }
    }

    void startRamp(AUParameterAddress address, AUValue value, AUAudioFrameCount duration) override {
        switch (address) {
            case centerFrequencyAddress:
                centerFrequencyRamper.startRamp(clamp(value, (float)12.0, (float)20000.0), duration);
                break;

            case bandwidthAddress:
                bandwidthRamper.startRamp(clamp(value, (float)0.0, (float)20000.0), duration);
                break;

        }
    }

    void setBuffers(AudioBufferList *inBufferList, AudioBufferList *outBufferList) {
        inBufferListPtr = inBufferList;
        outBufferListPtr = outBufferList;
    }

    void process(AUAudioFrameCount frameCount, AUAudioFrameCount bufferOffset) override {

        for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) {

            int frameOffset = int(frameIndex + bufferOffset);

            centerFrequency = centerFrequencyRamper.getAndStep();
            butbr->freq = (float)centerFrequency;
            bandwidth = bandwidthRamper.getAndStep();
            butbr->bw = (float)bandwidth;

            for (int channel = 0; channel < channels; ++channel) {
                float *in  = (float *)inBufferListPtr->mBuffers[channel].mData  + frameOffset;
                float *out = (float *)outBufferListPtr->mBuffers[channel].mData + frameOffset;

                if (started) {
                    sp_butbr_compute(sp, butbr, in, out);
                } else {
                    *out = *in;
                }
            }
        }
    }

    // MARK: Member Variables

private:

    int channels = AKSettings.numberOfChannels;
    float sampleRate = AKSettings.sampleRate;

    AudioBufferList *inBufferListPtr = nullptr;
    AudioBufferList *outBufferListPtr = nullptr;

    sp_data *sp;
    sp_butbr *butbr;

    float centerFrequency = 3000;
    float bandwidth = 2000;

public:
    bool started = true;
    bool resetted = false;
    ParameterRamper centerFrequencyRamper = 3000;
    ParameterRamper bandwidthRamper = 2000;
};

#endif /* AKBandRejectButterworthFilterDSPKernel_hpp */


text:
package io.cortical.rest.model;

/**
 * Contains the the names of the various distance metrics as constants.
 *
 */
abstract class MetricConstants {

    /** Cosine Similarity. */
    public static final String COSINE_SIMILARITY = "Cosine-Similarity";
    /** Euclidean Distance. */
    public static final String EUCLIDEAN_DISTANCE = "Euclidean-Distance";
    /** Jaccard Distance. */
    public static final String JACCARD_DISTANCE = "Jaccard-Distance";
    /** The total number of overlapping bits of the two fingerprints. **/
    public static final String OVERLAPPING_ALL = "Overlapping-all";
    /** The percentage of bits of the left-hand (first) fingerprint which overlap with the right-hand (second) fingerprint. */
    public static final String OVERLAPPING_LEFT_RIGHT = "Overlapping-left-right";
    /** The percentage of bits of the right-hand (second) fingerprint which overlap with the left-hand (first) fingerprint. */
    public static final String OVERLAPPING_RIGHT_LEFT = "Overlapping-right-left";
    /** Weighted scoring which takes the topology into account. */
    public static final String WEIGHTED_SCORING = "Weighted-Scoring";
    /** Size in bits of left fingerprint. */
    public static final String SIZE_LEFT = "Size-left";
    /** Size in bits of right fingerprint. */
    public static final String SIZE_RIGHT = "Size-right";
}


text:
<?php
namespace Braintree;

/**
 * Braintree AmexExpressCheckoutCard module
 * Creates and manages Braintree Amex Express Checkout cards
 *
 * == More information ==
 *
 * See {@link https://developers.braintreepayments.com/javascript+php}

 *
 * @package    Braintree
 * @category   Resources
 *
 * @property-read string $bin
 * @property-read string $cardMemberExpiryDate
 * @property-read string $cardMemberNumber
 * @property-read string $cardType
 * @property-read \DateTime $createdAt
 * @property-read string $customerId
 * @property-read boolean $default
 * @property-read string $expirationMonth
 * @property-read string $expirationYear
 * @property-read string $imageUrl
 * @property-read string $token
 * @property-read string $sourceDescription
 * @property-read \Braintree\Subscription[] $subscriptions
 * @property-read \DateTime $updatedAt
 */
class AmexExpressCheckoutCard extends Base
{
    /* instance methods */
    /**
     * returns false if default is null or false
     *
     * @return boolean
     */
    public function isDefault()
    {
        return $this->default;
    }

    /**
     *  factory method: returns an instance of AmexExpressCheckoutCard
     *  to the requesting method, with populated properties
     *
     * @ignore
     * @return AmexExpressCheckoutCard
     */
    public static function factory($attributes)
    {

        $instance = new self();
        $instance->_initialize($attributes);
        return $instance;
    }

    /**
     * sets instance properties from an array of values
     *
     * @access protected
     * @param array $amexExpressCheckoutCardAttribs array of Amex Express Checkout card properties
     * @return void
     */
    protected function _initialize($amexExpressCheckoutCardAttribs)
    {
        // set the attributes
        $this->_attributes = $amexExpressCheckoutCardAttribs;

        $subscriptionArray = [];
        if (isset($amexExpressCheckoutCardAttribs['subscriptions'])) {
            foreach ($amexExpressCheckoutCardAttribs['subscriptions'] AS $subscription) {
                $subscriptionArray[] = Subscription::factory($subscription);
            }
        }

        $this->_set('subscriptions', $subscriptionArray);
    }
}
class_alias('Braintree\AmexExpressCheckoutCard', 'Braintree_AmexExpressCheckoutCard');