text:
class Resource < ActiveRecord::Base

  has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "50x50>" }

  attr_accessible :description, :link, :name, :photo

  def image_url
    photo.url
  end
end

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>Xén ảnh</title>
		<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
		<meta name="viewport" content="width=device-width" />

		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.5.1/croppie.min.css" />
		<link rel="stylesheet" href="mycss.css"/>

Bạn hãy tải ảnh lên để xén!

								Tải lên
								<input type="file" id="upload" value="Choose a file" accept="image/*" />

							<button class="btn btn-danger upload-result">Lấy kết quả</button>

							<button class="btn btn-success btnRotate" data-rotate="-90">Xoay trái</button>
							<button class="btn btn-success btnRotate" data-rotate="90">Xoay phải</button>

Lưu ý: Hãy chọn ảnh có chất lượng tốt để tải lên! Hãy xén phần khuôn mặt của mình để làm ảnh đại diện!

							<canvas id="mycanvas"></canvas>

									brightness
									<input type="range" min="-100" max="100" step="1" value="0" data-filter="brightness">
									0

									contrast
									<input type="range" min="-100" max="100" step="1" value="0" data-filter="contrast">
									0

									saturation
									<input type="range" min="-100" max="100" step="1" value="0" data-filter="saturation">
									0

									vibrance
									<input type="range" min="-100" max="100" step="1" value="0" data-filter="vibrance">
									0

									exposure
									<input type="range" min="-100" max="100" step="1" value="0" data-filter="exposure">
									0

									hue
									<input type="range" min="0" max="100" step="1" value="0" data-filter="hue">
									0

									sepia
									<input type="range" min="0" max="100" step="1" value="0" data-filter="sepia">
									0

									gamma
									<input type="range" min="0" max="10" step="0.1" value="0" data-filter="gamma">
									0

									noise
									<input type="range" min="0" max="100" step="1" value="0" data-filter="noise">
									0

									clip
									<input type="range" min="0" max="100" step="1" value="0" data-filter="clip">
									0

									sharpen
									<input type="range" min="0" max="100" step="1" value="0" data-filter="sharpen">
									0

									stackBlur
									<input type="range" min="0" max="20" step="1" value="0" data-filter="stackBlur">
									0

								Vintage
								Lomo
								Clarity
								Sin City
								Sunrise
								Cross Process
								Orange Peel
								Love
								Grungy
								Jarques
								Pinhole
								Old Boot
								Glowing Sun
								Hazy Days
								Her Majesty
								Nostalgia
								Hemingway
								Concentrate
								reset


text:
node.default['apache']['servertokens']    = 'Minimal'

include_recipe 'apache2::default'
include_recipe 'apache2::mod_python'
include_recipe 'apache2::mod_php5'
include_recipe 'apache2::mod_cgi'
include_recipe 'apache2::mod_ssl'
include_recipe 'apache2::mod_rewrite'

template ::File.join(node['apache']['dir'], 'conf-available', 'icinga2-classic-ui.conf') do
  source 'apache.vhost.icinga2_classic_ui.conf.erb'
  owner node['apache2']['user']
  group node['apache2']['group']
  notifies :reload, 'service[apache2]', :delayed
end

template ::File.join(node['apache']['dir'], 'conf-available', 'icinga2-web2.conf') do
  source 'apache.vhost.icinga2_web2.erb'
  owner node['apache2']['user']
  group node['apache2']['group']
  notifies :reload, 'service[apache2]', :delayed
  variables(:web_root => node['icinga2']['web2']['web_root'],
            :web_uri => node['icinga2']['web2']['web_uri'],
            :conf_dir => node['icinga2']['web2']['conf_dir'])
end

apache_config 'icinga2-classic-ui'
apache_config 'icinga2-web2'


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace NetCore_Knockout.Models
{
    public class NetCore_KnockoutContext : DbContext
    {
        public NetCore_KnockoutContext (DbContextOptions<NetCore_KnockoutContext> options)
            : base(options)
        {
        }

        public DbSet<Member> Member { get; set; }
    }
}


text:
#include "stdneb.h"
#include "scriptfeature/inc/script_component.h"
#include "scriptfeature/inc/script_utility.h"
#include "foundation/core/rtti.h"
#include "appframework/scene.h"

using namespace Util;

namespace App
{
	void ICallReg_ScriptRuntime_Scene( void );

	static void ICall_Scene_Release( MonoObject* pMonoObj )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );
		Scene* pInst = self.GetCppObjPtr();
		n_assert( NULL!=pInst );
		ReleaseCppObjWithMonoObj<Scene>( pInst, pMonoObj );
	}

	static int ICall_Scene_GetActorCount( MonoObject* pMonoObj )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );

		return (int)self->GetActorCount();
	}

	static MonoObject* ICall_Scene_GetActor( MonoObject* pMonoObj, int index )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );
		const GPtr<Actor>& pActor =  self->GetActor(index);
		if ( pActor.isvalid() )
		{
			return CppObjectToScriptObj( *pActor );
		}
		return NULL;
	}

	static MonoObject* ICall_Scene_FindActorByFastID( MonoObject* pMonoObj, uint index )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );
		const GPtr<Actor>& pActor =  self->FindActor(index);
		if ( pActor.isvalid() )
		{
			return CppObjectToScriptObj( *pActor );
		}
		return NULL;
	}

	static MonoObject* ICall_Scene_FindActorByTag( MonoObject* pMonoObj, uint index )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );
		const GPtr<Actor>& pActor =  self->FindActorByTag(index);
		if ( pActor.isvalid() )
		{
			return CppObjectToScriptObj( *pActor );
		}
		return NULL;
	}

	static MonoArray* ICall_Scene_FindActorsByTag( MonoObject* pMonoObj, uint index )
	{
		Util::Array< GPtr<Actor> > actors;
		ScriptObjWrapper<Scene> self( pMonoObj );
		self->FindActorsByTag(index,actors);
		return Utility_CppArrToMonoArr(actors);
	}

	static mono_bool ICall_Scene_AddActor( MonoObject* pMonoObj, MonoObject* pActor )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );
		ScriptObjWrapper<Actor> add( pActor );
		GPtr<Actor> actorPtr(add.GetCppObjPtr());
		self->AddActor( actorPtr );
		return c_iMonoBool_True;
	}

	static mono_bool ICall_Scene_RemoveActor( MonoObject* pMonoObj, MonoObject* pActor )
	{
		ScriptObjWrapper<Scene> self( pMonoObj );
		ScriptObjWrapper<Actor> sub( pActor );
		GPtr<Actor> actorPtr(sub.GetCppObjPtr());
		self->RemoveActor( actorPtr );
		return c_iMonoBool_True;
	}

	static MonoObject* ICall_Scene_FindActorByGuid( MonoObject* pMonoObj, MonoArray* guid)
	{
		ScriptObjWrapper<Scene> self( pMonoObj );

		Util::Guid uGuid = Utility_MonoGuidToUtilGuid(guid);

		const GPtr<Actor>& pActor = self->FindActor(uGuid);
		if ( pActor.isvalid() )
		{
			return CppObjectToScriptObj( *pActor );
		}
		return NULL;
	}

	static MonoObject* ICall_Scene_FindActorByName( MonoObject* pMonoObj, MonoString* name)
	{
		ScriptObjWrapper<Scene> self( pMonoObj );

		Util::String uString;
		Utility_MonoStringToCppString(name, uString);

		const GPtr<Actor>& pActor = self->FindActor(uString);
		if ( pActor.isvalid() )
		{
			return CppObjectToScriptObj( *pActor );
		}
		return NULL;
	}

}

#include "autogen/scriptbind_Scene_register.h"


text:
"""Parsers for Jam debug output."""

__all__ = (
    "parse",
)

from ._dd import DDParser
from ._dm import DMParser
from ._dc import DCParser
from ._d5 import D5Parser

def parse(db, logfile, parsers):
    """
    Parse as much information as possible from the given log file into a DB.

    :param db:
        Target database to populate.
    :param logfile:
        Source jam log file containing debug output.

    """
    parser_clses = {
        "d":DDParser,
        "c":DCParser,
        "3":DMParser,
        "5":D5Parser,
    }

    # Get which parsers to run from the command line option
    parsers_to_run = set()
    parsers = list(parsers)
    if "m" in parsers:
        # The 'm' option is the same as the +3 option
        # replace m for +3 for numerical options to work
        parsers.append("+")
        parsers.append("3")
        parsers.remove("m")
    for i in range(len(parsers)):
        if parsers[i].isdigit():
            # Handle numerical options
            if (i > 0 and parsers[i-1] == "+"):
                # Specific numerical level given
                if parsers[i] in parser_clses:
                    parsers_to_run.add(parser_clses[parsers[i]])
                else:
                    print("No parser exists for option +{}".format(parsers[i]))
            else:
                # Run all available parsers up to given number
                for num in range(2,int(parsers[i])+1):
                    if str(num) in parser_clses:
                        parsers_to_run.add(parser_clses[str(num)])
                    else:
                        print("No parser exists for option +{}".format(num))
        else:
            # Handle alphabetic options
            if parsers[i] in parser_clses:
                parsers_to_run.add(parser_clses[parsers[i]])
            elif parsers[i] != "+":
                print("No parser exists for option {}".format(parsers[i]))

    for parser_cls in parsers_to_run:
        print("Running {}".format(parser_cls.__name__))
        parser_cls(db).parse_logfile(logfile)


text:
package com.simonenfp.me.module.model;

/**
 * Created by simonenfp on 2016-08-14.
 */
public class HttpResult<T> {
    public int status;
    public T data;
}


text:
<!--

    Copyright 2004-2014 The Kuali Foundation

    Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php

    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.

-->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

	<bean id="PayStep" parent="PayStep-parentBean" />
	<bean id="PayStep-parentBean" abstract="true" parent="KPMEHrBusinessObjectParent">
		<property name="dataObjectClass" value="org.kuali.kpme.core.paystep.PayStepBo" />
		<property name="attributes">
			<list merge="true">
				<ref bean="PayStep-pmPayStepId" />
				<ref bean="PayStep-payStep" />
				<ref bean="PayStep-salaryGroup" />
				<ref bean="PayStep-payGrade" />
				<ref bean="PayStep-stepNumber" />
				<ref bean="PayStep-compRate" />
				<ref bean="PayStep-serviceAmount" />
				<ref bean="PayStep-serviceUnit" />
			</list>
		</property>
		<property name="objectLabel" value="Pay Step" />
	</bean>

	<!-- Attribute Definitions -->
	<bean id="PayStep-pmPayStepId" parent="PayStep-pmPayStepId-parentBean" />
	<bean id="PayStep-pmPayStepId-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="shortLabel" value="PayStep Id" />
		<property name="maxLength" value="60" />
		<property name="controlField">
			<bean parent="Uif-TextControl" p:size="60" />
		</property>
		<property name="name" value="pmPayStepId" />
		<property name="label" value="PayStep Id" />
	</bean>

	<bean id="PayStep-payStep" parent="PayStep-payStep-parentBean" />
	<bean id="PayStep-payStep-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="maxLength" value="10" />
 		<property name="required" value="true" />
		<property name="controlField">
			<bean parent="Uif-TextControl" p:size="15" />
		</property>
		<property name="name" value="payStep" />
		<property name="label" value="Pay Step" />
		<property name="description" value="Pay Step" />
	</bean>

	<bean id="PayStep-salaryGroup" parent="PayStep-salaryGroup-parentBean" />
	<bean id="PayStep-salaryGroup-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="maxLength" value="10" />
 		<property name="required" value="true" />
		<property name="controlField">
			<bean parent="Uif-TextControl" p:size="15" />
		</property>
		<property name="name" value="salaryGroup" />
		<property name="label" value="Salary Group" />
		<property name="description" value="Salary Group" />
	</bean>

	<bean id="PayStep-payGrade" parent="PayStep-payGrade-parentBean" />
	<bean id="PayStep-payGrade-parentBean" abstract="true" parent="KpmeAttributeReference-payGrade">
 		<property name="required" value="true" />
	</bean>

	<bean id="PayStep-stepNumber" parent="PayStep-stepNumber-parentBean" />
	<bean id="PayStep-stepNumber-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="controlField">
			<bean parent="Uif-TextControl" p:size="5" />
		</property>
		<property name="name" value="stepNumber" />
		<property name="label" value="Step Number" />
	</bean>

	<bean id="PayStep-compRate" parent="PayStep-compRate-parentBean" />
	<bean id="PayStep-compRate-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="shortLabel" value="Comp Rate" />
		<property name="maxLength" value="6" />
		<property name="controlField">
			<bean parent="Uif-TextControl" p:size="6" />
		</property>
		<property name="name" value="compRate" />
		<property name="label" value="Compensation Rate" />
	</bean>

	<bean id="PayStep-serviceAmount" parent="PayStep-serviceAmount-parentBean" />
	<bean id="PayStep-serviceAmount-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="controlField">
			<bean parent="Uif-TextControl" p:size="15" />
		</property>
		<property name="name" value="serviceAmount" />
		<property name="label" value="Service Amount" />
	</bean>

	<bean id="PayStep-serviceUnit" parent="PayStep-serviceUnit-parentBean" />
	<bean id="PayStep-serviceUnit-parentBean" abstract="true" parent="AttributeDefinition">
		<property name="shortLabel" value="Service Unit" />
		<property name="controlField">
			<bean parent="Uif-VerticalRadioControl">
				<property name="options">
					<list>
						<bean parent="Uif-KeyLabelPair" p:key="N" p:value="Not Applicable"/>
						<bean parent="Uif-KeyLabelPair" p:key="M" p:value="Months"/>
						<bean parent="Uif-KeyLabelPair" p:key="Y" p:value="Years"/>
					</list>
				</property>
			</bean>
		</property>
		<property name="name" value="serviceUnit" />
		<property name="label" value="Service Unit" />
	</bean>

	<!-- Business Object Inquiry Definition -->
	<bean id="PayStep-InquiryView" parent="Uif-InquiryView">
		<property name="headerText" value="Pay Step Inquiry" />
		<property name="dataObjectClassName" value="org.kuali.kpme.core.paystep.PayStepBo" />
		<property name="singlePageView" value="true" />
		<property name="title" value="Pay Step Inquiry" />
		<property name="items">
			<list>
				<bean parent="Uif-Disclosure-GridSection">
					<property name="layoutManager.numberOfColumns" value="2" />
					<property name="items">
						<list merge="true">
							<bean parent="Uif-DataField" p:propertyName="pmPayStepId" />
							<bean parent="Uif-DataField" p:propertyName="payStep" />
							<bean parent="Uif-DataField" p:propertyName="salaryGroup" />
							<bean parent="Uif-DataField" p:propertyName="payGrade" />
							<bean parent="Uif-DataField" p:propertyName="stepNumber" />
							<bean parent="Uif-DataField" p:propertyName="compRate" />
							<bean parent="Uif-DataField" p:propertyName="serviceAmount" />
							<bean parent="Uif-DataField" p:propertyName="serviceUnit" />
							<bean parent="Uif-DataField" p:propertyName="active" />
							<bean parent="Uif-DataField" p:propertyName="userPrincipalId" />
						</list>
					</property>
				</bean>
			</list>
		</property>
	</bean>

  <!-- Maintenance View -->

  <bean id="PayStepMaintenanceDocument-PayStepMaintenance" parent="PayStepMaintenanceDocument-PayStepMaintenance-parentBean"/>
  <bean id="PayStepMaintenanceDocument-PayStepMaintenance-parentBean" abstract="true" parent="KPMEEffectiveDateBO-MaintenanceView">
  	<property name="headerText" value= "Pay Step Maintenance"/>
  	<property name="dataObjectClassName" value="org.kuali.kpme.core.paystep.PayStepBo"/>
    <property name="items">
      <list merge="true">
      	<bean parent="Uif-MaintenanceGridSection">
	      	<property name="items">
	      		<list merge="true">
	      			<bean parent="Uif-InputField" p:propertyName="effectiveDate" p:required="true"/>
					<bean parent="Uif-InputField" p:propertyName="payStep" p:required="true"/>
					<bean parent="Uif-InputField" p:propertyName="salaryGroup" p:required="true">
						<property name="quickfinder">
				            <bean parent="Uif-QuickFinderByScript"
				            	p:viewName="quickFinderView"
				            	p:dataObjectClassName="org.kuali.kpme.core.salarygroup.SalaryGroupBo"
				                p:fieldConversions="hrSalGroup:salaryGroup"/>
				        </property>
					</bean>
					<bean parent="Uif-InputField" p:propertyName="payGrade" p:required="true">
						<property name="quickfinder">
				            <bean parent="Uif-QuickFinderByScript" p:dataObjectClassName="org.kuali.kpme.core.paygrade.PayGradeBo"
				                  p:fieldConversions="payGrade:payGrade"/>
				        </property>
					</bean>
					<bean parent="Uif-InputField" p:propertyName="stepNumber" p:exclusiveMin="0">
						<property name="validCharactersConstraint">
							<bean parent="IntegerPatternConstraint"/>
						</property>
					</bean>
					<bean parent="Uif-InputField" p:propertyName="compRate">
						<property name="validCharactersConstraint">
				        	<bean parent="FixedPointPatternConstraint" p:precision="5" p:scale="2" />
						</property>
					</bean>
					<bean parent="Uif-InputField" p:propertyName="serviceAmount">
						<property name="validCharactersConstraint">
							<bean parent="IntegerPatternConstraint"/>
						</property>
					</bean>
					<bean parent="Uif-InputField" p:propertyName="serviceUnit" p:defaultValue="N"/>
			        <bean parent="Uif-InputField" p:propertyName="active" p:defaultValue="true" />
			    </list>
	      	</property>
      	  </bean>
      	</list>
    </property>
  </bean>

  <!-- KRAD Lookup View Definition -->
  <bean id="PayStep-LookupView" parent="KPMEUif-EffectiveDateBOLookupView">
    <property name="headerText" value="Pay Step Lookup" />
    <property name="dataObjectClassName" value="org.kuali.kpme.core.paystep.PayStepBo" />
    <property name="criteriaFields">
      <list merge="true">
      	<bean parent="Uif-LookupCriteriaInputField" p:propertyName="payStep" />
		<bean parent="Uif-LookupCriteriaInputField" p:propertyName="salaryGroup">
			<property name="quickfinder">
	            <bean parent="Uif-QuickFinderByScript"
	            	p:viewName="quickFinderView"
	            	p:dataObjectClassName="org.kuali.kpme.core.salarygroup.SalaryGroupBo"
	                p:fieldConversions="hrSalGroup:salaryGroup"/>
	        </property>
		</bean>
		<bean parent="Uif-LookupCriteriaInputField" p:propertyName="payGrade">
			<property name="quickfinder">
	            <bean parent="Uif-QuickFinderByScript" p:dataObjectClassName="org.kuali.kpme.core.paygrade.PayGradeBo"
	                  p:fieldConversions="payGrade:payGrade"/>
	        </property>
		</bean>
		<bean parent="Uif-LookupCriteriaInputField" p:propertyName="history" p:defaultValue="N"/>
		<bean parent="Uif-LookupCriteriaInputField" p:propertyName="active" p:defaultValue="Y"/>
      </list>
    </property>
    <property name="resultFields">
      <list merge="true" >
      	<bean parent="Uif-DataField" p:propertyName="payStep" >
      		<property name="inquiry">
				<bean parent="Uif-Inquiry" p:dataObjectClassName="org.kuali.kpme.core.paystep.PayStepBo"
					p:inquiryParameters="pmPayStepId:pmPayStepId" />
			</property>
		</bean>
		<bean parent="Uif-DataField" p:propertyName="salaryGroup" />
		<bean parent="Uif-DataField" p:propertyName="payGrade" />
		<bean parent="Uif-DataField" p:propertyName="effectiveDate"/>
      </list>
    </property>
  </bean>

</beans>


text:
package com.google.api.ads.adwords.jaxws.v201502.cm;

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

/**
 *
 *             Contains a subset of {@link DomainCategory} objects resulting from
 *             the filtering and paging of {@link DataService#getDomainCategory} call.
 *
 *
 *
Java class for DomainCategoryPage complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="DomainCategoryPage">
 *   <complexContent>
 *     <extension base="{https://adwords.google.com/api/adwords/cm/v201502}Page">
 *       <sequence>
 *         <element name="entries" type="{https://adwords.google.com/api/adwords/cm/v201502}DomainCategory" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DomainCategoryPage", propOrder = {
    "entries"
})
public class DomainCategoryPage
    extends Page
{

    protected List<DomainCategory> entries;

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

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

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

     *    getEntries().add(newItem);
     *

     *
     *
     *

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

}


text:
package com.zfgc.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zfgc.dbobj.TopicViewDbObj;
import com.zfgc.dbobj.TopicViewDbObjExample;
import com.zfgc.mappers.TopicViewDbObjMapper;
import com.zfgc.model.forum.Topic;

@Component
public class TopicViewDao extends AbstractDao<TopicViewDbObjExample, TopicViewDbObj, Topic>{

	@Autowired
	private TopicViewDbObjMapper topicViewDbObjMapper;

	@Override
	public List<TopicViewDbObj> get(TopicViewDbObjExample ex) throws RuntimeException {
		return topicViewDbObjMapper.selectByExample(ex);
	}

	@Override
	public void hardDelete(Topic obj) throws RuntimeException {
		// TODO Auto-generated method stub

	}

	@Override
	public void updateOrInsert(Topic obj) throws RuntimeException {
		// TODO Auto-generated method stub

	}

	@Override
	public void updateByExample(Topic obj, TopicViewDbObjExample ex) throws RuntimeException {
		// TODO Auto-generated method stub

	}

	@Override
	public Integer deleteByExample(Topic obj, TopicViewDbObjExample ex) throws RuntimeException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Long countByExample(Topic obj, TopicViewDbObjExample ex) throws RuntimeException {
		return topicViewDbObjMapper.countByExample(ex);
	}

}


text:
package uuid

import (
    "sync/atomic"
)

type SyncCounter struct {
    counter int64
}

func (this *SyncCounter) Inc() int64 {
    return atomic.AddInt64(&this.counter, 1)
}

func (this *SyncCounter) Get() int64 {
    return atomic.LoadInt64(&this.counter)
}

func (this *SyncCounter) Dec() int64 {
    return atomic.AddInt64(&this.counter, -1)
}

func (this *SyncCounter) Set(value int64) {
    atomic.StoreInt64(&this.counter, value)
}


text:
module BuildKit

  Dir["./*.rb"].each {|file| require file }

  module Utilities

    module PlistPal

      def self.read_value_in_plist plist, key
        %x[/usr/libexec/PlistBuddy -c "Print #{key}" \"#{plist}\"]
      end

      def self.write_value_in_plist plist, key, value
        plist_buddy_command = "\"Set :#{key} #{value}\" \"#{plist}\""
        system "/usr/libexec/PlistBuddy -c #{plist_buddy_command}"
      end

      def self.brute_replace_in_plist plist, value, new_value
    	  original = File.read plist
      	updated = original.gsub value, new_value
      	File.open(plist, "w") { |file| file.write updated }
    	end

    end

  end

end


text:
import { Observable } from '../Observable';
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';

/* tslint:disable:max-line-length */
export function find<T, S extends T>(this: Observable<T>,
                                     predicate: (value: T, index: number) => value is S,
                                     thisArg?: any): Observable<S>;
export function find<T>(this: Observable<T>,
                        predicate: (value: T, index: number) => boolean,
                        thisArg?: any): Observable<T>;
/* tslint:enable:max-line-length */

/**
 * 只发出源 Observable 所发出的值中第一个满足条件的值。
 *
 * 找到第一个通过测试的值并将其发出。
 *
 *
 *
 * `find` 会查找源 Observable 中与 `predicate` 函数体现的指定条件匹配的第一项,然后
 * 将其返回。不同于 {@link first},在 `find` 中 `predicate` 是必须的,而且如果没找到
 * 有效的值的话也不会发出错误。
 *
 * @example
找到并发出第一个点击 DIV 元素的事件

 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.find(ev => ev.target.tagName === 'DIV');
 * result.subscribe(x => console.log(x));
 *
 * @see {@link filter}
 * @see {@link first}
 * @see {@link findIndex}
 * @see {@link take}
 *
 * @param {function(value: T, index: number, source: Observable<T>): boolean} predicate
 * 使用每项来调用的函数,用于测试是否符合条件。
 * @param {any} [thisArg] 可选参数,用来决定 `predicate` 函数中的 `this` 的值。
 * @return {Observable<T>} 符合条件的第一项的 Observable 。
 * @method find
 * @owner Observable
 */
export function find<T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => boolean,
                        thisArg?: any): Observable<T> {
  if (typeof predicate !== 'function') {
    throw new TypeError('predicate is not a function');
  }
  return <any>this.lift<any>(new FindValueOperator(predicate, this, false, thisArg));
}

export class FindValueOperator<T> implements Operator<T, T> {
  constructor(private predicate: (value: T, index: number, source: Observable<T>) => boolean,
              private source: Observable<T>,
              private yieldIndex: boolean,
              private thisArg?: any) {
  }

  call(observer: Subscriber<T>, source: any): any {
    return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
  }
}

/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
export class FindValueSubscriber<T> extends Subscriber<T> {
  private index: number = 0;

  constructor(destination: Subscriber<T>,
              private predicate: (value: T, index: number, source: Observable<T>) => boolean,
              private source: Observable<T>,
              private yieldIndex: boolean,
              private thisArg?: any) {
    super(destination);
  }

  private notifyComplete(value: any): void {
    const destination = this.destination;

    destination.next(value);
    destination.complete();
  }

  protected _next(value: T): void {
    const { predicate, thisArg } = this;
    const index = this.index++;
    try {
      const result = predicate.call(thisArg || this, value, index, this.source);
      if (result) {
        this.notifyComplete(this.yieldIndex ? index : value);
      }
    } catch (err) {
      this.destination.error(err);
    }
  }

  protected _complete(): void {
    this.notifyComplete(this.yieldIndex ? -1 : undefined);
  }
}


text:
using namespace std;
using namespace makerspec;

int main(int argc, char *argv[]){

    if(argc < 2){
        cerr << "Error: No input file." << endl;
        return EXIT_FAILURE;
    }

    ifstream input(argv[1], ios_base::in);
    if(!input){
        cerr << "Error: Could not open file: " << argv[1] << endl;
        return EXIT_FAILURE;
    }

    Configuration config;
    Condition condition;
    std::string testfile;
    bool result = Parser::parse(input, testfile, config, condition);

    if(result){
        cout << "loading model " << testfile << "..." << endl;

        IPhoneCaseModel model(&config, testfile);

        cout << "model loaded." << endl
             << "Faces: " << model.mesh.numFaces << endl
             << "Vertices: " << model.mesh.numVertices << endl;

        IPhoneCaseModel::Size size = model.getSize();
        cout << "Running all specs..." << endl;
        float width = condition.right.at(0);
        float height = condition.right.at(1);
        if(size.width > width && size.height > height){
            cout << "." << endl;
        } else{
            cout << "Expected width = " << width << ", height = " << height << " but actual is width = " << size.width << ", height = " << size.height << "." << endl;
            return EXIT_FAILURE;
        }
        cout << "All green." << endl;
    } else{
        cerr << "Error: Parse failed." << endl;
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}


text:
cd /usr/local/glassfish4

# if appropriate; reconfigure PID provider on the basis of environmental variables.
if [ ! -z "${DoiProvider}" ]; then
        curl -X PUT -d ${DoiProvider} http://localhost:8080/api/admin/settings/:DoiProvider
fi
if [ ! -z "${doi_username}" ]; then
        bin/asadmin create-jvm-options "-Ddoi.username=${doi_password}"
fi
if [ ! -z "${doi_password}" ]; then
        bin/asadmin create-jvm-options "-Ddoi.password=${doi_password}"
fi
if [ ! -z "${doi_baseurl}" ]; then
        bin/asadmin delete-jvm-options "-Ddoi.baseurlstring=https\://mds.test.datacite.org"
        doi_baseurl_esc=`echo ${doi_baseurl} | sed -e 's/:/\\:/'`
        bin/asadmin create-jvm-options "\"-Ddoi.baseurlstring=${doi_baseurl_esc}\""
fi


text:
import React from 'react';

import './Header.css';

import { Icon } from '../../shared';
import { SignOutButton } from '../../auth';

export function Header({icon, title}) {
  return (

      <Icon>{icon}</Icon>

{title}

      <SignOutButton/>

  );
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Scope.RouteArgs (Play! API)
</TITLE>

<META NAME="date" CONTENT="2010-11-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

play.mvc

Class Scope.RouteArgs

java.lang.Object
  play.mvc.Scope.RouteArgs

Enclosing class:
Scope

public static class Scope.RouteArgs
extends java.lang.Object

Routes args (used in reserve routing)

Field Summary

static java.lang.ThreadLocal<Scope.RouteArgs>
current

 java.util.Map<java.lang.String,java.lang.Object>
data

Constructor Summary

Scope.RouteArgs()

Method Summary

static Scope.RouteArgs
current()

 java.lang.Object
get(java.lang.String key)

 void
put(java.lang.String key,
    java.lang.Object arg)

 java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

data

public java.util.Map<java.lang.String,java.lang.Object> data

current

public static java.lang.ThreadLocal<Scope.RouteArgs> current

Constructor Detail

Scope.RouteArgs

public Scope.RouteArgs()

Method Detail

current

public static Scope.RouteArgs current()

put

public void put(java.lang.String key,
                java.lang.Object arg)

get

public java.lang.Object get(java.lang.String key)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly


text:
namespace cryo {
namespace opencl {
namespace js {

v8::Handle<v8::Value> JsOpenclDevice::New(v8::Isolate* p_isolate, const cryo::opencl::OpenclDevice& p_device) {
	v8::EscapableHandleScope scope(p_isolate);

	std::vector<std::size_t> maxWorkItemSizes(p_device.getMaxWorkItemSizes());
	v8::Local<v8::Array> jsMaxWorkItemSizes = v8::Array::New(p_isolate, static_cast<int>(maxWorkItemSizes.size()));
	for(std::size_t i = 0 ; i < maxWorkItemSizes.size() ; ++i) {
		jsMaxWorkItemSizes->Set(static_cast<int>(i), v8::Integer::New(p_isolate, static_cast<int>(maxWorkItemSizes[i])));
	}

	v8::Local<v8::Object> obj = v8::Object::New(p_isolate);
	obj->Set(v8::String::NewFromUtf8(p_isolate, "type"), v8::String::NewFromUtf8(p_isolate, p_device.getType().c_str()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "name"), v8::String::NewFromUtf8(p_isolate, p_device.getName().c_str()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "vendor"), v8::String::NewFromUtf8(p_isolate, p_device.getVendor().c_str()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "version"), v8::String::NewFromUtf8(p_isolate, p_device.getVersion().c_str()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "driverVersion"), v8::String::NewFromUtf8(p_isolate, p_device.getDriverVersion().c_str()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "maxClockFrequency"), v8::Integer::New(p_isolate, p_device.getMaxClockFrequency()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "maxComputeUnits"), v8::Integer::New(p_isolate, p_device.getMaxComputeUnits()));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "globalMemorySize"), v8::Number::New(p_isolate, static_cast<double>(p_device.getGlobalMemorySize())));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "maxMemoryAllocationSize"), v8::Number::New(p_isolate, static_cast<double>(p_device.getMaxMemoryAllocationSize())));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "maxWorkGroupSize"), v8::Integer::New(p_isolate, static_cast<int>(p_device.getMaxWorkGroupSize())));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "localMemorySize"), v8::Number::New(p_isolate, static_cast<double>(p_device.getLocalMemorySize())));
	obj->Set(v8::String::NewFromUtf8(p_isolate, "maxWorkItemSizes"), jsMaxWorkItemSizes);

	return scope.Escape(obj);
}

}}}


text:
package mobileoak.volleyballtracker.activity;

import android.app.Activity;

public class EmailScoresActivity extends Activity {
}


text:
/*!
 * Sprinting JavaScript Library - Release 0.2.1 Alpha
 * https://nanalan.github.io/sprinting/docs/
 */
window.Sprinting = (function(S) {
  require('traceur/bin/traceur-runtime')

  /**
   * @namespace Sprinting
   */

  class World {
    /**
     * Contains {@link Sprinting.Thing|everything}.
     * @class    World
     * @memberof Sprinting
     * @param    {HTMLElement|String} element - (CSS Selector of) element to draw to.
     * @param    {Number} [width=800] - Width, in pixels, of draw window.
     * @param    {Number} [height=600] - Height, in pixels, of draw window.
     * @example
     * let world = new Sprinting.World('#world')
     * world.add(new Sprinting.Square)
     * world.draw()
     */
    constructor(element, width=800, height=600) {
      switch(typeof element) {
        case 'string':
          if(element = document.querySelector(element)) {} else
            throw TypeError('element must be a CSS Selector or an HTMLElement')
          break
        case 'undefined':
            throw TypeError('element must be a CSS Selector or an HTMLElement')
          break
        default:
          if(!element instanceof HTMLElement)
            throw TypeError('element must be a CSS Selector or an HTMLElement')
          break
      }
      if(typeof width !== 'number') throw TypeError('width must be a Number')
      if(typeof height !== 'number') throw TypeError('height must be a Number')

      /**
       * Width, in pixels, of draw window.
       * @name #width
       * @alias #w
       * @memberof Sprinting.World
       * @type Number
       */
      this.width = width

      /**
       * Height, in pixels, of draw window.
       * @name #height
       * @alias #h
       * @memberof Sprinting.World
       * @type Number
       */
      this.height = height

      /**
       * Element.
       * @name #el
       * @alias #canvas
       * @memberof Sprinting.World
       * @type HTMLElement
       */
      this.el = element
      this.el.style.width = this.w + 'px'
      this.el.style.height = this.h + 'px'
      this.el.style.cursor = 'default'
      this.el.style.outline = 'initial'
      this.el.setAttribute('tabindex', 0)

      /**
       * Mouse and touch states/positions are stored here.
       * Can also be referred to as both `World#mouse` and `World#touch`.
       * @alias Sprinting.World#touch
       * @alias Sprinting.World#mouse
       * @type {Object}
       * @namespace #pointer
       * @memberof Sprinting.World
       */
      this.pointer = this.mouse = this.touch = {
        /**
         * Mouse xpos or last touched x.
         * @type {Number}
         * @name #x
         * @memberOf Sprinting.World#pointer
         * @example
         * let world = new World('#world')
         * console.log(world.mouse.x)
         */
        x: 0,

        /**
         * Mouse ypos or last touched y.
         * @name #y
         * @type {Number}
         * @memberOf Sprinting.World#pointer
         * @example
         * let world = new World('#world')
         * console.log(world.mouse.y)
         */
        y: 0,

        /**
         * Checks to see if `which` is currently down.
         * @type {Object}
         * @param {String} [which='any'] `'left'`, `'right'`, `'touch'`, or `'middle'`. Pass `'any'` to recieve any button or tap/touch.
         * @returns {Boolean} [description]
         * @memberOf Sprinting.World#pointer
         * @function #down
         * @example
         * let world = new Sprinting.World('#world')
         * world.drawLoop(function() {
         *   if(world.pointer.down('any'))
         *     console.log('mouse/touch down')
         * })
         * @todo Implement `touch`
         */
        down: (which='any') => {
          if((which === 'any' || which === 'left')   && this.mouse._down.left)   return true
          if((which === 'any' || which === 'right')  && this.mouse._down.right)  return true
          if((which === 'any' || which === 'middle') && this.mouse._down.middle) return true
          if((which === 'any' || which === 'touch')  && this.touch._down.touch)  return true
                                                                                return false
        }
      }

      Object.defineProperty(this.pointer, '_down', {
        writable: true,
        value: {}
      })

      window.addEventListener('touchmove', (evt) => {
        this.pointer.x = evt.changedTouches[0].pageX - this.canvas.offsetLeft
        this.pointer.y = evt.changedTouches[0].pageY - this.canvas.offsetTop
        evt.preventDefault()
        evt.stopPropagation()
        return false
      })

      // listen on window allows corners to be moved to
      window.addEventListener('mousemove', (evt) => {
        this.pointer.x = evt.pageX - this.canvas.offsetLeft
        this.pointer.y = evt.pageY - this.canvas.offsetTop
        evt.preventDefault()
        evt.stopPropagation()
        return false
      })

      window.addEventListener('mousedown', e => {
        if(e.button == 0) this.mouse._down.left = true
        if(e.button == 2) this.mouse._down.right = true
        if(e.button == 1) this.mouse._down.middle = true

        e.preventDefault()
        e.stopPropagation()
        return false
      })

      window.addEventListener('mouseup', e => {
        if(e.button == 0) this.mouse._down.left = false
        if(e.button == 2) this.mouse._down.right = false
        if(e.button == 1) this.mouse._down.middle = false

        e.preventDefault()
        e.stopPropagation()
        return false
      })

      this.canvas.setAttribute('width', this.w)
      this.canvas.setAttribute('height', this.h)
      //this.canvas.innerHTML = 'Looks like your web browser doesn\'t support the <canvas> tag. Update your web browser now!'

      this.el.addEventListener('contextmenu', e => {
        if(!this.focus) return
        e.preventDefault()
        e.stopPropagation()
        return false
      })

      /**
       * Canvas context.
       * @name #ctx
       * @memberof Sprinting.World
       * @type CanvasRenderingContext2D
       */
      this.ctx = this.canvas.getContext('2d', { alpha: true })

      /**
       * Array of {@link Sprinting.Thing|Thing}s that are contained within this World.
       * @name #things
       * @memberof Sprinting.World
       * @type Array
       */
      this.things = []

      /**
       * Array of all sub-loops contained within this World being called each tick.
       *
       * @name #subLoops
       * @memberof Sprinting.World
       * @type Array
       */
      this.subLoops = []

      /**
       * Starts the main loop of in which all the sub-loops are called and draws all it's {@link Sprinting.Thing|things}.
       *
       * @method #initLoop
       * @memberOf Sprinting.World
       * @private
       * @ignore
       */
      Object.defineProperty(this, 'initLoop', {
        value: () => {
          let tick = () => {
            this.draw()
            if(this.focus || this.new || this._neverstop) this.subLoops.forEach(loop => loop())

            window.setTimeout(() => window.requestAnimationFrame(tick.bind(this)), this.msPerTick)
          }

          tick.call(this)
        }
      })

      Object.defineProperty(this, '_nostop', {
        writable: true,
        value: false
      })

      this.initLoop()

      /**
       * `true` when the World is in focus. When `false`, the World will enter **debug mode**. Don't modify if you can help it.
       * @name #focus
       * @memberof Sprinting.World
       * @type {Boolean}
       * @protected
       */
      this.el.addEventListener('blur', e => {
        if(this._neverstop) return

        this.focus = false
      })

      this.el.addEventListener('focus', e => {
        if(this._neverstop) return

        this.focus = true

        // hide debug elements
        this.things.forEach(thing => {
          if(thing._el) {
            this.el.removeChild(thing._el)
            delete thing._el

            thing._observer.disconnect()
            delete thing._observer
          }
        })
      })

      this.el.addEventListener('mousemove', e => {
        this.el.focus()
      })

      this.el.addEventListener('touchstart', e => {
        this.el.focus()
      })

      this.el.focus()
    }

    get w() {
      return this.width
    }

    set w(w) {
      this.width = w
    }

    get h() {
      return this.height
    }

    set h(h) {
      this.height = h
    }

    get el() {
      return this.canvas
    }

    set el(el) {
      this.canvas = el
    }

    /**
     * Turns on/off [antialiasing](https://www.wikiwand.com/en/Supersampling).
     * @method #antialias
     * @memberOf Sprinting.World
     * @param {Boolean} on
     * @default true
     * @chainable
     */
    antialias(on=true) {
      on = on === true ? true : false

      if(typeof this.ctx.imageSmoothingEnabled === 'undefined') {
        this.ctx.webkitImageSmoothingEnabled = on
        this.ctx.mozImageSmoothingEnabled = on
      } else {
        this.ctx.imageSmoothingEnabled = on
      }

      return this
    }

    /**
     * Add {@link Sprinting.Thing|something} to this World, which will be drawn when {@link Sprinting.World#draw|World#draw} is called.
     * @method #add
     * @memberOf Sprinting.World
     * @param {Sprinting.Thing} thing
     * @chainable
     */
    add(thing) {
      this.things.push(thing)

      return this
    }

    /**
     * Remove an existing {@link Sprinting.Thing|something} from this World.
     * @method #remove
     * @memberOf Sprinting.World
     * @param {Sprinting.Thing} thing
     * @chainable
     */
    remove(thing) {
      this.things = this.things.filter(should => should !== thing)

      return this
    }

    /**
     * Don't enter debug mode. Ever.
     * @method #neverStop
     * @memberOf Sprinting.World
     * @param {Boolean} [to=true]
     * @chainable
     */
    neverStop(to=true) {
      this._neverstop = to
      return this
    }

    /**
     * Draw {@link Sprinting.Thing|everything}.
     * @method #draw
     * @memberOf Sprinting.World
     * @chainable
     */
    draw() {
      if(this.focus || this.new || this._neverstop) {
        this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)

        // sort by z
        this.things.sort((a, b) => {
          return a.z - b.z
        })

        this.things.forEach(thing => {
          world.ctx.save()

          // rotation
          {
            world.ctx.translate(thing.x, thing.y)
            if(thing.r) world.ctx.rotate(thing.r * Math.PI/180)
            world.ctx.translate(-thing.width * thing.rx, -thing.height * thing.ry)
          }

          thing.draw(this)
          world.ctx.restore()
        })

        if(this.new) delete this.new
      } else {
        //this.ctx.fillStyle = 'rgba(0,0,0,0.2)'
        //this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height)

        this.things.forEach(thing => {
          if(!thing._el) {
            Object.defineProperty(thing, '_el', {
              configurable: true,
              writable: true,
              value: document.createElement(thing.constructor.name)
            })

            Object.defineProperty(thing, '_observer', {
              configurable: true,
              writable: true,
              value: new MutationObserver(mutation => {
                let attr = mutation[0].attributeName
                thing[attr] = thing._el.getAttribute(attr)

                // force a render
                this.new = true
                this.draw()
              })
            })

            let el = thing._el
            let observer = thing._observer

            for(let attr in thing) {
              thing._el.setAttribute(attr, thing[attr])
            }

            world.el.appendChild(thing._el)
            observer.observe(el, { attributes: true })
          }
        })
      }

      return this
    }

    /**
     * Sets the frame-rate of the draw loop.
     *
     * @method #setFrameRate
     * @memberOf Sprinting.World
     * @chainable
     * @param {Number} fps
     */
    setFrameRate(fps) {
      this.msPerTick = 1000 / fps

      return this
    }

    /**
     * Calls `fn` every frame.
     *
     * @method #drawLoop
     * @param {Function} fn Called each frame.
     * @memberOf Sprinting.World
     * @chainable
     */
    drawLoop(fn) {
      this.subLoops.push(fn)

      return this
    }

    /**
     * Automatically scale this World as big as possible (that fits inside the viewport). [Here's an example.](/sprinting/examples/games)
     *
     * @method #scale
     * @memberOf Sprinting.World
     * @chainable
     */
    scale() {
      /*
      const resize = () => {
        let height = window.innerHeight
        let ratio = this.canvas.width / this.canvas.height
        let width = height * ratio

        this.canvas.style.width = width + 'px'
        this.canvas.style.height = height + 'px'

        this.el.style.width = width + 'px'
        this.el.style.height = height + 'px'
      }

      resize()
      window.addEventListener('resize', resize, false)
      */

      this.el.style.width = '100%'
      this.el.style.height = '100%'
      this.el.style.objectFit = 'contain'

      return this
    }
  }

  class Thing {
    /**
     * Things are objects that live within {@link Sprinting.World|Worlds}.
     * **Things should never be constructed directly**, rather, use an extension such as a {@link Sprinting.Square|Square}.
     *
     * @class Thing
     * @memberOf Sprinting
     * @see {@link Sprinting.Shape|Shape}
     * @param {Boolean} [quiet=false] - Whether or not to output the direct construction warning.
     * @private
     */
    constructor(quiet=false) {
      if(!quiet) console.warn('Things should never be constructed directly!')

      /**
       * X position.
       * @name #x
       * @memberof Sprinting.Thing
       * @type {Number}
       */
      this.x = 0

      /**
       * Y position.
       * @name #y
       * @memberof Sprinting.Thing
       * @type {Number}
       */
      this.y = 0

      /**
       * Rotation (in degrees).
       * @name #r
       * @memberof Sprinting.Thing
       * @type {Number}
       */
      this.r = 0

      /**
       * Z position - higher means this'll be drawn *after* others.
       * @name #z
       * @memberof Sprinting.Thing
       * @type Number
       */
      this.z = 0

      /**
       * Rotation offset x, from zero to one where zero is no offset (top-left corner) and one is full offset (bottom-right corner).
       * @name #rx
       * @memberof Sprinting.Thing
       * @type {Number}
       */
      this.rx = 0.5

      /**
       * Rotation offset y, from zero to one where zero is no offset (top-left corner) and one is full offset (bottom-right corner).
       * @name #ry
       * @memberof Sprinting.Thing
       * @type {Number}
       */
      this.ry = 0.5
    }

    /**
     * Things may not be drawn unless they are extended.
     * @memberof Sprinting.Thing
     * @ignore
     */
    draw() {
      throw Error('Things cannot be drawn unless extended.')
    }
  }

  class Shape extends Thing {
    /**
     * Shapes are {@link Sprinting.Thing|Things} with both a stroke color and a fill color.
     * **Shapes should never be constructed directly**, rather, use an extension such as a {@link Sprinting.Rectangle|Rectangle}.
     *
     * @class Shape
     * @memberOf Sprinting
     * @see {@link Sprinting.Circle|Circle} {@link Sprinting.Rectangle|Rectangle}
     * @param {String} [stroke='#000'] - Stroke color.
     * @param {String} [fill='transparent'] - Fill color.
     * @param {Number} [strokeWidth=1] - Stroke width in pixels.
     * @param {Boolean} [quiet=false] - Whether or not to output the direct construction warning.
     * @private
     */
    constructor(stroke='#000', fill='transparent', strokeWidth=1, quiet=false) {
      super(true)
      if(!quiet) console.warn('Shapes should never be constructed directly!')

      /**
       * @name #stroke
       * @memberof Sprinting.Shape
       * @type {String}
       */
      if(!stroke instanceof String) throw TypeError('stroke must be a String')
      this.stroke = stroke

      /**
       * @name #fill
       * @memberof Sprinting.Shape
       * @type {String}
       */
      if(!fill instanceof String) throw TypeError('fill must be a String')
      this.fill = fill

      /**
       * @name #strokeWidth
       * @memberof Sprinting.Shape
       * @type {String}
       */
      if(!strokeWidth instanceof Number) throw TypeError('strokeWidth must be a Number')
      this.strokeWidth = strokeWidth
    }

    /**
     * Shapes may not be drawn unless they are extended.
     * @ignore
     */
    draw() {
      throw Error('Shapes cannot be drawn unless extended.')
    }
  }

  class SizedShape extends Shape {
      constructor(width=50, height=50, stroke='#000', fill='transparent', strokeWidth=1, quiet=false) {
        super(stroke, fill, strokeWidth, quiet)

        /**
         * @name #width
         * @memberof Sprinting.SizedShape
         * @type {Number}
         */
        if(!(typeof width === 'number')) throw new TypeError('width must be a Number')
        this.width = width

        /**
         * @name #height
         * @memberof Sprinting.SizedShape
         * @type {Number}
         */
        if(!(typeof height === 'number')) throw new TypeError('height must be a Number')
        this.height = height
      }
  }

  class Rectangle extends SizedShape {
    /**
     * Rectangles are {@link Sprinting.Shape|Shapes} that have a width and height.
     *
     * @class Sprinting.Rectangle
     * @extends Sprinting.Shape
     * @param {Number} [width=75]
     * @param {Number} [height=75]
     * @param {String} [stroke='#000'] - Stroke color.
     * @param {String} [fill='transparent'] - Fill color.
     * @param {Number} [strokeWidth=1] - Stroke width in pixels.
     * @example
     * // draws a 100x75 black-bordered rectangle in the World
     * let world = new World('#world')
     * world.add(new Rectangle).draw()
     */
    constructor(width=100, height=75, stroke='#000', fill='transparent', strokeWidth=1) {
      super(width, height, stroke, fill, strokeWidth, true)
    }

    /**
     * This method is called by the parent World's {@link Sprinting.World#draw|draw()} method (although you can call it on it's own as shown in the example).
     * @example
     * let world = new World('#world')
     * let rect = new Rectangle
     * rect.draw(world)
     * @function #draw
     * @memberof Sprinting.Rectangle
     */
    draw(world) {
      if(!world instanceof World) throw TypeError('world must be a World')

      world.ctx.strokeStyle = this.stroke
      world.ctx.fillStyle = this.fill
      world.ctx.lineWidth = this.strokeWidth
      world.ctx.fillRect(0, 0, this.width, this.height)
      world.ctx.strokeRect(0, 0, this.width, this.height)
    }
  }

  class Circle extends SizedShape {
    /**
     * Circles are {@link Sprinting.Shape|Shapes} that have a radius.
     *
     * @class Sprinting.Circle
     * @extends Sprinting.Shape
     * @param {Number} [width=100]
     * @param {Number} [height=100]
     * @param {String} [stroke='#000'] - Stroke color.
     * @param {String} [fill='transparent'] - Fill color.
     * @param {Number} [strokeWidth=1] - Stroke width in pixels.
     * @example
     * // draws a circle with 100px diameter
     * let world = new World('#world')
     * world.add(new Circle).draw()
     * @example
     * // draws a semicircle with 200px diameter
     * let world = new World('#world')
     * world.add(new Circle(200, 200, 180)).draw()
     */
    constructor(width=100, height=100, stroke='#000', fill='transparent', strokeWidth=1) {
      super(width, height, stroke, fill, strokeWidth, true)
    }

    /**
     * This method is called by the parent World's {@link Sprinting.World#draw|draw()} method.
     * @see Sprinting.Rectangle#draw
     * @function #draw
     * @memberof Sprinting.Circle
     */
    draw(world) {
      if(!world instanceof World) throw TypeError('world must be a World')

      const specialConst = .5522848,
            cpOffsetX    = (this.width / 2)  * specialConst,
            cpOffsetY    = (this.height / 2) * specialConst,
            greatestX    = this.width,
            greatestY    = this.height,
            centerX      = this.width / 2,
            centerY      = this.height / 2

      world.ctx.strokeStyle = this.stroke
      world.ctx.fillStyle = this.fill
      world.ctx.lineWidth = this.strokeWidth

      world.ctx.beginPath()
      world.ctx.moveTo(0, centerY)

      world.ctx.bezierCurveTo(0,centerY - cpOffsetY, centerX - cpOffsetX,0, centerX,0)
      world.ctx.bezierCurveTo(centerX + cpOffsetX,0, greatestX,centerY - cpOffsetY, greatestX,centerY)
      world.ctx.bezierCurveTo(greatestX,centerY+cpOffsetY, centerX+cpOffsetX,greatestY, centerX,greatestY)
      world.ctx.bezierCurveTo(centerX - cpOffsetX,greatestY, 0,centerY+cpOffsetY, 0,centerY)

      world.ctx.fill()
      world.ctx.stroke()
    }
  }

  class Img extends Thing {
    /**
     * Images are {@link Sprinting.Thing|Things} that are drawn with a URI. **Warning: due to browser security, you must use [some kind of webserver](http://www.tecmint.com/python-simplehttpserver-to-create-webserver-or-serve-files-instantly/) to load images correctly**.
     *
     * @class Img
     * @memberOf Sprinting
     * @param {String} src - Image to display.
     * @param {Number|'auto'} [width='auto']
     * @param {Number|'auto'} [height='auto']
     * @example
     * // display an image of Donald Trump (of course)
     * let img = new Sprinting.Img('trump.jpg')
     * world.add(img)
     */
    constructor(src, width='auto', height='auto') {
      super(true)

      /**
       * @name #_src
       * @memberof Sprinting.Img
       * @type {Image}
       * @private
       */
      Object.defineProperty(this, '_src', {
        writable: true,
        value: src
      })

      /**
       * Load this image. Called automatically.
       * @name #load
       * @memberof Sprinting.Img
       * @type {Function}
       */
      Object.defineProperty(this, 'load', {
        value: function() {
          /**
           * @name #img
           * @memberof Sprinting.Img
           * @type {Image}
           * @private
           */
          Object.defineProperty(this, 'img', {
            writable: true,
            value: new Image()
          })

          this.loaded = false
          this.img.addEventListener('load', () => this.loaded = true)
          this.img.src = src

          this._src = src
          this.src = src
        }
      })

      this.load()

      /**
       * @name #src
       * @memberof Sprinting.Img
       * @type {String}
       */
      if(!src instanceof String) throw TypeError('src must be a String')
      this.src = src

      /**
       * `true` once {@link Sprinting.Img#src|src} has loaded.
       * @name #loaded
       * @memberof Sprinting.Img
       * @type {Boolean}
       */
      this.loaded = false

      /**
       * @name #width
       * @memberOf Sprinting.Img
       * @type {Number|'auto'}
       */
      if(typeof width !== 'number' && width !== 'auto')
        throw TypeError('width must be a Number or "auto"')
      Object.defineProperty(this, '_width', { value: width, writable: true })

      /**
       * @name #height
       * @memberOf Sprinting.Img
       * @type {Number|'auto'}
       */
      if(typeof width !== 'number' && height !== 'auto')
        throw TypeError('height must be a Number or "auto"')
      Object.defineProperty(this, '_height', { value: height, writable: true })

      Object.defineProperty(this, 'width', {
        get: () => this._width === 'auto' ? this.img.width : this._width,
        set: w => this._width = w,
        enumerable: true
      })

      Object.defineProperty(this, 'height', {
        get: () => this._height === 'auto' ? this.img.height : this._height,
        set: h => this._height = h,
        enumerable: true
      })
    }

    /**
     * This method is called by the parent World's {@link Sprinting.World#draw|draw()} method.
     * @see Sprinting.Rectangle#draw
     * @function #draw
     * @memberof Sprinting.Img
     */
    draw(world) {
      if(!world instanceof World) throw TypeError('world must be a World')

      if(this._src !== this.src) this.loaded = false

      if(this.loaded) {
        world.ctx.drawImage(
          this.img,
          0, 0,
          this.width,
          this.height
        )
      } else {
        this.load()
      }
    }
  }

  S.World = World
  S.Thing = Thing
  S.Shape = Shape
  S.Rectangle = Rectangle
  S.Circle = Circle
  S.Img = Img
  return S
}({}))


text:
public class CarElementDoVisitor implements CarElementVisitor {
	public void visit(Wheel wheel) {
		System.out.println("Kicking my " + wheel.getName() + " wheel");
	}

	public void visit(Engine engine) {
		System.out.println("Starting my engine");
	}

	public void visit(Body body) {
		System.out.println("Moving my body");
	}

	public void visit(Car car) {
		System.out.println("Starting my car");
	}
}


text:
require "spec_helper"

if Mongoid::VERSION =~ /\A3\./

describe Mongoid::Persistence::Atomic::Inc do

  describe "#inc" do

    let(:person) do
      Person.create(age: 100)
    end

    let(:reloaded) do
      person.reload
    end

    context "when incrementing a field on an embedded document" do

      let(:address) do
        person.addresses.create(street: "Tauentzienstr", number: 5)
      end

      let!(:inced) do
        address.inc(:number, 5)
      end

      it "increments the provided value" do
        inced.should eq(10)
      end

      it "persists the change" do
        reloaded.addresses.first.number.should eq(10)
      end
    end

    context "when incrementing a field with a value" do

      context "when provided an integer" do

        let!(:inced) do
          person.inc(:age, 2)
        end

        it "increments by the provided value" do
          person.age.should eq(102)
        end

        it "returns the new value" do
          inced.should eq(102)
        end

        it "persists the changes" do
          reloaded.age.should eq(102)
        end

        it "keeps the field as an integer" do
          inced.should be_a(Integer)
        end

        it "resets the dirty attributes" do
          person.changes["age"].should be_nil
        end
      end

      context "when provided a big decimal" do

        let!(:inced) do
          person.inc(:blood_alcohol_content, BigDecimal.new("2.2"))
        end

        it "increments by the provided value" do
          person.blood_alcohol_content.should eq(2.2)
        end

        it "returns the new value" do
          inced.should eq(2.2)
        end

        it "persists the changes" do
          reloaded.blood_alcohol_content.should eq(2.2)
        end

        it "resets the dirty attributes" do
          person.changes["blood_alcohol_content"].should be_nil
        end
      end
    end

    context "when incrementing a nil field" do

      let!(:inced) do
        person.inc(:score, 2)
      end

      it "sets the value to the provided number" do
        person.score.should eq(2)
      end

      it "returns the new value" do
        inced.should eq(2)
      end

      it "persists the changes" do
        reloaded.score.should eq(2)
      end

      it "resets the dirty attributes" do
        person.changes["score"].should be_nil
      end
    end

    context "when incrementing a non existant field" do

      let!(:inced) do
        person.inc(:high_score, 5)
      end

      it "sets the value to the provided number" do
        person.high_score.should eq(5)
      end

      it "returns the new value" do
        inced.should eq(5)
      end

      it "persists the changes" do
        reloaded.high_score.should eq(5)
      end

      it "resets the dirty attributes" do
        person.changes["high_score"].should be_nil
      end
    end
  end
end

end


text:
<?php

namespace User\Model;

use Zend\Db\TableGateway\AbstractTableGateway;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql\Select;
use Zend\Crypt\Password\Bcrypt;

class UserTable extends AbstractTableGateway
{
    protected $tableGateway;

    public function __construct(TableGateway $tableGateway)
    {
        $this->tableGateway = $tableGateway;
    }

    public function fetchAll()
    {
        $resultSet = $this->tableGateway->select(function (Select $select) {
            $select->order('id DESC');
        });
        return $resultSet;
    }

    public function getUser($id)
    {
        $id  = (int) $id;
        $rowset = $this->tableGateway->select(array('id' => $id));
        $row = $rowset->current();
        if (!$row) {
            throw new \Exception("Could not find row $id");
        }
        return $row;
    }

    public function saveUser(User $user)
    {
        $bcrypt = new Bcrypt();
        $password = $bcrypt->create($user->password);

        $data = array(
            'username' => $user->username,
            'password'  => $password,
            'nome' => $user->nome,
            'email' => $user->email,
        );

        $id = (int) $user->id;
        if ($id == 0) {
            $this->tableGateway->insert($data);
        } else {
            if ($this->getUser($id)) {
                $this->tableGateway->update($data, array('id' => $id));
            } else {
                throw new \Exception('Id não existe.');
            }
        }
    }

    public function deleteUser($id)
    {
        $this->tableGateway->delete(array('id' => $id));
    }

    // Usado para paginação
    public function getSql()
    {
        return $this->tableGateway->getSql();
    }
    public function getSelect($where = null, $order = null)
    {
        $select = new Select($this->tableGateway->getTable());
        if ($where) {
            $select->where($where);
        }
        if ($order) {
            $select->order($order);
        }
        return $select;
    }
}


text:
'use strict';

angular.module('sqwiggle-feed.fibonacci').factory('Fibonacci', ['$timeout', function($timeout) {
	return  {
		isPolling: false,
		series: [],
		index: 0,
		next: 1,
		max: 5,
		initialize: function(options) {
			this.series = [1, 1];
			this.index = 0;
			this.next = 1;

			for(var prop in options) {
				this[prop] = options[prop];
			}
		},
		start: function (options) {
			this.initialize(options);
			this.tick(this.next);
			this.isPolling = true;
		},
		stop: function() {
			if(this.timeout) {
				var timeout = this.timeout;
				$timeout.cancel(timeout);
			}
			this.isPolling = false;
		},
		tick: function(seconds) {
			var self = this;
			self.timeout = $timeout(function(){
				self.next = self.series[self.index] + self.series[self.index + 1];
				self.series.push(self.next);
				if(self.callback && typeof(self.callback) == "function") {
					self.callback();
				}
				self.index ++;
				if(self.series.length > self.max) {
					self.restart();
				} else {
					self.tick(self.next);
				}
			}, seconds * 1000);
		},
		restart: function() {
			var self = this;
			self.stop();
			self.start();
		}
	}
}]);


text:
package net.bytebuddy.implementation.attribute;

import net.bytebuddy.test.utility.ObjectPropertyAssertion;
import org.junit.Test;

import static org.mockito.Mockito.verifyZeroInteractions;

public class TypeAttributeAppenderNoOpTest extends AbstractTypeAttributeAppenderTest {

    @Test
    public void testApplication() throws Exception {
        TypeAttributeAppender.NoOp.INSTANCE.apply(classVisitor, instrumentedType, annotationValueFilter);
        verifyZeroInteractions(classVisitor);
        verifyZeroInteractions(instrumentedType);
    }

    @Test
    public void testObjectProperties() throws Exception {
        ObjectPropertyAssertion.of(TypeAttributeAppender.NoOp.class).apply();
    }
}


text:
SPEC_BEGIN(UAIAMListRolesRequestSpec)

describe(@"UAIAMListRolesRequest", ^
{

});

SPEC_END


text:
package org.innovateuk.ifs.util;

/**
 * A consumer that takes 4 arguments
 */
@FunctionalInterface
public interface QuadConsumer<A, B, C, D> {

    void accept(A a, B b, C c, D d);
}