text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 -->
<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
  <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
  <primitive>true</primitive>
  <annotatorImplementationName>org.apache.uima.annotator.calais.mock.MockedOpenCalaisAnnotator</annotatorImplementationName>
  <analysisEngineMetaData>
    <name>OpenCalaisAnnotator</name>
    <description></description>
    <configurationParameters>

      <configurationParameter>
          <name>allowDistribution</name>
          <description></description>
          <type>Boolean</type>
          <multiValued>false</multiValued>
          <mandatory>true</mandatory>
       </configurationParameter>

      <configurationParameter>
          <name>allowSearch</name>
          <description></description>
          <type>Boolean</type>
          <multiValued>false</multiValued>
          <mandatory>true</mandatory>
       </configurationParameter>

      <configurationParameter>
          <name>submitter</name>
          <description></description>
          <type>String</type>
          <multiValued>false</multiValued>
          <mandatory>true</mandatory>
       </configurationParameter>

      <configurationParameter>
          <name>licenseID</name>
          <description></description>
          <type>String</type>
          <multiValued>false</multiValued>
          <mandatory>true</mandatory>
       </configurationParameter>

    </configurationParameters>

    <configurationParameterSettings>

       <nameValuePair>
          <name>allowDistribution</name>
          <value>
               <boolean>false</boolean>
          </value>
       </nameValuePair>

       <nameValuePair>
          <name>allowSearch</name>
          <value>
               <boolean>false</boolean>
          </value>
       </nameValuePair>

       <nameValuePair>
          <name>submitter</name>
          <value>
               <string></string>
          </value>
       </nameValuePair>

       <nameValuePair>
          <name>licenseID</name>
          <value>
               <string></string>
          </value>
       </nameValuePair>

    </configurationParameterSettings>
    <typeSystemDescription>
      <types>
        <typeDescription>
          <name>org.apache.uima.calais.Person</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Anniversary</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.City</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Company</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Continent</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Country</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Currency</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.EmailAddress</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Facility</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.FaxNumber</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Holiday</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.IndustryTerm</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.NaturalDisaster</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.NaturalFeature</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Organization</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.PhoneNumber</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.ProviceOrState</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Region</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.Technology</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.URL</name>
          <description/>
          <supertypeName>org.apache.uima.calais.BaseType</supertypeName>
        </typeDescription>
        <typeDescription>
          <name>org.apache.uima.calais.BaseType</name>
          <description/>
          <supertypeName>uima.tcas.Annotation</supertypeName>
          <features>
        <featureDescription>
          <name>calaisType</name>
          <description>OpenCalais type</description>
          <rangeTypeName>uima.cas.String</rangeTypeName>
        </featureDescription>
      </features>
        </typeDescription>
       </types>
    </typeSystemDescription>
    <capabilities>
      <capability>
        <inputs/>
        <outputs>
        </outputs>
        <languagesSupported/>
      </capability>
    </capabilities>
    <operationalProperties>
      <modifiesCas>true</modifiesCas>
      <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
      <outputsNewCASes>false</outputsNewCASes>
    </operationalProperties>
  </analysisEngineMetaData>

</analysisEngineDescription>


text:
<?php
/**
 *
 */
class Renovation extends Eloquent
{
    protected $table = 'renovaciones';
  /*
  *
  ## A Renovation belongs to a membership
  */
    public function Membership(){
        return $this->belongsTo('membresia');
    }

}

redpajama_set_name: RedPajamaGithub


text:
package com.paulinemenage.bumple;

import processing.event.KeyEvent;

public abstract class Screen {

    /**
     * Binds keys to different actions.
     * @param event An event.
     */
    public void keyPressed(KeyEvent event) { }

    /**
     * Binds the mouse click to different actions.
     */
    public void mouseClicked() { }

    /**
     * Draws the screen.
     */
    public void draw() { }

}


text:
require 'spec_helper'

require File.join(File.dirname(__FILE__), '/../factory_rspec_helper')
require 'puppet/pops'

describe Puppet::Pops::Model::AstTransformer do
  include FactoryRspecHelper

  let(:filename) { "the-file.pp" }
  let(:transformer) { Puppet::Pops::Model::AstTransformer.new(filename) }

  context "literal numbers" do
    it "converts a decimal number to a string Name" do
      ast = transform(QNAME_OR_NUMBER("10"))

      ast.should be_kind_of(Puppet::Parser::AST::Name)
      ast.value.should == "10"
    end

    it "converts a 0 to a decimal 0" do
      ast = transform(QNAME_OR_NUMBER("0"))

      ast.should be_kind_of(Puppet::Parser::AST::Name)
      ast.value.should == "0"
    end

    it "converts a 00 to an octal 00" do
      ast = transform(QNAME_OR_NUMBER("0"))

      ast.should be_kind_of(Puppet::Parser::AST::Name)
      ast.value.should == "0"
    end

    it "converts an octal number to a string Name" do
      ast = transform(QNAME_OR_NUMBER("020"))

      ast.should be_kind_of(Puppet::Parser::AST::Name)
      ast.value.should == "020"
    end

    it "converts a hex number to a string Name" do
      ast = transform(QNAME_OR_NUMBER("0x20"))

      ast.should be_kind_of(Puppet::Parser::AST::Name)
      ast.value.should == "0x20"
    end

    it "converts an unknown radix to an error string" do
      ast = transform(Puppet::Pops::Model::Factory.new(Puppet::Pops::Model::LiteralInteger, 3, 2))

      ast.should be_kind_of(Puppet::Parser::AST::Name)
      ast.value.should == "bad radix:3"
    end
  end

  it "preserves the file location" do
    model = literal(1)
    adapter = Puppet::Pops::Adapters::SourcePosAdapter.adapt(model.current)
    adapter.locator = Puppet::Pops::Parser::Locator.locator("\n\n1",filename)
    model.record_position(location(2, 1), nil)

    ast = transform(model)

    ast.file.should == filename
    ast.line.should == 3
    ast.pos.should == 1
  end

  def transform(model)
    transformer.transform(model)
  end

  def location(offset, length)
    Puppet::Pops::Parser::Locatable::Fixed.new(offset, length)
  end
end


text:
/**
 * Created with IntelliJ IDEA.
 * User: pat
 * Date: 12-05-10
 * Time: 2:15 PM
 * To change this template use File | Settings | File Templates.
 */
define(['underscore', 'backbone', '../lib/utility', '../lib/backbone-utility', '../lib/backbone-couch-schema-model', '../lib/backbone.couchdb'],
    function (_, Backbone, Utility, BackboneUtility, BackboneCouchSchemaModel, Backbone) {

  var TodoApp = {
    Models:{},
    Collections:{},
    Routers:{},
    App: {
      router: false
    }
  };

  TodoApp.Models.Todo = BackboneCouchSchemaModel.extend({
    // TODO Introduce a app-config dependency that contains all the configuration options of the application, such as the url of the couchdb server
    defaults: {
      type: 'todo'
    },
    schema:{
      description:'Todo item',
      type:'todo',
      properties:{
        name:{
          title:'Name',
          type:'string',
          required:true,
          'default':'What needs to be done?'
        },
        description:{
          title:'Description',
          required: false,
          type:'string'
        },
        createdAt:{
          title:'Creation date',
          type:'string',
          format: 'date-time'
        },
        completedAt:{
          title:'Completion date',
          type:'string',
          format: 'date-time'
        }
      }
    }
  });

  TodoApp.Collections.TodoCollection = Backbone.couch.Collection.extend({
    model:TodoApp.Models.Todo,
    change_feed: true,
    couch: function() {
      return {
        view: Backbone.couch.options.design + '/by_type',
        key: 'todo',
        include_docs: true
      }
    },
    initialize: function(){
      this._db = Backbone.couch.db(Backbone.couch.options.database);
      Backbone.couch.Collection.prototype.initialize.apply(this, arguments);
    }
    // _db:Backbone.couch.db(Backbone.couch.options.database) // Set a runtime...
  });

  TodoApp.Routers.TodoRouter = BackboneUtility.Routers.ScaffoldViewBasedRouter.extend({
    modelName:'todo',
    pluralModelName:'todos',
    modelClass:TodoApp.Models.Todo,
    parentContainer: $("#apps-container").append('

'),
    initialize: function(opts){
      BackboneUtility.Routers.ScaffoldViewBasedRouter.prototype.initialize.apply(this, arguments);
      this.collection = new TodoApp.Collections.TodoCollection();
    }
  });

  return TodoApp;
});


text:
#ifndef UIEVENTS_H__REMOTEPC__INCLUDED_
#define UIEVENTS_H__REMOTEPC__INCLUDED_

namespace RemotePC
{
	class UIEvents
		: public mc::CommonImpl< IUIEvents >
	{
	public:

		UIEvents();

		/**
		 * IUIEvents section
		 */

        virtual void OnConnected();

        virtual void OnApproved();

        virtual void OnPasswordRequested(bool wrongPass);

        virtual void OnError(const std::string& message);

        virtual void OnDisconnected();

		virtual void AttachGLContext();

		virtual void ShowScreenshot(mc::IMessageRef message);

        virtual void UpdateVolume(unsigned long volume);

		virtual void WarnOnOldRemotePC();

        virtual void ShowShellResponse(const std::string& response);

		virtual void UpdateZoomParams(float minZoom, float maxZoom, float currentZoom);
	};
}

#endif // !UIEVENTS_H__REMOTEPC__INCLUDED_


text:
namespace HotSwapLogger
{
    public interface ILogEventFormatter
    {
        string Format(LogEvent logEvent);
    }
}


text:
            Change Language

            {% if languages_len == 1 %}
                No languages to choose
            {% endif %}
            {% for language in languages %}
                {% if language.flag_name != current_language.flag_name %}

                        {{ language.english_name }}

                        {{ language.flag_name }}

                {% endif %}
            {% endfor %}

                    {{ name }}

{#

#}

                    Profile

                    Logout

{#                #}
{#                Level {{ level }}#}

                Level {{ level }}

Main

                Overview

                All Words

Categories

        {% for pinned_category in pinned_categories %}
            {% if pinned_category.id == current_category_id %}

                        {{ pinned_category.shortened }}
                        {{ pinned_category.name }}

                        {{ pinned_category.num_words }}

            {% else %}

                        {{ pinned_category.shortened }}
                        {{ pinned_category.name }}

                        {{ pinned_category.num_words }}

            {% endif %}
        {% endfor %}

                All Categories

                New Category

Language

                Change Language

{#
Progress
#}

                Home

                Categories


text:
import chai from 'chai';
import mongoose from 'mongoose';
import orderLib from '../../src/order';

const should = chai.should();

describe('order', () => {
	let
		Kitteh = mongoose.model('kittehs-order', new mongoose.Schema({
			birthday : {
				default : Date.now,
				type : Date
			},
			features : {
				color : String,
				isFurreh : Boolean
			},
			home : String,
			isDead: Boolean,
			name : String,
			peePatches : [String]
		})),
		sortClauseItems = [];

	before(() => {
		orderLib(mongoose);

		mongoose.Query.prototype.sort = (clause) => {
			if (clause) {
				sortClauseItems.push(clause);
			}
		};
	});

	beforeEach(() => {
		sortClauseItems = [];
	});

	it ('should return a query when created', () => {
		let query = Kitteh
			.find()
			.order(null);

		should.exist(query);
		(query instanceof mongoose.Query).should.equals(true);
	});

	it ('should sort fields in descending order when supplied', () => {
		let options = {
			sort : '-name'
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(1);
		sortClauseItems[0].name.should.equals(-1);
	});

	it ('should sort fields in descending order when an array is supplied', () => {
		let options = {
			sort : ['-name', '-birthday']
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].name.should.equals(-1);
		sortClauseItems[1].birthday.should.equals(-1);
	});

	it ('should sort fields in descending order when an object is supplied', () => {
		let options = {
			sort : {
				birthday : -1,
				name : -1
			}
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].birthday.should.equals(-1);
		sortClauseItems[1].name.should.equals(-1);
	});

	it ('should sort fields in ascending order when supplied', () => {
		let options = {
			sort : ['name']
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(1);
		sortClauseItems[0].name.should.equals(1);
	});

	it ('should sort fields in ascending order when an array is supplied', () => {
		let options = {
			sort : ['birthday', 'name']
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].birthday.should.equals(1);
		sortClauseItems[1].name.should.equals(1);
	});

	it ('should sort fields in ascending order when an object is supplied', () => {
		let options = {
			sort : {
				birthday: 1,
				name: 1
			}
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].birthday.should.equals(1);
		sortClauseItems[1].name.should.equals(1);
	});

	it ('should sort fields in both ascending and descending order when supplied as a string', () => {
		let options = {
			sort : 'home, -name'
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].home.should.equals(1);
		sortClauseItems[1].name.should.equals(-1);
	});

	it ('should sort fields in both ascending and descending order when supplied as an array', () => {
		let options = {
			sort : ['home', '-name']
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].home.should.equals(1);
		sortClauseItems[1].name.should.equals(-1);
	});

	it ('should sort fields in both ascending and descending order when supplied as an object', () => {
		let options = {
			sort : {
				'home': 1,
				'name': -1
			}
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].home.should.equals(1);
		sortClauseItems[1].name.should.equals(-1);
	});

	it ('should sort fields in default ascending order when values in supplied object are not valid numbers', () => {
		let options = {
			sort : {
				'home': 1,
				'name': 'invalid number'
			}
		};

		Kitteh
			.find()
			.order(options);

		sortClauseItems.should.have.length(2);
		sortClauseItems[0].home.should.equals(1);
		sortClauseItems[1].name.should.equals(1);
	});

});


text:
function SetState(self, newState, bShowAnimation)
	if bShowAnimation == nil then
		bShowAnimation = true	--true 是默认
	end

    local attr = self:GetAttribute()
    local owner = self:GetOwner()
    local bkg = self:GetControlObject("checkimage")
    local oldBkg = self:GetControlObject("oldimage")

	oldBkg:SetResID(bkg:GetResID())
	oldBkg:SetAlpha(255)

	if attr.Check then
		if newState == 0 then
			bkg:SetResID(attr.CheckNormalIconID)
		elseif newState == 1 then
			bkg:SetResID(attr.CheckDownIconID)
		elseif newState == 2 then
			bkg:SetResID(attr.CheckDisableIconID)
		elseif newState == 3 then
			bkg:SetResID(attr.CheckHoverIconID)
		end
	else
		if newState == 0 then
			bkg:SetResID(attr.UncheckNormalIconID)
		elseif newState == 1 then
			bkg:SetResID(attr.UncheckDownIconID)
		elseif newState == 2 then
			bkg:SetResID(attr.UncheckDisableIconID)
		elseif newState == 3 then
			bkg:SetResID(attr.UncheckHoverIconID)
		end
	end
	attr.NowState = newState

	if bShowAnimation then
		local aniFactory = XLGetObject("Xunlei.UIEngine.AnimationFactory")
		local aniAlpha = aniFactory:CreateAnimation("AlphaChangeAnimation")
		aniAlpha:BindRenderObj(oldBkg)
		aniAlpha:SetTotalTime(150)
		aniAlpha:SetKeyFrameAlpha(255,0)
		owner:AddAnimation(aniAlpha)
		aniAlpha:Resume()
	else
		oldBkg:SetAlpha(0)
	end
end

function SetCheck(self, check, bClick, bShowAnimation)	--bClick:是否是鼠标单击导致的状态改变
	if bClick == nil then
		bClick = false
	end
    local c = check
    if c == nil then
        c = false
    end

    if c == self:GetCheck() then
        return
    end

    local attr = self:GetAttribute()
    attr.Check = c
    if attr.Enable then
        self:SetState(0, bShowAnimation)
    else
        self:SetState(2, bShowAnimation)
    end
    self:FireExtEvent("OnCheck",attr.Check, bClick)
end

function GetCheck(self)
    local attr = self:GetAttribute()
    return attr.Check
end

function SetEnable(self, enable)
    if enable == nil or enable == self:GetEnable() then
        return
    end
    local attr = self:GetAttribute()
    attr.Enable = enable
    if not attr.Enable then
        self:SetState(2)
    else
        self:SetState(0)
    end
end

function GetEnable(self)
    local attr = self:GetAttribute()
    return attr.Enable
end

function OnBind(self)
    local attr = self:GetAttribute()
    attr.Check = false
    attr.NowState=0
    attr.Enable=true
    if attr.Text then
        text = self:GetControlObject("checktext")
        text:SetText(attr.Text)
    end
    local bkg = self:GetControlObject("checkimage")
    bkg:SetResID(attr.UncheckNormalIconID)
	local textObj = self:GetControlObject("checktext")
	textObj:SetTextColorResID(attr.TextColor)
	textObj:SetTextFontResID(attr.TextFont)

end

function OnInitControl(self)
    local attr = self:GetAttribute()
    self:Show(attr.Visible)
end

function OnLButtonDown(self)
    local attr = self:GetAttribute()
    if attr.Enable then
        self:SetState(1)
        self:SetCaptureMouse(true)
    end
end

function OnLButtonUp(self)
    local attr = self:GetAttribute()
    if attr.Enable then
        if attr.NowState==1 then
            self:SetCheck(not attr.Check, true)
        end
        self:SetCaptureMouse(false)
    end
end

function OnMouseMove(self)
    local attr = self:GetAttribute()
    if attr.Enable then
        if attr.NowState==0 then
            self:SetState(3)
        end
    end
end

function OnMouseLeave(self)
    local attr = self:GetAttribute()
    self:SetState(0)
end

function OnChar(self, char)
    if char == 32 or char == 13 then
        local attr = self:GetAttribute()
        self:SetCheck(not attr.Check, false)
    elseif char == 9 then
        self:RouteToFather()
    end
    return 0, true
end

function Show(self, visible)
    local attr = self:GetAttribute()
    attr.Visible = visible
    self:SetVisible(visible)
    self:SetChildrenVisible(visible)
end

function IsShow(self)
    local attr = self:GetAttribute()
    return attr.Visible
end

function AddTip(ctrl, text, type)
    if not type then
        type = 1
    end
    local left, top, right, buttom = ctrl:GetObjPos()
    local width, height = right - left, buttom - top
    local tipid = ctrl:RemoveTip()
    local objFactory = XLGetObject("Xunlei.UIEngine.ObjectFactory")
    local tip = objFactory:CreateUIObject(tipid,"Thunder.NewTask.Tip")
    tip:SetText(text)
    tip:SetType(type)
    local tipwidth, tipheight = tip:GetSize(44, 35)

	tip:SetZorder(500)
    ctrl:AddChild(tip)
	if type == 1 then
        tip:SetObjPos(0, -height - 15, tipwidth + 2, -height + tipheight - 15)
    elseif type == 2 then
        tip:SetObjPos(0, height - 10, tipwidth + 2, height + tipheight - 10)
    elseif type == 3 then
        tip:SetObjPos(width - tipwidth, -height, width - 2, -height + tipheight)
    elseif type == 4 then
        tip:SetObjPos(width - tipwidth, height - 10, width - 2, height + tipheight - 10)
    end
end

function RemoveTip(ctrl)
    local id = ctrl:GetID()
    local tipid = id..".tip"
    local tip = ctrl:GetControlObject(tipid)
    if tip ~= nil then
        ctrl:RemoveChild(tip)
    end
    return tipid
end


text:
from pastas.plots import TrackSolve, compare

from test_model import test_add_stressmodel

def test_plot():
    ml = test_add_stressmodel()
    ml.plot()

def test_decomposition():
    ml = test_add_stressmodel()
    ml.plots.decomposition(min_ylim_diff=0.1)

def test_results():
    ml = test_add_stressmodel()
    ml.plots.results()

def test_stacked_results():
    ml = test_add_stressmodel()
    ml.plots.stacked_results()

def test_block_response():
    ml = test_add_stressmodel()
    ml.plots.block_response()

def test_step_response():
    ml = test_add_stressmodel()
    ml.plots.step_response()

def test_diagnostics():
    ml = test_add_stressmodel()
    ml.plots.diagnostics(acf_options=dict(min_obs=10))

def test_stresses():
    ml = test_add_stressmodel()
    ml.plots.stresses()

def test_contributions_pie():
    ml = test_add_stressmodel()
    ml.plots.contributions_pie()

def test_compare():
    ml = test_add_stressmodel()
    ml2 = ml.copy()
    ml2.name = "Test_Model2"
    models = [ml, ml2]
    compare(models)

def test_tracksolve():
    ml = test_add_stressmodel()
    track = TrackSolve(ml)
    ml.solve(callback=track.plot_track_solve)


text:
'use strict';

const getAuthParams = require('./authParams');

module.exports = function(options, ctx, req, res, routingInfo) {
    const authParams = getAuthParams(options, ctx, req);
    const scope = 'openid name email email_verified ' + (options.scope || '');
    if (!authParams) {
        // TODO, tjanczuk, support the shared Auth0 application case
        return options.loginError({
            code: 400,
            message: 'You must specify Auth0 client ID, client secret, and domain when creating the webtask. See https://webtask.io/docs/auth for details.'
        }, ctx, req, res, routingInfo.baseUrl);
        // Neither client id or domain are specified; use shared Auth0 settings
        // var authUrl = 'https://auth0.auth0.com/i/oauth2/authorize'
        //     + '?response_type=code'
        //     + '&audience=https://auth0.auth0.com/userinfo'
        //     + '&scope=' + encodeURIComponent(scope)
        //     + '&client_id=' + encodeURIComponent(routingInfo.baseUrl)
        //     + '&redirect_uri=' + encodeURIComponent(routingInfo.baseUrl + '/callback');
        // res.writeHead(302, { Location: authUrl });
        // return res.end();
    }
    else {
        // Use custom Auth0 account
        const authUrl = 'https://' + authParams.domain + '/authorize'
            + '?response_type=code'
            + '&scope=' + encodeURIComponent(scope)
            + '&client_id=' + encodeURIComponent(authParams.clientId)
            + '&audience=' + encodeURIComponent(authParams.audience)
            + '&redirect_uri=' + encodeURIComponent(routingInfo.baseUrl + '/callback');
        res.writeHead(302, { Location: authUrl });
        return res.end();
    }
};


text:
package com.vitco.app.util.components.dialog;

/**
 * Listener interface for the UserInputDialog that is
 * notified when the dialog is closed by the user.
 */
public interface UserInputDialogListener {
    // called when the dialog closes (uses presses cancel or submit)
    // needs to return true if closing should be permitted
    // Note: The result is ignored if the resultFlag is equal to the cancel flag
    boolean onClose(int resultFlag);
}


text:
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <limits.h>
#include <inttypes.h>
#include <errno.h>
#include <assert.h>
#include "defs/error.h"

/**
 * Determines which numeric base the specified string should be parsed with.
 * Strings with leading zeroes are not parsed as octal.
 */
static int
parse_num_base(const char *sval)
{
    /* Skip optional sign. */
    if (sval[0] == '+' || sval[0] == '-') {
        sval++;
    }

    if (sval[0] == '0' && sval[1] == 'x') {
        return 0;
    } else {
        return 10;
    }
}

/**
 * Parses a long long within an imposed range.
 *
 * @param sval                  The string to parse.
 * @param min                   Values less than this are rejected.
 * @param max                   Values greater than this are rejected.
 * @param out_status            Written on completion;
 *                                  0: success;
 *                                  SYS_EINVAL: invalid string or number out of
 *                                      range.
 *
 * @return                      The parsed number on success;
 *                              unspecified on error.
 */
long long
parse_ll_bounds(const char *sval, long long min, long long max,
                int *out_status)
{
    char *endptr;
    long long llval;

    llval = strtoll(sval, &endptr, parse_num_base(sval));
    if (sval[0] != '\0' && *endptr == '\0' &&
        llval >= min && llval <= max) {

        *out_status = 0;
        return llval;
    }

    *out_status = SYS_EINVAL;
    return 0;
}

/**
 * Parses an unsigned long long within an imposed range.
 *
 * @param sval                  The string to parse.
 * @param min                   Values less than this are rejected.
 * @param max                   Values greater than this are rejected.
 * @param out_status            Written on completion;
 *                                  0: success;
 *                                  SYS_EINVAL: invalid string or number out of
 *                                      range.
 *
 * @return                      The parsed number on success;
 *                              unspecified on error.
 */
unsigned long long
parse_ull_bounds(const char *sval,
                 unsigned long long min, unsigned long long max,
                 int *out_status)
{
    char *endptr;
    unsigned long long ullval;

    ullval = strtoull(sval, &endptr, parse_num_base(sval));
    if (sval[0] != '\0' && *endptr == '\0' &&
        ullval >= min && ullval <= max) {

        *out_status = 0;
        return ullval;
    }

    *out_status = SYS_EINVAL;
    return 0;
}

/**
 * Parses a long long.
 *
 * @param sval                  The string to parse.
 * @param out_status            Written on completion;
 *                                  0: success;
 *                                  SYS_EINVAL: invalid string or number out of
 *                                      range.
 *
 * @return                      The parsed number on success;
 *                              unspecified on error.
 */
long long
parse_ll(const char *sval, int *out_status)
{
    return parse_ll_bounds(sval, LLONG_MIN, LLONG_MAX, out_status);
}

/**
 * Parses an unsigned long long.
 *
 * @param sval                  The string to parse.
 * @param out_status            Written on completion;
 *                                  0: success;
 *                                  SYS_EINVAL: invalid string or number out of
 *                                      range.
 *
 * @return                      The parsed number on success;
 *                              unspecified on error.
 */
unsigned long long
parse_ull(const char *sval, int *out_status)
{
    return parse_ull_bounds(sval, 0, ULLONG_MAX, out_status);
}

/**
 * Parses a stream of bytes with the specified delimiter(s).
 *
 * @param sval                  The string to parse.
 * @param delims                String containing delimiters; each character
 *                                  can act as a delimiter.
 * @param max_len               The maximum number of bytes to write.
 * @param dst                   The destination buffer to write bytes to.
 * @param out_len               Written on success; total number of bytes
 *                                  written to the destination buffer.
 *
 * @return                      0 on success;
 *                              SYS_EINVAL on invalid byte stream;
 *                              SYS_ERANGE if result only partially written to
 *                                  buffer due to insufficient space.
 */
int
parse_byte_stream_delim(const char *sval, const char *delims, int max_len,
                        uint8_t *dst, int *out_len)
{
    unsigned long ul;
    const char *cur;
    char *endptr;
    int i;

    i = 0;
    cur = sval;
    while (*cur != '\0') {
        if (i >= max_len) {
            return SYS_ERANGE;
        }

        ul = strtoul(cur, &endptr, parse_num_base(cur));
        if (endptr == cur) {
            return SYS_EINVAL;
        }
        cur = endptr;

        if (*cur != '\0') {
            if (strspn(cur, delims) != 1) {
                return SYS_EINVAL;
            }
            cur++;
            if (*cur == '\0') {
                /* Ended with a delimiter. */
                return SYS_EINVAL;
            }
        }

        if (ul > UINT8_MAX) {
            return SYS_EINVAL;
        }

        dst[i] = ul;
        i++;
    }

    *out_len = i;

    return 0;
}

/**
 * Parses a stream of bytes using ':' or '-' as delimiters.
 *
 * @param sval                  The string to parse.
 * @param max_len               The maximum number of bytes to write.
 * @param dst                   The destination buffer to write bytes to.
 * @param out_len               Written on success; total number of bytes
 *                                  written to the destination buffer.
 *
 * @return                      0 on success;
 *                              SYS_EINVAL on invalid byte stream;
 *                              SYS_ERANGE if result only partially written to
 *                                  buffer due to insufficient space.
 */
int
parse_byte_stream(const char *sval, int max_len, uint8_t *dst, int *out_len)
{
    return parse_byte_stream_delim(sval, ":-", max_len, dst, out_len);
}

/**
 * Parses a stream of bytes using ':' or '-' as delimiters.  The number of
 * bytes must be the exact value specified.
 *
 * @param sval                  The string to parse.
 * @param max_len               The maximum number of bytes to write.
 * @param dst                   The destination buffer to write bytes to.
 * @param len                   Number of bytes to parse.
 *
 * @return                      0 on success;
 *                              SYS_EINVAL on invalid byte stream or if source
 *                                  string contains an unexpected number of
 *                                  bytes;
 */
int
parse_byte_stream_exact_length(const char *sval, uint8_t *dst, int len)
{
    int actual_len;
    int rc;

    rc = parse_byte_stream(sval, len, dst, &actual_len);
    if (rc != 0) {
        return rc;
    }

    if (actual_len != len) {
        return SYS_EINVAL;
    }

    return 0;
}


text:
Simple script that uses `youtube-dl` to download a batch of videos (that are allowed to distribute or are free) from
multiple video hosting services such as Youtube or Wistia.

## Requirements
* [youtube-dl](https://rg3.github.io/youtube-dl/index.html)

Quick installation of the binary on Linux/Mac:

 ```
sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
 ```

## Usage

Apart from the destination of the files, `video_downloader` requires two text files as inputs, one for the list of URLs
and the other for the list of titles.

 ```
 python video_downloader.py -o output_location -i input.txt -t video_titles.txt
 ```


text:
@implementation SCVideoConfiguration

- (id)init {
    self = [super init];

    if (self) {
        self.bitrate = kSCVideoConfigurationDefaultBitrate;
        _size = CGSizeZero;
        _codec = kSCVideoConfigurationDefaultCodec;
        _scalingMode = kSCVideoConfigurationDefaultScalingMode;
        _affineTransform = CGAffineTransformIdentity;
        _timeScale = 1;
        _keepInputAffineTransform = YES;
    }

    return self;
}

static CGSize MakeVideoSize(CGSize videoSize, float requestedWidth) {
    float ratio = videoSize.width / requestedWidth;

    if (ratio <= 1) {
        return videoSize;
    }

    return CGSizeMake(videoSize.width / ratio, videoSize.height / ratio);
}

- (NSDictionary *)createAssetWriterOptionsWithVideoSize:(CGSize)videoSize {
    NSDictionary *options = self.options;
    if (options != nil) {
        return options;
    }

    CGSize outputSize = self.size;
    unsigned long bitrate = self.bitrate;

    if (self.preset != nil) {
        if ([self.preset isEqualToString:SCPresetLowQuality]) {
            bitrate = 500000;
            outputSize = MakeVideoSize(videoSize, 640);
        } else if ([self.preset isEqualToString:SCPresetMediumQuality]) {
            bitrate = 1000000;
            outputSize = MakeVideoSize(videoSize, 1280);
        } else if ([self.preset isEqualToString:SCPresetHighestQuality]) {
            bitrate = 6000000;
            outputSize = MakeVideoSize(videoSize, 1920);
        } else {
            NSLog(@"Unrecognized video preset %@", self.preset);
        }
    }

    if (CGSizeEqualToSize(outputSize, CGSizeZero)) {
        outputSize = videoSize;
    }

    if (self.sizeAsSquare) {
        if (videoSize.width > videoSize.height) {
            outputSize.width = videoSize.height;
        } else {
            outputSize.height = videoSize.width;
        }
    }

    NSMutableDictionary *compressionSettings = [NSMutableDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:bitrate] forKey:AVVideoAverageBitRateKey];

    if (self.shouldKeepOnlyKeyFrames) {
        [compressionSettings setObject:@1 forKey:AVVideoMaxKeyFrameIntervalKey];
    }

    if (self.profileLevel) {
        [compressionSettings setObject:self.profileLevel forKey:AVVideoProfileLevelKey];
    }
    [compressionSettings setObject:@30 forKey:AVVideoAverageNonDroppableFrameRateKey];
    [compressionSettings setObject:@NO forKey:AVVideoAllowFrameReorderingKey];
    [compressionSettings setObject:AVVideoH264EntropyModeCABAC forKey:AVVideoH264EntropyModeKey];
    [compressionSettings setObject:@30 forKey:AVVideoExpectedSourceFrameRateKey];

    return @{
             AVVideoCodecKey : self.codec,
             AVVideoScalingModeKey : self.scalingMode,
             AVVideoWidthKey : [NSNumber numberWithInteger:outputSize.width],
             AVVideoHeightKey : [NSNumber numberWithInteger:outputSize.height],
             AVVideoCompressionPropertiesKey : compressionSettings
             };

}

- (NSDictionary *)createAssetWriterOptionsUsingSampleBuffer:(CMSampleBufferRef)sampleBuffer {
    CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
    size_t width = CVPixelBufferGetWidth(imageBuffer);
    size_t height = CVPixelBufferGetHeight(imageBuffer);

    return [self createAssetWriterOptionsWithVideoSize:CGSizeMake(width, height)];
}

@end


text:
package org.cytoscape.keggscape.internal;

import static org.cytoscape.work.ServiceProperties.ID;
import static org.cytoscape.work.ServiceProperties.MENU_GRAVITY;
import static org.cytoscape.work.ServiceProperties.PREFERRED_MENU;
import static org.cytoscape.work.ServiceProperties.TITLE;

import java.util.Properties;

import org.cytoscape.work.TaskMonitor;
import org.cytoscape.group.CyGroupFactory;
import org.cytoscape.io.CyFileFilter;
import org.cytoscape.io.DataCategory;
import org.cytoscape.io.read.InputStreamTaskFactory;
import org.cytoscape.io.util.StreamUtil;
import org.cytoscape.keggscape.internal.read.kgml.KeggscapeFileFilter;
import org.cytoscape.keggscape.internal.read.kgml.KeggscapeNetworkReaderFactory;
import org.cytoscape.keggscape.internal.style.KGMLVisualStyleBuilder;
import org.cytoscape.keggscape.internal.task.ExpandPathwayContextMenuTaskFactory;
import org.cytoscape.keggscape.internal.task.OpenDetailsInBrowserTaskFactory;
import org.cytoscape.model.CyNetworkFactory;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.subnetwork.CyRootNetworkManager;
import org.cytoscape.service.util.AbstractCyActivator;
import org.cytoscape.task.NodeViewTaskFactory;
import org.cytoscape.task.read.LoadNetworkURLTaskFactory;
import org.cytoscape.util.swing.OpenBrowser;
import org.cytoscape.view.model.CyNetworkViewFactory;
import org.cytoscape.view.model.CyNetworkViewManager;
import org.cytoscape.view.vizmap.VisualMappingFunctionFactory;
import org.cytoscape.view.vizmap.VisualMappingManager;
import org.cytoscape.view.vizmap.VisualStyleFactory;
import org.osgi.framework.BundleContext;
import org.cytoscape.ci.CIResponseFactory;
import org.cytoscape.keggscape.internal.rest.KeggscapeResource;
import org.osgi.util.tracker.ServiceTracker;

/**
 * {@code CyActivator} is a class that is a starting point for OSGi bundles.
 *
 * A quick overview of OSGi: The common currency of OSGi is the service.
 * A service is merely a Java interface, along with objects that implement the
 * interface. OSGi establishes a system of bundles. Most bundles import
 * services. Some bundles export services. Some do both. When a bundle exports a
 * service, it provides an implementation to the service's interface. Bundles
 * import a service by asking OSGi for an implementation. The implementation is
 * provided by some other bundle.
 *
 * When OSGi starts your bundle, it will invoke {@CyActivator}'s
 * {@code start} method. So, the {@code start} method is where
 * you put in all your code that sets up your app. This is where you import and
 * export services.
 *
 * Your bundle's {@code Bundle-Activator} manifest entry has a fully-qualified
 * path to this class. It's not necessary to inherit from
 * {@code AbstractCyActivator}. However, we provide this class as a convenience
 * to make it easier to work with OSGi.
 *
 * Note: AbstractCyActivator already provides its own {@code stop} method, which
 * {@code unget}s any services we fetch using getService().
 */
public class CyActivator extends AbstractCyActivator {

	private ServiceTracker ciResponseFactoryTracker = null;
	private ServiceTracker ciExceptionFactoryTracker = null;
	private ServiceTracker ciErrorFactoryTracker = null;

	/**
	 * This is the {@code start} method, which sets up your app. The
	 * {@code BundleContext} object allows you to communicate with the OSGi
	 * environment. You use {@code BundleContext} to import services or ask OSGi
	 * about the status of some service.
	 */
	public CyActivator() {
		super();
	}

	@Override
	public void start(BundleContext bc) throws Exception {

		// importing services
		final StreamUtil streamUtil = getService(bc, StreamUtil.class);
		final CyNetworkViewFactory cyNetworkViewFactory = getService(bc, CyNetworkViewFactory.class);
		final CyNetworkFactory cyNetworkFactory = getService(bc, CyNetworkFactory.class);
		final CyNetworkManager cyNetworkManager = getService(bc, CyNetworkManager.class);
		final CyRootNetworkManager cyRootNetworkManager = getService(bc, CyRootNetworkManager.class);
		final CyNetworkViewManager cyNetworkViewManager = getService(bc, CyNetworkViewManager.class);
		final CyGroupFactory groupFactory = getService(bc, CyGroupFactory.class);
		final OpenBrowser openBrowser = getService(bc, OpenBrowser.class);

		final VisualMappingManager vmm = getService(bc, VisualMappingManager.class);
		// final TaskMonitor tm = getService(bc, TaskMonitor.class);
		// final CIResponseFactory ciResponseFactory = getService(bc, CIResponseFactory.class);
		ciResponseFactoryTracker = new ServiceTracker(bc, bc.createFilter("(objectClass=org.cytoscape.ci.CIResponseFactory)"), null);
		ciResponseFactoryTracker.open();

		ciResponseFactoryTracker = new ServiceTracker(bc, bc.createFilter("(objectClass=org.cytoscape.ci.CIResponseFactory)"), null);
		ciResponseFactoryTracker.open();

		ciExceptionFactoryTracker = new ServiceTracker(bc, bc.createFilter("(objectClass=org.cytoscape.ci.CIExceptionFactory)"), null);
		ciExceptionFactoryTracker.open();

		ciErrorFactoryTracker = new ServiceTracker(bc, bc.createFilter("(objectClass=org.cytoscape.ci.CIErrorFactory)"), null);
		ciErrorFactoryTracker.open();

		LoadNetworkURLTaskFactory loadNetworkURLTaskFactory = getService(bc, LoadNetworkURLTaskFactory.class);

		VisualStyleFactory vsFactoryServiceRef = getService(bc, VisualStyleFactory.class);
		VisualMappingFunctionFactory passthroughMappingFactoryRef = getService(bc, VisualMappingFunctionFactory.class,
				"(mapping.type=passthrough)");
		VisualMappingFunctionFactory discreteMappingFactoryRef = getService(bc, VisualMappingFunctionFactory.class,
				"(mapping.type=discrete)");

		KGMLVisualStyleBuilder vsBuilder = new KGMLVisualStyleBuilder(vsFactoryServiceRef,
				discreteMappingFactoryRef, passthroughMappingFactoryRef, vmm);

		// readers
		final CyFileFilter keggscapeReaderFilter = new KeggscapeFileFilter(new String[] { "xml", "kgml"},
				new String[] { "application/xml" }, "KEGG XML Files (KGML)", DataCategory.NETWORK, streamUtil);
		final KeggscapeNetworkReaderFactory kgmlReaderFactory = new KeggscapeNetworkReaderFactory(
				keggscapeReaderFilter, cyNetworkViewFactory, cyNetworkFactory, cyNetworkManager, cyRootNetworkManager,
				vsBuilder, vmm, groupFactory);
		final Properties keggscapeNetworkReaderFactoryProps = new Properties();

		keggscapeNetworkReaderFactoryProps.put(ID, "keggscapeNetworkReaderFactory");

		registerService(bc, kgmlReaderFactory, InputStreamTaskFactory.class, keggscapeNetworkReaderFactoryProps);

		final ExpandPathwayContextMenuTaskFactory expandPathwayContextMenuTaskFactory = new ExpandPathwayContextMenuTaskFactory(loadNetworkURLTaskFactory, vmm);
		final Properties nodeProp = new Properties();
		nodeProp.setProperty("preferredTaskManager", "menu");
		nodeProp.setProperty(PREFERRED_MENU, "KEGGScape[1]");
		nodeProp.setProperty(MENU_GRAVITY, "0.0");
		nodeProp.setProperty(TITLE, "Import selected pathway node from KEGG database...");
		registerService(bc, expandPathwayContextMenuTaskFactory, NodeViewTaskFactory.class, nodeProp);

		final OpenDetailsInBrowserTaskFactory openDetailsInBrowserTaskFactory = new OpenDetailsInBrowserTaskFactory(openBrowser);
		final Properties openProp = new Properties();
		openProp.setProperty("preferredTaskManager", "menu");
		openProp.setProperty(PREFERRED_MENU, "KEGGScape[1]");
		openProp.setProperty(MENU_GRAVITY, "10.0");
		openProp.setProperty(TITLE, "View details in web browser...");
		registerService(bc, openDetailsInBrowserTaskFactory, NodeViewTaskFactory.class, openProp);
			//new KeggscapeTaskFactory(), // Implementation
//			TaskFactory.class, // Interface
//			properties); // Service properties

//		final ShowPathwaySelectorAction showPathwaySelectorAction = new ShowPathwaySelectorAction();
//		registerService(bc, showPathwaySelectorAction, CyAction.class, new Properties());

		// registerService(bc, new KeggscapeResourceImpl(cyNetworkViewFactory, cyNetworkFactory, cyNetworkManager, cyRootNetworkManager, vsBuilder, vmm, groupFactory), KeggscapeResource.class, new Properties());

		KeggscapeResource keggscapeResource = new KeggscapeResource(cyNetworkViewFactory,
		cyNetworkFactory,	cyNetworkManager, cyRootNetworkManager, vsBuilder, vmm,
		groupFactory, ciResponseFactoryTracker, ciExceptionFactoryTracker, ciErrorFactoryTracker, cyNetworkViewManager);
		registerService(bc, keggscapeResource, KeggscapeResource.class, new Properties());

	}
}


text:
package com.ichmed.trinketeers.util.texturesystem;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Set;

import org.reflections.Reflections;

/**
 * This is the registry for all format decoder classes. It is also used to instantiate new Textures.<br>
 * Note: It is NOT a texture management class.
 * @author marcel
 * @see com.ichmed.trinketeers.util.render.TextureLibrary TextureLibrary
 * @see Texture
 */
public abstract class TextureCodecRegistry {

	private static HashMap<String, Class<?>> decoders;
	private static HashMap<String, Class<?>> encoders;

	static{
		decoders = new HashMap<>();
		encoders = new HashMap<>();
		Reflections ref = new Reflections("com.ichmed.trinketeers.util.texturesystem.ktxplugin");
		Set<Class<?>> classes = ref.getTypesAnnotatedWith(TextureCodecParameters.class);
		for(Class<?> c: classes){
			TextureCodecParameters p = c.getAnnotation(TextureCodecParameters.class);
			if(p.candecode()){
				registerDecoder(p.extension(), c);
			}
			if(p.canencode()){
				registerEncoder(p.extension(), c);
			}
		}
	}

	/**
	 * registers a new Texture format decoder
	 * @param extension the file extension without '.'
	 * @param codec the format decoder class
	 */
	private static void registerDecoder(String extension, Class<?> codec){
		decoders.put(extension, codec);
	}

	/**
	 * registers a new Texture format encoder
	 * @param extension the file extension without '.'
	 * @param codec the format encoder class
	 */
	private static void registerEncoder(String extension, Class<?> codec){
		encoders.put(extension, codec);

	}

	/**
	 * create a new instance of a texture at the given path
	 * @param source the data source to load the texture from
	 */
	public static Texture createTexture(String source) {
		if(source.lastIndexOf('.') != -1){
			String extension = source.substring(source.lastIndexOf('.')+1);
			if(decoders.containsKey(extension)){
				Class<?> clazz = decoders.get(extension);
				TextureCodecParameters pars = clazz.getAnnotation(TextureCodecParameters.class);
				if(!pars.candecode())
					throw new RuntimeException("the registered codec for "
							+extension+" can not decode.");
				try {
					Method decoder = clazz.getMethod("decode", String.class);
					return (Texture) decoder.invoke(null, source);
				} catch (NoSuchMethodException e) {
					throw new RuntimeException("the class "
							+ clazz.getCanonicalName()
							+" does not follow the method conventions. Thus"
							+" it cannot be used.", e);
				} catch (SecurityException e) {
					e.printStackTrace();
					throw new RuntimeException(e);
				} catch (IllegalAccessException e) {
					e.printStackTrace();
					throw new RuntimeException(e);
				} catch (IllegalArgumentException e) {
					e.printStackTrace();
					throw new RuntimeException(e);
				} catch (InvocationTargetException e) {
					e.printStackTrace();
					throw new RuntimeException(e);
				}
			}else{
				throw new RuntimeException("The extension "+extension+" not registered at the formatregistry.");
			}
		}else{
			throw new RuntimeException("could not determine file extension of "+source);
		}
	}

}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GameController;

import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.scene.Node;

/**
 *
 * @author Thong
 */
public class CharGhost extends CharacterControl{

    protected Node T;

    public CharGhost(CollisionShape shape,Node T) {
        super(shape,0f);
        this.T = T;
    }

}


text:
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Tomcat 7.0" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 7.0">
    <option name="START_JAVASCRIPT_DEBUGGER" value="true" />
    <deployment>
      <artifact name="SpringAppSecurity:war exploded">
        <settings>
          <option name="CONTEXT_PATH" value="/" />
        </settings>
      </artifact>
    </deployment>
    <server-settings>
      <option name="BASE_DIRECTORY_NAME" value="Tomcat_7_0_TeamProject" />
      <option name="DEPLOY_TOMCAT_APPS" value="true" />
      <option name="PRESERVE_SESSIONS" value="true" />
    </server-settings>
    <predefined_log_file id="Tomcat" enabled="true" />
    <predefined_log_file id="Tomcat Catalina" enabled="true" />
    <predefined_log_file id="Tomcat Manager" enabled="false" />
    <predefined_log_file id="Tomcat Host Manager" enabled="false" />
    <predefined_log_file id="Tomcat Localhost Access" enabled="false" />
    <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
      <pattern>
        <option name="PATTERN" value="com.springapp.security.ApplicationController" />
        <option name="ENABLED" value="true" />
      </pattern>
      <pattern>
        <option name="PATTERN" value="com.springapp.security.UserService" />
        <option name="ENABLED" value="true" />
      </pattern>
    </extension>
    <RunnerSettings RunnerId="Cover" />
    <RunnerSettings RunnerId="Debug">
      <option name="DEBUG_PORT" value="56400" />
      <option name="TRANSPORT" value="0" />
      <option name="LOCAL" value="true" />
    </RunnerSettings>
    <RunnerSettings RunnerId="Run" />
    <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
      <option name="USE_ENV_VARIABLES" value="true" />
      <STARTUP>
        <option name="USE_DEFAULT" value="true" />
        <option name="SCRIPT" value="" />
        <option name="VM_PARAMETERS" value="" />
        <option name="PROGRAM_PARAMETERS" value="" />
      </STARTUP>
      <SHUTDOWN>
        <option name="USE_DEFAULT" value="true" />
        <option name="SCRIPT" value="" />
        <option name="VM_PARAMETERS" value="" />
        <option name="PROGRAM_PARAMETERS" value="" />
      </SHUTDOWN>
    </ConfigurationWrapper>
    <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
      <option name="USE_ENV_VARIABLES" value="true" />
      <STARTUP>
        <option name="USE_DEFAULT" value="true" />
        <option name="SCRIPT" value="" />
        <option name="VM_PARAMETERS" value="" />
        <option name="PROGRAM_PARAMETERS" value="" />
      </STARTUP>
      <SHUTDOWN>
        <option name="USE_DEFAULT" value="true" />
        <option name="SCRIPT" value="" />
        <option name="VM_PARAMETERS" value="" />
        <option name="PROGRAM_PARAMETERS" value="" />
      </SHUTDOWN>
    </ConfigurationWrapper>
    <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
      <option name="USE_ENV_VARIABLES" value="false" />
      <STARTUP>
        <option name="USE_DEFAULT" value="true" />
        <option name="SCRIPT" value="" />
        <option name="VM_PARAMETERS" value="" />
        <option name="PROGRAM_PARAMETERS" value="" />
      </STARTUP>
      <SHUTDOWN>
        <option name="USE_DEFAULT" value="true" />
        <option name="SCRIPT" value="" />
        <option name="VM_PARAMETERS" value="" />
        <option name="PROGRAM_PARAMETERS" value="" />
      </SHUTDOWN>
    </ConfigurationWrapper>
    <method>
      <option name="BuildArtifacts" enabled="true">
        <artifact name="SpringAppSecurity:war exploded" />
      </option>
    </method>
  </configuration>
</component>


text:
require 'spec_helper'

describe "team pages" do

	subject { page }

	create_user_league
	let(:team) { league.teams.create(name: "exmaple league 2")}

	describe "when visiting the index" do
		before do
			league.teams.create(name: "example team")
			visit league_teams_path(league)
		end

		it { should have_title("Teams") }
		it { should have_content("example team") }
		it { should have_content("example league") }

	end

	describe "when visiting the team page" do
		before do
			sign_in(user)
			visit team_path(team.id)
		end
		it { should have_title("#{team.name}") }
		it { should have_content("join this team") }

		describe "when trying to join a team you are not on" do
			before { click_link("join this team") }

			it { should have_content("#{user.name}") }
			it { should have_content("You are now part of the #{team.name}!")}

			describe "when trying to join a team you already on" do
				before do
					click_link("join this team")
				end

				it { should have_content("You are already on this team") }
			end
		end

	end

	describe "when on the create team page" do
		before do
			sign_in(user)
			visit league_path(league)
			click_link "Create a team"
		end

		it { should have_title("Create Team") }

		describe "when creating a new team" do
			before do
				fill_in('Name', :with => 'example team')
				click_button('Create')
			end

			it { should have_title("#{league.name}") }
			it { should have_content("example team") }
			it { should have_content("example league") }
		end
	end

	describe "when looking at the teams in the league pages" do
		before do
			league.teams.create(name: "example team")
			sign_in(user)
			visit league_path(league)
		end

		describe "as the commissioner" do
			it { should have_content("delete") }
		end

		describe "when deleting a team with credentials" do
			before { click_link("delete") }

			it { should_not have_content("example team") }
		end
	end
end


text:
'use strict';

import { ChangePasswordRequest, ChangePasswordResponse } from '../../../src/packet/change-password';

require('../../common');

describe('ChangePasswordRequest', () => {

  describe('#constructor()', () => {

    it('should fail due to invalid parameters', () => {
      expect(() => {return new ChangePasswordRequest();}).to.throw(/Invalid user ID/);
      expect(() => {return new ChangePasswordRequest('USER');}).to.throw(/Invalid old password/);
      expect(() => {return new ChangePasswordRequest('USER', 'OLDPASS');}).to.throw(/Invalid new password/);
      expect(() => {return new ChangePasswordRequest('USER', 'OLDPASS', 'NEWPASS');}).to.throw(/Invalid encrypted password/);
      expect(() => {return new ChangePasswordRequest('USER', 'OLDPASS', 'NEWPASS', new Buffer(10));}).to.throw(/Invalid server level/);
    });

    it('should create new instance', () => {
      let user = 'USER';
      let oldPassword = 'OLDPASS';
      let newPassword = 'NEWPASS';
      let encryptedPassword = new Buffer(8);
      encryptedPassword.fill(0xFF);
      let p = new ChangePasswordRequest(user, oldPassword, newPassword, encryptedPassword, 10);
      p.length.should.equal(84);
      p.serviceId.should.equal(0xE009);
      p.requestResponseId.should.equal(0x7005);
      p.templateLength.should.equal(1);
      p.data[20].should.equal(0x01);
      p.userId.should.equal('USER');
      console.log(p.data.toString('hex'));
    });

  });

});


text:
var fs = require('fs');
var parse5 = require("parse5");
var Transformer = require("../lib/index.js").Transformer;
var Walker = require("../lib/index.js").Walker;

var parser = new parse5.Parser();
var document = parser.parse(fs.readFileSync(__dirname + "/custom-tag.html", "utf-8"));
var serializer = new parse5.Serializer();

var transformer  = new Transformer();

//change header to div.header
var changeHeaderWalker = new Walker();
changeHeaderWalker.handle = function(node, callback){
  if(node.tagName == 'header'){
    node.tagName = 'div';
    node.attrs.push({name: 'class', value: 'header'});
  }
  callback(node);
}
transformer.addBeforeFilter(function(doc, callback){
  changeHeaderWalker.walk(doc, callback);
});

//include file
transformer.addNodeFilter(function(node, callback){
  if(node.tagName == 'include'){
    var file;
    node.attrs.forEach(function(item){
      if(item.name == 'file'){
        file = item.value;
      }
    });
    if(file){
      try{
        var fragment = parser.parseFragment(fs.readFileSync(__dirname + "/" + file, "utf-8"));
        callback(fragment.childNodes[0]);
      }catch(err){
        console.log(err);
        callback(null);
      }
    }else{
      callback(null);
    }
  }else{
    callback(node)
  }
});

//remove comment
var removeCommentWalker = new Walker();
removeCommentWalker.handle = function(node, callback){
  if(node.nodeName != '#comment'){
    callback(node);
    if(node.nodeName == 'h1'){
    console.log(node);
    }
  }else{
    callback(null);
  }
}
transformer.addAfterFilter(function(doc, callback){
  removeCommentWalker.walk(doc, callback);
});

//execute transform
transformer.transform(document, function(doc){
  var html = serializer.serialize(doc);
  console.log(html);
});


text:
declare module "gulp-env" {
  interface EnvironmentMapping {
    [key: string]: any;
  }

  interface ForceableStream extends NodeJS.ReadWriteStream {
    force: boolean;
  }

  interface EnvStream extends NodeJS.ReadWriteStream {
    reset: ForceableStream;
    restore(force?: boolean): boolean;
  }

  interface Env {
    (file: string): EnvStream;

    (options: {
      vars: EnvironmentMapping,
    }): EnvStream;

    (options: {
      file: string,
      handler?: (contents: string) => EnvironmentMapping,
      vars?: EnvironmentMapping,
    }): EnvStream;

    (options: {
      file: string,
      type: string,
      vars?: EnvironmentMapping,
    }): EnvStream;

    set(vars: EnvironmentMapping): EnvStream;
  }

  export default Env;
}


text:
<?php

declare(strict_types=1);

namespace Borobudur\Component\Http\Controller;

use Borobudur\Component\Http\ResponseInterface;
use Borobudur\Component\Messaging\Message\MessageInterface;
use Borobudur\Component\Messaging\Request\ConfigurationInterface;

/**
 * @author  Iqbal Maulana <iq.bluejack@gmail.com>
 */
interface InvokableMessageControllerInterface
{
    /**
     * Dispatch a message in controller.
     *
     * @param MessageInterface       $message
     * @param ConfigurationInterface $requestConfiguration
     *
     * @return ResponseInterface
     */
    public function __invoke(MessageInterface $message, ConfigurationInterface $requestConfiguration): ResponseInterface;
}


text:
var cloud = factory.createCloud();
var myAmazonEC2node = factory.createNode();
myAmazonEC2node.id  = "EC2_0";
cloud.addNodes(myAmazonEC2node);
var myNginx = factory.createSoftware();
myNginx.name = "SRV0";
myAmazonEC2node.addSoftwares(myNginx);

draw(cloud,"Original");

var listener = { elementChanged : function(event){
 switch(event.getType()){
  case ActionType.$ADD:
    console.log("Add event ! "+event);
	break;
  case ActionType.$SET:
    console.log("Set event ! "+event);
	break;
 }
}};
//Add as Tree (meaning global) listener
cloud.addModelTreeListener(listener);
//Std listener only listen local event
//cloud.addModelListener(listener);
var node = factory.createNode();
node.id = "EC1";
//Trigger event ADD
cloud.addNodes(node);
//Trigger event SET
node.id = "EC2_1";

draw(cloud,"After Add");

console.log("Software found : "+cloud.findByPath("nodes[EC2_1]").id);

/* Declare a new instance of cloud */
var newCloud = factory.createCloud();
/* Declare a new listener */
var listener2 = { elementChanged : function(event){
    var traces = event2trace.convert(event);
	//send trace to network or browser events
	//for remote synchronization
    traces.applyOn(newCloud);
}};
cloud.addModelTreeListener(listener2);

var newNode = factory.createNode();
newNode.id = "newNode";
cloud.addNodes(newNode);

console.log(cloud.findByPath("nodes[newNode]").id);
console.log(newCloud.findByPath("nodes[newNode]").id);

draw(cloud,"Original+Added node");
draw(newCloud,"Last event sync");


text:
struct Environment {
  Environment() { logging::SetMinLogLevel(logging::LOG_FATAL); }
};

Environment* env = new Environment();

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  std::vector<uint8_t> license(data, data + size);
  std::vector<uint8_t> first_key;
  media::ExtractFirstKeyIdFromLicenseRequest(license, &first_key);

  std::string input(reinterpret_cast<const char*>(data), size);
  media::KeyIdAndKeyPairs keys;
  media::CdmSessionType session_type;
  media::ExtractKeysFromJWKSet(input, &keys, &session_type);

  media::KeyIdList key_ids;
  std::string error_message;
  media::ExtractKeyIdsFromKeyIdsInitData(input, &key_ids, &error_message);

  return 0;
}


text:
using System;
using System.IO;
using System.Collections.Generic;
using System.Reflection.TypeLoading;

namespace System.Reflection
{
    /// <summary>
    /// A MetadataLoadContext represents a closed universe of Type objects loaded for inspection-only purposes.
    /// Each MetadataLoadContext can have its own binding rules and is isolated from all other MetadataLoadContexts.
    ///
    /// A MetadataLoadContext serves as a dictionary that binds assembly names to Assembly instances that were previously
    /// loaded into the context or need to be loaded.
    ///
    /// Assemblies are treated strictly as metadata. There are no restrictions on loading assemblies based
    /// on target platform, CPU architecture or pointer size. There are no restrictions on the assembly designated
    /// as the core assembly ("mscorlib").
    /// </summary>
    /// <remarks>
    /// Also, as long as the metadata is "syntactically correct", the MetadataLoadContext strives to report it "as is" (as long it
    /// can do so in a way that can be distinguished from valid data) and refrains from judging whether it's "executable."
    /// This is both for performance reasons (checks cost time) and its intended role as metadata inspection tool.
    /// Examples of things that MetadataLoadContexts let go unchecked include creating generic instances that violate generic
    /// parameter constraints, and loading type hierachies that would be unloadable in an actual runtime (deriving from sealed classes,
    /// overriding members that don't exist in the ancestor classes, failing to implement all abstract methods, etc.)
    ///
    /// You cannot invoke methods, set or get field or property values or instantiate objects using
    /// the Type objects from a MetadataLoadContext. You can however, use FieldInfo.GetRawConstantValue(),
    /// ParameterInfo.RawDefaultValue and PropertyInfo.GetRawConstantValue(). You can retrieve custom attributes
    /// in CustomAttributeData format but not as instantiated custom attributes. The CustomAttributeExtensions
    /// extension api will not work with these Types nor will the IsDefined() family of api.
    ///
    /// There is no default binding policy. You must use a MetadataAssemblyResolver-derived class to load dependencies as needed.
    /// The MetadataLoadContext strives to avoid loading dependencies unless needed.
    /// Therefore, it is possible to do useful analysis of an assembly even
    /// in the absence of dependencies. For example, retrieving an assembly's name and the names of its (direct)
    /// dependencies can be done without having any of those dependencies on hand.
    ///
    /// To bind assemblies, the MetadataLoadContext calls the Resolve method on the correspding MetadataAssemblyResolver.
    /// That method should load the requested assembly and return it.
    /// To do this, it can use LoadFromAssemblyPath() or one of its variants (LoadFromStream(), LoadFromByteArray()).
    ///
    /// Once an assembly has been bound, no assembly with the same assembly name identity
    /// can be bound again from a different location unless the Mvids are identical.
    ///
    /// Once loaded, the underlying file may be locked for the duration of the MetadataLoadContext's lifetime. You can
    /// release the locks by disposing the MetadataLoadContext object. The behavior of any Type, Assembly or other reflection
    /// objects handed out by the MetadataLoadContext is undefined after disposal. Though objects provided by the MetadataLoadContext
    /// strive to throw an ObjectDisposedException, this is not guaranteed. Some apis may return fixed or previously
    /// cached data. Accessing objects *during* a Dispose may result in a unmanaged access violation and failfast.
    ///
    /// Comparing Type, Member and Assembly objects:
    ///   The right way to compare two Reflection objects dispensed by the MetadataLoadContext are:
    ///       m1 == m2
    ///       m1.Equals(m2)
    ///   but not
    ///       object.ReferenceEquals(m1, m2)   /// WRONG
    ///       (object)m1 == (object)m2         /// WRONG
    ///
    ///   Note that the following descriptions are not literal descriptions of how Equals() is implemented. The MetadataLoadContext
    ///   reserves the right to implement Equals() as "object.ReferenceEquals()" and intern the associated objects in such
    ///   a way that Equals() works "as if" it were comparing those things.
    ///
    /// - Each MetadataLoadContext permits only one Assembly instance per assembly identity so equality of assemblies is the same as the
    ///   equality of their assembly identity.
    ///
    /// - Modules are compared by comparing their containing assemblies and their row indices in the assembly's manifest file table.
    ///
    /// - Defined types are compared by comparing their containing modules and their row indices in the module's TypeDefinition table.
    ///
    /// - Constructed types (arrays, byrefs, pointers, generic instances) are compared by comparing all of their component types.
    ///
    /// - Generic parameter types are compared by comparing their containing Modules and their row indices in the module's GenericParameter table.
    ///
    /// - Constructors, methods, fields, events and properties are compared by comparing their declaring types, their row indices in their respective
    ///   token tables and their ReflectedType property.
    ///
    /// - Parameters are compared by comparing their declaring member and their position index.
    ///
    /// Multithreading:
    ///   The MetadataLoadContext and the reflection objects it hands out are all multithread-safe and logically immutable,
    ///   except that no Loads or inspections of reflection objects can be done during or after disposing the owning MetadataLoadContext.
    ///
    /// Support for NetCore Reflection apis:
    ///   .NETCore added a number of apis (IsSZArray, IsVariableBoundArray, IsTypeDefinition, IsGenericTypeParameter, IsGenericMethodParameter,
    ///      HasSameMetadataDefinitionAs, to name a few.) to the Reflection surface area.
    ///
    ///   The Reflection objects dispensed by MetadataLoadContexts support all the new apis *provided* that you are using the netcore build of System.Reflection.MetadataLoadContext.dll.
    ///
    ///   If you are using the netstandard build of System.Reflection.MetadataLoadContext.dll, the NetCore-specific apis are not supported. Attempting to invoke
    ///   them will generate a NotImplementedException or NullReferenceException (unfortunately, we can't improve the exceptions thrown because
    ///   they are being thrown by code this library doesn't control.)
    /// </remarks>
    public sealed partial class MetadataLoadContext : IDisposable
    {
        /// <summary>
        /// Create a new MetadataLoadContext object.
        /// </summary>
        /// <param name="coreAssemblyName">
        /// The name of the assembly that contains the core types such as System.Object. Typically, this would be "mscorlib".
        /// </param>
        public MetadataLoadContext(MetadataAssemblyResolver resolver, string coreAssemblyName = null)
        {
            if (resolver == null)
                throw new ArgumentNullException(nameof(resolver));

            this.resolver = resolver;

            if (coreAssemblyName != null)
            {
                // Validate now that the value is a parsable assembly name.
                new AssemblyName(coreAssemblyName);
            }

            // Resolve the core assembly now
            _coreTypes = new CoreTypes(this, coreAssemblyName);
        }

        /// <summary>
        /// Loads an assembly from a specific path on the disk and binds its assembly name to it in the MetadataLoadContext. If a prior
        /// assembly with the same name was already loaded into the MetadataLoadContext, the prior assembly will be returned. If the
        /// two assemblies do not have the same Mvid, this method throws a FileLoadException.
        /// </summary>
        public Assembly LoadFromAssemblyPath(string assemblyPath)
        {
            if (IsDisposed)
                throw new ObjectDisposedException(nameof(MetadataLoadContext));

            if (assemblyPath == null)
                throw new ArgumentNullException(nameof(assemblyPath));

            return LoadFromStreamCore(File.OpenRead(assemblyPath));
        }

        /// <summary>
        /// Loads an assembly from a byte array and binds its assembly name to it in the MetadataLoadContext. If a prior
        /// assembly with the same name was already loaded into the MetadataLoadContext, the prior assembly will be returned. If the
        /// two assemblies do not have the same Mvid, this method throws a FileLoadException.
        /// </summary>
        public Assembly LoadFromByteArray(byte[] assembly)
        {
            if (IsDisposed)
                throw new ObjectDisposedException(nameof(MetadataLoadContext));

            if (assembly == null)
                throw new ArgumentNullException(nameof(assembly));

            return LoadFromStreamCore(new MemoryStream(assembly));
        }

        /// <summary>
        /// Loads an assembly from a stream and binds its assembly name to it in the MetadataLoadContext. If a prior
        /// assembly with the same name was already loaded into the MetadataLoadContext, the prior assembly will be returned. If the
        /// two assemblies do not have the same Mvid, this method throws a FileLoadException.
        ///
        /// The MetadataLoadContext takes ownership of the Stream passed into this method. The original owner must not mutate its position, dispose the Stream or
        /// assume that its position will stay unchanged.
        /// </summary>
        public Assembly LoadFromStream(Stream assembly)
        {
            if (IsDisposed)
                throw new ObjectDisposedException(nameof(MetadataLoadContext));

            if (assembly == null)
                throw new ArgumentNullException(nameof(assembly));

            assembly.Position = 0;
            return LoadFromStreamCore(assembly);
        }

        /// <summary>
        /// Resolves the supplied assembly name to an assembly. If an assembly was previously bound by to this name, that assembly is returned.
        /// Otherwise, the MetadataLoadContext calls the specified MetadataAssemblyResolver. If the resolver returns null, this method throws a FileNotFoundException.
        ///
        /// Note that this behavior matches the behavior of AssemblyLoadContext.LoadFromAssemblyName() but does not match the behavior of
        /// Assembly.ReflectionOnlyLoad(). (the latter gives up without raising its resolve event.)
        /// </summary>
        public Assembly LoadFromAssemblyName(string assemblyName)
        {
            if (IsDisposed)
                throw new ObjectDisposedException(nameof(MetadataLoadContext));

            if (assemblyName == null)
                throw new ArgumentNullException(nameof(assemblyName));

            AssemblyName assemblyNameObject = new AssemblyName(assemblyName);
            RoAssemblyName refName = assemblyNameObject.ToRoAssemblyName();
            return ResolveAssembly(refName);
        }

        /// <summary>
        /// Resolves the supplied assembly name to an assembly. If an assembly was previously bound by to this name, that assembly is returned.
        /// Otherwise, the MetadataLoadContext calls the specified MetadataAssemblyResolver. If the resolver returns null, this method throws a FileNotFoundException.
        ///
        /// Note that this behavior matches the behavior of AssemblyLoadContext.LoadFromAssemblyName() resolve event but does not match the behavior of
        /// Assembly.ReflectionOnlyLoad(). (the latter gives up without raising its resolve event.)
        /// </summary>
        public Assembly LoadFromAssemblyName(AssemblyName assemblyName)
        {
            if (IsDisposed)
                throw new ObjectDisposedException(nameof(MetadataLoadContext));

            if (assemblyName == null)
                throw new ArgumentNullException(nameof(assemblyName));

            RoAssemblyName refName = assemblyName.ToRoAssemblyName();
            return ResolveAssembly(refName);
        }

        /// <summary>
        /// Returns the assembly that denotes the "system assembly" that houses the well-known types such as System.Int32.
        /// The core assembly is treated differently than other assemblies because references to these well-known types do
        /// not include the assembly reference, unlike normal types.
        ///
        /// Typically, this assembly is named "mscorlib", or "netstandard". If the core assembly cannot be found, the value will be
        /// null and many other reflection methods, including those that parse method signatures, will throw.
        ///
        /// The CoreAssembly is determined by passing the coreAssemblyName parameter passed to the MetadataAssemblyResolver constructor
        /// to the MetadataAssemblyResolver's Resolve method.
        /// If no coreAssemblyName argument was specified in the constructor of MetadataLoadContext, then default values are used
        /// including "mscorlib", "System.Runtime" and "netstandard".
        ///
        /// The designated core assembly does not need to contain the core types directly. It can type forward them to other assemblies.
        /// Thus, it is perfectly permissible to use the mscorlib facade as the designated core assembly.
        ///
        /// Note that "System.Runtime" is not an ideal core assembly as it excludes some of the interop-related pseudo-custom attribute types
        /// such as DllImportAttribute. However, it can serve if you have no interest in those attributes. The CustomAttributes api
        /// will skip those attributes if the core assembly does not include the necessary types.
        ///
        /// The CoreAssembly is not loaded until necessary. These APIs do not trigger the search for the core assembly:
        ///    MetadataLoadContext.LoadFromStream(), LoadFromAssemblyPath(), LoadFromByteArray()
        ///    Assembly.GetName(), Assembly.FullName, Assembly.GetReferencedAssemblies()
        ///    Assembly.GetTypes(), Assembly.DefinedTypes, Assembly.GetExportedTypes(), Assembly.GetForwardedTypes()
        ///    Assembly.GetType(string, bool, bool)
        ///    Type.Name, Type.FullName, Type.AssemblyQualifiedName
        ///
        /// If a core assembly cannot be found or if the core assembly is missing types, this will affect the behavior of the MetadataLoadContext as follows:
        ///
        /// - Apis that need to parse signatures or typespecs and return the results as Types will throw. For example,
        ///   MethodBase.ReturnType, MethodBase.GetParameters(), Type.BaseType, Type.GetInterfaces().
        ///
        /// - Apis that need to compare types to well known core types will not throw and the comparison will evaluate to "false."
        ///   For example, if you do not specify a core assembly, Type.IsPrimitive will return false for everything,
        ///   even types named "System.Int32". Similarly, Type.GetTypeCode() will return TypeCode.Object for everything.
        ///
        /// - If a metadata entity sets flags that surface as a pseudo-custom attribute, and the core assembly does not contain the pseudo-custom attribute
        ///   type, the necessary constructor or any of the parameter types of the constructor, the MetadataLoadContext will not throw. It will omit the pseudo-custom
        ///   attribute from the list of returned attributes.
        /// </summary>
        public Assembly CoreAssembly
        {
            get
            {
                if (IsDisposed)
                    throw new ObjectDisposedException(nameof(MetadataLoadContext));

                return _coreAssembly;
            }
        }

        /// <summary>
        /// Return an atomic snapshot of the assemblies that have been loaded into the MetadataLoadContext.
        /// </summary>
        public IEnumerable<Assembly> GetAssemblies()
        {
            if (IsDisposed)
                throw new ObjectDisposedException(nameof(MetadataLoadContext));

            return _loadedAssemblies.Values;
        }

        /// <summary>
        /// Releases any native resources (such as file locks on assembly files.) After disposal, it is not safe to use
        /// any Assembly objects dispensed by the MetadataLoadContext, nor any Reflection objects dispensed by those Assembly objects.
        /// Though objects provided by the MetadataLoadContext strive to throw an ObjectDisposedException, this is not guaranteed.
        /// Some apis may return fixed or previously cached data. Accessing objects *during* a Dispose may result in an
        /// unmanaged access violation and failfast.
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private MetadataAssemblyResolver resolver;
    }
}


text:
<!--

Copyright (c) 2000-2022, Board of Trustees of Leland Stanford Jr. University

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

-->
<map>
  <!-- Different start/permission - otherwise ClockssOJS2Plugin.xml inherited from OJS2Plugin.xml. -->
  <entry>
    <string>plugin_status</string>
    <string>ready</string>
  </entry>
  <entry>
    <string>plugin_identifier</string>
    <string>org.lockss.plugin.ojs3.ClockssOjs3Plugin</string>
  </entry>
  <entry>
    <string>plugin_version</string>
    <string>39</string>
  </entry>
  <entry>
    <string>plugin_parent</string>
    <string>org.lockss.plugin.ojs3.Ojs3Plugin</string>
  </entry>
  <entry>
    <string>plugin_parent_version</string>
    <string>39</string>
  </entry>
  <entry>
    <string>plugin_name</string>
    <string>Open Journal Systems Plugin (OJS 3.x for CLOCKSS)</string>
  </entry>
  <entry>
    <string>au_name</string>
    <string>"Open Journal Systems Plugin (OJS 3.x for CLOCKSS), Base URL %s, Journal ID %s, Year %d", base_url, journal_id, year</string>
  </entry>
<!--  The default. The start_stem attribute is inserted as needed by the crawl seed -->
  <entry>
    <string>au_start_url</string>
    <list>
      <string>"%s%s/gateway/clockss?year=%d", to_https(base_url), journal_id, year</string>
      <string>"%s%s/gateway/clockss?year=%d", to_http(base_url), journal_id, year</string>
    </list>
  </entry>
  <!--  must be defined here again because we redefine the start_url -->
 <entry>
    <string>plugin_crawl_seed_factory</string>
    <string>org.lockss.plugin.ojs3.Ojs3CrawlSeedFactory</string>
  </entry>
  <!--  permission is on the start_url for this version -->
  <entry>
    <string>clockss_override</string>
    <map>
      <entry>
        <string>au_def_pause_time</string>
        <long>100</long>
      </entry>
    </map>
  </entry>
</map>


text:
require 'spec_helper'

describe Pushrr::Subscriber do
  context '#all' do
    before do
      VCR.use_cassette 'subscribers' do
        domain_token = '93159b0efc2c83b87fed4af06b8236f5'
        domain = Pushrr::Domain.find(domain_token)
        @subscribers = Pushrr::Subscriber.all(domain)
      end
    end

    it { expect(@subscribers.count).to eq 1 }
    it { expect(@subscribers).to be_a Array }
    it { expect(@subscribers.sample).to be_a Pushrr::Subscriber }
  end
end


text:
Dogescript is potentially the greatest language on the internet. Not that this has anything to do with these docs, just couldn't resist adding it. It has a very simple and straightforward compiler that only takes two options, documented [here](https://github.com/remixz/dogescript#javascript) - only difference is that accord takes these via an options object rather than direct parameters, as usual.

Full options in an example:

```js
dogescript = accord.load('dogescript');
dogescript.render('wow', { beauty: true, trueDoge: true })
```

## Supported Methods
 - render

## Source Maps

Dogescript does not support sourcemaps. Honestly, I doubt it ever will. If you are writing dogescript, you probably don't need sourcemaps anyway because you are too boss for that kind of stuff.


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

namespace ESRI.ArcLogistics.Utility
{
    /// <summary>
    /// Represents a collection of disposable objects to be disposed together.
    /// </summary>
    internal sealed class CompositeDisposable : IDisposable
    {
        #region constructors
        /// <summary>
        /// Initializes a new instance of the CompositeDisposable class.
        /// </summary>
        /// <param name="disposables">The collection of disposable objects to
        /// be disposed together.</param>
        public CompositeDisposable(params IDisposable[] disposables)
        {
            if (disposables == null)
            {
                throw new ArgumentNullException("disposables");
            }

            if (disposables.Any(disposable => disposable == null))
            {
                throw new ArgumentOutOfRangeException("disposables");
            }

            _disposables = disposables.ToList();
        }
        #endregion

        #region IDisposable Members
        /// <summary>
        /// Disposes all contained objects.
        /// </summary>
        public void Dispose()
        {
            foreach (var disposable in _disposables)
            {
                disposable.Dispose();
            }

            _disposables.Clear();
        }
        #endregion

        #region private fields
        /// <summary>
        /// The collection of all disposable objects.
        /// </summary>
        private List<IDisposable> _disposables = new List<IDisposable>();
        #endregion
    }
}


text:
<!doctype html>

		<meta charset="utf-8" />
		<title>Baidu Maps</title>


text:
package Thread;

/**
 * Created by Defias on 2016/2/29.
 *
 * 多线程  主线程 子线程
 *
 */

class NewThread31 implements Runnable {
	String name; // name of thread
	Thread t;

    NewThread31(String threadname) {
		this.name = threadname;
		this.t = new Thread(this, this.name);
		System.out.println("New thread: " + t);
		t.start(); // Start the thread
	}

	// This is the entry point for thread.
	public void run() {
		try {
			for(int i = 5; i > 0; i--) {
				System.out.println(this.name + ": " + i);
				Thread.sleep(1000);
			}
		} catch (InterruptedException e) {
			System.out.println(this.name + "Interrupted");
		}
		System.out.println(this.name + " exiting.");
	}
}

//创建线程的最简单的方法就是创建一个实现Runnable接口的类
class NewThread32 implements Runnable {
	Thread t;
    NewThread32() {
		t = new Thread(this, "Demo Thread");  //实例化一个Thread类的对象:Thread(Runnable threadOb, String threadName),
		//threadOb是实现Runnable接口类的实例(传入本类的实例),threadName定义新线程的名称
		System.out.println("Child thread: " + t);
		t.start(); //建立新的线程后,它并不运行直到调用了它的start()方法。本质上start()执行的是一个对run()的调用
	}

	@Override
	public void run() {  //为实现Runnable接口,一个类仅需实现一个run()的简单方法
		try {
			for(int i=5; i>0; i--) {
				System.out.println("Child Thread: " + i);
				Thread.sleep(500);  //单位:ms
			}
		} catch (InterruptedException e) {
			System.out.println("Child interrupted.");
		}
		System.out.println("Exiting child thread.");
	}
}

class JavaThread3 {
	public static void main(String args[]) {
		new NewThread31("One"); // start threads
		new NewThread31("Two");
		new NewThread31("Three");
		try {
			// wait for other threads to end
			Thread.sleep(10000);
		} catch (InterruptedException e) {
			System.out.println("Main thread Interrupted");
		}
		System.out.println("Main thread exiting.");

        //new NewThread32(); // create a new thread
        //try {
        //    for(int i=5; i>0; i--) {
        //        System.out.println("Main Thread: " + i);
        //        Thread.sleep(1);
        //    }
        //} catch (InterruptedException e) {
        //    System.out.println("Main thread interrupted.");
        //}
        //System.out.println("Main thread exiting.");
	}
}


text:
//
//  ZBTargetView.m
//  SignatureMaker
//

#import "ZBTargetView.h"

@implementation ZBTargetView

- (id)initWithFrame:(NSRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    return self;
}

- (void)drawRect:(NSRect)rect {
    NSBezierPath *b = [NSBezierPath bezierPathWithRect:rect];
	[[NSColor whiteColor] setStroke];
	[b stroke];
}

@end


text:
Page Not Found

  Sorry, looks like we were unable to find that for you!


text:
/* AUTOCOMPLETE */

.autocomplete{
  width: 100%;
  position: relative;
}

.autocomplete ul{
  position: absolute;
  padding: 0;
  left: 0;
  width: 100%;
  border-color: inherit;
  border-left: 1px solid;
  border-right: 1px solid;
  border-bottom: 1px solid;
  z-index: 1;
}

.autocomplete li{
  text-align: left;
  list-style:none;
  width: 100%;
  padding:0.4em;
  background-color: #fff;
}

.autocomplete li.active{
  width: 100%;
  background-color: #4bf;
}

.autocomplete .highlight {
  background-color: #E2E2E2;
}

.autocomplete li.active .highlight {
  background: #666;
  color: #fff;
}