text:
package de.flapdoodle.embed.process.runtime;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

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

import de.flapdoodle.embed.process.config.SupportConfig;
import de.flapdoodle.embed.process.config.process.ProcessConfig;
import de.flapdoodle.embed.process.io.Processors;

public class ProcessControl {

	private static final long MAX_STOP_TIMEOUT_MS = 5000;
	private static Logger logger = LoggerFactory.getLogger(ProcessControl.class);
	private static final int SLEEP_TIMEOUT = 10;

	private final Process process;

	private InputStreamReader reader;
	private final InputStreamReader error;

	private final Long pid;

	private final SupportConfig runtime;

	public ProcessControl(SupportConfig runtime, Process process) {
		this.process = process;
		this.runtime = runtime;
		reader = new InputStreamReader(this.process.getInputStream());
		error = new InputStreamReader(this.process.getErrorStream());
		pid = Processes.processId(this.process);
	}

	public Reader getReader() {
		return reader;
	}

	public InputStreamReader getError() {
		return error;
	}

	public int stop() {
		return stop(MAX_STOP_TIMEOUT_MS);
	}

	public int stop(long maxStopTimeoutMillis) {
		return waitForProcessGotKilled(maxStopTimeoutMillis);
	}

	private void closeIOAndDestroy() {
		if (process != null) {
			try {
				// streams need to be closed, otherwise process may block
				// see http://kylecartmell.com/?p=9
				process.getErrorStream().close();
				process.getInputStream().close();
				process.getOutputStream().close();

			} catch (IOException e) {
				logger.error(e.getMessage());
			}
			reader = null;
		}
	}

	private Integer stopOrDestroyProcess(long maxStopTimeoutMillis) {
		Integer returnCode=null;

		// set back to minimal defaults
		if (maxStopTimeoutMillis<3000) maxStopTimeoutMillis=MAX_STOP_TIMEOUT_MS;

		try {
			returnCode=process.exitValue();
		} catch (IllegalThreadStateException itsx) {
		    	logger.info("stopOrDestroyProcess: "+itsx.getMessage() +" "+((itsx.getCause()!=null) ? itsx.getCause() : "") );
			Callable<Integer> callable= process::waitFor;

			FutureTask<Integer> task = new FutureTask<>(callable);
			new Thread(task).start();

			boolean stopped=false;
			try {

              try {
                returnCode = task.get(100, TimeUnit.MILLISECONDS);
                stopped = true;
              } catch (ExecutionException | TimeoutException e) {
              }

              closeIOAndDestroy();

              try {
                returnCode = task.get(maxStopTimeoutMillis, TimeUnit.MILLISECONDS);
                stopped = true;
              } catch (ExecutionException | TimeoutException e) {
              }
            } catch (InterruptedException e) {
			  Thread.currentThread().interrupt();
            }

          if (!stopped)	{
//				logger.severe(""+runtime.getName()+" NOT exited, thats why we destroy");
				process.destroy();
			}
		}

		return returnCode;
	}

	private int waitForProcessGotKilled(long maxStopTimeoutMillis) {
		Integer retCode=stopOrDestroyProcess(maxStopTimeoutMillis);
		if (retCode==null) {
			String message = "\n\n" + "----------------------------------------------------\n"
					+ "Something bad happened. We couldn't kill "+runtime.name()+" process, and tried a lot.\n"
					+ "If you want this problem solved you can help us if you open a new issue.\n" + "\n"
					+ "Follow this link:\n" + runtime.supportUrl() +
					"\n"
					+ "Thank you:)\n" + "----------------------------------------------------\n\n";
			throw new IllegalStateException("Couldn't kill "+runtime.name()+" process!" + message);
		}
		return retCode;
	}

	public static ProcessControl fromCommandLine(SupportConfig runtime, List<String> commandLine, boolean redirectErrorStream)
			throws IOException {
		ProcessBuilder processBuilder = newProcessBuilder(commandLine, redirectErrorStream);
		return start(runtime, processBuilder);
	}

	public static ProcessControl start(SupportConfig runtime, ProcessBuilder processBuilder) throws IOException {
		return new ProcessControl(runtime, processBuilder.start());
	}

	public static ProcessBuilder newProcessBuilder(List<String> commandLine, boolean redirectErrorStream) {
		return newProcessBuilder(commandLine, new HashMap<>(), redirectErrorStream);
	}

	public static ProcessBuilder newProcessBuilder(List<String> commandLine, Map<String,String> environment, boolean redirectErrorStream) {
		ProcessBuilder processBuilder = new ProcessBuilder(commandLine);
		if (!environment.isEmpty()){
			processBuilder.environment().putAll(environment);
		}
		if (redirectErrorStream)
			processBuilder.redirectErrorStream();
		return processBuilder;
	}

	public static boolean executeCommandLine(SupportConfig support, String label, ProcessConfig processConfig) {
		boolean ret;

		List<String> commandLine = processConfig.commandLine();
		try {
			ProcessControl process = fromCommandLine(support, processConfig.commandLine(), processConfig.error() == null);
			Processors.connect(process.getReader(), processConfig.output());
			Thread.sleep(SLEEP_TIMEOUT);
			ret = process.stop() == 0;
			logger.info("execSuccess: {} {}", ret, commandLine);
			return ret;
		} catch (IOException | InterruptedException e) {
			logger.error("" + commandLine, e);
		}
		return false;
	}

	public int waitFor() throws InterruptedException {
		return process.waitFor();
	}

	public int waitFor(long timeoutInMs) throws InterruptedException {
		synchronized (process) {
			while (process.isAlive()) {
				process.wait(timeoutInMs);
			}

			return process.exitValue();
		}
	}

	public static void addShutdownHook(Runnable runnable) {
		Runtime.getRuntime().addShutdownHook(new Thread(runnable));
	}

	public Long getPid() {
		return pid;
	}
}


text:
package com.kurtraschke.wsf.gtfsrealtime.services;

import org.onebusaway.gtfs.model.calendar.CalendarServiceData;

import com.google.inject.Provider;

import java.util.TimeZone;

import javax.inject.Inject;
import javax.inject.Named;

public class AgencyTimeZoneProvider implements Provider<TimeZone> {

  @Inject
  private CalendarServiceData _csd;

  @Inject
  @Named("WSF.agencyId")
  private String _agencyId;

  @Override
  public TimeZone get() {
    return _csd.getTimeZoneForAgencyId(_agencyId);
  }
}

redpajama_set_name: RedPajamaGithub


text:
var Location = can.Model({
    findAll: 'GET /locations/',
    findOne: function(params) {
        if (params.id) {
            return $.ajax({
                url: '/locations/'+params.id,
                type: 'GET',
                contentType: 'application/json'
            });
        } else if (params.LocationName) {
                return $.ajax({
                    url: '/locations/'+params.CollectionName,
                    type: 'GET',
                    contentType: 'application/json'
            })
        }
    },
    create:  {
        type: 'POST',
        contentType: 'application/json',
        url: '/locations/'
    },
    update:  {
        type: 'PUT',
        contentType: 'application/json',
        url: '/locations/{id}'
    },
    destroy: {
        type: 'DELETE',
        contentType: 'application/json',
        url: '/locations/{id}'
    }
}, {})


text:
<!--
  Copyright The Ohio State University Research Foundation, The University of Chicago -
Argonne National Laboratory, Emory University, SemanticBits LLC, and Ekagra Software Technologies Ltd.

  Distributed under the OSI-approved BSD 3-Clause License.
  See http://ncip.github.com/cagrid-general/LICENSE.txt for details.
-->
<ns1:ServiceMetadata xmlns:ns1="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata">
 <ns1:serviceDescription>
  <ns2:Service description="" name="StockManager" version="1.3" xmlns:ns2="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.service">
   <ns2:pointOfContactCollection>
    <ns3:PointOfContact affiliation="caGrid" email="knowledge@cagrid.org" firstName="Shannon" lastName="Hastings" phoneNumber="" role="Developer" xmlns:ns3="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common"/>
   </ns2:pointOfContactCollection>
   <ns2:serviceContextCollection>
    <ns2:ServiceContext description="" name="StockManager">
     <ns2:operationCollection>
      <ns2:Operation description="" name="GetMultipleResourceProperties">
       <ns2:inputParameterCollection/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="GetResourceProperty">
       <ns2:inputParameterCollection/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="QueryResourceProperties">
       <ns2:inputParameterCollection/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="getServiceSecurityMetadata">
       <ns2:inputParameterCollection/>
       <ns2:Output qName="ns4:ServiceSecurityMetadata" dimensionality="1" isArray="false" xmlns:ns4="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security">
        <ns5:UMLClass className="ServiceSecurityMetadata" description="An instance of the Security Service Metadata." id="7E230C2C-3E39-F166-E040-BB89AD436187" packageName="gov.nih.nci.cagrid.metadata.security" projectName="caGrid_Metadata_Models" projectVersion="1" xmlns:ns5="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common">
         <ns5:umlAttributeCollection/>
         <ns5:SemanticMetadata conceptCode="C80736" conceptDefinition="A software system providing a public need." conceptName="Software Service" order="2"/>
         <ns5:SemanticMetadata conceptCode="C25669" conceptDefinition="Security; freedom from anxiety or fear." conceptName="Security" order="1"/>
         <ns5:SemanticMetadata conceptCode="C52095" conceptDefinition="Data about data; information that describes another set of data." conceptName="Metadata" order="0"/>
        </ns5:UMLClass>
       </ns2:Output>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="returns a stock quote for a given symbol" name="getQuote">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns6:Symbol" dimensionality="1" index="0" isArray="false" isRequired="false" name="symbol" xmlns:ns6="http://tools.tutorial.introduce.cagrid.org/StockTools"/>
       </ns2:inputParameterCollection>
       <ns2:Output qName="ns7:Quote" dimensionality="1" isArray="false" xmlns:ns7="http://tools.tutorial.introduce.cagrid.org/StockTools"/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="Retrieve a stock chart for a given symbol" name="getChart">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns8:Symbol" dimensionality="1" index="0" isArray="false" isRequired="false" name="symbol" xmlns:ns8="http://tools.tutorial.introduce.cagrid.org/StockTools"/>
       </ns2:inputParameterCollection>
       <ns2:Output qName="ns9:TransferServiceContextReference" dimensionality="1" isArray="false" xmlns:ns9="http://transfer.cagrid.org/TransferService/Context/types"/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="Create a new portfolio instance" name="createPortfolio">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="xsd:string" dimensionality="1" index="0" isArray="false" isRequired="false" name="portfolioName" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
       </ns2:inputParameterCollection>
       <ns2:Output qName="ns10:StockPortfolioManagerReference" dimensionality="1" isArray="false" xmlns:ns10="http://stockmanager.tutorial.introduce.cagrid.org/StockManager/Portfolio/types"/>
       <ns2:faultCollection/>
      </ns2:Operation>
     </ns2:operationCollection>
     <ns2:contextPropertyCollection>
      <ns2:ContextProperty description="" name="{gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata}ServiceMetadata"/>
     </ns2:contextPropertyCollection>
    </ns2:ServiceContext>
    <ns2:ServiceContext description="" name="StockPortfolioManager">
     <ns2:operationCollection>
      <ns2:Operation description="adds a stock to monitor in this portfolio" name="addStock">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns11:Symbol" dimensionality="1" index="0" isArray="false" isRequired="false" name="symbol" xmlns:ns11="http://tools.tutorial.introduce.cagrid.org/StockTools"/>
       </ns2:inputParameterCollection>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="returns the current stock quotes for the portfolio" name="getPortfolioQuote">
       <ns2:inputParameterCollection/>
       <ns2:Output qName="ns12:PortfolioInstance" dimensionality="1" isArray="false" xmlns:ns12="http://tools.tutorial.introduce.cagrid.org/StockTools"/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="getServiceSecurityMetadata">
       <ns2:inputParameterCollection/>
       <ns2:Output qName="ns13:ServiceSecurityMetadata" dimensionality="1" isArray="false" xmlns:ns13="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security">
        <ns14:UMLClass className="ServiceSecurityMetadata" description="An instance of the Security Service Metadata." id="7E230C2C-3E39-F166-E040-BB89AD436187" packageName="gov.nih.nci.cagrid.metadata.security" projectName="caGrid_Metadata_Models" projectVersion="1" xmlns:ns14="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common">
         <ns14:umlAttributeCollection/>
         <ns14:SemanticMetadata conceptCode="C80736" conceptDefinition="A software system providing a public need." conceptName="Software Service" order="2"/>
         <ns14:SemanticMetadata conceptCode="C25669" conceptDefinition="Security; freedom from anxiety or fear." conceptName="Security" order="1"/>
         <ns14:SemanticMetadata conceptCode="C52095" conceptDefinition="Data about data; information that describes another set of data." conceptName="Metadata" order="0"/>
        </ns14:UMLClass>
       </ns2:Output>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="Enumerate over stocks in the portfolio" name="enumerateStocks">
       <ns2:inputParameterCollection/>
       <ns2:Output qName="ns15:EnumerationResponseContainer" dimensionality="1" isArray="false" xmlns:ns15="http://gov.nih.nci.cagrid.enumeration/EnumerationResponseContainer"/>
       <ns2:faultCollection>
        <ns2:Fault description="" name="PortfolioEnumerationException"/>
       </ns2:faultCollection>
      </ns2:Operation>
      <ns2:Operation description="" name="Destroy">
       <ns2:inputParameterCollection/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="SetTerminationTime">
       <ns2:inputParameterCollection/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="Subscribe">
       <ns2:inputParameterCollection/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="Add a set of stock symbols to an existing Portfolio via Transfer" name="addPortfolioSymbols">
       <ns2:inputParameterCollection/>
       <ns2:Output qName="ns16:TransferServiceContextReference" dimensionality="1" isArray="false" xmlns:ns16="http://transfer.cagrid.org/TransferService/Context/types"/>
       <ns2:faultCollection/>
      </ns2:Operation>
     </ns2:operationCollection>
     <ns2:contextPropertyCollection>
      <ns2:ContextProperty description="" name="{http://tools.tutorial.introduce.cagrid.org/StockTools}Portfolio"/>
      <ns2:ContextProperty description="" name="{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime"/>
      <ns2:ContextProperty description="" name="{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime"/>
     </ns2:contextPropertyCollection>
    </ns2:ServiceContext>
    <ns2:ServiceContext description="" name="CaGridEnumeration">
     <ns2:operationCollection>
      <ns2:Operation description="" name="PullOp">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns17:Pull" dimensionality="1" index="0" isArray="false" isRequired="false" name="pull" xmlns:ns17="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       </ns2:inputParameterCollection>
       <ns2:Output qName="ns18:PullResponse" dimensionality="1" isArray="false" xmlns:ns18="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="RenewOp">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns19:Renew" dimensionality="1" index="0" isArray="false" isRequired="false" name="renew" xmlns:ns19="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       </ns2:inputParameterCollection>
       <ns2:Output qName="ns20:RenewResponse" dimensionality="1" isArray="false" xmlns:ns20="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="GetStatusOp">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns21:GetStatus" dimensionality="1" index="0" isArray="false" isRequired="false" name="status" xmlns:ns21="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       </ns2:inputParameterCollection>
       <ns2:Output qName="ns22:GetStatusResponse" dimensionality="1" isArray="false" xmlns:ns22="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="ReleaseOp">
       <ns2:inputParameterCollection>
        <ns2:InputParameter qName="ns23:Release" dimensionality="1" index="0" isArray="false" isRequired="false" name="release" xmlns:ns23="http://schemas.xmlsoap.org/ws/2004/09/enumeration"/>
       </ns2:inputParameterCollection>
       <ns2:faultCollection/>
      </ns2:Operation>
      <ns2:Operation description="" name="getServiceSecurityMetadata">
       <ns2:inputParameterCollection/>
       <ns2:Output qName="ns24:ServiceSecurityMetadata" dimensionality="1" isArray="false" xmlns:ns24="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security">
        <ns25:UMLClass className="ServiceSecurityMetadata" description="An instance of the Security Service Metadata." id="7E230C2C-3E39-F166-E040-BB89AD436187" packageName="gov.nih.nci.cagrid.metadata.security" projectName="caGrid_Metadata_Models" projectVersion="1" xmlns:ns25="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common">
         <ns25:umlAttributeCollection/>
         <ns25:SemanticMetadata conceptCode="C80736" conceptDefinition="A software system providing a public need." conceptName="Software Service" order="2"/>
         <ns25:SemanticMetadata conceptCode="C25669" conceptDefinition="Security; freedom from anxiety or fear." conceptName="Security" order="1"/>
         <ns25:SemanticMetadata conceptCode="C52095" conceptDefinition="Data about data; information that describes another set of data." conceptName="Metadata" order="0"/>
        </ns25:UMLClass>
       </ns2:Output>
       <ns2:faultCollection/>
      </ns2:Operation>
     </ns2:operationCollection>
     <ns2:contextPropertyCollection/>
    </ns2:ServiceContext>
   </ns2:serviceContextCollection>
   <ns26:SemanticMetadata conceptCode="C63541" conceptDefinition="A service available on a system that coordinates resources that are not subject to central control, using open, general purpose protocols and interfaces to deliver nontrivial qualities of services." conceptName="Grid Service" order="0" xmlns:ns26="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common"/>
   <ns27:SemanticMetadata conceptCode="C63543" conceptDefinition="A published API which receives data in the form of objects, performs computations based upon the input data, and returns information to a client via caGrid in the form of one or more objects." conceptName="Analytical Grid Service" order="1" xmlns:ns27="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common"/>
  </ns2:Service>
 </ns1:serviceDescription>
 <ns1:hostingResearchCenter>
  <ns28:ResearchCenter displayName="" shortName="" xmlns:ns28="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common">
   <ns28:Address country="" locality="" postalCode="" stateProvince="" street1="" street2=""/>
   <ns28:ResearchCenterDescription description="" homepageURL="" imageURL="" rssNewsURL=""/>
   <ns28:pointOfContactCollection>
    <ns28:PointOfContact affiliation="" email="" firstName="" lastName="" phoneNumber="" role=""/>
   </ns28:pointOfContactCollection>
  </ns28:ResearchCenter>
 </ns1:hostingResearchCenter>
</ns1:ServiceMetadata>


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Instagram */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'moment_id')->textInput() ?>

    <?= $form->field($model, 'username')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'link')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'image_url')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'text')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'created_time')->textInput() ?>

    <?= $form->field($model, 'created_at')->textInput() ?>

    <?= $form->field($model, 'updated_at')->textInput() ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
MyComponents.Team = React.createClass({
  render: function() {

    // inspect this.props.team to make sure we load the data correctly
    console.log('members', this.props.members)

    // For each 'member' in 'team', create a
 component to display
    // information about this member.

    var members = this.props.members.map(function(member, i){
      return

              {member.name}
              Github

    })

    return (

            TODO: This is a component to display the info about our team
            raw props data is {JSON.stringify(this.props)}

          Team Members

            {members}

    );
  }
});


text:
package org.apache.atlas.typesystem.types;

import com.google.common.collect.ImmutableSortedMap;
import org.apache.atlas.AtlasException;

import java.util.Map;

abstract class AbstractDataType<T> implements IDataType<T> {

    protected T convertNull(Multiplicity m) throws AtlasException {
        if (!m.nullAllowed()) {
            throw new ValueConversionException.NullConversionException(m);
        }
        return null;
    }

    @Override
    public void output(T val, Appendable buf, String prefix) throws AtlasException {
        if (val instanceof Map) {
            ImmutableSortedMap immutableSortedMap = ImmutableSortedMap.copyOf((Map) val);
            TypeUtils.outputVal(val == null ? "<null>" : immutableSortedMap.toString(), buf, prefix);
        } else {
            TypeUtils.outputVal(val == null ? "<null>" : val.toString(), buf, prefix);
        }

    }
}


text:
<?php

namespace auth\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;

/**
 * UserSearch represents the model behind the search form about `auth\models\User`.
 */
class UserSearch extends User
{
    public function rules()
    {
        return [
            [['id', 'status'], 'integer'],
            [['username', 'email', 'password_hash', 'password_reset_token', 'auth_key', 'last_visit_time', 'create_time', 'update_time', 'delete_time'], 'safe'],
        ];
    }

    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    public function search($params)
    {
        $query = User::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'status' => $this->status,
        ]);

        $query->andFilterWhere(['like', 'username', $this->username])
            ->andFilterWhere(['like', 'email', $this->email])
            ->andFilterWhere(['like', 'password_hash', $this->password_hash])
            ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])
            ->andFilterWhere(['like', 'auth_key', $this->auth_key])
            ->andFilterWhere(['like', 'last_visit_time', $this->last_visit_time])
            ->andFilterWhere(['like', 'create_time', $this->create_time])
            ->andFilterWhere(['like', 'update_time', $this->update_time])
            ->andFilterWhere(['like', 'delete_time', $this->delete_time]);

        return $dataProvider;
    }
}


text:
package org.flywaydb.core.internal.util;

/**
 * Formats execution times.
 */
public class TimeFormat {
    /**
     * Prevent instantiation.
     */
    private TimeFormat() {
        // Do nothing
    }

    /**
     * Formats this execution time.
     *
     * @param millis The number of millis.
     * @return The execution in a human-readable format.
     */
    public static String format(long millis) {
        return String.format("%02d:%02d.%03ds", millis / 60000, (millis % 60000) / 1000, (millis % 1000));
    }
}


text:
module Gemstone.GL where

import Control.Monad
import Graphics.Rendering.OpenGL
import Graphics.UI.SDL (glSwapBuffers)

checkErrors :: IO ()
checkErrors = do
    es <- get errors
    putStrLn $ if null es
        then "All clear!"
        else "Error: " ++ show es

checkExtensions' :: [String] -> IO ()
checkExtensions' requiredExts = do
    exts <- get glExtensions
    forM_ requiredExts $ \x -> if "GL_" ++ x `elem` exts
        then putStrLn $ "Found extension " ++ x
        else error $ "Need extension " ++ x

checkExtensions :: IO ()
checkExtensions = checkExtensions' exts
    where exts = ["ARB_texture_rectangle", "ARB_texture_non_power_of_two"]

clearScreen :: IO ()
clearScreen = do
    clearColor $= Color4 0.1 0.1 0.1 0.0
    clear [ColorBuffer]

finishFrame :: IO ()
finishFrame = glSwapBuffers

-- | Resize the viewport such that:
--    * The smallest dimension still corresponds to at least [0, 1]
--    * The viewport is centered on (0.5, 0.5)
resizeViewport :: GLsizei -> GLsizei -> IO ()
resizeViewport w h
    | w > h     = viewport $= (Position ((w-3*h) `div` 2) (-h), Size (2*h) (2*h))
    | otherwise = viewport $= (Position (-w) ((h-3*w) `div` 2), Size (2*w) (2*w))

-- | Turn on alpha blending.
enableBlending :: IO ()
enableBlending = do
    blend $= Enabled
    blendFunc $= (SrcAlpha, OneMinusSrcAlpha)

-- | Set some initial GL state that should be set once and only once.
--
--   It doesn't hurt to call this action multiple times.
prepareGLState :: IO ()
prepareGLState = do
    putStrLn "Preparing GL state..."
    checkErrors
    enableBlending
    putStrLn "Finished preparing GL state!"
    checkErrors


text:
/**
 * Created by ssehacker on 16/7/24.
 */
import MarkDownEditor from './MarkDownEditor';

class ProfileResume extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            defaultValue: this.props.value || ''
        };
    }

    componentDidMount(){
        //Ajax get data...
        this.setState({
            defaultValue: 'defaultValue...'
        });
    }

    handleSubmit(){
        let value = this.refs.editor.getValue();
        console.log(value);
        $.ajax({
            url: '/api/user',
            method: 'PATCH',
            data: {
                fieldName: 'resumeMD',
                fieldValue: value
            },
            success: (res)=> {
                if(res.code === 0){
                    alert('保存成功!');
                }else{
                    alert(res.msg);
                }
            }
        })
    }

    render(){
        let me = this;
        return (

                    Tips:以下信息将在你博客中的"关于我"页面中展示.
                    <button className="btn-1" onClick={me.handleSubmit.bind(me)}>保存</button>

                <MarkDownEditor ref="editor" defaultValue={me.state.defaultValue}/>

        );
    }
}

export default ProfileResume;


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

export class DataItem implements OnInit {
    constructor() {
    }

    ngOnInit() {
    }
}


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

Bedwetter

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


text:
import { Action } from "@ngrx/store";

export class ActionImpl implements Action {
	constructor(public type: string, public payload?: any) {
	}
}


text:
package huippu.mobile;

import java.util.Random;

import huippu.common.Dude;

import javax.microedition.lcdui.Graphics;

abstract class MobileDude extends Dude
{
    public static final int DUDE_COUNT = 3;

    private static final int COLOR_DRAW[] =
        { 0x00CC2020, 0x0020AA40, 0x002020CC };

    private static final int COLOR_REMOVABLE = 0x00BBBBBB;
    private static final int COLOR_CHANGE_BORDER = 0x30;

    protected int mColorDraw;
    protected int mColorDrawDarker;
    protected int mColorDrawLighter;

    public MobileDude( final int pId, final int pColorDraw )
    {
        super( pId );
        mColorDraw = pColorDraw;
        mColorDrawDarker = getBorderColor( mColorDraw, true );
        mColorDrawLighter = getBorderColor( mColorDraw, false );
    }

    public static final void setColors()
    {
        final Random rand = new Random();

        // Fisher-Yates shuffle
        for ( int i = DUDE_COUNT; i > 1; --i )
        {
            final int j = rand.nextInt( i );

            final int temp = COLOR_DRAW[ j ];
            COLOR_DRAW[ j ] = COLOR_DRAW[ i - 1 ];
            COLOR_DRAW[ i - 1 ] = temp;
        }
    }

    public static final MobileDude getDude( final int pId )
    {
        final MobileDude dude;

        switch ( pId )
        {
            case 0:
                dude = new MobileDude1( pId, COLOR_DRAW[ pId ] );
                break;

            case 1:
                dude = new MobileDude2( pId, COLOR_DRAW[ pId ] );
                break;

            case 2:
                dude = new MobileDude3( pId, COLOR_DRAW[ pId ] );
                break;

            default:
                throw new IllegalArgumentException( "Unknown Dude id " + pId );
        }

        return dude;
    }

    void drawAsRemovable( final Graphics pG )
    {
        pG.setColor( COLOR_REMOVABLE );
        pG.fillRect( mScreenX,
                     mScreenY,
                     mCellWidth,
                     mCellHeight );

        // Draw Dude "down"
        pG.setColor( mColorDraw );
        draw( pG, 1, 1, true );
    }

    public final void draw( final Object pGraphics )
    {
        final Graphics g = (Graphics) pGraphics;

        // Draw Dude
        g.setColor( mColorDraw );
        draw( g, 1, 1, false );
    }

    static final int getBorderColor( final int pColor, final boolean pDarker )
    {
        int borderColor = pColor;
        final int change = COLOR_CHANGE_BORDER;

        for ( int shift = 16; shift >= 0; shift -= 8 )
        {
            final int mask = 0xFF << shift;
            int component = ( pColor & mask ) >> shift;

            if ( pDarker )
            {
                component -= change;
                component = ( component < 0x00 ) ? 0x00 : component;
            }
            else
            {
                component += change;
                component = ( component > 0xFF ) ? 0xFF : component;
            }

            borderColor &= ~mask;
            borderColor |= component << shift;
        }

        return borderColor;
    }

    protected abstract void draw( final Graphics pG, final int pOffsetX,
                                  final int pOffsetY, final boolean pRemovable );
}


text:
@interface ESCColorPickerModelTest : XCTestCase

@property (nonatomic) ESCColorPickerModel *testObject;
@property (nonatomic) id mockObserver;

@end

@implementation ESCColorPickerModelTest

- (void)setUp {
    [super setUp];

	self.testObject = [[ESCColorPickerModel alloc] init];
	self.testObject.hue = 0.2;
	self.testObject.saturation = 0.3;
	self.testObject.brightness = 0.4;
	self.mockObserver = [OCMockObject niceMockForProtocol:@protocol(ESCColorPickerModelObserver)];
	[self.testObject escAddObserver:self.mockObserver];
}

- (void)testModelSendsEventForHueChange {
	[[[self.mockObserver expect] andDo:^(NSInvocation *invocation) {
		XCTAssertEquals(self.testObject.hue, 0.76f, @"Hue should be set correctly before event is fired");
	}] colorDidChange];

	self.testObject.hue = 0.76;

	[self.mockObserver verify];
}

- (void)testModelSendsEventForSaturationChange {
	[[[self.mockObserver expect] andDo:^(NSInvocation *invocation) {
		XCTAssertEquals(self.testObject.saturation, 0.52f, @"Saturation should be set correctly before event is fired");
	}] colorDidChange];

	self.testObject.saturation = 0.52;

	[self.mockObserver verify];
}

- (void)testModelSendsEventForBrightnessChange {
	[[[self.mockObserver expect] andDo:^(NSInvocation *invocation) {
		XCTAssertEquals(self.testObject.brightness, 0.23f, @"Brightness should be set correctly before event is fired");
	}] colorDidChange];

	self.testObject.brightness = 0.23;

	[self.mockObserver verify];
}

- (void)testModelSendsDescriptionEventWhenColorChanges {
	[[self.mockObserver expect] colorDescriptionDidChangeKeys:@[@"H", @"S", @"B"] values:@[@"0.500", @"0.300", @"0.400"]];
	self.testObject.hue = 0.5;
	[self.mockObserver verify];

	[[self.mockObserver expect] colorDescriptionDidChangeKeys:@[@"H", @"S", @"B"] values:@[@"0.500", @"0.600", @"0.400"]];
	self.testObject.saturation = 0.6;
	[self.mockObserver verify];

	[[self.mockObserver expect] colorDescriptionDidChangeKeys:@[@"H", @"S", @"B"] values:@[@"0.500", @"0.600", @"0.129"]];
	self.testObject.brightness = 0.129;
	[self.mockObserver verify];
}

- (void)testModelSendsDescriptionEventWhenColorFormatChanges {
	[[self.mockObserver expect] colorDescriptionDidChangeKeys:@[@"R", @"G", @"B"] values:@[@"0.376", @"0.400", @"0.280"]];
	self.testObject.descriptionFormat = ESCColorPickerModelDescriptionFormatRGB;
	[self.mockObserver verify];

	[[self.mockObserver expect] colorDescriptionDidChangeKeys:@[@"#"] values:@[@"5F6647"]];
	self.testObject.descriptionFormat = ESCColorPickerModelDescriptionFormatRGBHex;
	[self.mockObserver verify];

	[[self.mockObserver expect] colorDescriptionDidChangeKeys:@[@"H", @"S", @"B"] values:@[@"0.200", @"0.300", @"0.400"]];
	self.testObject.descriptionFormat = ESCColorPickerModelDescriptionFormatHSB;
	[self.mockObserver verify];
}

@end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Women's immune systems hold the secret to longer life  - Telegraph</title>

<meta name="description" content="Women may live longer, healthier lives than men because their immune systems
  age more slowly, researchers have found." />

<meta name="keywords" content="Science News,Science" />

<link rel="shortcut icon" href="/favicon.ico?v=1.2">
			<meta name="tmgads.zone" content="science.science-news" />
<meta name="tmgads.channel" content="science" />
<meta name="tmgads.section" content="science-science_news" />

<meta name="tmgads.articleid" content="10056901" />
<meta name="tmgads.pagetype" content="story" />
<meta name="tmgads.level" content="3" />
<meta name="tmgads.otherdata" content="" />

<meta name="tmgads.geo" content="DK" />

<meta name="section-id" content="4137" />

<meta name="last-modified" content="2013-05-15" />
		<meta name="article-id" content="10056901" />
		<meta name="title" content="Women's immune systems hold the secret to longer life " />
		<meta name="GSAMLC" content="science/sciencenews" />
<meta name="GSAChannel" content="science" />

<meta name="GSAChannelName" content="Science" />

<meta name="GSACategory" content="sciencenews" />
	<meta name="GSASectionUniqueName" content="science-science_news" />

<meta name="GSAArticleType" content="Story" />
	<meta name="DC.date.issued" content="2013-05-15" />
<meta name="robots" content="noarchive,noodp" />
	<meta property="fb:app_id" content="120118784736295" />
<meta property="fb:admins" content="686953094,531239902,100002344351237" />

<meta property="og:description" content="Women may live longer, healthier lives than men because their immune systems   age more slowly, researchers have found." />
<meta property="og:site_name" content="Telegraph.co.uk" />
<meta property="og:title" content="Women's immune systems hold the secret to longer life  - Telegraph" />
<meta property="og:url" content="http://www.telegraph.co.uk/science/science-news/10056901/Womens-immune-systems-hold-the-secret-to-longer-life.html" />

<meta property="og:image" content="http://i.telegraph.co.uk/multimedia/archive/02562/lymphocytes_2562654k.jpg" />
<meta property="og:type" content="article" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@Telegraph" />

<meta name="twitter:creator" content="@chalkmark" />
<link rel="canonical" href="http://www.telegraph.co.uk/science/science-news/10056901/Womens-immune-systems-hold-the-secret-to-longer-life.html"/>

<link rel="stylesheet" type="text/css" href="/template/ver1-0/css/screen.css" media="screen" />
 <link href='http://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>

<link rel="stylesheet" type="text/css" href="/template/ver1-0/css/tracker.css" media="screen" />
 <link href='http://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/template/ver1-0/templates/fragments/common/tmglBrandCSS.jsp" media="screen" />

<link rel="alternate" type="application/rss+xml" title="RSS Feed for Science News articles - Telegraph.co.uk" href="http://www.telegraph.co.uk/science/science-news/rss" />

		<meta name="DCSext.MLC" content="/science/science-news" />
	<meta name="DCSext.Category" content="science-news" />
							<meta name="WT.cg_s" content="science-news" />
						<meta name="DCSext.Channel" content="science" />
					<meta name="WT.cg_n" content="science" />
						<meta name="DCSext.Content_Type" content="Story" />
    <meta name="DCSext.Level" content="3" />
	<meta name="DCSext.author" content="Richard Gray" />
			<meta name="DCSext.articleFirstPublished" content="2013-05-14" />
	<meta name="DCSext.articleId" content="10056901" />

			<meta name="DCSext.cf" content="1"/>
			  	<meta name="DCSext.pd" content="1"/>

<link rel="stylesheet" type="text/css" href="/template/ver1-0/css/subscriber.css" media="screen" />

Accessibility links

Skip to article

Skip to navigation

Advertisement

Telegraph.co.uk

	<form name="tg_search" id="tg_search" method="get" action="/search/">
		<input type="text" class="searchBox google" name="queryText" value="" size="19" tabindex="1"  />
		<input type="submit" class="formSubmit" tabindex="2" id="go" name="Search" value="" alt="Search" />
	</form>

		Tuesday 28 May 2013

Home

News

World

Sport

Finance

Comment

Blogs

Culture

Travel

Life

Fashion

Tech

					Dating

					Offers

					Jobs

Politics

Obits

Education

Earth

Science

Defence

Health

Scotland

Royal

Celebrities

Weird

Science News

Space

Night Sky

Roger Highfield

Dinosaurs

Evolution

Steve Jones

Science Picture Galleries

Home»

Science»

Science News

Women's immune systems hold the secret to longer life

Women may live longer, healthier lives than men because their immune systems
  age more slowly, researchers have found.

											The number of T-cell and B-cell lymphocytes decline faster in men Photo: Alamy

							By
											Richard Gray, Science Correspondent

7:01AM BST 15 May 2013

				Comments

A new study has shown that levels of key white blood cells, which are
  responsible for fighting off infections, become lower in men as they get
  older compared to women.

The average life expectancy for men in the UK is 79 years old, while for women
  it is 82 years old. In some parts of the world, such as Japan, the gap is
  even larger, with women living on average nearly six years longer.

There have been a number of theories for why this may be, including a recent
  finding that the tiny “power cells” that produce energy for their cells tend
  to have fewer faults than in men.

Scientists in Japan have now uncovered another reason after finding that the
  levels of white blood cells and other parts of the immune system called
  cytokines decline faster in men.

They believe this might be because female sex hormones such as oestrogen can
  boost the immune system’s response to infections.

Related Articles

			We need to relearn the art of dying

	18 May 2013

			Why women live longer than men

	03 Aug 2012

			Why do men die younger than women?

	13 Jun 2011

			Men 'live longer' if they marry younger woman

	02 Jun 2009

The work could now help scientists predict the "biological age" of
  people based on the state of their immune system.

Professor Katsuiku Hirokawa, who led the research at Tokyo Medical &
  Dental University, said: "Because people age at different rates, a
  person's immunological parameters could be used to provide an indication of
  their true biological age."

The scientists, whose research is published in the journal Immunity
  and Ageing, examined the blood of 356 men and women aged between 20
  and 90 years old.

They looked at levels of white blood cells and cytokines, which help to carry
  messages in the immune system.

In both sexes the number of white blood cells decreased with age, but two key
  elements – known as the T-cell and B-cell lymphocytes, declined faster in
  men.

Both of these white blood cells are involved in fighting off bacterial
  infections.

They also found that another type of cell that tackles viruses and tumours
  increased with age, with women having a higher rate of increase than men.

They also found that men showed a decline in two types of cytokines that help
  to keep the immune system under control and prevent inflammation from
  damaging surrounding tissue.

Professor Hirokawa added: “It is well known that ageing is associated with a
  decline in the normal function of the immune system, leading to increased
  susceptibility to various diseases and shortened longevity.

“However, specific dysfunctions in the immune system directly responsible for
  this have yet to be identified.

“Among the important factors, T cells are central to the immune response, and
  their function is significantly altered with increasing age."

Science News

News »

Science »

Health »

Health News »

Richard Gray »

In Science News

			Apollo 11 engines recovered

			Designs of the Year 2013

			Bug-eyed macro photos

			ALMA telescope project

			Life on Mars

Advertisement

telegraphuk

		Please enable JavaScript to view the comments powered by Disqus.
		blog comments powered by Disqus

Advertisement

					More from the web

            Loading

Advertisement

					More from the web

            Loading

Science Most Viewed

							TODAY

							PAST WEEK

							PAST MONTH

Time-lapse: Mars Rover's nine-month mission condensed into 60 seconds

Gene screening to 'fundamentally change' understanding of childhood disorders

Breakthrough hair loss product works on stem cells

Dropping in on Mars: new Nasa video shows touch-down of Curiosity rover

Nasa's advice on asteroid hitting Earth: pray

US scientists unveil new IQ measure: take the test

Painting through the power of thought enabled by scientists

Major Tim puts an end to Britain's space oddity

Breakthrough hair loss product works on stem cells

Prime number breakthrough by unknown professor

Grey hair 'a thing of the past' after scientists discover why follicles become discoloured

Sperm cells created from female embryo

International Space Station ammonia leak 'very serious'

Astronaut Chris Hadfield returns to Earth

US scientists unveil new IQ measure: take the test

Advertisement

					More from The Telegraph

            Loading

				Engineering Jobs

						Apply Now: Chief Executive - Engineering

						View

				Telegraph Jobs

						Apply Now:  Policy Advisor - Transport

						View

				Telegraph Courses

						Free Prince2 and Agile project management training

						View

				Interview Skills

						Expert interview skills training

						View

Back to top

HOME

News

World News

Obituaries

Travel

Health

Jobs

Sport

Football

Cricket

Fantasy Rugby

Culture

Motoring

Dating

Finance

Personal Finance

Economics

Markets

Fashion

Property

Crossword

Comment

Blogs

My Telegraph

Letters

Technology

Gardening

Telegraph Journalists

Contact Us

Privacy and Cookies

Advertising

Fantasy Football

Tickets

Announcements

Reader Prints

Follow Us

Apps

Epaper

Expat

Promotions

Subscriber

Syndication

© Copyright of Telegraph Media Group Limited 2013

Terms and Conditions

Today's News

Archive

Style Book

Weather Forecast

<link rel="stylesheet" type="text/css" href="/template/ver1-0/css/printArticle.css" media="print" />


text:
package akka.systemActors;

import static akka.pattern.Patterns.ask;

import java.time.Duration;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import akka.ActorFactory;
import akka.actor.ActorSystem;
import akka.basicActors.LoggingMode;
import akka.systemMessages.StartMessage;
import akka.testkit.TestActorRef;
import topology.ActorTopology;

/**
 * ActorMonitor Test
 *
 * @author bytschkow
 */
@SuppressWarnings("unused")
public class ActorMonitorTest {

    public ActorMonitor actorMonitor;
    public ActorSystem actorSystem;
    public TestActorRef<ActorMonitor> actorMonitorRef;
    private ActorTopology actorTopology;
    final int maxTimeStep = 10;

	@Before
    public void setUp() {

		/** TODO - a lot of refactoring was ongining. This Test wont execute and need to be fixed.

        actorTopology = new ActorTopology("TestSystem");
        actorTopology.addActor("/user/ActorSupervisor/Child", ActorFactory.createPlainActor());

        actorSystem  = ActorSystem.create("TestSystem");
        actorSystem.actorOf(ActorSupervisor.create("TestSystem", LoggingMode.UNIT_TEST, actorTopology), "ActorSupervisor");

        actorMonitorRef = TestActorRef.create(actorSystem, ActorMonitor.create(LoggingMode.UNIT_TEST), "ActorMonitor");
        actorMonitor = actorMonitorRef.underlyingActor();
        actorMonitor.operationMode = LoggingMode.UNIT_TEST;

        @SuppressWarnings("unused")
		CompletableFuture<Void> future =
			    ask(actorSystem.actorSelection("/user/ActorMonitor"), "Inbox intitialize",
			    		Duration.ofSeconds(1)).toCompletableFuture().thenAccept(s -> {});

        // If future is done, the system is initiated.

        System.out.println("setUp()");
        */
    }

    @Test
    public void testIncrementTimeStep() throws Exception {
        actorMonitor.setCurrentTimeStep(10);
        actorMonitor.setLastTimeStep(11);
        actorMonitor.startNewTimeStep();
        Assert.assertEquals(11, actorMonitor.getCurrentTimeStep());
    }

    @Test
    public void testIncrementTimeStepMaxReached() throws InterruptedException {
        actorMonitor.setCurrentTimeStep(8);
    	actorMonitor.setLastTimeStep(10);
        actorMonitor.startNewTimeStep();
        Assert.assertEquals(9, actorMonitor.getCurrentTimeStep());

        actorMonitor.startNewTimeStep();
        Assert.assertEquals(10, actorMonitor.getCurrentTimeStep());

        actorMonitor.startNewTimeStep();
        Assert.assertEquals(10, actorMonitor.getCurrentTimeStep());
    }

	@Test
    public void testBroadcastTimeStep() {
    	TestActorRef<ActorSupervisor> gridActorSupervisorRef = TestActorRef.create(actorSystem, ActorSupervisor.create("TestSystem", LoggingMode.UNIT_TEST, actorTopology), "GridActorSupervisor");
        ActorSupervisor gridActorSupervisor = gridActorSupervisorRef.underlyingActor();
        actorMonitor.setLastTimeStep(100);
        actorMonitor.setCurrentTimeStep(2);

        //actorMonitor.broadcastTimeStep();
        Assert.assertEquals(2, gridActorSupervisor.getCurrentTimeStep());
    }

	@Test
    public void testLoggingTypes() {
        Assert.assertEquals(LoggingMode.UNIT_TEST, actorMonitor.operationMode);
        TestActorRef<ActorMonitor> actorMonitorProductionRef =  TestActorRef.create(actorSystem, ActorMonitor.create(LoggingMode.PRODUCTION), "TestActorMonitorProduction");
        ActorMonitor actorMonitorProduction = actorMonitorProductionRef.underlyingActor();
        Assert.assertEquals(LoggingMode.PRODUCTION, actorMonitorProduction.operationMode);
    }

	@Test
    public void testStartSimulation() {

        actorMonitor.setLastTimeStep(10);
        actorMonitor.setCurrentTimeStep(0);

        // Systen simulation
        CompletableFuture<Void> future =
			    ask(actorSystem.actorSelection("/user/ActorMonitor"),
			    		new StartMessage(0, 10),
			    		Duration.ofSeconds(5)).toCompletableFuture().thenAccept(s -> {});

		try {
			future.get(); // blocking, i.e. it waits until the topology is created

			Assert.assertEquals(10, actorMonitor.getCurrentTimeStep());

			System.out.println("SimulationStarter: Simulation completed. Terminating system.");
			actorSystem.terminate();

		} catch (InterruptedException | ExecutionException e) {
			e.printStackTrace();
		}
    }

    @After
    public void tearDown() {
        actorSystem.terminate();
        System.out.println("ActorMonitorTest tearDown(), i.e. terminate()");
    }
}


text:
import {action} from '../utils/actionUtils'

const SCREEN_RESIZE = 'SCREEN_RESIZE'
export const screenResize = (vw, vh) => action(SCREEN_RESIZE, {vw, vh})


text: /* This test will have to be run last so user isn't left logged in */


text:
/**
 * @author Zail
 * @email zzzzail@163.com
 * @date 2017/7/30
 * @description APP 初始化
 *
 */

const os = require('os')
const mongodb = require('../libs/mongodb')
const { keys, version, title, keywords, description, codeFooter } = require('../config/app')

module.exports = function(app) {

  app.keys = keys

  app.use(async(ctx, next) => {
    ctx.state.version = version
    ctx.state.site = {
      title,
      keywords,
      description,
      codeFooter
    }
    ctx.state.moment = require('moment')
    await next()
  })

  app.use(async(ctx, next) => {
    try {
      await next()
    } catch (err) {
      console.log(err)
      ctx.status = 500
      return ctx.body = {
        code: ctx.status,
        message: err.message
      }
    }

    if (parseInt(ctx.status) === 404) {
      return ctx.body = '404 链接不存在!'
    }
  })

}


text:
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package};

import com.google.common.annotations.VisibleForTesting;

/**
 * The main class for the CS410J airline Project
 */
public class Project1 {

  @VisibleForTesting
  static boolean isValidDateAndTime(String dateAndTime) {
    return true;
  }

  public static void main(String[] args) {
    Flight flight = new Flight();  // Refer to one of Dave's classes so that we can be sure it is on the classpath
    System.err.println("Missing command line arguments");
    for (String arg : args) {
      System.out.println(arg);
    }
  }

}


text:
<?php

namespace Boomstone\Controller;

use Silex\ControllerProviderInterface,
    Silex\ControllerCollection,
    Silex\Application;
use Symfony\Component\Form\FormError;
use Boomstone\Form;
use Boomstone\Document\User,
    Boomstone\Document\PasswordRequest;

/**
 * Lost controller provider.
 */
class Lost implements ControllerProviderInterface
{
    public function connect(Application $app)
    {
        $controllers = new ControllerCollection();

        /**
         * lost_access
         *
         * GET /lost/request
         * Lost password form
         */
        $controllers->get('/request', function () use ($app) {
            $form = $app['form.factory']->create(new Form\PasswordRequestType());
            return $app['twig']->render('Lost/request.html.twig', array('form' => $form->createView()));
        })->bind('lost_access');

        /**
         * access_request
         *
         * POST /lost/request
         * Lost password process
         */
        $controllers->post('/request', function () use ($app) {
            $form = $app['form.factory']->create(new Form\PasswordRequestType());
            $form->bindRequest($app['request']);

            if ($form->isValid()) {
                $data = $form->getData();

                $user = $app['boomgo']->get('User')->findOneByEmail($data['email']);

                if (null !== $user) {
                    $passwordRequest = new PasswordRequest();
                    $user->setPasswordRequest($passwordRequest);
                    $app['boomgo']->get('User')->save($user);

                    $recoverLink = $app['url_generator']->generate('access_recovery', array('token' => $passwordRequest->getToken()),true);

                    $message = \Swift_Message::newInstance()
                        ->setSubject('Retentio to the rescue')
                        ->setFrom($app['mailer.sender'])
                        ->setTo(array($user->getEmail()))
                        ->setBody('You seems to have lost your password, click here to recover: '.$recoverLink);
                    $app['mailer']->send($message);

                    $app['session']->setFlash('success', $app['translator']->trans('An email has been sent with the access recovery instructions', array(), 'flash'));

                    return $app->redirect($app['url_generator']->generate('homepage'));
                }
            }
            return $app['twig']->render('Lost/request.html.twig', array('form' => $form->createView()));
        })->bind('access_request');

        /**
         * access_recovery
         *
         * Get /lost/recovery/{token}
         * Access recovery form
         */
        $controllers->get('/recovery/{token}', function($token) use ($app) {
            $user = $app['boomgo']->get('User')->findOneByRecoveryToken($token);

            if (null === $user) {
                return $app->redirect($app['url_generator']->generate('homepage'));
            }

            $form = $app['form.factory']->create(new Form\PasswordRecoveryType());

            return $app['twig']->render('Lost/recovery.html.twig', array('form' => $form->createView()));
        })->bind('access_recovery');

        /**
         * password_recover
         *
         * POST /lost/recovery/{token}
         * Access recovery process
         */
        $controllers->post('/recovery/{token}', function($token) use ($app) {
            $user = $app['boomgo']->get('User')->findOneByRecoveryToken($token);

            if (null === $user) {
                return $app->redirect($app['url_generator']->generate('homepage'));
            }

            $form = $app['form.factory']->create(new Form\PasswordRecoveryType());
            $form->bindRequest($app['request']);

            if ($form->isValid()) {
                $data = $form->getData();

                if ($data['email'] !== $user->getEmail()) {
                    $form->addError(new FormError($app['translator']->trans('Sorry, this email does not correspond to your account', array(), 'form')));
                }

                if ($data['password'] !== $data['password2']) {
                    $form->addError(new FormError($app['translator']->trans('Passwords must be similar', array(), 'form')));
                }

                if (!$form->hasErrors()) {
                    $user->resetPasswordRequest(\Boomstone\Utils\Toolbox::encode($data['password'], $user->getSalt()));
                    $app['boomgo']->get('User')->save($user);
                    return $app->redirect($app['url_generator']->generate('signin'));
                }
            }

            return $app['twig']->render('Lost/recovery.html.twig');
        })->bind('access_recover');;

        return $controllers;
    }
}


text:
<?php

namespace Mautic\Tests\Api;

class ListsTest extends MauticApiTestCase
{
    public function testAddAndRemove()
    {
        $listApi = $this->getContext('lists');
        $result  = $listApi->addLead(1, 1);

        $message = isset($result['error']) ? $result['error']['message'] : '';
        $this->assertFalse(isset($result['error']), $message);

        //now remove the lead from the segment
        $result = $listApi->removeLead(1, 1);

        $message = isset($result['error']) ? $result['error']['message'] : '';
        $this->assertFalse(isset($result['error']), $message);
    }
}


text:
using OpenTK.Graphics.OpenGL;
using System;
using System.Drawing;

namespace GameCore.Rendering.Text
{
	[Obsolete]
	sealed class GL12TextOutputProvider : GL1TextOutputProvider
	{
		#region Fields

		TextQuality quality;
		GlyphCache cache;

		#endregion

		#region Constuctors

		public GL12TextOutputProvider(TextQuality quality)
		{
			this.quality = quality;

			cache = new GlyphCache<Texture2D>();
		}

		#endregion

		protected override void SetBlendFunction()
		{
			GL.BlendFunc(BlendingFactorSrc.ConstantColorExt, BlendingFactorDest.OneMinusSrcColor);
		}

		protected override void SetColor(Color color)
		{
			GL.Color3(Color.White);
			GL.BlendColor(color);
		}

		protected override TextQuality TextQuality
		{
			get
			{
				return quality;
			}
		}

		protected override GlyphCache Cache
		{
			get
			{
				return cache;
			}
		}
	}
}


text:
#ifndef STROMX_RUNTIME_IMPL_XMLUTILITES_H
#define STROMX_RUNTIME_IMPL_XMLUTILITES_H

#include <xercesc/util/XMLString.hpp>
#include "stromx/runtime/Exception.h"

namespace stromx
{
    namespace runtime
    {
        class Version;

        namespace impl
        {
            class XmlError : public Exception
            {
            public:
                XmlError(const std::string & message = "XmlError")
                : Exception(message)
                {}
            };

            class Str2Xml
            {
            public:
                explicit Str2Xml(const char* const str);
                ~Str2Xml();

                operator const XMLCh*();

            private:
                XMLCh* m_xmlStr;
            };

            class Xml2Str
            {
            public:
                explicit Xml2Str(const XMLCh* const str);
                ~Xml2Str();

                operator const char*();

            private:
                char* m_str;
            };

            class XmlUtilities
            {
            public:
                static const std::string computePath(const std::string & filepath);
                static const std::string computeName(const std::string & filepath);
                static const std::string stripExtension(const std::string & filename);
                static const std::string computeExtension(const std::string & filename);
            };
        }
    }
}

#endif // STROMX_RUNTIME_IMPL_XMLUTILITES_H


text:
export const enum TerminalStorageKeys {
	NeverMeasureRenderTime = 'terminal.integrated.neverMeasureRenderTime',
	SuggestedRendererType = 'terminal.integrated.suggestedRendererType',
	TabsListWidthHorizontal = 'tabs-list-width-horizontal',
	TabsListWidthVertical = 'tabs-list-width-vertical',
	EnvironmentVariableCollections = 'terminal.integrated.environmentVariableCollections',
	TerminalBufferState = 'terminal.integrated.bufferState',
	TerminalLayoutInfo = 'terminal.integrated.layoutInfo',
	PinnedRecentCommandsPrefix = 'terminal.pinnedRecentCommands'
}


text:
/*
 * Open Source Software published under the Apache Licence, Version 2.0.
 */

package io.github.vocabhunter.analysis.simple;

import io.github.vocabhunter.analysis.model.Analyser;
import io.github.vocabhunter.analysis.model.AnalysisResult;
import io.github.vocabhunter.analysis.model.WordUse;

import java.text.BreakIterator;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import javax.inject.Singleton;

import static io.github.vocabhunter.analysis.core.CoreConstants.LOCALE;
import static java.util.stream.Collectors.groupingBy;

@Singleton
public class SimpleAnalyser implements Analyser {
    private static final Pattern SPACE_PATTERN = Pattern.compile("[\\t\\n\\x0B\\f\\r]\\s*|\\s\\s+");

    @Override
    public AnalysisResult analyse(final String text, final String name) {
        List<String> lines = splitToList(text);
        Map<String, WordUse> map = IntStream.range(0, lines.size())
            .parallel()
            .boxed()
            .flatMap(i -> lineRecords(lines, i))
            .collect(groupingBy(AnalysisRecord::normalised, new AnalysisCollector()));
        List<WordUse> uses = map.values().stream()
            .sorted(WordStreamTool.WORD_COMPARATOR)
            .toList();

        return new AnalysisResult(name, uses, lines);
    }

    private Stream<AnalysisRecord> lineRecords(final List<String> lines, final Integer index) {
        String line = lines.get(index);

        return WordStreamTool.words(line)
            .map(w -> new AnalysisRecord(w, index));
    }

    private List<String> splitToList(final String text) {
        List<String> list = new ArrayList<>();
        BreakIterator iterator = BreakIterator.getSentenceInstance(LOCALE);
        iterator.setText(text);
        int start = iterator.first();
        int end = iterator.next();

        while (end != BreakIterator.DONE) {
            String line = text.substring(start, end).trim();

            if (!line.isEmpty()) {
                list.add(SPACE_PATTERN.matcher(line).replaceAll(" "));
            }
            start = end;
            end = iterator.next();
        }

        return list;
    }
}


text:
brew_softwares_file='./brew/brew.list'
for i in $(cat ${brew_softwares_file}); do brew install $i; done
brew cleanup


text:
package org.kuali.kfs.gl.businessobject.inquiry;

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

import org.kuali.kfs.gl.Constant;
import org.kuali.kfs.gl.businessobject.Balance;
import org.kuali.kfs.sys.KFSConstants;
import org.kuali.kfs.sys.KFSPropertyConstants;
import org.kuali.kfs.sys.businessobject.SystemOptions;
import org.kuali.kfs.sys.context.SpringContext;
import org.kuali.kfs.sys.service.OptionsService;
import org.kuali.rice.kns.service.BusinessObjectDictionaryService;
import org.kuali.rice.krad.service.LookupService;

/**
 * This class is used to generate the URL for the user-defined attributes for available account balace screen. It is entended the
 * AbstractGeneralLedgerInquirableImpl class, so it covers both the default implementation and customized implemetnation.
 */
public class AccountBalanceInquirableImpl extends AbstractGeneralLedgerInquirableImpl {
    private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AccountBalanceInquirableImpl.class);

    private BusinessObjectDictionaryService dataDictionary;
    private LookupService lookupService;
    private Class businessObjectClass;

    /**
     * Builds the keys for this inquiry.
     * @return a List of Strings, holding the keys of this inquiry
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#buildUserDefinedAttributeKeyList()
     */
    protected List buildUserDefinedAttributeKeyList() {
        List keys = new ArrayList();

        keys.add(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR);
        keys.add(KFSPropertyConstants.ACCOUNT_NUMBER);
        keys.add(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
        keys.add(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
        keys.add(KFSPropertyConstants.OBJECT_CODE);
        keys.add(KFSPropertyConstants.SUB_OBJECT_CODE);
        keys.add(Constant.CONSOLIDATION_OPTION);
        keys.add(Constant.PENDING_ENTRY_OPTION);

        return keys;
    }

    /**
     * The addition of user attributes - current budget, actual budget, and encumbrance balance
     * @return a Map of user defined attributes
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getUserDefinedAttributeMap()
     */
    protected Map getUserDefinedAttributeMap() {
        Map userDefinedAttributeMap = new HashMap();

        OptionsService os = SpringContext.getBean(OptionsService.class);
        SystemOptions o = os.getCurrentYearOptions();

        userDefinedAttributeMap.put(KFSPropertyConstants.CURRENT_BUDGET_LINE_BALANCE_AMOUNT, Constant.BALANCE_TYPE_CB);
        userDefinedAttributeMap.put(KFSPropertyConstants.ACCOUNT_LINE_ACTUALS_BALANCE_AMOUNT, o.getActualFinancialBalanceTypeCd());
        userDefinedAttributeMap.put(KFSPropertyConstants.ACCOUNT_LINE_ENCUMBRANCE_BALANCE_AMOUNT, KFSConstants.AGGREGATE_ENCUMBRANCE_BALANCE_TYPE_CODE);

        return userDefinedAttributeMap;
    }

    /**
     * Changes the name of attributes on the fly...in this case, doesn't do anything
     * @param attributeName the attribute to rename
     * @return a String with the new attribute name
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getAttributeName(java.lang.String)
     */
    protected String getAttributeName(String attributeName) {
        return attributeName;
    }

    /**
     * If the key name sent in represents an "exclusive field", returns "" as the key value
     * @param keyName the name of the key that may be changed
     * @param keyValue the value of the key that may be changed
     * @return an Object with the perhaps modified value for the key
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getKeyValue(java.lang.String, java.lang.Object)
     */
    protected Object getKeyValue(String keyName, Object keyValue) {
        if (isExclusiveField(keyName, keyValue)) {
            keyValue = "";
        }
        return keyValue;
    }

    /**
     * Justs returns the key name given
     * @param keyName a key name
     * @return the key name given
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getKeyName(java.lang.String)
     */
    protected String getKeyName(String keyName) {
        return keyName;
    }

    /**
     * Return a Spring bean for the drill up lookup, which is the balance lookup
     * @return the name of the Spring bean of the lookup
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getLookupableImplAttributeName()
     */
    protected String getLookupableImplAttributeName() {
        return Constant.GL_LOOKUPABLE_BALANCE;
    }

    /**
     * Return the page name of this lookup
     * @return the page name for inquiry options
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getBaseUrl()
     */
    protected String getBaseUrl() {
        return KFSConstants.GL_BALANCE_INQUIRY_ACTION;
    }

    /**
     * Retrieves the business class to use as the basis of an inquiry for the given attribute; in this case, it's always Balance
     * @param attributeName the name to build the inquiry link to
     * @return the Class of the business object that should be inquired on
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getInquiryBusinessObjectClass(String)
     */
    protected Class getInquiryBusinessObjectClass(String attributeName) {
        return Balance.class;
    }

    /**
     * Addes the lookup impl and balance type attributes to the parameters
     * @param parameter the parameters used in the lookup
     * @param attributeName the attribute name that an inquiry URL is being built for
     * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#addMoreParameters(java.util.Properties, java.lang.String)
     */
    protected void addMoreParameters(Properties parameter, String attributeName) {
        parameter.put(KFSConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME, getLookupableImplAttributeName());
        parameter.put(Constant.AMOUNT_VIEW_OPTION, Constant.MONTHLY);

        String balanceTypeCode = (String) getUserDefinedAttributeMap().get(getAttributeName(attributeName));
        parameter.put(KFSPropertyConstants.BALANCE_TYPE_CODE, balanceTypeCode);
    }
}


text:
require_relative '../../../../../lib/objects/local_string_generator.rb'
class StorageDirectoryGenerator < StringGenerator
  def initialize
    super
    self.module_name = 'Storage Directory Generator'
  end

  def generate
    # TODO: Fix the creation of subdirectories in puppet (nfs + smb) then re-introduce filler_path.
    # current_date_time = Time.now.strftime("%d-%m-%Y--%H%M")
    # random_number = rand(1..99)
    # filler_path = [ "/#{current_date_time}", "/files_#{random_number}", ''].sample

    directory_name = %w(exports repository files storage).sample

    full_path = '/' + directory_name # + filler_path
    self.outputs << full_path
  end
end

StorageDirectoryGenerator.new.run


text:
@{
    RootModule = 'XD7Common.psm1'
    ModuleVersion = '1.0'
    GUID = '68e21726-3708-4ec2-828f-e1a00799fb0e'
    Author = 'Iain Brighton'
    CompanyName = 'Virtual Engine'
    Copyright = '(c) 2015 Virtual Engine Limited. All rights reserved.'
    Description = 'Citrix XenDesktop 7.x Common DSC Resource library'
    PowerShellVersion = '4.0'
    FunctionsToExport = '*'
    CmdletsToExport = '*'
    VariablesToExport = '*'
    AliasesToExport = '*'
}


text:
"""
This module parses course textbook information from the `UCSD Bookstore's website <http://bookstore.ucsd.edu/>`_.

:copyright: (c) 2010 by Christopher Rebert.
:license: MIT, see :file:`LICENSE.txt` for more details.
"""

from decimal import Decimal

from triton_scraper.fetchparse import make_tree4url
from triton_scraper.util import *
from triton_scraper import config

class BookList(object):
    def __init__(self, required=None, optional=None, as_soft_reserves=False, unknown=False):
        #: Required books
        #:
        #: :type: list of :class:`Book`-s
        self.required = required or []
        #: Optional books
        #:
        #: :type: list of :class:`Book`-s
        self.optional = optional or []
        #: Is a course reader from A.S. Soft Reserves required?
        #:
        #: :type: bool
        self.as_soft_reserves = as_soft_reserves
        #: Indicates whether the UCSD Bookstore has yet to receive a booklist for the associated course
        #:
        #: :type: bool
        self.unknown = unknown

    def __repr__(self):
        if self.unknown:
            return "The UCSD Bookstore has not yet been given a book list."
        requireds = ["Required:"] + self.required
        if self.as_soft_reserves:
            requireds.append("Custom reader from A.S. Soft Reserves")
        requireds = "\n\t".join(str(entry) for entry in requireds)
        optionals = "\n\t".join(str(entry) for entry in ["Optional:"]+self.optional)
        string = '\n'.join([(requireds if self.any_required else ''), (optionals if self.optional else '')])
        return string

    @property
    def any_required(self):
        """Are any materials on this booklist required?

        :type: bool
        """
        return self.as_soft_reserves or self.required

    def add_book(self, book, required):
        """Add the given *book* to the booklist.

        :param book: textbook to add
        :type book: :class:`Book`
        :param required: is the textbook required?
        :type required: bool
        """
        (self.required if required else self.optional).append(book)

class Book(object):
    """Textbook from the UCSD Bookstore."""
    __FORMAT = u'ISBN {0.isbn}: "{0.title}" by {0.author}; ${0.used_price} Used, ${0.new_price} New; '
    def __init__(self, isbn, new_price=NaN, used_price=NaN, title='', author=''):
        #: Author of book
        #:
        #: :type: string
        self.author = author
        #: Title of book
        #:
        #: :type: string
        self.title = title
        #: International Standard Book Number
        #:
        #: :type: string
        self.isbn = isbn
        #: Price of a new copy at the UCSD Bookstore; NaN if new copies unavailable.
        #:
        #: :type: :class:`decimal.Decimal`
        self.new_price = new_price
        #: Price of a used copy at the UCSD Bookstore; NaN if used copies unavailable.
        #:
        #: :type: :class:`decimal.Decimal`
        self.used_price = used_price

    def __repr__(self):
        return self.__FORMAT.format(self).encode('utf8')

book_cells = XPath(RELATIVE_PREFIX+"/table[@border='1']/tr/td/font[not(@align='right')]")
discounted_price = XPath(RELATIVE_PREFIX+"/font[@color='#008000']")
def _availability2price(availability): # New Books, In Stock, Retail Price: $62.50
    return Decimal(availability.split("$")[1]) if config.IN_STOCK in availability else NaN
def _skipping_availability_side_headers(cells):
    for cell in cells:
        if cell.text:
            yield cell
def books_on(bookstore_url_from_tritonlink):
    """Returns book list based on the given course page at the UCSD Bookstore's website.

    :param bookstore_url_from_tritonlink: UCSD Bookstore website URL for a course section
    :type bookstore_url_from_tritonlink: string
    :rtype: :class:`BookList`
    """
    url = bookstore_url_from_tritonlink.replace("https", "http", 1)
    tree, _url = make_tree4url()(url)
    booklist = BookList()
    for sextuple in grouper(6, _skipping_availability_side_headers(book_cells(tree))):
        if config.LACK_BOOK_LIST in sextuple[0].text:# No book list
            return BookList(unknown=True)
        _sections, _instructor, required, author, title_comma_isbn = (cell.text for cell in sextuple[:5])
        availability = sextuple[-1]
        required = required == config.REQUIRED_BOOK_CODE
        title, isbn = title_comma_isbn.rsplit(", ", 1) # Principles Of General Chemistry, 2 Edition, 9780077470500
        if config.NO_TEXTBOOK_REQUIRED in title:
            return BookList(required=[])
        if config.AS_SOFT_RESERVES in title:
            booklist.as_soft_reserves = True
            continue
        discounts = discounted_price(availability)
        if discounts:
            discount = discounts[0]
            if config.IN_STOCK not in availability.text:
                new = NaN
            else:
                # New Books, Not in Stock*, Retail Price: $65.70, Discounted Price: $21.03
                new = Decimal(discount.text[1:])#remove dollar sign
            used = discount.tail
        else:
            new, used = availability.text.split("\n")
            new = _availability2price(new)
        used = _availability2price(used)
        booklist.add_book(Book(isbn, new, used, title, author), required)
    return booklist


text:
SYNONYM

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

#### Published in
Meddn Soc. Fauna Flora fenn. 5: 23 (1879)

#### Original name
Coprinus lagopides P. Karst., 1879

### Remarks
null


text:
userAtHost() {
  echo $(id -nu)-at-$(hostname -s)
}

CONTAINER_PROPERTIES_PATH=''

update_container_props_path() {
  test -s "$CONTAINER_PROPERTIES_PATH" && return
  CONTAINER_PROPERTIES_PATH="$(find .. . -maxdepth 1 -name container.properties)"
  test "$CONTAINER_PROPERTIES_PATH" || CONTAINER_PROPERTIES_PATH=container.properties
  CONTAINER_PROPERTIES_PATH="$(readlink -f "$CONTAINER_PROPERTIES_PATH")"
  test -s "$CONTAINER_PROPERTIES_PATH" || { echo >&2 "Missing file '$CONTAINER_PROPERTIES_PATH'"; return ;}
  echo >> "$CONTAINER_PROPERTIES_PATH"
}

getprop_container() {
  local cprops="$CONTAINER_PROPERTIES_PATH"
  test -s "$cprops" && getprop "$cprops" "$1" && return
  local val="$(eval echo $2)"
  test "$val" || return
  cprops="${cprops:-container.properties}"
  echo $1=$val >> "$cprops" && echo $val
}

set_img_vars() {
  test $# -ge 2 || {
    printf 'Parameters:\n\nIMG_NAME\n<BUILD_NUMBER>\n<CHANGESET>\nIMG_REPO'
    return 1
  }

  echo >&2 "[set_img_vars] IMG_NAME: '$IMG_NAME'"
  echo >&2 "[set_img_vars] BUILD_NUMBER: '$BUILD_NUMBER'"
  echo >&2 "[set_img_vars] CHANGESET: '$CHANGESET'"
  echo >&2 "[set_img_vars] IMG_REPO: '$IMG_REPO'"

  update_container_props_path

  echo >&2 "[set_img_vars] JOB_NAME: '$JOB_NAME'"
  echo >&2 "[set_img_vars] IMG_NAME will be: '$(getprop_container IMG_NAME '$IMG_NAME' | tr '/ %' '.-.')'..."

  local IMG_NAME="${1:-$JOB_NAME}"; test $# -gt 0 && shift
  IMG_NAME="$(getprop_container IMG_NAME '$IMG_NAME' | tr '/ %' '.-.')"

  local IMG_BUILD_NUMBER="${1:-$BUILD_NUMBER}"; test $# -gt 0 && shift
  IMG_BUILD_NUMBER="$(getprop_container IMG_BUILD_NUMBER '${IMG_BUILD_NUMBER:-$(userAtHost)}' | tr '/ %' '.-.')"

  local IMG_CHANGESET="${1:-$CHANGESET}"; test $# -gt 0 && shift
  IMG_CHANGESET="$(getprop_container IMG_CHANGESET '${IMG_CHANGESET:-$(changeset)}' | tr '/ %' '.-.')"

  local IMG_REPO="$(echo ${1:-$IMG_REPO})"
  IMG_REPO="$(getprop_container IMG_REPO '$IMG_REPO' | tr ' ' '-')"
  test "$IMG_REPO" || {
    cat <<-EOF >&2
ERROR: "\$IMG_REPO" is empty. You can also create a file named 'container.properties' with content like this:
IMG_REPO=mycompany/my-repo
EOF
 return 0
  }

  IMG_PREFIX_BASE="$(echo $IMG_REPO:$IMG_NAME | tr '[:upper:]' '[:lower:]')."
  IMG_PREFIX_BN="$(echo ${IMG_PREFIX_BASE}$IMG_BUILD_NUMBER | tr '[:upper:]' '[:lower:]')"
  IMG_PREFIX_CS="$IMG_PREFIX_BN-$(changeset_short "$IMG_CHANGESET")"
}


text:
import React, { Component } from 'react';

class Model extends Component {

  constructor(props) {
    super(props);
  }

  closeModel() {
    this.props.history.goBack();
  }

  render() {
    return (

            {this.props.title}
            X

            {this.props.children}

    );
  }
}

export default Model;


text:
using System.Windows;
using Microsoft.Win32;

namespace MoleculeViewer
{
    public partial class MainWindow : Window
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            this.Visibility = Visibility.Hidden;

            Splash splash = new Splash();

            splash.Closed += delegate
            {
                this.Visibility = Visibility.Visible;
            };

            splash.IsOpen = true;
        }

        private void OpenMenuItemClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = "Sample PDBs";
            openFileDialog.Filter = "PDB File|*.pdb";

            if (openFileDialog.ShowDialog() ?? false)
            {
                LocalEntity localEntity = new LocalEntity(openFileDialog.FileName);

                this.Title = localEntity.DisplayName;

                this.tsriImage.Visibility = Visibility.Hidden;

                this.artifactControl.OpenArtifact(localEntity);

                this.closeMenuItem.IsEnabled = true;
            }
        }

        private void CloseMenuItemClick(object sender, RoutedEventArgs e)
        {
            this.tsriImage.Visibility = Visibility.Visible;

            this.artifactControl.CloseArtifact();

            this.closeMenuItem.IsEnabled = false;
        }

        private void AboutMenuItemClick(object sender, RoutedEventArgs e)
        {
            AboutWindow aboutWindow = new AboutWindow();
            aboutWindow.ShowDialog();
        }
    }
}


text:
#ifndef AXARIAGridRow_h
#define AXARIAGridRow_h

#include "core/accessibility/AXTableRow.h"

namespace WebCore {

class AXARIAGridRow : public AXTableRow {

private:
    explicit AXARIAGridRow(RenderObject*);
public:
    static PassRefPtr<AXARIAGridRow> create(RenderObject*);
    virtual ~AXARIAGridRow();

    void disclosedRows(AccessibilityChildrenVector&);
    AXObject* disclosedByRow() const;

    virtual AXObject* headerObject() OVERRIDE;

private:
    virtual bool isARIATreeGridRow() const;
};

} // namespace WebCore

#endif // AXARIAGridRow_h


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Flat UI</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet">

    <link href="css/flat-ui.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/favicon.ico">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-01">
              </button>

              ADMIN

    <?= $this->session->userdata('username') ?>   1

                  Gestion des clients

<?= $this->session->userdata('email') ?>

Another action

Something else here

Separated link

Gestion des reservation

Another action

Something else here

<a href="<?= site_url('home/logout') ?>">Logout

Popular

Newest

Bestselling

                    Dropdown

Newest

Bestselling

I'm in Section 1.

Howdy, I'm in Section 2.

Howdy, I'm in Section 3.


text:
\hypertarget{_comportement_pouvoir_guerrier_8hpp}{\section{Comportement\-Pouvoir\-Guerrier.\-hpp}
\label{_comportement_pouvoir_guerrier_8hpp}\index{include/\-Controleur/\-Comportement\-Pouvoir/\-Comportement\-Pouvoir\-Guerrier.\-hpp@{include/\-Controleur/\-Comportement\-Pouvoir/\-Comportement\-Pouvoir\-Guerrier.\-hpp}}
}

\begin{DoxyCode}
00001
00006 \textcolor{preprocessor}{#ifndef COMPORTEMENTPOUVOIRGUERRIER\_HPP}
00007 \textcolor{preprocessor}{}\textcolor{preprocessor}{#define COMPORTEMENTPOUVOIRGUERRIER\_HPP}
00008 \textcolor{preprocessor}{}
00009 \textcolor{preprocessor}{#include <string>} \textcolor{comment}{// pour le type std::string}
00010 \textcolor{preprocessor}{#include "\hyperlink{_comportement_pouvoir_8hpp}{ComportementPouvoir.hpp}"}
00011 \textcolor{preprocessor}{#include "../../Modele/Joueur/Joueur.hpp"}
00012
00013 \textcolor{comment}{/******************************************************************************/}
00014
\hypertarget{_comportement_pouvoir_guerrier_8hpp_source_l00015}{}\hyperlink{class_comportement_pouvoir_guerrier}{00015} \textcolor{keyword}{class }\hyperlink{class_comportement_pouvoir_guerrier}{ComportementPouvoirGuerrier} : \textcolor{keyword}{public}
      \hyperlink{class_comportement_pouvoir}{ComportementPouvoir}
00016 \{
00017
00018    \textcolor{keyword}{private}:
00019     \hyperlink{class_joueur}{Joueur}* joueur;
00020
00021    \textcolor{keyword}{public} :
00022       \hyperlink{class_comportement_pouvoir_guerrier_a5b4e19698e98c3d7a58a3859c6ca5118}{ComportementPouvoirGuerrier}(\hyperlink{class_joueur}{Joueur}* j);
00023       \hyperlink{class_comportement_pouvoir_guerrier_ae5113657a16d91283b311f18aa32b1e9}{~ComportementPouvoirGuerrier}();
00024       \textcolor{keywordtype}{void} \hyperlink{class_comportement_pouvoir_guerrier_a2747bbff54360379e100aa62254a2a79}{pouvoir}();
00025
00026 \};
00027
00028 \textcolor{preprocessor}{#include "../../../src/Controleur/ComportementPouvoir/ComportementPouvoirGuerrier.cpp"}
00029 \textcolor{preprocessor}{#endif // ComportementPouvoirGuerrier\_HPP}
\end{DoxyCode}


text:
**Dua**

Little ORM for Node


text:
package com.sop4j.base.apache.io.filefilter;

import java.io.File;
import java.io.Serializable;

/**
 * This filter accepts Files that can be written to.
 *

 * Example, showing how to print out a list of the
 * current directory's writable files:
 *
 *

 * File dir = new File(".");
 * String[] files = dir.list( CanWriteFileFilter.CAN_WRITE );
 * for ( int i = 0; i < files.length; i++ ) {
 *     System.out.println(files[i]);
 * }
 *

 *
 *

 * Example, showing how to print out a list of the
 * current directory's un-writable files:
 *
 *

 * File dir = new File(".");
 * String[] files = dir.list( CanWriteFileFilter.CANNOT_WRITE );
 * for ( int i = 0; i < files.length; i++ ) {
 *     System.out.println(files[i]);
 * }
 *

 *
 *

 * N.B. For read-only files, use
 *    CanReadFileFilter.READ_ONLY.
 *
 * @since 1.3
 * @version $Id: CanWriteFileFilter.java 1307462 2012-03-30 15:13:11Z ggregory $
 */
public class CanWriteFileFilter extends AbstractFileFilter implements Serializable {

    /** Singleton instance of writable filter */
    public static final IOFileFilter CAN_WRITE = new CanWriteFileFilter();

    /** Singleton instance of not writable filter */
    public static final IOFileFilter CANNOT_WRITE = new NotFileFilter(CAN_WRITE);

    /**
     * Restrictive consructor.
     */
    protected CanWriteFileFilter() {
    }

    /**
     * Checks to see if the file can be written to.
     *
     * @param file  the File to check
     * @return {@code true} if the file can be
     *  written to, otherwise {@code false}.
     */
    @Override
    public boolean accept(File file) {
        return file.canWrite();
    }

}


text:
package com.stackify.api.common.util;

import java.io.IOException;
import java.nio.CharBuffer;

/**
 * CharStreams
 * @author Eric Martin
 */
public class CharStreams {

	/**
	 * Read char stream to a string
	 * @param r Readable
	 * @return String
	 * @throws IOException
	 */
	public static String toString(final Readable r) throws IOException {
		Preconditions.checkNotNull(r);

	    StringBuilder sb = new StringBuilder();

	    CharBuffer buf = CharBuffer.allocate(0x800);

	    while (r.read(buf) != -1) {
	    	buf.flip();
	    	sb.append(buf);
	    	buf.clear();
	    }

	    return sb.toString();
	}

	/**
	 * Hidden to prevent construction
	 */
	private CharStreams() {
	}
}


text:
extern "C" {
#endif

#include "include/capi/cef_base_capi.h"

///
// Implement this structure to provide handler implementations.
///
typedef struct _cef_request_context_handler_t {
  ///
  // Base structure.
  ///
  cef_base_t base;

  ///
  // Called on the IO thread to retrieve the cookie manager. The global cookie
  // manager will be used if this function returns NULL.
  ///
  struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)(
      struct _cef_request_context_handler_t* self);
} cef_request_context_handler_t;

#ifdef __cplusplus
}
#endif

#endif  // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_


text:
package ru.org.codingteam.cttalk.model

/**
 * Created by hgn on 30.10.2015.
 */
case class ReceivedToken(token: String)


text:
"""
maxminddb.decoder
~~~~~~~~~~~~~~~~~

This package contains code for decoding the MaxMind DB data section.

"""
from __future__ import unicode_literals

import struct

from maxminddb.compat import byte_from_int, int_from_bytes
from maxminddb.errors import InvalidDatabaseError

class Decoder(object):  # pylint: disable=too-few-public-methods

    """Decoder for the data section of the MaxMind DB"""

    def __init__(self, database_buffer, pointer_base=0, pointer_test=False):
        """Created a Decoder for a MaxMind DB

        Arguments:
        database_buffer -- an mmap'd MaxMind DB file.
        pointer_base -- the base number to use when decoding a pointer
        pointer_test -- used for internal unit testing of pointer code
        """
        self._pointer_test = pointer_test
        self._buffer = database_buffer
        self._pointer_base = pointer_base

    def _decode_array(self, size, offset):
        array = []
        for _ in range(size):
            (value, offset) = self.decode(offset)
            array.append(value)
        return array, offset

    def _decode_boolean(self, size, offset):
        return size != 0, offset

    def _decode_bytes(self, size, offset):
        new_offset = offset + size
        return self._buffer[offset:new_offset], new_offset

    # pylint: disable=no-self-argument
    # |-> I am open to better ways of doing this as long as it doesn't involve
    #     lots of code duplication.
    def _decode_packed_type(type_code, type_size, pad=False):
        # pylint: disable=protected-access, missing-docstring
        def unpack_type(self, size, offset):
            if not pad:
                self._verify_size(size, type_size)
            new_offset = offset + type_size
            packed_bytes = self._buffer[offset:new_offset]
            if pad:
                packed_bytes = packed_bytes.rjust(type_size, b'\x00')
            (value,) = struct.unpack(type_code, packed_bytes)
            return value, new_offset
        return unpack_type

    def _decode_map(self, size, offset):
        container = {}
        for _ in range(size):
            (key, offset) = self.decode(offset)
            (value, offset) = self.decode(offset)
            container[key] = value
        return container, offset

    _pointer_value_offset = {
        1: 0,
        2: 2048,
        3: 526336,
        4: 0,
    }

    def _decode_pointer(self, size, offset):
        pointer_size = ((size >> 3) & 0x3) + 1
        new_offset = offset + pointer_size
        pointer_bytes = self._buffer[offset:new_offset]
        packed = pointer_bytes if pointer_size == 4 else struct.pack(
            b'!c', byte_from_int(size & 0x7)) + pointer_bytes
        unpacked = int_from_bytes(packed)
        pointer = unpacked + self._pointer_base + \
            self._pointer_value_offset[pointer_size]
        if self._pointer_test:
            return pointer, new_offset
        (value, _) = self.decode(pointer)
        return value, new_offset

    def _decode_uint(self, size, offset):
        new_offset = offset + size
        uint_bytes = self._buffer[offset:new_offset]
        return int_from_bytes(uint_bytes), new_offset

    def _decode_utf8_string(self, size, offset):
        new_offset = offset + size
        return self._buffer[offset:new_offset].decode('utf-8'), new_offset

    _type_decoder = {
        1: _decode_pointer,
        2: _decode_utf8_string,
        3: _decode_packed_type(b'!d', 8),  # double,
        4: _decode_bytes,
        5: _decode_uint,  # uint16
        6: _decode_uint,  # uint32
        7: _decode_map,
        8: _decode_packed_type(b'!i', 4, pad=True),  # int32
        9: _decode_uint,  # uint64
        10: _decode_uint,  # uint128
        11: _decode_array,
        14: _decode_boolean,
        15: _decode_packed_type(b'!f', 4),  # float,
    }

    def decode(self, offset):
        """Decode a section of the data section starting at offset

        Arguments:
        offset -- the location of the data structure to decode
        """
        new_offset = offset + 1
        (ctrl_byte,) = struct.unpack(b'!B', self._buffer[offset:new_offset])
        type_num = ctrl_byte >> 5
        # Extended type
        if not type_num:
            (type_num, new_offset) = self._read_extended(new_offset)

        (size, new_offset) = self._size_from_ctrl_byte(
            ctrl_byte, new_offset, type_num)
        return self._type_decoder[type_num](self, size, new_offset)

    def _read_extended(self, offset):
        (next_byte,) = struct.unpack(b'!B', self._buffer[offset:offset + 1])
        type_num = next_byte + 7
        if type_num < 7:
            raise InvalidDatabaseError(
                'Something went horribly wrong in the decoder. An '
                'extended type resolved to a type number < 8 '
                '({type})'.format(type=type_num))
        return type_num, offset + 1

    def _verify_size(self, expected, actual):
        if expected != actual:
            raise InvalidDatabaseError(
                'The MaxMind DB file\'s data section contains bad data '
                '(unknown data type or corrupt data)'
            )

    def _size_from_ctrl_byte(self, ctrl_byte, offset, type_num):
        size = ctrl_byte & 0x1f
        if type_num == 1:
            return size, offset
        bytes_to_read = 0 if size < 29 else size - 28

        new_offset = offset + bytes_to_read
        size_bytes = self._buffer[offset:new_offset]

        # Using unpack rather than int_from_bytes as it is about 200 lookups
        # per second faster here.
        if size == 29:
            size = 29 + struct.unpack(b'!B', size_bytes)[0]
        elif size == 30:
            size = 285 + struct.unpack(b'!H', size_bytes)[0]
        elif size > 30:
            size = struct.unpack(
                b'!I', size_bytes.rjust(4, b'\x00'))[0] + 65821

        return size, new_offset