text:
<!doctype html>
<html amp lang="en" dir="rtl">
  <head>
    <meta charset="utf-8">
    <title>Shopping</title>
    <link rel="canonical" href="amps.html">
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
    <script async custom-element="amp-story-auto-analytics" src="https://cdn.ampproject.org/v0/amp-story-auto-analytics-0.1.js"></script>
    <script async custom-element="amp-story-shopping" src="https://cdn.ampproject.org/v0/amp-story-shopping-0.1.js"></script>
    <style amp-custom>
      [data-product-id="lamp"] {
        top: 31%;
        left: 1%;
      }
      [data-product-id="art"] {
        top: 15%;
        left: 40%;
      }
      [data-product-id="chair"] {
        top: 53%;
        left: 30%;
      }
      [data-product-id="flowers"] {
        top: 46%;
        left: 83%;
      }
      /* Prevents CSS animations from running. */
      * {
        animation-duration: 0s !important
      }
    </style>
  </head>
  <body>
    <amp-story-auto-analytics gtag-id="UA-174115079-1"></amp-story-auto-analytics>
    <amp-story
        standalone
        title="Story Shopping Component"
        publisher="AMP Story Shopping"
        publisher-logo-src="example.com/logo.png"
        poster-portrait-src="example.com/poster.jpg">
      <amp-story-page id="inline-light-theme">
        <amp-story-grid-layer template="fill">
          <amp-img layout="fill" src="/examples/visual-tests/amp-story/img/cat1.jpg"></amp-img>
        </amp-story-grid-layer>
        <amp-story-grid-layer template="vertical">
          <amp-story-shopping-tag data-product-id="lamp" ></amp-story-shopping-tag>
          <amp-story-shopping-tag data-product-id="art" ></amp-story-shopping-tag>
          <amp-story-shopping-tag data-product-id="chair" ></amp-story-shopping-tag>
          <amp-story-shopping-tag data-product-id="flowers" ></amp-story-shopping-tag>
        </amp-story-grid-layer>
        <!--
          Example of Inline config. Multiple product tags with icon defined.
        -->
        <amp-story-shopping-attachment>
          <script type="application/json">
            {
                "items" : [
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "lamp",
                    "productTitle": "Brass Lamp",
                    "productBrand": "Lamp Co",
                    "productPrice": 799.00,
                    "productPriceCurrency": "USD",
                    "productImages": [
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 1"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 2"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 3"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 4"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 5"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 6"}
                    ],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   },
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "art",
                    "productTitle": "Abstract Art",
                    "productBrand": "V. Artsy",
                    "productPrice": 1200.00,
                    "productPriceCurrency": "INR",
                    "productImages": [{"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "art"}],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   },
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "chair",
                    "productTitle": "Yellow chair",
                    "productPrice": 1000.00,
                    "productPriceCurrency": "BRL",
                    "productTagText": "The perfectly imperfect yellow chair",
                    "productImages": [{"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "chair"}],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   },
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "flowers",
                    "productTitle": "Flowers",
                    "productBrand": "Very Long Flower Company Name",
                    "productPrice": 10.00,
                    "productPriceCurrency": "USD",
                    "productIcon": "/examples/visual-tests/amp-story/img/shopping/icon.png",
                    "productImages": [{"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "flowers"}],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. \n Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   }
                ]
              }
          </script>
        </amp-story-shopping-attachment>
      </amp-story-page>
      <amp-story-page id="inline-dark-theme">
        <!--
          Dark theme example of Inline config. Multiple product tags with icon defined.
        -->
        <amp-story-grid-layer template="fill">
          <amp-img layout="fill" src="/examples/visual-tests/amp-story/img/cat1.jpg"></amp-img>
        </amp-story-grid-layer>
        <amp-story-grid-layer template="vertical">
          <amp-story-shopping-tag data-product-id="lamp" ></amp-story-shopping-tag>
          <amp-story-shopping-tag data-product-id="art" ></amp-story-shopping-tag>
          <amp-story-shopping-tag data-product-id="chair" ></amp-story-shopping-tag>
          <amp-story-shopping-tag data-product-id="flowers" ></amp-story-shopping-tag>
        </amp-story-grid-layer>
        <amp-story-shopping-attachment theme="dark">
          <script type="application/json">
            {
                "items" : [
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "lamp",
                    "productTitle": "Brass Lamp",
                    "productBrand": "Lamp Co",
                    "productPrice": 799.00,
                    "productPriceCurrency": "USD",
                    "productImages": [
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 1"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 2"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 3"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 4"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 5"},
                       {"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "lamp 6"}
                    ],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. \n Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   },
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "art",
                    "productTitle": "Abstract Art",
                    "productBrand": "V. Artsy",
                    "productPrice": 1200.00,
                    "productPriceCurrency": "INR",
                    "productImages": [{"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "art"}],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. \n Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   },
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "chair",
                    "productTitle": "Yellow chair",
                    "productPrice": 1000.00,
                    "productPriceCurrency": "BRL",
                    "productTagText": "The perfectly imperfect yellow chair",
                    "productImages": [{"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "chair"}],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. \n Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   },
                   {
                    "productUrl": "https://www.google.com",
                    "productId": "flowers",
                    "productTitle": "Flowers",
                    "productBrand": "Very Long Flower Company Name",
                    "productPrice": 10.00,
                    "productPriceCurrency": "USD",
                    "productIcon": "/examples/visual-tests/amp-story/img/shopping/icon.png",
                    "productImages": [{"url": "/examples/visual-tests/amp-story/img/cat1.jpg", "alt": "flowers"}],
                    "aggregateRating": {
                      "ratingValue": 4.4,
                      "reviewCount": 89,
                      "reviewUrl": "https://www.google.com"
                    },
                    "productDetails": "Lorem ipsum dolor sit amet consectetur adipisicing elit. \n Facere error deserunt dignissimos in laborum ea molestias veritatis sint laudantium iusto expedita atque provident doloremque, ad voluptatem culpa adipisci."
                   }
                ]
              }
          </script>
        </amp-story-shopping-attachment>
      </amp-story-page>
      <amp-story-page id="remote-with-product">
        <amp-story-grid-layer template="fill">
          <amp-img layout="fill" src="/examples/visual-tests/amp-story/img/cat1.jpg"></amp-img>
        </amp-story-grid-layer>
        <amp-story-grid-layer template="vertical">
          <amp-story-shopping-tag data-product-id="art" ></amp-story-shopping-tag>
        </amp-story-grid-layer>
        <!--
          Example of:
          CTA Button rendering due to remote product tag existing, but no inline.
        -->
        <amp-story-shopping-attachment theme="dark" src="/examples/amp-story/shopping/remote.json">
          <script type="application/json">
            {
              "items" : []
            }
          </script>
        </amp-story-shopping-attachment>
      </amp-story-page>
      <amp-story-page id="inline-no-product">
      <amp-story-grid-layer template="fill">
        <amp-img layout="fill" src="/examples/visual-tests/amp-story/img/cat1.jpg"></amp-img>
      </amp-story-grid-layer>
        <!--
          Example of:
          CTA Button not rendering due to no product tags.
        -->
      <amp-story-shopping-attachment>
        <script type="application/json">
          {
            "items" : []
          }
        </script>
      </amp-story-shopping-attachment>
      </amp-story-page>
       <!--
          Example of:
          CTA Button not rendering due to no shopping attachment.
        -->
      <amp-story-page id="remote-dark-theme">
        <amp-story-grid-layer template="fill">
          <amp-img layout="fill" src="/examples/visual-tests/amp-story/img/cat1.jpg"></amp-img>
        </amp-story-grid-layer>
        <amp-story-grid-layer template="vertical">
          <amp-story-shopping-tag data-product-id="art" ></amp-story-shopping-tag>
        </amp-story-grid-layer>
      </amp-story-page>
    </amp-story>
  </body>
</html>


text:
import { Component, ViewEncapsulation } from '@angular/core';

@Component({
  selector: 'demo-tooltip-styling-global',
  templateUrl: './styling-global.html',
  encapsulation: ViewEncapsulation.None
})
export class DemoTooltipStylingGlobalComponent {
}

redpajama_set_name: RedPajamaGithub


text:
#include <string>
#include <sstream>

namespace gui
{
	enum {
		display_slider_id,
		mipmap_lerp_checkbox_id,
		filter_mode_slider_id,
		max_anisotropy_slider_id,
		lod_bias_slider_id,
		tex_scale_slider_id,
		tex_movement_x_slider_id,
		tex_movement_y_slider_id
	};

	IMPLEMENT_CLASS(SettingsPane, wxWindow)
	BEGIN_EVENT_TABLE(SettingsPane, wxWindow)
		EVT_SIZE(OnSize)
		EVT_COMMAND_SCROLL(display_slider_id, OnDisplaySliderChanged)
		EVT_CHECKBOX(mipmap_lerp_checkbox_id, OnLERP)
		EVT_COMMAND_SCROLL(filter_mode_slider_id, OnFilterModeSliderChanged)
		EVT_COMMAND_SCROLL(max_anisotropy_slider_id, OnAnisotropySliderChanged)
		EVT_COMMAND_SCROLL(lod_bias_slider_id, OnLODBiasSliderChanged)
		EVT_COMMAND_SCROLL(tex_scale_slider_id, OnTexScaleSliderChanged)
		EVT_COMMAND_SCROLL(tex_movement_x_slider_id, OnTexMovementSliderChanged)
		EVT_COMMAND_SCROLL(tex_movement_y_slider_id, OnTexMovementSliderChanged)
	END_EVENT_TABLE()

	SettingsPane::SettingsPane(wxWindow *parent, Viewport *viewport)
		: wxWindow(parent, -1, wxDefaultPosition, wxSize(250,300)), viewport(viewport)
	{
		display_slider_caption = new wxStaticText(this, -1, L"Display Mode:");
		display_slider = new wxSlider(this, display_slider_id, 0, 0, 2);
		display_value = new wxStaticText(this, -1, L"TMU");

		trilinear_filtering_checkbox = new wxCheckBox(this, mipmap_lerp_checkbox_id, L"ALU Mipmap Interpolation");
		trilinear_filtering_checkbox->SetValue(true);

		filter_mode_slider_caption = new wxStaticText(this, -1, L"ALU Filtering Mode:");
		filter_mode_slider = new wxSlider(this, filter_mode_slider_id, 0, 0, 2);
		filter_mode_value = new wxStaticText(this, -1, L"Simple");

		max_anisotropy_slider_caption = new wxStaticText(this, -1, L"Max Anisotropy:");
		max_anisotropy_slider = new wxSlider(this, max_anisotropy_slider_id, 1, 1, 10);
		max_anisotropy_value = new wxStaticText(this, -1, L"1x");

		lod_bias_slider_caption = new wxStaticText(this, -1, L"LOD Bias:");
		lod_bias_slider = new wxSlider(this, lod_bias_slider_id, 0, -100, 100);
		lod_bias_value = new wxStaticText(this, -1, L"0.0");

		tex_scale_slider_caption = new wxStaticText(this, -1, L"Texture Scale:");
		tex_scale_slider = new wxSlider(this, tex_scale_slider_id, 0, -20, 20);
		tex_scale_value = new wxStaticText(this, -1, L"1.0x");

		tex_movement_x_slider_caption = new wxStaticText(this, -1, L"Texture Movement X:");
		tex_movement_x_slider = new wxSlider(this, tex_movement_x_slider_id, 0, -30, 30);
		tex_movement_x_value = new wxStaticText(this, -1, L"0.0");

		tex_movement_y_slider_caption = new wxStaticText(this, -1, L"Texture Movement Y:");
		tex_movement_y_slider = new wxSlider(this, tex_movement_y_slider_id, 0, -30, 30);
		tex_movement_y_value = new wxStaticText(this, -1, L"0.0");
	}

	void SettingsPane::ApplySliders()
	{
		wxScrollEvent event;

		OnFilterModeSliderChanged(event);
		OnAnisotropySliderChanged(event);
		OnLODBiasSliderChanged(event);
		OnTexScaleSliderChanged(event);
		OnTexMovementSliderChanged(event);
	}

	void SettingsPane::OnSize(wxSizeEvent &event)
	{
		unsigned top;
		unsigned int slide_width = GetSize().GetWidth() - 60;
		unsigned int value_pos_x = GetSize().GetWidth() - 55;

		top = 8;
		display_slider_caption->SetSize(12, top, 150, 23);
		display_slider->SetSize(5, top+20, slide_width , 25);
		display_value->SetSize(value_pos_x, top+23, 40, 23);

		top += 50;
		trilinear_filtering_checkbox->SetSize(12, top, 150, 23);

		top += 32;
		filter_mode_slider_caption->SetSize(12, top, 150, 23);
		filter_mode_slider->SetSize(5, top+20, slide_width , 25);
		filter_mode_value->SetSize(value_pos_x, top+23, 40, 23);

		top += 55;
		max_anisotropy_slider_caption->SetSize(12, top, 150, 23);
		max_anisotropy_slider->SetSize(5, top+20, slide_width , 25);
		max_anisotropy_value->SetSize(value_pos_x, top+23, 40, 23);

		top += 55;
		lod_bias_slider_caption->SetSize(12, top, 150, 23);
		lod_bias_slider->SetSize(5, top+20, slide_width, 25);
		lod_bias_value->SetSize(value_pos_x, top+23, 40, 23);

		top += 55;
		tex_scale_slider_caption->SetSize(12, top, 150, 23);
		tex_scale_slider->SetSize(5, top+20, slide_width, 25);
		tex_scale_value->SetSize(value_pos_x, top+23, 40, 23);

		top += 55;
		tex_movement_x_slider_caption->SetSize(12, top, 150, 23);
		tex_movement_x_slider->SetSize(5, top+20, slide_width, 25);
		tex_movement_x_value->SetSize(value_pos_x, top+23, 40, 23);

		top += 55;
		tex_movement_y_slider_caption->SetSize(12, top, 150, 23);
		tex_movement_y_slider->SetSize(5, top+20, slide_width, 25);
		tex_movement_y_value->SetSize(value_pos_x, top+23, 40, 23);
	}

	void SettingsPane::OnDisplaySliderChanged(wxScrollEvent &event)
	{
		engine::Renderer &renderer = engine::engine.GetRenderer();

		unsigned int value = display_slider->GetValue();
		if(value == 0) {
			display_value->SetLabel(L"TMU");
			renderer.SetRenderMode(engine::Renderer::render_tmu);
		}
		else if(value == 1) {
			display_value->SetLabel(L"ALU");
			renderer.SetRenderMode(engine::Renderer::render_alu);
		}
		else {
			display_value->SetLabel(L"Split");
			renderer.SetRenderMode(engine::Renderer::render_split);
		}
	}

	void SettingsPane::OnLERP(wxCommandEvent &event)
	{
		engine::engine.GetRenderer().ToggleLinearInterpolation();
	}

	void SettingsPane::OnFilterModeSliderChanged(wxScrollEvent &event)
	{
		unsigned int value = filter_mode_slider->GetValue();
		if(value == 0) filter_mode_value->SetLabel(L"Simple");
		else if(value == 1) filter_mode_value->SetLabel(L"Improved");
		else filter_mode_value->SetLabel(L"Perfect");

		engine::engine.GetRenderer().SetFilterMode(value);
	}

	void SettingsPane::OnAnisotropySliderChanged(wxScrollEvent &event)
	{
		unsigned int value = 1 << (max_anisotropy_slider->GetValue()-1);
		max_anisotropy_value->SetLabel(std::to_wstring(value) + L"x");
		engine::engine.GetRenderer().SetMaxAnisotropy(value);
	}

	void SettingsPane::OnLODBiasSliderChanged(wxScrollEvent &event)
	{
		float value = (float)(lod_bias_slider->GetValue()) / 20.0f;

		std::wstringstream ss;
		ss.precision(2);
		ss << value;
		std::wstring string_value = ss.str();
		lod_bias_value->SetLabel(string_value);

		engine::engine.GetRenderer().SetLODBias(value);
	}

	void SettingsPane::OnTexScaleSliderChanged(wxScrollEvent &event)
	{
		float tex_scale = pow(10.0f, (float)(tex_scale_slider->GetValue()) / 20.0f);

		std::wstringstream ss;
		ss.precision(2);
		ss << tex_scale;
		std::wstring string_value = ss.str();
		tex_scale_value->SetLabel(string_value + L"x");

		engine::engine.GetRenderer().SetTextureScale(tex_scale);
	}

	void SettingsPane::OnTexMovementSliderChanged(wxScrollEvent &event)
	{
		float x_movement = (float)(tex_movement_x_slider->GetValue()) / 100.0f;
		float y_movement = (float)(tex_movement_y_slider->GetValue()) / 100.0f;

		std::wstringstream x_stringstream;
		x_stringstream.precision(2);
		x_stringstream << x_movement;
		std::wstring x_movement_string_value = x_stringstream.str();
		tex_movement_x_value->SetLabel(x_movement_string_value);

		std::wstringstream y_stringstream;
		y_stringstream.precision(2);
		y_stringstream << y_movement;
		std::wstring y_movement_string_value = y_stringstream.str();
		tex_movement_y_value->SetLabel(y_movement_string_value);

		engine::engine.GetRenderer().SetTextureMovement(x_movement, y_movement);
	}
}


text:
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

import os
import sys

if float("%d.%d" % sys.version_info[:2]) < 2.5 or float("%d.%d" % sys.version_info[:2]) >= 3.0:
    sys.stderr.write("Your Python version %d.%d.%d is not supported.\n" % sys.version_info[:3])
    sys.stderr.write("osscmd requires Python between 2.4 and 3.0.\n")
    sys.exit(1)

source_dir_list = []
package_list = []
data_file_dict = {}
data_file_list = []
for dir in os.listdir(os.getcwd()):
    if os.path.exists(os.path.join(dir, '__init__.py')):
        package_list.append(dir)
        source_dir_list.append(dir)

for source_dir in source_dir_list:
    for rootDir, dirs, files in os.walk(source_dir):
        for dir in dirs:
            dir = os.path.join(rootDir, dir)
            if os.path.exists(os.path.join(dir, '__init__.py')):
                package_list.append(dir.replace(os.sep, '.'))
        for file in files:
            file = os.path.join(rootDir, file)
            if not file.endswith('.py') and not file.endswith('.pyc') and '.svn' not in file:
                if rootDir not in data_file_dict.keys():
                    data_file_dict[rootDir] = [file]
                else:
                    data_file_dict[rootDir].append(file)

for k, v in data_file_dict.items():
    data_file_list.append((k, v))

setup(
    name = 'cisco_vpn',
    version = '0.0.12',
    keywords = ('cisco', 'vpn', 'cisco vpn'),
    description = 'Connect Cisco VPN With Python',
    license = 'MIT License',
    install_requires=[
            "docopt",
            "pexpect",
        ],

    url = 'https://github.com/casaLBS/vpnc',
    author = 'Phodal Huang',
    author_email = 'h@phodal.com',

    packages=package_list,
    data_files=data_file_list,
    include_package_data = True,
    platforms = 'any',
    scripts=[
        'pyvpn',
    ],
)


text:
define( 'local.base',[

    'underscore',
    'backbone',
    'usertiming',
    'backbone.declarative.views'

], function ( _, Backbone, performance ) {

    var eventBus = _.extend( {}, Backbone.Events ),

        Model = Backbone.Model.extend(),

        Collection = Backbone.Collection.extend(
            { model: Model },
            {
                create: function ( modelCount ) {
                    var i,
                        collection = new Collection(),
                        models = [];

                    for ( i = 0; i < modelCount; i++ ) models.push( new collection.model( { number: i + 1 } ) );
                    collection.reset( models );

                    return collection;
                }
            }
        ),

        StatsView = Backbone.View.extend( {

            template: "#stats-template",

            parent: ".stats",

            initialize: function ( options ) {
                var compiledTemplate = this.declarativeViews.getCachedTemplate().compiled;
                this.template = compiledTemplate || _.template( this.declarativeViews.getCachedTemplate(). html );

                options || ( options = {} );

                if ( options.parent ) this.parent = options.parent;
                this.$parent = Backbone.$( this.parent );
                this.$el.appendTo( this.$parent );

                this.listenTo( eventBus, "createStats", this.render );
            },

            render: function ( stats ) {
                stats.totalDuration = Math.round( this.getTotalDuration() );
                this.$el.html( this.template( stats ) );
            },

            getTotalDuration: function () {
                // Query the document height. This is to assess the true total render time, including the painting.
                // The calculation of the document height should be blocked by the browser until all item elements have
                // been painted.
                var docHeight = $( document ).height();

                performance.measure( "paint", "create-itemViews-start" );
                return performance.getEntriesByName( "paint" )[0].duration;
            }

        } );

    Backbone.DeclarativeViews.custom.compiler = _.template;

    return {
        Model: Model,
        Collection: Collection,
        StatsView: StatsView,
        eventBus: eventBus
    }

} );

// views-backbone.js

define( 'local.views-backbone',[

    'underscore',
    'backbone',
    'usertiming',
    'local.base',
    'backbone.declarative.views'

], function ( _, Backbone, performance, base ) {

    var ItemView = Backbone.View.extend( {

            initialize: function ( options ) {
                this.template = this.declarativeViews.getCachedTemplate().compiled;
            },

            render: function () {
                this.$el.html( this.template( this.model.attributes ) );
                return this;
            },

            appendTo: function ( $parent ) {
                if ( !( $parent instanceof Backbone.$ ) ) $parent = Backbone.$( $parent );
                $parent.append( this.$el );
                return this;
            }

        } ),

        ListView = Backbone.View.extend( {

            initialize: function ( options ) {
                options || ( options = {} );                                // jshint ignore:line

                if ( options.ItemView ) this.ItemView = options.ItemView;
                if ( options.parent ) this.parent = options.parent;
                this.$parent = Backbone.$( this.parent );
            },

            render: function () {
                var duration, renderDuration,
                    els = [];

                this.itemViews = [];

                // Start timer
                performance.clearMarks();
                performance.clearMeasures();
                performance.mark( "create-itemViews-start" );

                this.collection.each( function ( model ) {
                    //Backbone.DeclarativeViews.clearCache();
                    var itemView = new this.ItemView( { model: model } );
                    itemView.render();

                    this.itemViews.push( itemView );
                    els.push( itemView.el );
                }, this );

                // Measure itemView creation time
                performance.measure( "create-itemViews", "create-itemViews-start" );
                duration = performance.getEntriesByName( "create-itemViews" )[0].duration;

                this.$el.append( els );
                this.$el.appendTo( this.$parent );

                // Measure render duration time (total from beginning of itemView creation)
                performance.measure( "render", "create-itemViews-start" );
                renderDuration = performance.getEntriesByName( "render" )[0].duration;

                base.eventBus.trigger( "createStats", {
                    itemViewCount : this.itemViews.length,
                    duration: Math.round( duration ),
                    renderDuration: Math.round( renderDuration )
                } );
            },

            destroy: function () {
                _.each( this.itemViews, function ( itemView ) {
                    itemView.remove();
                } );

                this.remove();
            }

        } );

    return {
        ItemView: ItemView,
        ListView: ListView
    }

} );

// plain.js

require( [

    'local.base',
    'local.views-backbone'

], function ( base, backboneViews ) {

    var count = 1000,

        ItemView = backboneViews.ItemView.extend( {
            template: "#item-template"
        } ),

        listView = new backboneViews.ListView( {
            template: "#list-template",
            parent: ".container",
            ItemView: ItemView,
            collection: base.Collection.create( count )
        } );

    new base.StatsView();
    listView.render();

} );

define("local.plain", function(){});


text:
package com.reason.lang.core.psi.impl;

import com.intellij.lang.ASTNode;
import com.intellij.navigation.ItemPresentation;
import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.util.IncorrectOperationException;
import com.reason.lang.core.ORUtil;
import com.reason.lang.core.psi.PsiException;
import com.reason.lang.core.stub.PsiExceptionStub;
import com.reason.lang.core.type.ORTypes;
import icons.ORIcons;

import javax.swing.*;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class PsiExceptionImpl extends PsiTokenStub<ORTypes, PsiException, PsiExceptionStub> implements PsiException {
    // region Constructors
    public PsiExceptionImpl(@NotNull ORTypes types, @NotNull ASTNode node) {
        super(types, node);
    }

    public PsiExceptionImpl(@NotNull ORTypes types, @NotNull PsiExceptionStub stub, @NotNull IStubElementType nodeType) {
        super(types, stub, nodeType);
    }
    // endregion

    @Override
    public @Nullable String getName() {
        PsiElement nameIdentifier = ORUtil.findImmediateFirstChildOfClass(this, PsiUpperIdentifier.class);
        return nameIdentifier == null ? null : nameIdentifier.getText();
    }

    @Override
    public @NotNull PsiElement setName(@NotNull String name) throws IncorrectOperationException {
        throw new IncorrectOperationException("Not implemented");
    }

    @Override
    public @NotNull String getPath() {
        PsiExceptionStub stub = getGreenStub();
        if (stub != null) {
            return stub.getPath();
        }

        return ORUtil.getQualifiedPath(this);
    }

    @Override
    public @NotNull String getQualifiedName() {
        PsiExceptionStub stub = getGreenStub();
        if (stub != null) {
            return stub.getQualifiedName();
        }

        return ORUtil.getQualifiedName(this);
    }

    @Override
    public @Nullable String getAlias() {
        PsiElement eq = findChildByType(m_types.EQ);
        if (eq != null) {
            return ORUtil.computeAlias(eq.getNextSibling(), getLanguage(), false);
        }

        return null;
    }

    @Override
    public ItemPresentation getPresentation() {
        return new ItemPresentation() {
            @Override
            public @Nullable String getPresentableText() {
                return getName();
            }

            @Override
            public @Nullable String getLocationString() {
                return null;
            }

            @Override
            public @NotNull Icon getIcon(boolean unused) {
                return ORIcons.EXCEPTION;
            }
        };
    }

    @Override
    public @Nullable String toString() {
        return "Exception " + getName();
    }
}


text:
<!DOCTYPE html>

<meta charset="utf-8">

Domain : aaeachicago.blogspot.com


text:
<?php

declare(strict_types=1);

namespace Leevel\Level\Provider;

use Leevel\Di\IContainer;
use Leevel\Di\ICoroutine;
use Leevel\Di\Provider;
use Leevel\Level\Coroutine;
use Leevel\Level\HttpServer;
use Leevel\Level\ITask;
use Leevel\Level\ITimer;
use Leevel\Level\Task;
use Leevel\Level\Timer;
use Leevel\Level\WebsocketServer;

/**
 * Swoole 服务提供者.
 */
class Register extends Provider
{
    /**
     * {@inheritDoc}
     */
    public function register(): void
    {
        $this->coroutine();
        $this->httpServer();
        $this->websocketServer();
        $this->task();
        $this->timer();
    }

    /**
     * {@inheritDoc}
     */
    public static function providers(): array
    {
        return [
            'coroutine'        => [ICoroutine::class, Coroutine::class],
            'http.server'      => HttpServer::class,
            'websocket.server' => WebsocketServer::class,
            'task'             => [ITask::class, Task::class],
            'timer'            => [ITimer::class, Timer::class],
        ];
    }

    /**
     * {@inheritDoc}
     */
    public static function isDeferred(): bool
    {
        return true;
    }

    /**
     * 注册 coroutine 服务.
     */
    protected function coroutine(): void
    {
        $this->container
            ->singleton(
                'coroutine',
                fn (): Coroutine => new Coroutine(),
            );
    }

    /**
     * 注册 http.server 服务.
     */
    protected function httpServer(): void
    {
        $this->container
            ->singleton(
                'http.server',
                function (IContainer $container): HttpServer {
                    return new HttpServer(
                        $container,
                        $container->make('coroutine'),
                        $this->normalizeOptions($container, 'http'),
                    );
                },
            );
    }

    /**
     * 注册 websocket.server 服务.
     */
    protected function websocketServer(): void
    {
        $this->container
            ->singleton(
                'websocket.server',
                function (IContainer $container): WebsocketServer {
                    return new WebsocketServer(
                        $container,
                        $container->make('coroutine'),
                        $this->normalizeOptions($container, 'websocket'),
                    );
                },
            );
    }

    /**
     * 注册 task 服务.
     */
    protected function task(): void
    {
        $this->container
            ->singleton(
                'task',
                fn (IContainer $container): Task => new Task($container->make('server')),
            );
    }

    /**
     * 注册 timer 服务.
     */
    protected function timer(): void
    {
        $this->container
            ->singleton(
                'timer',
                fn (IContainer $container): Timer => new Timer($container->make('logs')),
            );
    }

    /**
     * 整理服务配置.
     */
    protected function normalizeOptions(IContainer $container, string $serverType): array
    {
        /** @var \Leevel\Option\IOption $option */
        $option = $container->make('option');
        $options = array_merge(
            $option->get('level\\server'),
            $option->get('level\\'.$serverType)
        );
        $options = $this->mergeOptionsForProcesses($container, $options);

        return $options;
    }

    /**
     * 合并自定义进程配置.
     */
    protected function mergeOptionsForProcesses(IContainer $container, array $options): array
    {
        /** @var \Leevel\Kernel\IApp $app */
        $app = $container->make('app');

        if ($app->isDevelopment() &&
            isset($options['processes'], $options['processes_dev'])) {
            $options['processes'] = array_merge($options['processes'], $options['processes_dev']);
        }

        return $options;
    }
}


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

namespace ObjectSender
{
    class Fish : Pet
    {
        public bool FreshWater { get; set; }
        public Fish(string petName) : base(petName)
        {
            this.Type = AnimalType.Fish;
        }
    }
}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch07/7.6/7.6.1/7.6.1-1-15.js
 * @description Allow reserved words as property names at object initialization, verified with hasOwnProperty: package, protected, static
 */

function testcase(){
        var tokenCodes  = {
            package: 0,
            protected: 1,
            static: 2
        };
        var arr = [
            'package',
            'protected',
            'static'
        ];
        for(var p in tokenCodes) {
            for(var p1 in arr) {
                if(arr[p1] === p) {
                    if(!tokenCodes.hasOwnProperty(arr[p1])) {
                        return false;
                    };
                }
            }
        }
        return true;
}
runTestCase(testcase);


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Rep. Tottori Mycol. Inst. 10: 425 (1973)

#### Original name
Hypocrea pseudogelatinosa A. Komatsu & Yoshim. Doi

### Remarks
null


text:
@implementation ASDGradientNode

//参考ASDisplayNode+Subclasses.h: _ASDisplayLayerDelegate
+ (void)drawRect:(CGRect)bounds withParameters:(id<NSObject>)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing;
{

    CGContextRef myContext = UIGraphicsGetCurrentContext();
    CGContextSaveGState(myContext);

    //对线半部分进行描绘
    CGContextClipToRect(myContext, CGRectMake(0, bounds.size.height/2, bounds.size.width, bounds.size.height/2));

    uint componentCount = 2;
    CGFloat locations[] = {0.0, 1.0};
    CGFloat components[] = {1,0,0,1,0,0,1,1};

    CGGradientRef gref = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), components, locations, componentCount);
    CGContextDrawLinearGradient(myContext, gref, CGPointMake(0, 0), CGPointMake(1, 1), kCGGradientDrawsAfterEndLocation);

    CGContextRestoreGState(myContext);
}

@end


text:
doppio: A JVM in TypeScript
=================================

_doppio_ is a double shot of espresso.
In this case it's also a JVM written in [TypeScript](http://www.typescriptlang.org/).

To try doppio now, head to the [live demo page](http://plasma-umass.github.io/doppio-demo/).

To learn more, head to the [doppio wiki](https://github.com/plasma-umass/doppio/wiki), or read our [academic paper](http://dl.acm.org/citation.cfm?id=2594293) [(alt. link w/ no paywall)](https://plasma-umass.github.io/doppio-demo/paper.pdf) published at [PLDI 2014](http://conferences.inf.ed.ac.uk/pldi2014/)!

You can also get in touch via our [mailing list][mail] or via the IRC channel
\#plasma-umass on Freenode.

[mail]: https://groups.google.com/forum/?fromgroups#!forum/plasma-umass-gsoc

Integrating Into Your Site
--------------------------

Check out our
[Developer Guide](https://github.com/plasma-umass/doppio/wiki/Doppio-Developer-Guide)
for information on how you can integrate doppio into your website!

Getting & Building the Code
---------------------------

Before attempting to build doppio, you must have the following installed:
* Node v0.10 or higher
* NPM packages `grunt-cli` and `bower` installed globally
  * `npm install -g grunt-cli bower`
* Java 8 JDK

If you are on Windows, you will need the following installed:
* Git (must be on your PATH)
* Python (must be on your PATH)
* A version of Visual Studio

Run the following commands to build doppio. Note that your first time building may take some time, as the build script will download the entire Java Class Library.

    git clone https://github.com/plasma-umass/doppio.git
    cd doppio
    npm install
    bower install
    grunt release      # For browser integration.
    grunt release-cli  # For command-line use.

Testing
-------

Run the full test suite using node.js:

    grunt test

Run the full test suite in a web browser:

    grunt test-browser

Run a specific test by invoking the test runner manually:

    node build/dev-cli/console/test_runner.js classes/test/Strings

Command-line Usage
------------------

Run doppio with node.js (after `grunt release-cli`):

    ./doppio classes.demo.Fib 7
    ./doppio -jar my_application.jar
    ./doppio -cp my/class/path SomeClass

Automated Rebuilding
--------------------

To automatically rebuild doppio while you modify files, run the following command:

    grunt release watch

This will perform a complete build of doppio, and then will watch files to trigger partial rebuilds.


text:
Pyacq Documentation
===================

Contents:

.. toctree::
   :maxdepth: 2

   intro
   nodes
   manager
   streams
   apiref/index
   examples/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
* Node JS - >v6.10
* NPM - >v3.10.10

## Installation
1. Clone, or download this repository
1. Download and install libraries with NPM `npm install`
1. Run gulp to build static web resources
  * If gulp isn't already installed: `node node_modules/gulp/bin/gulp`
  * If gulp is installed on your system globally: `gulp`

# Starting Calypear
Start Calypear by running `node server/app.js` or `npm start`

Open a browser (chrome is strongly advised) and navigate to the URL the script outputs.

## Quickstart
To prevent starting an installation without users, that can't be accessed, `calypear-quickstart` will check everytime the server starts if any users exist in the database, if not it will create one and announce this on the console (or log file if you've configured logging), normally the username will be `admin` and the password `admin` as well.

### Prevent Quickstart
Quickstart will always run, but will take no action if any user exists in the database (even if the only user is expired or invalid).


text:
// =================================================================================================
// Copyright 2011 Twitter, Inc.
// -------------------------------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this work except in compliance with the License.
// You may obtain a copy of the License in the LICENSE file, or 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.twitter.common.thrift.text;

import java.util.Iterator;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;

/**
 * A parsing context used for Sequences (lists & sets). Maintains its
 * child elements, and a pointer to the current one being parsed.
 *
 * @author Alex Roetter
 */
class SequenceContext extends BaseContext {

  private final Iterator<JsonElement> children;
  private JsonElement currentChild;

  /**
   * Create an iterator over the children. May be constructed with a null
   * JsonArray if we only use it for writing.
   */
  protected SequenceContext(JsonArray json) {
    children = (null != json) ? json.iterator() : null;
  }

  @Override
  protected void read() {
    if (!children.hasNext()) {
      throw new RuntimeException(
          "Called SequenceContext.read() too many times!");
    }
    currentChild = children.next();
  }

  @Override
  protected JsonElement getCurrentChild() {
    return currentChild;
  }

  @Override
  protected boolean hasMoreChildren() {
    return children.hasNext();
  }
}


text:
package xryusha.onlinedebug.testcases.nested;

import xryusha.onlinedebug.testcases.Flow;

public class FromInstanceInner extends Flow
{
    private int counter = 0;
    private static int statCounter = 0;

    @Override
    public void reset()
    {
        counter = 0;
        statCounter = 0;
    }

    @Override
    public Object call() throws Exception
    {
        counter = 5;
        statCounter = 6;
        f();
        return null;
    }

    void f()
    {
        Inner in = new Inner();
        in.innF();
    }

    class Inner
    {
        int innerInt = 7;
        int innerStaticInt = 8;

        void innF()
        {
            String BP = "rwerwerew";
        }
    }
}


text:
<?php

App::uses('AppController', 'Controller');

class BlogAppController extends AppController{
}


text:
.ico-flashpoint {
  background-image: url('./../imgs/icon/flashpoint_earth.png') !important;
}

.ico-outlook {
  background-image: url('./../imgs/icon/ico_outlook.png') !important;
}

.ico-gmail {
  background-image: url('./../imgs/icon/ico_gmail.png') !important;
}

.ico-github {
  background-image: url('./../imgs/icon/ico_github.png') !important;
}

.ico-sf {
  background-image: url('./../imgs/icon/ico_sf.png') !important;
}

.ico-zhihu {
  background-image: url('./../imgs/icon/ico_zhihu.png') !important;
}

.ico-stamp {
  background-image: url('./../imgs/icon/stamp.png') !important;
}

.ico-filter-category {
  background-image: url('./../imgs/icon/filter_category.png') !important;
}


text:
const cloneDeep = require('lodash/cloneDeep');
const merge = require('lodash/merge');

const config = cloneDeep(require('../default.config'));

merge(config.features, {
  registrationManagement: { enabled: true },
  registration: { enabled: true },
});

module.exports = {
  config,
  client: {
    client_id: 'client',
    client_secret: 'secret',
    redirect_uris: ['https://client.example.com/cb'],
  },
};


text:
echo "Type GLfloat GLdouble" > 'floating.dat'
grep "primitives" float | cut -d'(' -f2 | cut -d' ' -f1 > 'primitive_counts'
grep "Median draw time:" float	 | cut -d: -f2 > 'float_medians'
grep "Median draw time:" double | cut -d: -f2 > 'double_medians'
paste primitive_counts float_medians double_medians > 'table'
cat table >> floating.dat
gnuplot main.gpi


text:
PhotoShare
==========

This a a very simple camera app that automatically uploads photos to Parse. Once uploaded, a list of all photos can be queried from Parse and viewed within the app.  This app is not intended for public use, it is very rough and the development goal is solely to become more familiar with the uses and limitations of the Parse platform.


text:
FOUNDATION_EXPORT double ARSLineProgressVersionNumber;

//! Project version string for ARSLineProgress.
FOUNDATION_EXPORT const unsigned char ARSLineProgressVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <ARSLineProgress/PublicHeader.h>


text:
from a_helper import parser

var = 0

def start(ctx, argv):
    global var
    var = parser.parse_args(argv[1:]).var

def here(ctx):
    global var
    var += 1
    return var

def errargs():
    pass


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

namespace Talifun.Crusher.Crusher
{
    public interface ICssPathRewriter
    {
        string RewriteCssPathsToBeRelativeToPath(IEnumerable<Uri> relativePaths, Uri cssRootUri, Uri absoluteUriDirectory, string css);
        IEnumerable<Uri> FindDistinctRelativePaths(string css);
        string RewriteCssPathsToAppendHash(IEnumerable<Uri> localPaths, Uri cssRootUri, string css);
        IEnumerable<Uri> FindDistinctLocalPaths(string css);
    }
}


text:
package com.gdn.venice.facade;

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

import javax.ejb.Local;

import com.gdn.venice.persistence.LogProviderPickupOrderReport;
import com.djarum.raf.utilities.JPQLAdvancedQueryCriteria;
import com.gdn.venice.facade.finder.FinderReturn;

@Local
public interface LogProviderPickupOrderReportSessionEJBLocal {

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#queryByRange(java.lang
	 * .String, int, int)
	 */
	public List<LogProviderPickupOrderReport> queryByRange(String jpqlStmt, int firstResult,
			int maxResults);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#persistLogProviderPickupOrderReport(com
	 * .gdn.venice.persistence.LogProviderPickupOrderReport)
	 */
	public LogProviderPickupOrderReport persistLogProviderPickupOrderReport(LogProviderPickupOrderReport logProviderPickupOrderReport);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#persistLogProviderPickupOrderReportList
	 * (java.util.List)
	 */
	public ArrayList<LogProviderPickupOrderReport> persistLogProviderPickupOrderReportList(
			List<LogProviderPickupOrderReport> logProviderPickupOrderReportList);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#mergeLogProviderPickupOrderReport(com.
	 * gdn.venice.persistence.LogProviderPickupOrderReport)
	 */
	public LogProviderPickupOrderReport mergeLogProviderPickupOrderReport(LogProviderPickupOrderReport logProviderPickupOrderReport);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#mergeLogProviderPickupOrderReportList(
	 * java.util.List)
	 */
	public ArrayList<LogProviderPickupOrderReport> mergeLogProviderPickupOrderReportList(
			List<LogProviderPickupOrderReport> logProviderPickupOrderReportList);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#removeLogProviderPickupOrderReport(com
	 * .gdn.venice.persistence.LogProviderPickupOrderReport)
	 */
	public void removeLogProviderPickupOrderReport(LogProviderPickupOrderReport logProviderPickupOrderReport);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#removeLogProviderPickupOrderReportList
	 * (java.util.List)
	 */
	public void removeLogProviderPickupOrderReportList(List<LogProviderPickupOrderReport> logProviderPickupOrderReportList);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#findByLogProviderPickupOrderReportLike
	 * (com.gdn.venice.persistence.LogProviderPickupOrderReport, int, int)
	 */
	public List<LogProviderPickupOrderReport> findByLogProviderPickupOrderReportLike(LogProviderPickupOrderReport logProviderPickupOrderReport,
			JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.gdn.venice.facade.LogProviderPickupOrderReportSessionEJBRemote#findByLogProviderPickupOrderReportLikeFR
	 * (com.gdn.venice.persistence.LogProviderPickupOrderReport, int, int)
	 */
	public FinderReturn findByLogProviderPickupOrderReportLikeFR(LogProviderPickupOrderReport logProviderPickupOrderReport,
			JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);

}


text:
@extends('layouts.master')

@section('css')
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />

<link href="{{ asset('css/skin-blue.min.css') }}" rel="stylesheet" type="text/css" />
@endsection

@section('title')
Connexion
@endsection

@section('bodycontent')

                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
                                Toggle navigation

                            </button>
                            Intégration UTT

 Retour

                        @include('display-errors')
                        @if (count($errors) > 0)

                                    @foreach ($errors->all() as $error)

{{ $error }}

                                    @endforeach

                        @endif

Bienvenue à l'UTT !

                                        Bonjour à toi, ami nouveau ! Tu trouveras les identifiants du site d'intégration sur l'email que tu receveras courant juillet.

                                        Si tu n'as toujours pas reçu tes identifiants début août ou pour toute autre question, envoie nous un message.

                                    <form action="{{ route('newcomer.auth.login') }}" method="post">
                                        <input type="text" name="login" class="form-control" placeholder="Identifiant"/>
                                        <input type="password" name="password" class="form-control" placeholder="Mot de passe"/>
                                        <input type="submit" class="btn form-control btn-primary" value="Se connecter" />
                                    </form>

@endsection


text:
if [ ! -e /var/log/postgresql/pg_backup.log ]; then
  touch /var/log/postgresql/pg_backup.log
  chmod 666 /var/log/postgresql/pg_backup.log
fi
tail -f /var/log/postgresql/pg_backup.log


text:
package com.ecommerce.ecommerpizzas.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.ecommerce.ecommerpizzas.models.entity.MenuPizza;
import com.ecommerce.ecommerpizzas.models.entity.MyCart;
import com.ecommerce.ecommerpizzas.models.entity.User;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.dao.RuntimeExceptionDao;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;

import java.sql.SQLException;

/**
 * Created by Asus on 24/10/2016.
 */

public class DatabaseHelper extends OrmLiteSqliteOpenHelper {

    private static final String DATABASE_NAME    = "ECommercePizzaV2.db";
    private static final int    DATABASE_VERSION = 4;
    private Dao<User, String> userDao = null;
    private Dao<MenuPizza, String> menuPizzaDao = null;
    private Dao<MyCart, String> myCartDao = null;
    private RuntimeExceptionDao<User, ?> mUser;
    private RuntimeExceptionDao<MenuPizza, ?> mMenuPizza;
    private RuntimeExceptionDao<MyCart, ?> mMyCart;

    public DatabaseHelper(Context context){
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
        try {
            TableUtils.createTable(connectionSource, User.class);
            TableUtils.createTable(connectionSource, MenuPizza.class);
            TableUtils.createTable(connectionSource, MyCart.class);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {
        try {
            TableUtils.dropTable(connectionSource, User.class, true);
            TableUtils.dropTable(connectionSource, MenuPizza.class, true);
            TableUtils.dropTable(connectionSource, MyCart.class, true);
            onCreate(database, connectionSource);

        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void close() {
        super.close();
    }

    public Dao<User, String> getUserDao() throws SQLException {
        if (userDao == null) {
            userDao = getDao(User.class);
        }
        mUser = getRuntimeExceptionDao(User.class);
        return userDao;
    }

    public Dao<MenuPizza, String> getMenuPizzaDao() throws SQLException {
        if (menuPizzaDao == null) {
            menuPizzaDao = getDao(MenuPizza.class);
        }
        mMenuPizza = getRuntimeExceptionDao(MenuPizza.class);
        return menuPizzaDao;
    }

    public Dao<MyCart, String> getMyCartDao() throws SQLException {
        if (myCartDao == null) {
            myCartDao = getDao(MyCart.class);
        }
        mMyCart = getRuntimeExceptionDao(MyCart.class);
        return myCartDao;
    }

    public String AddDataMenuPizza() {
        String message = "";
        try {
            // add sample data
            for (int i = 1; i < 11; i++) {
                MenuPizza item = new MenuPizza();
                item.setIdMenu(String.valueOf(i));
                switch (i) {
                    case 1:
                        item.setMenuName("BEEF RENDANG");
                        item.setDetail("Rendang Sauce, Shredded Mozzarella Cheese, Onion, Green Pepper");
                        item.setHarga("Rp.105.000");
                        item.setSize("10 Inch");
                        break;
                    case 2:
                        item.setMenuName("AYAM BAKAR");
                        item.setDetail("Rendang Sauce, Shredded Mozzarella Cheese, Onion, AyamBakar, Dry Parsley Flake");
                        item.setHarga("Rp.105.000");
                        item.setSize("10 Inch");
                        break;
                    case 3:
                        item.setMenuName("EXTRAVAGANZZA");
                        item.setDetail("Domino's Pizza Sauce, Green Peppers, Beef Crumble, Beef Pepperoni, Onions, Mushrooms, Black Olives, Mozzarella Cheese");
                        item.setHarga("Rp.85.000");
                        item.setSize("10 Inch");
                        break;
                    case 4:
                        item.setMenuName("SPICY GARLIC PRAWN");
                        item.setDetail("Rustic Sauce, Shredded Mozzarella Cheese, Prawn, Garlic Bread Seasoning, Onion, Local Tomato, Dry Parsley Flakes");
                        item.setHarga("Rp.105.000");
                        item.setSize("10 Inch");
                        break;
                    case 5:
                        item.setMenuName("TANDOORI CHICKEN");
                        item.setDetail("Curry Sauce, Onion, Green Pepper, Tandoori Chicken, Rahitta Sauce");
                        item.setHarga("Rp.105.000");
                        item.setSize("10 Inch");
                        break;
                    case 6:
                        item.setMenuName("FIRE BREATHER");
                        item.setDetail("Domino's Pizza Sauce, Sambal Sauce, Jalapeno, Tomato, Beef Pepperoni, Dry Chili Flakes, Mozzarella Cheese");
                        item.setHarga("Rp.72.000");
                        item.setSize("10 Inch");
                        break;
                    case 7:
                        item.setMenuName("VEGGIE MANIA");
                        item.setDetail("Domino's Pizza Sauce, Onions, Green Peppers, Corns, Mushrooms, Black Olives, Tomato Dice, Dried Parsley, Mozarella Cheese");
                        item.setHarga("Rp.85.000");
                        item.setSize("10 Inch");
                        break;
                    case 8:
                        item.setMenuName("VEGGIE SUPREME");
                        item.setDetail("Domino's Pizza Sauce, Green Pepper, Red Pepper, Onion, Feta Cheese, Parsley, Mozzarella Cheese");
                        item.setHarga("Rp.72.000");
                        item.setSize("10 Inch");
                        break;
                    case 9:
                        item.setMenuName("SAMBAL BEEF");
                        item.setDetail("Pizza Dough, Dom Pizza Sauce, Mozarella Cheese, Beef Topping / Cramble, Sambal Sauce");
                        item.setHarga("Rp.45.000");
                        item.setSize("10 Inch");
                        break;
                    case 10:
                        item.setMenuName("BEEF PEPPERONI FEAST");
                        item.setDetail("Domino's Pizza Sauce, Beef Pepperoni, Mozarella Cheese");
                        item.setHarga("Rp.72.000");
                        item.setSize("10 Inch");
                        break;
                }
            menuPizzaDao.create(item);
        }
            message = "Succes Add Data Menu Pizza";
    } catch (SQLException e) {
        e.printStackTrace();
        message = e.getMessage();
    }
    return message;
}

}


text:
/* @summary Verify proper basic functionality of Security.grant(Class, Class)
 */

public class StringPrincipal implements java.security.Principal {

    private String name;

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

    public String getName() {
	return name;
    }

    public int hashCode() {
	return name.hashCode();
    }

    public String toString() {
	return "StringPrincipal[" + name + "]";
    }

    public boolean equals(Object obj) {
	return (obj instanceof StringPrincipal &&
		name.equals(((StringPrincipal) obj).name));
    }
}


text:
type(
  'PreLoadHandler',
  [],
  {
    execute: function() {
      var self = this;

      if (this.counter === 0) {
        this.process();
      } else {
        $L(this.actionList).each(function(preloadItem) {
          var hook = new WatchValue();
          hook.set(false);
          hook.observe(function(value) {
            if (value) {
              bind.detach(hook);
              self.counter--;

              if (self.counter === 0) {
                self.process();
              }
            }
          });

          if (preloadItem.PreLoadAction) {
            preloadItem.run(hook);
          } else {
            preloadItem.call(self, hook);
          }
        });
      }
    },
  },
  function(list, process) {
    this.actionList = list;
    this.counter = list.length;
    this.process = process;
  }
);

type(
  'ProgressDialog',
  ['ExclusivePopup'],
  {
    draw: function() {
      return this.ExclusivePopup.prototype.draw.call(
        this,
        $('
').append($('
').html(this.text)),
        {background: '#424242', border: 'none', padding: '20px', overflow: 'visible'},
        {background: '#424242', border: 'none', padding: '1px', overflow: 'auto', display: 'inline'}
      );
    },
  },
  function(text) {
    if (text === undefined) {
      this.text = $T('Loading...');
    } else {
      this.text = text;
    }
    this.ExclusivePopup();
  }
);

IndicoUI.Dialogs = {};


text:
<?php

namespace Djgg\SharepriceBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use APY\DataGridBundle\Grid\Source\Entity;
use Djgg\SharepriceBundle\Entity\Category;
use Djgg\SharepriceBundle\Form\CategoryType;

/**
 * Category controller.
 *
 */
class CategoryController extends Controller
{

	public function gridAction()
	{

		$source = new Entity('DjggSharepriceBundle:Category');
		$grid = $this->get('grid');
		$grid->setSource($source);

		// Manage the grid redirection, exports and the response of the controller
		return $grid->getGridResponse('DjggSharepriceBundle:Category:grid.html.twig');
	}

    /**
     * Creates a new Category entity.
     *
     */
    public function createAction(Request $request)
    {
        $entity  = new Category();
        $form = $this->createForm(new CategoryType(), $entity);
        $form->bind($request);

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

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

        return $this->render('DjggSharepriceBundle:Category:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Displays a form to create a new Category entity.
     *
     */
    public function newAction()
    {
        $entity = new Category();
        $form   = $this->createForm(new CategoryType(), $entity);

        return $this->render('DjggSharepriceBundle:Category:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Finds and displays a Category entity.
     *
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('DjggSharepriceBundle:Category')->find($id);

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

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

        return $this->render('DjggSharepriceBundle:Category:show.html.twig', array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),        ));
    }

    /**
     * Displays a form to edit an existing Category entity.
     *
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('DjggSharepriceBundle:Category')->find($id);

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

        $editForm = $this->createForm(new CategoryType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        return $this->render('DjggSharepriceBundle:Category:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Edits an existing Category entity.
     *
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('DjggSharepriceBundle:Category')->find($id);

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

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createForm(new CategoryType(), $entity);
        $editForm->bind($request);

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

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

        return $this->render('DjggSharepriceBundle:Category:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Deletes a Category entity.
     *
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->bind($request);

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

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

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

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

    /**
     * Creates a form to delete a Category entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder(array('id' => $id))
            ->add('id', 'hidden')
            ->getForm()
        ;
    }
}


text:
autocommit off;
create class foo (a int unique);
insert into foo values (1) into :p1;
select * from foo;
update object :p1 set a = 2;
select * from foo;
rollback;


text:
#ifndef __GAME_HEADER__
#define __GAME_HEADER__

/* *************************************
 * 	Includes
 * *************************************/

#include "Global_Inc.h"
#include "GameStructures.h"
#include "LoadMenu.h"
#include "System.h"
#include "Camera.h"
#include "GameGui.h"
#include "GamePhysics.h"
#include "Menu.h"

/* *************************************
 * 	Defines
 * *************************************/

#define PLAYER_ONE 0
#define PLAYER_TWO 1
#define MAX_PLAYERS (PLAYER_TWO + 1)
#define MAX_WAVES 13
#define MAX_SECONDROW_WAVES (MAX_WAVES * 2)

#define TILE_SIZE 64
#define LEVEL_TITLE_SIZE 32
#define TILE_SIZE_BIT_SHIFT 6

#define LEVEL_X_SIZE 768
#define LEVEL_Y_SIZE 240

/* *************************************
 * 	Global variables
 * *************************************/

extern bool GameStartupFlag;
extern TYPE_PLAYER PlayerData[];
extern TYPE_WAVE WaveData[];
extern SsVag SplashSnd;
extern SsVag DeathSnd;

/* *************************************
 * 	Global prototypes
 * *************************************/

void 		Game(void);
char * 		GetGameLevelTitle(void);
void 		GameSetTime(uint8_t minutes, uint8_t seconds);

#endif //__GAME_HEADER__


text:
from __future__ import unicode_literals

from flask_restplus import fields, Model

from . import TestCase

class ModelTestCase(TestCase):
    def test_model_as_flat_dict(self):
        model = Model('Person', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
        })

        self.assertEqual(model.__schema__, {
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                }
            },
            'type': 'object'
        })

    def test_model_as_nested_dict(self):
        address = Model('Address', {
            'road': fields.String,
        })

        person = Model('Person', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
            'address': fields.Nested(address)
        })

        self.assertEqual(person.__schema__, {
            # 'required': ['address'],
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'address': {
                    '$ref': '#/definitions/Address',
                }
            },
            'type': 'object'
        })

        self.assertEqual(address.__schema__, {
            'properties': {
                'road': {
                    'type': 'string'
                },
            },
            'type': 'object'
        })

    def test_model_as_dict_with_list(self):
        model = Model('Person', {
            'name': fields.String,
            'age': fields.Integer,
            'tags': fields.List(fields.String),
        })

        self.assertEqual(model.__schema__, {
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'tags': {
                    'type': 'array',
                    'items': {
                        'type': 'string'
                    }
                }
            },
            'type': 'object'
        })

    def test_model_as_nested_dict_with_list(self):
        address = Model('Address', {
            'road': fields.String,
        })

        person = Model('Person', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
            'addresses': fields.List(fields.Nested(address))
        })

        self.assertEqual(person.__schema__, {
            # 'required': ['address'],
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'addresses': {
                    'type': 'array',
                    'items': {
                        '$ref': '#/definitions/Address',
                    }
                }
            },
            'type': 'object'
        })

        self.assertEqual(address.__schema__, {
            'properties': {
                'road': {
                    'type': 'string'
                },
            },
            'type': 'object'
        })

    def test_model_with_required(self):
        model = Model('Person', {
            'name': fields.String(required=True),
            'age': fields.Integer,
            'birthdate': fields.DateTime(required=True),
        })

        self.assertEqual(model.__schema__, {
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                }
            },
            'required': ['birthdate', 'name'],
            'type': 'object'
        })

    def test_model_as_nested_dict_and_required(self):
        address = Model('Address', {
            'road': fields.String,
        })

        person = Model('Person', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
            'address': fields.Nested(address, required=True)
        })

        self.assertEqual(person.__schema__, {
            'required': ['address'],
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'address': {
                    '$ref': '#/definitions/Address',
                }
            },
            'type': 'object'
        })

        self.assertEqual(address.__schema__, {
            'properties': {
                'road': {
                    'type': 'string'
                },
            },
            'type': 'object'
        })

    def test_model_with_discriminator(self):
        model = Model('Person', {
            'name': fields.String(discriminator=True),
            'age': fields.Integer,
        })

        self.assertEqual(model.__schema__, {
            'properties': {
                'name': {'type': 'string'},
                'age': {'type': 'integer'},
            },
            'discriminator': 'name',
            'required': ['name'],
            'type': 'object'
        })

    def test_model_with_discriminator_override_require(self):
        model = Model('Person', {
            'name': fields.String(discriminator=True, required=False),
            'age': fields.Integer,
        })

        self.assertEqual(model.__schema__, {
            'properties': {
                'name': {'type': 'string'},
                'age': {'type': 'integer'},
            },
            'discriminator': 'name',
            'required': ['name'],
            'type': 'object'
        })

    def test_clone_from_instance(self):
        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
        })

        child = parent.clone('Child', {
            'extra': fields.String,
        })

        self.assertEqual(child.__schema__, {
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'extra': {
                    'type': 'string'
                }
            },
            'type': 'object'
        })

    def test_clone_from_class(self):
        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
        })

        child = Model.clone('Child', parent, {
            'extra': fields.String,
        })

        self.assertEqual(child.__schema__, {
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'extra': {
                    'type': 'string'
                }
            },
            'type': 'object'
        })

    def test_clone_from_instance_with_multiple_parents(self):
        grand_parent = Model('GrandParent', {
            'grand_parent': fields.String,
        })

        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
        })

        child = grand_parent.clone('Child', parent, {
            'extra': fields.String,
        })

        self.assertEqual(child.__schema__, {
            'properties': {
                'grand_parent': {
                    'type': 'string'
                },
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'extra': {
                    'type': 'string'
                }
            },
            'type': 'object'
        })

    def test_clone_from_class_with_multiple_parents(self):
        grand_parent = Model('GrandParent', {
            'grand_parent': fields.String,
        })

        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
        })

        child = Model.clone('Child', grand_parent, parent, {
            'extra': fields.String,
        })

        self.assertEqual(child.__schema__, {
            'properties': {
                'grand_parent': {
                    'type': 'string'
                },
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'extra': {
                    'type': 'string'
                }
            },
            'type': 'object'
        })

    def test_inherit_from_instance(self):
        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
        })

        child = parent.inherit('Child', {
            'extra': fields.String,
        })

        self.assertEqual(parent.__schema__, {
            'properties': {
                'name': {'type': 'string'},
                'age': {'type': 'integer'},
            },
            'type': 'object'
        })
        self.assertEqual(child.__schema__, {
            'allOf': [
                {'$ref': '#/definitions/Parent'},
                {
                    'properties': {
                        'extra': {'type': 'string'}
                    },
                    'type': 'object'
                }
            ]
        })

    def test_inherit_from_class(self):
        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
        })

        child = Model.inherit('Child', parent, {
            'extra': fields.String,
        })

        self.assertEqual(parent.__schema__, {
            'properties': {
                'name': {'type': 'string'},
                'age': {'type': 'integer'},
            },
            'type': 'object'
        })
        self.assertEqual(child.__schema__, {
            'allOf': [
                {'$ref': '#/definitions/Parent'},
                {
                    'properties': {
                        'extra': {'type': 'string'}
                    },
                    'type': 'object'
                }
            ]
        })

    def test_inherit_from_class_from_multiple_parents(self):
        grand_parent = Model('GrandParent', {
            'grand_parent': fields.String,
        })

        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
        })

        child = Model.inherit('Child', grand_parent, parent, {
            'extra': fields.String,
        })

        self.assertEqual(child.__schema__, {
            'allOf': [
                {'$ref': '#/definitions/GrandParent'},
                {'$ref': '#/definitions/Parent'},
                {
                    'properties': {
                        'extra': {'type': 'string'}
                    },
                    'type': 'object'
                }
            ]
        })

    def test_inherit_from_instance_from_multiple_parents(self):
        grand_parent = Model('GrandParent', {
            'grand_parent': fields.String,
        })

        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
        })

        child = grand_parent.inherit('Child', parent, {
            'extra': fields.String,
        })

        self.assertEqual(child.__schema__, {
            'allOf': [
                {'$ref': '#/definitions/GrandParent'},
                {'$ref': '#/definitions/Parent'},
                {
                    'properties': {
                        'extra': {'type': 'string'}
                    },
                    'type': 'object'
                }
            ]
        })

    # def test_inherit_inline(self):
    #     parent = Model('Person', {
    #         'name': fields.String,
    #         'age': fields.Integer,
    #     })
    #
    #     child = self.api.inherit('Child', parent, {
    #         'extra': fields.String,
    #     })
    #
    #     Model('Output', {
    #         'child': fields.Nested(child),
    #         'children': fields.List(fields.Nested(child))
    #     })
    #
    #     self.assertIn('Person', Models)
    #     self.assertIn('Child', Models)

    def test_polymorph_inherit_common_ancestor(self):
        class Child1:
            pass

        class Child2:
            pass

        parent = Model('Person', {
            'name': fields.String,
            'age': fields.Integer,
        })

        child1 = parent.inherit('Child1', {
            'extra1': fields.String,
        })

        child2 = parent.inherit('Child2', {
            'extra2': fields.String,
        })

        mapping = {
            Child1: child1,
            Child2: child2,
        }

        output = Model('Output', {
            'child': fields.Polymorph(mapping)
        })

        # Should use the common ancestor
        self.assertEqual(output.__schema__, {
            'properties': {
                'child': {'$ref': '#/definitions/Person'},
            },
            'type': 'object'
        })

    def test_validate(self):
        from jsonschema import FormatChecker
        from werkzeug.exceptions import BadRequest

        class IPAddress(fields.Raw):
            __schema_type__ = 'string'
            __schema_format__ = 'ipv4'

        data = {'ip': '192.168.1'}
        model = Model('MyModel', {'ip': IPAddress()})

        # Test that validate without a FormatChecker does not check if a
        # primitive type conforms to the defined format property
        self.assertIsNone(model.validate(data))

        # Test that validate with a FormatChecker enforces the check of the
        # format property and throws an error if invalid
        with self.assertRaises(BadRequest):
            model.validate(data, format_checker=FormatChecker())

class ModelDeprecattionsTest(TestCase):
    def test_extend_is_deprecated(self):
        parent = Model('Parent', {
            'name': fields.String,
            'age': fields.Integer,
            'birthdate': fields.DateTime,
        })

        with self.assert_warning(DeprecationWarning):
            child = parent.extend('Child', {
                'extra': fields.String,
            })

        self.assertEqual(child.__schema__, {
            'properties': {
                'name': {
                    'type': 'string'
                },
                'age': {
                    'type': 'integer'
                },
                'birthdate': {
                    'type': 'string',
                    'format': 'date-time'
                },
                'extra': {
                    'type': 'string'
                }
            },
            'type': 'object'
        })


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W26895_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans3.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans211.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans330.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans708.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">"Hanna" u Ill :10"
123859
. = utllt.lt\ «4f unluflmflhflfln
ammo.
1/2'—MIL:
.1 MILES TO sea
EXIT FROM DICKlNSON, ND
12/05/15
Dunn County, Norm Dakota :3: I O
FAIMAN 24-33PH 345' FSL 8: 2081 ' FEL SE 1/4 Section 33, T141N, R97W - 5th Principal Men'dian 0.9 MiLEs To PROPOSED ROAD
DATE.-
Ekis'TING ACCESS ROAD
93'
+ INTERSECNON
N w M R O P R o C m G & N. O G W —" H W
6.2 MILES TO
' COUNTY access
LEG END Emma ROAD
HIG HLAN DS ENGINEERING 8: SURVEYING. PLLC
Dickinson, ND 58601 701.483.2444 office 701 .4832610 fax www.hlghlandsang.oom
253 24th Street East


text:
<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="stylesheet" href="/tracing/ui/tracks/rect_track.css">

<link rel="import" href="/tracing/base/utils.html">
<link rel="import" href="/tracing/model/proxy_selectable_item.html">
<link rel="import" href="/tracing/ui/base/draw_helpers.html">
<link rel="import" href="/tracing/ui/base/fast_rect_renderer.html">
<link rel="import" href="/tracing/ui/base/heading.html">
<link rel="import" href="/tracing/ui/base/ui.html">
<link rel="import" href="/tracing/ui/tracks/track.html">

<script>
'use strict';

tr.exportTo('tr.ui.tracks', function() {
  /**
   * A track that displays an array of Rect objects.
   * @constructor
   * @extends {Track}
   */
  const RectTrack = tr.ui.b.define(
      'rect-track', tr.ui.tracks.Track);

  RectTrack.prototype = {

    __proto__: tr.ui.tracks.Track.prototype,

    decorate(viewport) {
      tr.ui.tracks.Track.prototype.decorate.call(this, viewport);
      Polymer.dom(this).classList.add('rect-track');
      this.asyncStyle_ = false;
      this.rects_ = null;

      this.heading_ = document.createElement('tr-ui-b-heading');
      Polymer.dom(this).appendChild(this.heading_);
    },

    set heading(heading) {
      this.heading_.heading = heading;
    },

    get heading() {
      return this.heading_.heading;
    },

    set tooltip(tooltip) {
      this.heading_.tooltip = tooltip;
    },

    set selectionGenerator(generator) {
      this.heading_.selectionGenerator = generator;
    },

    set expanded(expanded) {
      this.heading_.expanded = !!expanded;
    },

    set arrowVisible(arrowVisible) {
      this.heading_.arrowVisible = !!arrowVisible;
    },

    get expanded() {
      return this.heading_.expanded;
    },

    get asyncStyle() {
      return this.asyncStyle_;
    },

    set asyncStyle(v) {
      this.asyncStyle_ = !!v;
    },

    get rects() {
      return this.rects_;
    },

    set rects(rects) {
      this.rects_ = rects || [];
      this.invalidateDrawingContainer();
    },

    get height() {
      return window.getComputedStyle(this).height;
    },

    set height(height) {
      this.style.height = height;
      this.invalidateDrawingContainer();
    },

    get hasVisibleContent() {
      return this.rects_.length > 0;
    },

    draw(type, viewLWorld, viewRWorld, viewHeight) {
      switch (type) {
        case tr.ui.tracks.DrawType.GENERAL_EVENT:
          this.drawRects_(viewLWorld, viewRWorld);
          break;
      }
    },

    drawRects_(viewLWorld, viewRWorld) {
      const ctx = this.context();

      ctx.save();
      const bounds = this.getBoundingClientRect();
      tr.ui.b.drawSlices(
          ctx,
          this.viewport.currentDisplayTransform,
          viewLWorld,
          viewRWorld,
          bounds.height,
          this.rects_,
          this.asyncStyle_);
      ctx.restore();

      if (bounds.height <= 6) return;

      let fontSize;
      let yOffset;
      if (bounds.height < 15) {
        fontSize = 6;
        yOffset = 1.0;
      } else {
        fontSize = 10;
        yOffset = 2.5;
      }
      tr.ui.b.drawLabels(
          ctx,
          this.viewport.currentDisplayTransform,
          viewLWorld,
          viewRWorld,
          this.rects_,
          this.asyncStyle_,
          fontSize,
          yOffset);
    },

    addEventsToTrackMap(eventToTrackMap) {
      if (this.rects_ === undefined || this.rects_ === null) {
        return;
      }

      this.rects_.forEach(function(rect) {
        rect.addToTrackMap(eventToTrackMap, this);
      }, this);
    },

    addIntersectingEventsInRangeToSelectionInWorldSpace(
        loWX, hiWX, viewPixWidthWorld, selection) {
      function onRect(rect) {
        rect.addToSelection(selection);
      }
      onRect = onRect.bind(this);
      const instantEventWidth = 2 * viewPixWidthWorld;
      tr.b.iterateOverIntersectingIntervals(this.rects_,
          function(x) { return x.start; },
          function(x) {
            return x.duration === 0 ?
              x.duration + instantEventWidth :
              x.duration;
          },
          loWX, hiWX,
          onRect);
    },

    /**
     * Add the item to the left or right of the provided event, if any, to the
     * selection.
     * @param {rect} The current rect.
     * @param {Number} offset Number of rects away from the event to look.
     * @param {Selection} selection The selection to add an event to,
     * if found.
     * @return {boolean} Whether an event was found.
     * @private
     */
    addEventNearToProvidedEventToSelection(event, offset, selection) {
      const index = this.rects_.findIndex(rect => rect.modelItem === event);
      if (index === -1) return false;

      const newIndex = index + offset;
      if (newIndex < 0 || newIndex >= this.rects_.length) return false;

      this.rects_[newIndex].addToSelection(selection);
      return true;
    },

    addAllEventsMatchingFilterToSelection(filter, selection) {
      for (let i = 0; i < this.rects_.length; ++i) {
        // TODO(petrcermak): Rather than unpacking the proxy item here,
        // we should probably add an addToSelectionIfMatching(selection, filter)
        // method to SelectableItem (#900).
        const modelItem = this.rects_[i].modelItem;
        if (!modelItem) continue;

        if (filter.matchSlice(modelItem)) {
          selection.push(modelItem);
        }
      }
    },

    addClosestEventToSelection(worldX, worldMaxDist, loY, hiY,
        selection) {
      const rect = tr.b.findClosestIntervalInSortedIntervals(
          this.rects_,
          function(x) { return x.start; },
          function(x) { return x.end; },
          worldX,
          worldMaxDist);

      if (!rect) return;

      rect.addToSelection(selection);
    }
  };

  /**
   * A filled rectangle with a title.
   *
   * @constructor
   * @extends {ProxySelectableItem}
   */
  function Rect(modelItem, title, colorId, start, duration) {
    tr.model.ProxySelectableItem.call(this, modelItem);
    this.title = title;
    this.colorId = colorId;
    this.start = start;
    this.duration = duration;
    this.end = start + duration;
  }

  Rect.prototype = {
    __proto__: tr.model.ProxySelectableItem.prototype
  };

  return {
    RectTrack,
    Rect,
  };
});
</script>


text:
package edu.clemson.cs.r2jt.typeandpopulate.programtypes;

import edu.clemson.cs.r2jt.typeandpopulate.MTType;
import edu.clemson.cs.r2jt.typeandpopulate.entry.FacilityEntry;
import edu.clemson.cs.r2jt.typeandpopulate.entry.ProgramTypeDefinitionEntry;
import edu.clemson.cs.r2jt.typereasoning.TypeGraph;
import java.util.Map;

/**
 *
A PTRepresentation wraps an existing {@link PTType PTType}
 * with additional information about a {@link PTFamily PTFamily} this type
 * represents.  An instance of PTRepresentation is thus a special
 * case of its wrapped type that happens to be functioning as a representation
 * type.

 */
public class PTRepresentation extends PTType {

    private final PTType myBaseType;
    private final ProgramTypeDefinitionEntry myFamily;

    public PTRepresentation(TypeGraph g, PTType baseType,
            ProgramTypeDefinitionEntry family) {
        super(g);

        myBaseType = baseType;
        myFamily = family;
    }

    public PTType getBaseType() {
        return myBaseType;
    }

    public ProgramTypeDefinitionEntry getFamily() {
        return myFamily;
    }

    @Override
    public MTType toMath() {
        return myBaseType.toMath();
    }

    @Override
    public PTType instantiateGenerics(
            Map<String, PTType> genericInstantiations,
            FacilityEntry instantiatingFacility) {

        throw new UnsupportedOperationException(this.getClass() + " cannot "
                + "be instantiated.");
    }

    @Override
    public boolean acceptableFor(PTType t) {
        boolean result = super.acceptableFor(t);

        if (!result) {
            result = myFamily.getProgramType().acceptableFor(t);
        }

        return result;
    }

    @Override
    public String toString() {
        return myFamily.getName() + " as " + myBaseType;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. mens. Soc. linn. Lyon 21: 153 (1952)

#### Original name
Drosophila fulvescens Romagn., 1952

### Remarks
null


text:
// ReflectSoftware.Facebook
// Copyright (c) 2020 ReflectSoftware Inc.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Newtonsoft.Json;

namespace ReflectSoftware.Facebook.Messenger.Common.Models
{
    public class Payload
    {
        [JsonProperty("is_reusable", NullValueHandling = NullValueHandling.Ignore)]
        public bool? IsReusable { get; set; }
    }
}


text:
def group_feed_reader(group,mode='div',counter='5'):
    """parse group feeds"""

    url = "http://groups.google.com/group/%s/feed/rss_v2_0_topics.xml?num=%s" %\
          (group,counter)
    from gluon.contrib import feedparser
    g = feedparser.parse(url)

    if mode == 'div':
        html = XML(TAG.BLOCKQUOTE(UL(*[LI(A(entry['title']+' - ' +\
                                 entry['author'][entry['author'].rfind('('):],\
                                 _href=entry['link'],_target='_blank'))\
                            for entry in g['entries'] ]),\
                       _class="boxInfo",\
                       _style="padding-bottom:5px;"))

    else:
        html = XML(UL(*[LI(A(entry['title']+' - ' +\
                             entry['author'][entry['author'].rfind('('):],\
                             _href=entry['link'],_target='_blank'))\
                            for entry in g['entries'] ]))

    return html

def code_feed_reader(project,mode='div'):
    """parse code feeds"""

    url = "http://code.google.com/feeds/p/%s/hgchanges/basic" % project
    from gluon.contrib import feedparser
    g = feedparser.parse(url)
    if mode == 'div':
        html = XML(DIV(UL(*[LI(A(entry['title'],_href=entry['link'],\
                                 _target='_blank'))\
                            for entry in g['entries'][0:5]]),\
                       _class="boxInfo",\
                       _style="padding-bottom:5px;"))
    else:
        html = XML(UL(*[LI(A(entry['title'],_href=entry['link'],\
                             _target='_blank'))\
                            for entry in g['entries'][0:5]]))

    return html


text:
<?php

namespace PUGX\Godfather\Test;

use PUGX\Godfather\Container\ArrayContainer;

Class ArrayContainerTest extends \PHPUnit_Framework_TestCase
{
    public function testContainer()
    {
        $container = new ArrayContainer();
        $class = new \stdClass();
        $container->set('std', $class);
        $this->assertEquals($container->get('std'), $class);
        $container->setAlias('std2', 'std');
        $this->assertEquals($container->get('std2'), $class);
        $this->assertTrue($container->has('std'));
        $this->assertTrue($container->has('std2'));
    }
}


text:
package fatjar.implementations.schedule;

import fatjar.Schedule;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import static java.util.concurrent.TimeUnit.SECONDS;

public class ThreadSchedule implements Schedule {

    private ScheduledExecutorService scheduler = new ScheduledThreadPoolExecutor(5);

    @Override
    public void add(Scheduled scheduled) {
        final Runnable runnable = scheduled::apply;
        final ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(runnable, 0, 1, SECONDS);
        scheduler.schedule((Runnable) () -> future.cancel(true), 0, SECONDS);
    }

    @Override
    public void add(Scheduled scheduled, long period, TimeUnit unit) {
        final Runnable runnable = scheduled::apply;
        final ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(runnable, 0, period, unit);
        scheduler.schedule((Runnable) () -> future.cancel(true), 0, SECONDS);
    }

}