text:
$(document).ready(function() {

	// Définition des textareas redimentionnables
	$("textarea").addClass("ui-widget-content").resizable( { handles: "s", minHeight: 50 });

	// Liste droit d'appel
	if(TELEFON_RequestType == "CRE") {
		if(TELEFON_RequestStation == "SERV") {
			var strHTML = "<input type=\"radio\" name=\"TELEFON_CallLevel\" id=\"TELEFON_CallLevel\" value=\"INTERNE\"" + (TELEFON_CallLevel == "INTERNE" ? " checked" : "")  + " >" + l_TELEFON_CallLevel1 + "";
			strHTML += "<input type=\"radio\" name=\"TELEFON_CallLevel\" id=\"TELEFON_CallLevel\" value=\"NATIONAL\"" + (TELEFON_CallLevel == "NATIONAL" ? " checked" : "")  + " >" + l_TELEFON_CallLevel2 + "";
			strHTML += "<input type=\"radio\" name=\"TELEFON_CallLevel\" id=\"TELEFON_CallLevel\" value=\"INTERNATIONAL\"" + (TELEFON_CallLevel == "INTERNATIONAL" ? " checked" : "")  + " >" + l_TELEFON_CallLevel3 + "";
		}
		else {
			var strHTML = "<input type=\"radio\" value=\"INTERNE\" id=\"TELEFON_CallLevel\" name=\"TELEFON_CallLevel\"" + (TELEFON_CallLevel == "INTERNE" ? " checked" : "") + " onclick=\"TELEFON_CallLevel_OnClick(this)\")>" + l_TELEFON_CallLevel1 + "";
			strHTML += "<input type=\"radio\" value=\"NATIONAL\" id=\"TELEFON_CallLevel\" name=\"TELEFON_CallLevel\"" + (TELEFON_CallLevel == "NATIONAL" ? " checked" : "") + " onclick=\"TELEFON_CallLevel_OnClick(this)\")>" + l_TELEFON_CallLevel2 + "";
			strHTML += "<input type=\"radio\" value=\"INTERNATIONAL_LIMITED\" id=\"TELEFON_CallLevel\" name=\"TELEFON_CallLevel\"" + (TELEFON_CallLevel == "INTERNATIONAL_LIMITED" ? " checked" : "") + " onclick=\"TELEFON_CallLevel_OnClick(this)\")>" + l_TELEFON_CallLevel4 + "";
			strHTML += "<input type=\"radio\" value=\"INTERNATIONAL_FULL\" id=\"TELEFON_CallLevel\" name=\"TELEFON_CallLevel\"" + (TELEFON_CallLevel == "INTERNATIONAL_FULL" ? " checked" : "") + " onclick=\"TELEFON_CallLevel_OnClick(this)\")>" + l_TELEFON_CallLevel5 + "";
		}
		// on affiche pour tous les cas
		$("#TELEFON_CallLevel").html(strHTML).parents("tr").eq(0).show();

	}

	if(TELEFON_RequestType == "UPD") {

		// création de la liste déroulante des nouveaux droits d'appel en sélectionnant la valeur précédemment choisie
		var strHTML = "<select id=\"TELEFON_UpdNewCallLevel_Value\" name=\"TELEFON_UpdNewCallLevel\";\">";
		strHTML += "<option" + (TELEFON_UpdNewCallLevel == "INTERNE" ? " selected" : "") + " value=\"INTERNE\">" + l_TELEFON_CallLevel1 + "</option>";
		strHTML += "<option" + (TELEFON_UpdNewCallLevel == "NATIONAL" ? " selected" : "") + " value=\"NATIONAL\">" + l_TELEFON_CallLevel2 + "</option>";
		strHTML += "<option" + (TELEFON_UpdNewCallLevel == "INTERNATIONAL_LIMITED" ? " selected" : "") + " value=\"INTERNATIONAL_LIMITED\">" + l_TELEFON_CallLevel4 + "</option>";
		strHTML += "<option" + (TELEFON_UpdNewCallLevel == "INTERNATIONAL_FULL" ? " selected" : "") + " value=\"INTERNATIONAL_FULL\">" + l_TELEFON_CallLevel5 + "</option>";
		strHTML += "</select>";

		// on affiche pour tous les cas
		$("#TELEFON_UpdNewCallLevel").html(strHTML).parents("tr").eq(0).show();
	}

});

// Soumission
function TELEFON_Submit() {

	// Anti double clic
	if(fmr.document.hasBeenSent) return false;

	if(TELEFON_RequestStation == "SERV") {
		// Call level - Droits d'appel
		if (($("input[name='TELEFON_CallLevel']:checked").val() == "")||($("input[name='TELEFON_CallLevel']:checked").val() == undefined)) { DisplayErrMsgOnField("TELEFON_CallLevel", l_Forms_Err_ChampObligatoire + "\"" + l_TELEFON_CallLevel + "\" !"); return false; };
	}

	if(TELEFON_RequestStation == "SERV") {
		// Call level - Droits d'appel
		if (($("input[name='TELEFON_CallLevel']:checked").val() == "")||($("input[name='TELEFON_CallLevel']:checked").val() == undefined)) { DisplayErrMsgOnField("TELEFON_CallLevel", l_Forms_Err_ChampObligatoire + "\"" + l_TELEFON_CallLevel + "\" !"); return false; };
	}

	// Confirmation de la soumission
	if(confirm(l_Conf_Submit)) {
		FormHasBeenSent = true;
		$("#f_ActionAFaire").val("soumettre");
		document.forms[0].submit();
	}
}

function TELEFON_CallLevel_OnClick() {
	if (($("input[name='TELEFON_CallLevel']:checked").val() == "INTERNATIONAL_LIMITED")||($("input[name='TELEFON_CallLevel']:checked").val() == "INTERNATIONAL_FULL")) {
		$("#TELEFON_AccessComments").parents("tr").eq(0).show();
	}
	else {
		$("#TELEFON_AccessComments").parents("tr").eq(0).hide();
	}
}


text:
title: Lattice paths
localeTitle: Caminhos de treliça
---
## Problema 15: caminhos da rede

Este é um esboço. [Ajude nossa comunidade a expandi-lo](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/project-euler/problem-15-lattice-paths/index.md) .

[Este guia de estilo rápido ajudará a garantir que sua solicitação de recebimento seja aceita](https://github.com/freecodecamp/guides/blob/master/README.md) .

redpajama_set_name: RedPajamaGithub


text:
package com.github.z3on.telegram.bots.humorometer;

import com.github.z3on.telegram.bots.AbstractPollingBot;
import com.github.z3on.telegram.config.BotName;
import com.github.z3on.telegram.config.BotToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.telegram.telegrambots.api.methods.send.SendMessage;
import org.telegram.telegrambots.api.objects.Message;
import org.telegram.telegrambots.exceptions.TelegramApiException;

import java.util.List;

public class HumorometerBot extends AbstractPollingBot {

  private static final String PARSE_MODE = "Markdown";
  private static final Logger LOGGER = LoggerFactory.getLogger(HumorometerBot.class);

  private HumorStatistics humorStatistics = new HumorStatistics();

  @BotName("humorometer")
  private String botName;

  @BotToken("humorometer")
  private String botToken;

  public HumorometerBot() {
    registerAction("/up", this::upvote);
    registerAction("/down", this::downvote);
    registerAction("/stats", this::getStats);
    registerAction("/reset", this::resetStats);
  }

  @Override
  public String getBotUsername() {
    return botName;
  }

  @Override
  public String getBotToken() {
    return botToken;
  }

  private void upvote(Message message, List<String> args) {
    Long chatId = message.getChatId();
    if (!args.isEmpty()) {
      args.stream().distinct().forEach(name -> humorStatistics.increment(chatId, name));
      sendMessage(chatId, "_Upvote registered_");
    } else {
      sendMessage(chatId, "You should specify name (or multiple) for upvote:\n`/up <name>`\nor\n`/up <name> <anotherName> ...`");
    }
  }

  private void downvote(Message message, List<String> args) {
    Long chatId = message.getChatId();
    if (!args.isEmpty()) {
      args.stream().distinct().forEach(name -> humorStatistics.decrement(chatId, name));
      sendMessage(chatId, "_Downvote registered_");
    } else {
      sendMessage(chatId, "You should specify name (or multiple) for downvote:\n`/down <name>`\nor\n`/down <name> <anotherName> ...`");
    }
  }

  private void getStats(Message message, List<String> args) {
    Long chatId = message.getChatId();
    String stats = humorStatistics.getStats(message.getChatId(), args);
    sendMessage(chatId, stats);
  }

  private void resetStats(Message message, List<String> args) {
    Long chatId = message.getChatId();
    humorStatistics.resetStats(message.getChatId(), args);
    sendMessage(chatId, "_Stats were reset_");
  }

  private void sendMessage(Long chatId, String text) {
    try {
      sendMessage(new SendMessage().setChatId(chatId).setText(text).setParseMode(PARSE_MODE));
    } catch (TelegramApiException ex) {
      LOGGER.error("Unable to send message to chat " + chatId, ex);
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

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

  <context:annotation-config />

  <bean id="springSecurityFilterChain" class="org.springframework.security.web.FilterChainProxy">
    <security:filter-chain-map path-type="ant">

      <!-- Backend - getDSAuthenticated gets auth filters, getDS does not -->
      <security:filter-chain pattern="/getDSAuth*"
        filters="ChannelFilter,${security.auth.filters}" />
      <security:filter-chain pattern="/getDS*"
        filters="ChannelFilter" />

      <!-- RISearch service gets auth protection -->
      <security:filter-chain pattern="/risearch*"
        filters="ChannelFilter,${security.auth.filters}" />

      <!-- REST API -->
      <security:filter-chain pattern="/objects*/**"
        filters="ChannelFilter,${security.auth.filters}" />

      <!-- User servlet -->
      <security:filter-chain pattern="/user*"
        filters="ChannelFilter,${security.auth.filters}" />

      <!-- BUG There is a bug in classic authN for disseminators, auth needs
        to be off to emulate its behaviour -->
      <security:filter-chain pattern="/get/*/*/**"
        filters="ChannelFilter" />
      <!-- /BUG -->

      <!-- Lite APIs -->
      <security:filter-chain pattern="/get*/**"
        filters="ChannelFilter,${security.auth.filters}" />
      <security:filter-chain pattern="/search*"
        filters="ChannelFilter,${security.auth.filters}" />
      <security:filter-chain pattern="/describe*"
        filters="ChannelFilter,${security.auth.filters}" />
      <security:filter-chain pattern="/list*/**"
        filters="ChannelFilter,${security.auth.filters}" />
      <security:filter-chain pattern="/management/*/**"
        filters="ChannelFilter,${security.auth.filters}" />
      <security:filter-chain pattern="/upload*"
        filters="ChannelFilter,${security.auth.filters}" />

      <!-- SOAP APIs -->
      <security:filter-chain pattern="/services*/**"
        filters="ChannelFilter,${security.auth.filters}" />

      <security:filter-chain pattern="/**"
        filters="ChannelFilter" />

      <!-- Uncomment to enable Classic AuthN <security:filter-chain pattern="/**"
        filters="ChannelFilter,SetupFilter,XmlUserfileFilter,EnforceAuthnFilter.FinalizeFilter"
        /> End Classic AuthN -->
    </security:filter-chain-map>
  </bean>

  <bean id="ChannelFilter"
    class="org.springframework.security.web.access.channel.ChannelProcessingFilter">
    <property name="channelDecisionManager" ref="channelDecisionManager" />
    <property name="securityMetadataSource">
      <security:filter-invocation-definition-source
        path-type="ant">

        <!-- API-A-Lite -->
        <security:intercept-url pattern="/get*/**"
          access="${security.ssl.api.access}" />
        <security:intercept-url pattern="/search*"
          access="${security.ssl.api.access}" />
        <security:intercept-url pattern="/list*/**"
          access="${security.ssl.api.access}" />
        <security:intercept-url pattern="/describe*"
          access="${security.ssl.api.access}" />

        <!-- API-M-Lite -->
        <security:intercept-url pattern="/management/upload*"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/management/getNextPID*"
          access="${security.ssl.api.management}" />

        <!-- API-A -->
        <security:intercept-url pattern="/services/access"
          access="${security.ssl.api.access}" />

        <!-- API-M -->
        <security:intercept-url pattern="/index.html"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/services/management"
          access="${security.ssl.api.management}" />

        <!-- REST API management -->
        <security:intercept-url pattern="/upload*"
          method="POST" access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects*/**"
          method="POST" access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects*/**"
          method="PUT" access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects*/**"
          method="DELETE" access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/export**"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/versions*"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/validate*"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/objectXML*"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/datastreams/*"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/relationships*"
          access="${security.ssl.api.management}" />
        <security:intercept-url pattern="/objects/*/datastreams/*/versions*"
          access="${security.ssl.api.management}" />

        <!-- User Servlet -->
        <security:intercept-url pattern="/user*"
          access="${security.ssl.api.management}" />

        <!-- REST API access -->
        <security:intercept-url pattern="/objects*/**"
          access="${security.ssl.api.access}" />

        <!-- Backend Services -->
        <security:intercept-url pattern="/getDSAuthenticated*/**"
          access="${security.ssl.api.management}" />

        <!-- Misc. Services -->
        <security:intercept-url pattern="/oai*"
          access="${security.ssl.api.access}" />
        <security:intercept-url pattern="/risearch*"
          access="${security.ssl.api.access}" />

        <!-- Misc. Files -->
        <security:intercept-url pattern="/wsdl*"
          access="${security.ssl.api.access}" />
        <security:intercept-url pattern="**.jsp"
          access="${security.ssl.api.access}" />

        <!-- Anything not mentioned gets caught by default -->
        <security:intercept-url pattern="/**"
          access="${security.ssl.api.default}" />

      </security:filter-invocation-definition-source>
    </property>
  </bean>

  <bean id="channelDecisionManager"
    class="org.springframework.security.web.access.channel.ChannelDecisionManagerImpl"
    lazy-init="true">
    <property name="channelProcessors">
      <list>
        <ref bean="secureChannelProcessor" />
        <ref bean="insecureChannelProcessor" />
      </list>
    </property>
  </bean>

  <bean id="insecureChannelProcessor"
    class="org.springframework.security.web.access.channel.InsecureChannelProcessor"
    lazy-init="true" />

  <bean id="secureChannelProcessor"
    class="org.springframework.security.web.access.channel.SecureChannelProcessor"
    lazy-init="true">
    <property name="entryPoint" ref="HTTPS" />
  </bean>

  <bean id="HTTPS"
    class="org.springframework.security.web.access.channel.RetryWithHttpsEntryPoint"
    lazy-init="true">
    <property name="portMapper" ref="portMapper" />
    <property name="portResolver" ref="portResolver" />
  </bean>

  <bean id="portMapper" class="org.springframework.security.web.PortMapperImpl">
    <property name="portMappings">
      <map>
        <entry key="${fedora.port}" value="${fedora.port.secure}" />
      </map>
    </property>
  </bean>

  <bean id="portResolver" class="org.springframework.security.web.PortResolverImpl">
    <property name="portMapper" ref="portMapper" />
  </bean>

  <!-- FeSL JAAS Authn bean -->
  <bean id="AuthFilterJAAS" class="org.fcrepo.server.security.jaas.AuthFilterJAAS"
    init-method="init" lazy-init="true">
    <!-- OPTIONAL. A comma separated list of class names for user principals.
      First one that is found is effective only. -->
    <property name="userClassNames"
      value="org.fcrepo.server.security.jaas.auth.UserPrincipal" />

    <!-- True iff API-A requests via the REST API require authentication.
      If not specified, defaults to true. -->
    <property name="authnAPIA" value="${security.fesl.authN.jaas.apia.enabled}" />
  </bean>

  <!-- Classic authn beans -->
  <bean id="SetupFilter" class="org.fcrepo.server.security.servletfilters.FilterSetup"
    lazy-init="true" init-method="init">
    <property name="config">
      <bean class="org.fcrepo.common.http.FilterConfigBean">
        <property name="filterName" value="SetupFilter" />
      </bean>
    </property>
  </bean>

  <bean id="XmlUserfileFilter"
    class="org.fcrepo.server.security.servletfilters.xmluserfile.FilterXmlUserfile"
    lazy-init="true" init-method="init">
    <property name="config">
      <bean class="org.fcrepo.common.http.FilterConfigBean">
        <property name="filterName" value="XmlUserfileFilter" />
      </bean>
    </property>
  </bean>

  <bean id="EnforceAuthnFilter"
    class="org.fcrepo.server.security.servletfilters.FilterEnforceAuthn"
    lazy-init="true" init-method="init">
    <property name="config">
      <bean class="org.fcrepo.common.http.FilterConfigBean">
        <property name="filterName" value="EnforceAuthnFilter" />
      </bean>
    </property>
  </bean>

  <bean id="FinalizeFilter"
    class="org.fcrepo.server.security.servletfilters.FilterFinalize"
    lazy-init="true" init-method="init">
    <property name="config">
      <bean class="org.fcrepo.common.http.FilterConfigBean">
        <property name="filterName" value="FinalizeFilte" />
      </bean>
    </property>
  </bean>

  <bean id="RestApiAuthnFilter"
    class="org.fcrepo.server.security.servletfilters.FilterRestApiAuthn"
    lazy-init="true" init-method="init">
    <property name="config">
      <bean class="org.fcrepo.common.http.FilterConfigBean">
        <property name="filterName" value="FilterRestApiAuthn" />
      </bean>
    </property>
  </bean>

  <!-- FeSL Authz bean -->
  <bean id="PEPFilter" class="org.fcrepo.server.security.xacml.pep.rest.PEP"
    lazy-init="true" init-method="init" />

</beans>


text:
<?php

namespace spec\Sylius\Bundle\PromotionBundle\Form\Type;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Component\Registry\ServiceRegistryInterface;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
 * @author Saša Stamenković <umpirsky@gmail.com>
 */
class RuleTypeSpec extends ObjectBehavior
{
    function let(ServiceRegistryInterface $checkerRegistry)
    {
        $this->beConstructedWith('Rule', array('sylius'), $checkerRegistry);
    }

    function it_should_be_initializable()
    {
        $this->shouldHaveType('Sylius\Bundle\PromotionBundle\Form\Type\RuleType');
    }

    function it_should_be_a_form_type()
    {
        $this->shouldHaveType('Symfony\Component\Form\AbstractType');
    }

    function it_should_build_form_with_rule_choice_field(
        FormBuilder $builder,
        FormFactoryInterface $factory
    )
    {
        $builder->addEventSubscriber(Argument::any())->willReturn($builder);
        $builder->getFormFactory()->willReturn($factory);

        $builder
            ->add('type', 'sylius_promotion_rule_choice', Argument::any())
            ->shouldBeCalled()
            ->willReturn($builder)
        ;

        $this->buildForm($builder, array());
    }

    function it_should_add_build_promotion_rule_event_subscriber(
        FormBuilder $builder,
        FormFactoryInterface $factory
    )
    {
        $builder->add(Argument::any(), Argument::any(), Argument::any())->willReturn($builder);
        $builder->getFormFactory()->willReturn($factory);

        $builder
            ->addEventSubscriber(Argument::type('Sylius\Bundle\PromotionBundle\Form\EventListener\BuildRuleFormListener'))
            ->shouldBeCalled()
            ->willReturn($builder)
        ;

        $this->buildForm($builder, array());
    }

    function it_should_define_assigned_data_class(OptionsResolverInterface $resolver)
    {
        $resolver
            ->setDefaults(array(
                'data_class'        => 'Rule',
                'validation_groups' => array('sylius'),
            ))
            ->shouldBeCalled()
        ;

        $this->setDefaultOptions($resolver);
    }
}


text:
package com.jjzcru.luft.presentation.presenter.player;

import android.content.Context;
import android.support.annotation.NonNull;

import com.github.mikephil.charting.data.RadarEntry;
import com.jjzcru.luft.R;
import com.jjzcru.luft.domain.Player;
import com.jjzcru.luft.domain.Record;
import com.jjzcru.luft.domain.Training;
import com.jjzcru.luft.domain.exception.DefaultErrorBundle;
import com.jjzcru.luft.domain.exception.ErrorBundle;
import com.jjzcru.luft.domain.interactor.DefaultSubscriber;
import com.jjzcru.luft.domain.interactor.GetPlayerDetails;
import com.jjzcru.luft.domain.interactor.GetRecordList;
import com.jjzcru.luft.domain.interactor.GetTrainingList;
import com.jjzcru.luft.domain.interactor.UseCase;
import com.jjzcru.luft.presentation.exception.ErrorMessageFactory;
import com.jjzcru.luft.presentation.internal.di.PerActivity;
import com.jjzcru.luft.presentation.mapper.PlayerModelDataMapper;
import com.jjzcru.luft.presentation.mapper.RecordModelDataMapper;
import com.jjzcru.luft.presentation.mapper.TrainingModelDataMapper;
import com.jjzcru.luft.presentation.model.PlayerModel;
import com.jjzcru.luft.presentation.model.RecordModel;
import com.jjzcru.luft.presentation.model.TrainingModel;
import com.jjzcru.luft.presentation.presenter.Presenter;
import com.jjzcru.luft.presentation.view.view.player.PlayerPerformanceView;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

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

/**
 * {@link Presenter} that controls communication between views and models of the presentation
 * layer.
 */
@PerActivity
public class PlayerPerformancePresenter implements Presenter {
    private static final String TAG = "L-PlayerPerformancePresenter";
    private PlayerPerformanceView viewListView;

    private GetTrainingList getTrainingListUseCase;
    private final GetPlayerDetails getPlayerDetailsUseCase;
    private final GetRecordList getRecordListUseCase;

    private final PlayerModelDataMapper playerModelDataMapper;
    private final RecordModelDataMapper recordModelDataMapper;
    private final TrainingModelDataMapper trainingModelDataMapper;

    private PlayerModel playerModel;
    private List<RecordModel> recordModelList;
    private List<RecordModel> processedRecordModelList;
    private List<TrainingModel> trainingModelList;
    private String exerciseTagValues[];
    private String exerciseTagTitle[];

    private String PlayerID;

    private Map<String, String> tagValueMap;

    @Inject
    PlayerPerformancePresenter(@Named("trainingList") UseCase getTrainingListUseCase, @Named("getPlayer") UseCase getPlayerDetailsUseCase, @Named("getRecordList") UseCase getRecordListUseCase, PlayerModelDataMapper playerModelDataMapper, RecordModelDataMapper recordModelDataMapper, TrainingModelDataMapper trainingModelDataMapper, Context context) {
        this.getTrainingListUseCase = (GetTrainingList) getTrainingListUseCase;
        this.getPlayerDetailsUseCase = (GetPlayerDetails) getPlayerDetailsUseCase;
        this.getRecordListUseCase = (GetRecordList) getRecordListUseCase;

        this.playerModelDataMapper = playerModelDataMapper;
        this.recordModelDataMapper = recordModelDataMapper;
        this.trainingModelDataMapper = trainingModelDataMapper;

        this.exerciseTagValues = context.getResources().getStringArray(R.array.exercise_tag_value);
        this.exerciseTagTitle = context.getResources().getStringArray(R.array.exercise_tag);

        this.recordModelList = new ArrayList<>();
        this.trainingModelList = new ArrayList<>();
        this.processedRecordModelList = new ArrayList<>();
        this.tagValueMap = new HashMap<>();
    }

    public void setView(@NonNull PlayerPerformanceView view, String PlayerID) {
        this.viewListView = view;
        this.PlayerID = PlayerID;
        setTagValueMap();
    }

    private void setTagValueMap(){
        for(int i=1;i<this.exerciseTagValues.length;i++){
            tagValueMap.put(exerciseTagValues[i], exerciseTagTitle[i]);
        }
    }

    @Override
    public void resume() {
        this.loadRecordList();
    }

    @Override
    public void pause() {

    }

    @Override
    public void destroy() {
        this.getPlayerDetailsUseCase.unsubscribe();
        this.getRecordListUseCase.unsubscribe();
        this.viewListView = null;
    }

    /**
     * Initializes the presenter by start retrieving the getPlayer list.
     */
    public void initialize() {
        this.loadRecordList();
    }

    /**
     * Loads all getPlayers.
     */
    private void loadRecordList() {
        this.hideViewRetry();
        this.showViewLoading();
        this.getTraining();
    }

    private void showViewLoading() {
        this.viewListView.showLoading();
    }

    private void hideViewLoading() {
        this.viewListView.hideLoading();
    }

    private void showViewRetry() {
        this.viewListView.showRetry();
    }

    private void hideViewRetry() {
        this.viewListView.hideRetry();
    }

    private void showErrorMessage(ErrorBundle errorBundle) {
        String errorMessage = ErrorMessageFactory.create(this.viewListView.context(), errorBundle.getException());
        this.viewListView.showError(errorMessage);
    }

    private void getTraining(){
        this.getTrainingListUseCase.execute(new PlayerPerformancePresenter.TrainingListSubscriber());
    }

    private void getPlayerDetails() {
        this.getPlayerDetailsUseCase.setPlayerID(this.PlayerID);
        this.getPlayerDetailsUseCase.execute(new PlayerPerformancePresenter.PlayerDetailsSubscriber());
    }

    private void getRecordList(){
        this.getRecordListUseCase.execute(new PlayerPerformancePresenter.RecordListSubscriber());
    }

    private void setPlayer(Player player){
        this.playerModel = this.playerModelDataMapper.transform(player);
    }

    private void setTrainingList(List<Training> trainingList){
        this.trainingModelList = this.trainingModelDataMapper.transform(trainingList);
    }

    private void setRecordList(List<Record> recordCollection){
        for(RecordModel recordModel: this.recordModelDataMapper.transform(recordCollection)){
            if(recordModel.getPlayerID().equals(this.PlayerID)){
                this.recordModelList.add(recordModel);
            }
        }
    }

    private void processRecords(){
        this.processedRecordModelList = new ArrayList<>();
        Map<String, RecordModel> recordModelMap = new HashMap<>();
        for(int i=0;i<this.recordModelList.size();i++){
            RecordModel recordModel = this.recordModelList.get(i);
            if(recordModelMap.get(recordModel.getExerciseID()) == null){
                recordModelMap = addExercise(recordModelMap, recordModel.getExerciseID());
            }
        }

        for (RecordModel recordModel : recordModelMap.values()) {
            this.processedRecordModelList.add(recordModel);
        }

        Collections.sort(this.processedRecordModelList, sortRecordByScore());
        this.viewListView.renderRecordList(this.processedRecordModelList);
        displayChart();
    }

    private Map<String, RecordModel> addExercise(Map<String, RecordModel> recordModelMap, String ExerciseID){
        RecordModel newRecordModel = new RecordModel();
        newRecordModel.setExerciseID(ExerciseID);
        Integer repetition = 0;
        Float totalScore = 0f;
        Float totalValue = 0f;

        for(RecordModel recordModel: this.recordModelList){
            if(recordModel.getExerciseID().equals(ExerciseID)){
                newRecordModel.setExerciseName(recordModel.getExerciseName());
                newRecordModel.setMeasure(recordModel.getMeasure());
                newRecordModel.setTag(recordModel.getTag());
                totalScore += recordModel.getScore();
                totalValue += recordModel.getValue();
                repetition++;
            }
        }
        newRecordModel.setAverageValue(totalValue/repetition);
        newRecordModel.setAverageScore(totalScore/repetition);

        recordModelMap.put(ExerciseID, newRecordModel);
        return recordModelMap;
    }

    private void displayChart(){
        List<RadarEntry> entries = new ArrayList<>();
        /*String [] tagValue = new String[this.exerciseTagValues.length - 1];
        for(int i=1;i<this.exerciseTagValues.length;i++) {
            tagValue[i-1] = this.exerciseTagValues[i];
        }*/
        for(String tag: this.exerciseTagValues){
            entries.add(new RadarEntry(getTagScore(tag)));
        }
        this.viewListView.renderPerformanceChart(entries);
    }

    private Float getTagScore(String tag){
        Float total = 0f;
        Integer repetition = 0;
        Float average = 0f;
        for(RecordModel recordModel: this.recordModelList){
            if(recordModel.getTag().equals(tag)){
                total += recordModel.getScore();
                repetition++;
            }
        }
        if(repetition>0){
            average = total/repetition;
        }
        return average;
    }

    private Comparator<RecordModel> sortRecordByScore(){
        return (recordModel1, recordModel2) -> {
            if(recordModel1.getAverageScore()>=recordModel2.getAverageScore()){
                return -1;
            }
            else{
                return 1;
            }
        };
    }

    private final class TrainingListSubscriber extends DefaultSubscriber<List<Training>> {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {
            PlayerPerformancePresenter.this.hideViewLoading();
            PlayerPerformancePresenter.this.showErrorMessage(new DefaultErrorBundle((Exception) e));
            PlayerPerformancePresenter.this.showViewRetry();
        }

        @Override
        public void onNext(List<Training> trainingList) {
            PlayerPerformancePresenter.this.setTrainingList(trainingList);
            PlayerPerformancePresenter.this.getPlayerDetails();
        }
    }

    private final class PlayerDetailsSubscriber extends DefaultSubscriber<Player> {
        @Override
        public void onCompleted() {

        }

        @Override
        public void onError(Throwable e) {
            PlayerPerformancePresenter.this.hideViewLoading();
            PlayerPerformancePresenter.this.showErrorMessage(new DefaultErrorBundle((Exception) e));
            PlayerPerformancePresenter.this.showViewRetry();
        }

        @Override
        public void onNext(Player player) {
            PlayerPerformancePresenter.this.setPlayer(player);
            PlayerPerformancePresenter.this.getRecordList();
        }
    }

    private final class RecordListSubscriber extends DefaultSubscriber<List<Record>> {
        @Override
        public void onCompleted() {
            PlayerPerformancePresenter.this.hideViewLoading();
        }

        @Override
        public void onError(Throwable e) {
            PlayerPerformancePresenter.this.hideViewLoading();
            PlayerPerformancePresenter.this.showErrorMessage(new DefaultErrorBundle((Exception) e));
            PlayerPerformancePresenter.this.showViewRetry();
        }

        @Override
        public void onNext(List<Record> records) {
            PlayerPerformancePresenter.this.setRecordList(records);
            PlayerPerformancePresenter.this.processRecords();
        }
    }
}


text:
import { NodeBase } from './shared/Node';
import ExecutionPathOptions from '../ExecutionPathOptions';
import { NodeType } from './NodeType';
export default class TemplateElement extends NodeBase {
    type: NodeType.TemplateElement;
    tail: boolean;
    value: {
        cooked: string;
        raw: string;
    };
    hasEffects(_options: ExecutionPathOptions): boolean;
}


text:
using namespace SDKTemplate;

Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
{
    { "Track position", "SDKTemplate.GeolocationCPP.Scenario1" },
    { "Get position", "SDKTemplate.GeolocationCPP.Scenario2" },
    { "Background position", "SDKTemplate.GeolocationCPP.Scenario3" },
    { "Foreground geofencing", "SDKTemplate.GeolocationCPP.Scenario4" },
    { "Background geofencing", "SDKTemplate.GeolocationCPP.Scenario5" },
    { "Get last visit", "SDKTemplate.GeolocationCPP.Scenario6" },
    { "Foreground visit monitoring", "SDKTemplate.GeolocationCPP.Scenario7" },
    { "Background visit monitoring", "SDKTemplate.GeolocationCPP.Scenario8" },
};


text:
var appMain = require('../appMain');
window.Bounce = require('./bounce');
if (typeof global !== 'undefined') {
  global.Bounce = window.Bounce;
}
var blocks = require('./blocks');
var levels = require('./levels');
var skins = require('./skins');

window.bounceMain = function (options) {
  options.skinsModule = skins;
  options.blocksModule = blocks;
  appMain(window.Bounce, levels, options);
};


text:
package etcd

// Add a new directory with a random etcd-generated key under the given path.
func (c *Client) AddChildDir(key string, ttl uint64) (*Response, error) {
	raw, err := c.post(key, "", ttl)

	if err != nil {
		return nil, err
	}

	return raw.Unmarshal()
}

// Add a new file with a random etcd-generated key under the given path.
func (c *Client) AddChild(key string, value string, ttl uint64) (*Response, error) {
	raw, err := c.post(key, value, ttl)

	if err != nil {
		return nil, err
	}

	return raw.Unmarshal()
}


text:
require 'spec_helper'

describe PryIb::Security do
  before do
    puts "-- Start Security tests --"
  end

  describe "get_contract" do
    it "return stock by default" do
      contract = PryIb::Security.get_contract('AAPL')
      expect(contract.symbol).to   eq('AAPL')
      expect(contract.expiry).to   eq('')
      expect(contract.sec_type).to eq(:stock)
      expect(contract.currency).to eq('USD')
    end
  end

end


text:
'use strict';

/* eslint no-param-reassign: 0 */
var LINE_TERMINATORS = '\\u000A|\\u000D|\\u2028\\|\\u2029';

exports.onCommentStart = function (yy, type, line, column, range) {
  if (!yy.comments) {
    yy.comments = [];
  }
  // range: [[first_line, first_column], [end_line, end_column]]
  yy.comment = {
    loc: [[line, column]],
    range: [range],
    type: type,
    buffer: []
  };
};

exports.onCommentEnd = function (yy, type, line, column, range) {
  if (!yy.comments) {
    yy.comments = [];
  }
  yy.comment.loc.push([line, column]);
  yy.comment.range.push(range);

  // NOTICE: need to fix range after auto semicolon insertion
  // subtract insertion offset
  if (yy.autoInsertions) {
    var rangeStart = yy.comment.range[0];
    var countStart = 0;

    for (var i = 0; i < yy.autoInsertions.length; i++) {
      if (yy.autoInsertions[i]) {
        if (yy.autoInsertions[i] <= rangeStart) {
          countStart++;
        }
      }
    }
    yy.comment.range[0] -= countStart;
    yy.comment.range[1] -= countStart;
  }

  yy.comments.push(yy.comment);
};

exports.onComment = function (yy, value) {
  yy.comment.buffer.push(value);
};

var MultiLineCommentCharsStart = {
  conditions: ['*'],
  rule: '/\\*',
  handler: '\n    if (this.topState() === \'single_line_comment_start\') {\n      return require(\'./lex/comment\').onComment(yy, this.match);\n    }\n    if (this.topState() === \'single_string_start\') {\n      return \'SingleStringCharacter\';\n    }\n    if (this.topState() === \'double_string_start\') {\n      return \'DoubleStringCharacter\';\n    }\n    if (this.topState() === \'multi_line_comment_start\') {\n    } else {\n      this.begin(\'multi_line_comment_start\');\n    }\n    require(\'./lex/comment\').onCommentStart(yy, \'MultiLine\', yylloc.first_line, yylloc.first_column, yylloc.range[0]);\n    return \'\';\n  '
};

var MultiLineCommentCharsEnd = {
  conditions: ['multi_line_comment_start', 'multi_line_comment_post_asterisk_start'],
  rule: '\\*/',
  handler: '\n    if (this.topState() === \'multi_line_comment_post_asterisk_start\') {\n      this.popState();\n    }\n    this.popState();\n    require(\'./lex/comment\').onCommentEnd(yy, \'MultiLine\', yylloc.last_line, yylloc.last_column, yylloc.range[1]);\n    return \'\';\n  '
};

var MultiLineNotAsteriskChar = {
  conditions: ['multi_line_comment_start'],
  rule: '[^*]',
  handler: '\n    require(\'./lex/comment\').onComment(yy, this.match);\n    return \'\';\n  '
};

var PostAsteriskCommentCharsStart = {
  conditions: ['multi_line_comment_start'],
  rule: '[*]',
  handler: '\n    this.begin(\'multi_line_comment_post_asterisk_start\');\n    require(\'./lex/comment\').onComment(yy, this.match);\n    return \'\';\n  '
};

var PostAsteriskCommentChars = {
  conditions: ['multi_line_comment_post_asterisk_start'],
  rule: '.|' + LINE_TERMINATORS,
  handler: '\n    this.popState();\n    require(\'./lex/comment\').onComment(yy, this.match);\n    if (this.match === \'*\') {\n      //  asterist again\n      this.begin(\'multi_line_comment_post_asterisk_start\');\n      return \'\';\n    } else if (this.match === \'/\') {\n      // since \'*/\' match first\n      // should never enter this\n    } else {\n      // MultiLineNotForwardSlashOrAsteriskChar\n    }\n    return \'\';\n  '
};

var SingleLineCommentCharsStart = {
  conditions: ['*'],
  rule: '//',
  handler: '\n    if (this.topState() === \'single_string_start\') {\n      return \'SingleStringCharacter\';\n    }\n    if (this.topState() === \'double_string_start\') {\n      return \'DoubleStringCharacter\';\n    }\n    if (this.topState() === \'template_string_start\') {\n      return require(\'./util\').parseTemplateCharacters.call(this, this.match);\n    }\n    // //// will not begin new state\n    if (this.topState() !== \'single_line_comment_start\') {\n      this.begin(\'single_line_comment_start\');\n    }\n    require(\'./lex/comment\').onCommentStart(yy, \'SingleLine\', yylloc.first_line, yylloc.first_column, yylloc.range[0]);\n    return \'\';\n  '
};

var SingleLineCommentCharEnd = {
  conditions: ['single_line_comment_start'],
  rule: LINE_TERMINATORS,
  handler: '\n    this.popState();\n    // SourceCharacterbut not LineTerminator\n    require(\'./lex/comment\').onCommentEnd(yy, \'SingleLine\', yylloc.first_line, yylloc.first_column, yylloc.range[0]);\n    return \'\';\n  '
};

var SingleLineCommentChar = {
  conditions: ['single_line_comment_start'],
  rule: '.',
  handler: '\n    require(\'./lex/comment\').onComment(yy, this.match);\n    return \'\';\n  '
};

exports.singleLineComment = [SingleLineCommentCharsStart, SingleLineCommentCharEnd, SingleLineCommentChar];

exports.SingleLineCommentCharsStart = SingleLineCommentCharsStart;
exports.SingleLineCommentCharEnd = SingleLineCommentCharEnd;
exports.SingleLineCommentChar = SingleLineCommentChar;

exports.multiLineComment = [MultiLineCommentCharsEnd, MultiLineCommentCharsStart, MultiLineNotAsteriskChar, PostAsteriskCommentCharsStart, PostAsteriskCommentChars];


text:
module RSpec::Support::ControllerExampleGroup

  extend ActiveSupport::Concern

  included do
    include SerializerConcern
  end

  def threadable
    controller.threadable
  end

  def current_user
    threadable.current_user
  end

  def sign_in! user, remember_me: false
    controller.sign_in! user, remember_me: remember_me
  end

  def sign_out!
    controller.sign_out!
  end

  def response_json
    JSON.parse(response.body)
  end

  module ClassMethods

    def when_not_signed_in &block
      context "when not signed in" do
        before{ sign_out! }
        class_eval(&block)
      end
    end

    def when_signed_in_as email_address, &block
      context "when signed in as #{email_address}" do
        before{ sign_in! threadable.users.find_by_email_address!(email_address) }
        class_eval(&block)
      end
    end

  end

  RSpec.configuration.include self, :type => :controller

end


text:
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/ericgan/Documents/6837FinalProject")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/ericgan/Documents/6837FinalProject/build")

# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)

# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})


text:
local assert, getfenv, ipairs, loadstring, pairs, setfenv, tostring, tonumber, type = assert, getfenv, ipairs, loadstring, pairs, setfenv, tostring, tonumber, type
local io = require"io"
local lfs = require "lfs"
local lp = require "luadoc.lp"
local luadoc = require"luadoc"
local package = package
local string = require"string"
local table = require"table"

module "luadoc.doclet.html"

-------------------------------------------------------------------------------
-- Looks for a file `name' in given path. Removed from compat-5.1
-- @param path String with the path.
-- @param name String with the name to look for.
-- @return String with the complete path of the file found
--	or nil in case the file is not found.

local function search (path, name)
  for c in string.gfind(path, "[^;]+") do
    c = string.gsub(c, "%?", name)
    local f = io.open(c)
    if f then   -- file exist?
      f:close()
      return c
    end
  end
  return nil    -- file not found
end

-------------------------------------------------------------------------------
-- Include the result of a lp template into the current stream.

function include (template, env)
	-- template_dir is relative to package.path
	local templatepath = options.template_dir .. template

	-- search using package.path (modified to search .lp instead of .lua
	local search_path = string.gsub(package.path, "%.lua", "")
	local templatepath = search(search_path, templatepath)
	assert(templatepath, string.format("template `%s' not found", template))

	env = env or {}
	env.table = table
	env.io = io
	env.lp = lp
	env.ipairs = ipairs
	env.tonumber = tonumber
	env.tostring = tostring
	env.type = type
	env.luadoc = luadoc
	env.options = options

	return lp.include(templatepath, env)
end

-------------------------------------------------------------------------------
-- Returns a link to a html file, appending "../" to the link to make it right.
-- @param html Name of the html file to link to
-- @return link to the html file

function link (html, from)
	local h = html
	from = from or ""
	string.gsub(from, "/", function () h = "../" .. h end)
	return h
end

-------------------------------------------------------------------------------
-- Returns the name of the html file to be generated from a module.
-- Files with "lua" or "luadoc" extensions are replaced by "html" extension.
-- @param modulename Name of the module to be processed, may be a .lua file or
-- a .luadoc file.
-- @return name of the generated html file for the module

function module_link (modulename, doc, from)
	-- TODO: replace "." by "/" to create directories?
	-- TODO: how to deal with module names with "/"?
	assert(modulename)
	assert(doc)
	from = from or ""

	if doc.modules[modulename] == nil then
--		logger:error(string.format("unresolved reference to module `%s'", modulename))
		return
	end

	local href = "modules/" .. modulename .. ".html"
	string.gsub(from, "/", function () href = "../" .. href end)
	return href
end

-------------------------------------------------------------------------------
-- Returns the name of the html file to be generated from a lua(doc) file.
-- Files with "lua" or "luadoc" extensions are replaced by "html" extension.
-- @param to Name of the file to be processed, may be a .lua file or
-- a .luadoc file.
-- @param from path of where am I, based on this we append ..'s to the
-- beginning of path
-- @return name of the generated html file

function file_link (to, from)
	assert(to)
	from = from or ""

	local href = to
	href = string.gsub(href, "lua$", "html")
	href = string.gsub(href, "luadoc$", "html")
	href = "files/" .. href
	string.gsub(from, "/", function () href = "../" .. href end)
	return href
end

-------------------------------------------------------------------------------
-- Returns a link to a function or to a table
-- @param fname name of the function or table to link to.
-- @param doc documentation table
-- @param kind String specying the kinf of element to link ("functions" or "tables").

function link_to (fname, doc, module_doc, file_doc, from, kind)
	assert(fname)
	assert(doc)
	from = from or ""
	kind = kind or "functions"

	if file_doc then
		for _, func_name in pairs(file_doc[kind]) do
			if func_name == fname then
				return file_link(file_doc.name, from) .. "#" .. fname
			end
		end
	end

	local _, _, modulename, fname = string.find(fname, "^(.-)[%.%:]?([^%.%:]*)$")
	assert(fname)

	-- if fname does not specify a module, use the module_doc
	if string.len(modulename) == 0 and module_doc then
		modulename = module_doc.name
	end

	local module_doc = doc.modules[modulename]
	if not module_doc then
--		logger:error(string.format("unresolved reference to function `%s': module `%s' not found", fname, modulename))
		return
	end

	for _, func_name in pairs(module_doc[kind]) do
		if func_name == fname then
			return module_link(modulename, doc, from) .. "#" .. fname
		end
	end

--	logger:error(string.format("unresolved reference to function `%s' of module `%s'", fname, modulename))
end

-------------------------------------------------------------------------------
-- Make a link to a file, module or function

function symbol_link (symbol, doc, module_doc, file_doc, from)
	assert(symbol)
	assert(doc)

	local href =
--		file_link(symbol, from) or
		module_link(symbol, doc, from) or
		link_to(symbol, doc, module_doc, file_doc, from, "functions") or
		link_to(symbol, doc, module_doc, file_doc, from, "tables")

	if not href then
		logger:error(string.format("unresolved reference to symbol `%s'", symbol))
	end

	return href or ""
end

-------------------------------------------------------------------------------
-- Assembly the output filename for an input file.
-- TODO: change the name of this function
function out_file (filename)
	local h = filename
	h = string.gsub(h, "lua$", "html")
	h = string.gsub(h, "luadoc$", "html")
	h = "files/" .. h
--	h = options.output_dir .. string.gsub (h, "^.-([%w_]+%.html)$", "%1")
	h = options.output_dir .. h
	return h
end

-------------------------------------------------------------------------------
-- Assembly the output filename for a module.
-- TODO: change the name of this function
function out_module (modulename)
	local h = modulename .. ".html"
	h = "modules/" .. h
	h = options.output_dir .. h
	return h
end

-------------------------------------------------------------------------------
-- Update a table to make all string values refelect html tags for linebreaks
-- a leading spaces.
function fixhtmltable (doc)
    for k,v in pairs(doc) do
        if type(v) == "string" then
            -- update string value
            local s = string.gsub(v, "\n", "
")
            s = string.gsub(s, "
 ", "
&nbsp")
            while string.find(s, "&nbsp ") do
                s = string.gsub(s, "&nbsp ", "&nbsp&nbsp")
            end
            doc[k] = s
        elseif type(v) == "table" then
            -- recurse update table
            fixhtmltable(v)
        end
    end
end

-----------------------------------------------------------------
-- Generate the output.
-- @param doc Table with the structured documentation.

function start (doc)
    -- Pre proces doc table, replacing linebreaks and leading space by html equiv.
    fixhtmltable(doc)
	-- Generate index file
	if (#doc.files > 0 or #doc.modules > 0) and (not options.noindexpage) then
		local filename = options.output_dir.."index.html"
		logger:info(string.format("generating file `%s'", filename))
		local f = lfs.open(filename, "w")
		assert(f, string.format("could not open `%s' for writing", filename))
		io.output(f)
		include("index.lp", { doc = doc })
		f:close()
	end

	-- Process modules
	if not options.nomodules then
		for _, modulename in ipairs(doc.modules) do
			local module_doc = doc.modules[modulename]
			-- assembly the filename
			local filename = out_module(modulename)
			logger:info(string.format("generating file `%s'", filename))

			local f = lfs.open(filename, "w")
			assert(f, string.format("could not open `%s' for writing", filename))
			io.output(f)
			include("module.lp", { doc = doc, module_doc = module_doc })
			f:close()
		end
	end

	-- Process files
	if not options.nofiles then
		for _, filepath in ipairs(doc.files) do
			local file_doc = doc.files[filepath]
			-- assembly the filename
			local filename = out_file(file_doc.name)
			logger:info(string.format("generating file `%s'", filename))

			local f = lfs.open(filename, "w")
			assert(f, string.format("could not open `%s' for writing", filename))
			io.output(f)
			include("file.lp", { doc = doc, file_doc = file_doc} )
			f:close()
		end
	end

	-- copy extra files
	local f = lfs.open(options.output_dir.."luadoc.css", "w")
	io.output(f)
	include("luadoc.css")
	f:close()
end


text:
#ifdef __QNX__
#include <process.h>
#else  // __QNX__
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#endif  // __QNX__

#include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>

#include "utils/logger.h"
#include "utils/system.h"

namespace utils {

SDL_CREATE_LOG_VARIABLE("Utils")

struct GetCString {
  char* operator()(const std::string& string) {
    return const_cast<char*>(string.c_str());
  }
};

System::System(const std::string& command) : command_(command) {
  argv_.push_back(command);
}

System::System(const std::string& file, const std::string& command)
    : command_(file) {
  argv_.push_back(command);
}

System& System::Add(const std::string& arg) {
  argv_.push_back(arg);
  return *this;
}

std::string System::command() const {
  return command_;
}

std::vector<std::string> System::argv() const {
  return argv_;
}

bool System::Execute() {
  return Execute(false);
}

#ifdef __QNX__

bool System::Execute(bool wait) {
  size_t size = argv_.size();
  char** argv = new char*[size + 1];
  std::transform(argv_.begin(), argv_.end(), argv, GetCString());
  argv[size] = NULL;

  int mode = wait ? P_WAIT : P_NOWAIT;
  int ret = spawnvp(mode, command_.c_str(), argv);
  delete[] argv;

  if (ret == -1) {
    SDL_LOG_ERROR("Can't execute command: " << command_ << " Errno is: "
                                            << std::strerror(errno));
    return false;
  }

  if (wait) {
    return WEXITSTATUS(ret) == 0;
  }

  return true;
}

#else  // __QNX__

bool System::Execute(bool wait) {
  // Create a child process.
  pid_t pid_command = fork();

  switch (pid_command) {
    case -1: {  // Error
      SDL_LOG_FATAL("fork() failed!");
      return false;
    }
    case 0: {  // Child process
      int32_t fd_dev0 = open("/dev/null", O_RDWR, S_IWRITE);
      if (0 > fd_dev0) {
        SDL_LOG_FATAL("Open dev0 failed!");
        return false;
      }
      // close input/output file descriptors.
      close(STDIN_FILENO);
      close(STDOUT_FILENO);
      close(STDERR_FILENO);

      // move input/output to /dev/null.
      dup2(fd_dev0, STDIN_FILENO);
      dup2(fd_dev0, STDOUT_FILENO);
      dup2(fd_dev0, STDERR_FILENO);

      size_t size = argv_.size();
      char** argv = new char*[size + 1];
      std::transform(argv_.begin(), argv_.end(), argv, GetCString());
      argv[size] = NULL;

      // Execute the program.
      if (execvp(command_.c_str(), argv) == -1) {
        SDL_LOG_ERROR("Can't execute command: " << command_);
        _exit(EXIT_FAILURE);
      }
      delete[] argv;

      return true;
    }
    default: { /* Parent process */
      SDL_LOG_INFO("Process created with pid " << pid_command);
      if (wait) {
        int status;
        pid_t wait_pid;
        do {
          wait_pid = waitpid(pid_command, &status, WUNTRACED | WCONTINUED);
          if (wait_pid == -1) {
            SDL_LOG_ERROR_WITH_ERRNO("Can't wait");
            _exit(EXIT_FAILURE);
            return false;
          }
        } while (!WIFEXITED(status) && !WIFSIGNALED(status));
        return WEXITSTATUS(status) == 0;
      }

      return true;
    }
  }
}

#endif  // __QNX__

}  // namespace utils


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

namespace OkayCloudSearch.Query.Boolean
{
    public class ListBooleanCondition<T> : BooleanCondition
    {
        public string Field { get; set; }
        public List<T> Conditions { get; protected set; }
        public override bool IsOrCondition { get; set; }

        public override string GetQueryString()
        {
            List<string> stringConditions = Conditions
                .Select(x => x is string ? EncodeCondition(x as string)
                    : x.ToString()).ToList();

            return "(" + Field + ":(" + String.Join(Conditional, stringConditions) + "))";
        }

        private string Conditional
        {
            get
            {
                return IsOrCondition ?
                    Constants.Operators.Or.ToQueryString() : Constants.Operators.And.ToQueryString();
            }
        }

        public override bool IsList()
        {
            return true;
        }
    }
}


text:
var assert = require('assert');
var breathe = require('../breathe.js');

var initValue = 'init value';
var testValue = 'test value';
var testErrorMessage = 'test error message';
var testIterations = 11;

var getMilliseconds = function () {
  var hrtime = process.hrtime();
  return hrtime[0] * 1000000 + hrtime[1] / 1000;
};

var delayedPromise = function (timeout, val) {
  return new Promise(function (resolve, reject) {
    setTimeout(function () {
      resolve(val);
    }, timeout);
  });
};

var blockingRecursiveChain = function (remaining, fn) {
  if (fn) {
    fn();
  }
  if (!remaining) {
    return breathe.chain();
  }
  var start = getMilliseconds();
  while (getMilliseconds() - start < 1) {
    // wait
  }
  return breathe.chain().then(function () {
    return blockingRecursiveChain(remaining - 1, fn);
  });
};

var blockingChain = function (time) {
  return breathe.chain(function (resolve, reject) {
    var i=0;
    var start = getMilliseconds();
    while (getMilliseconds() - start < time) {
      // wait
      i++;
    }
    resolve();
  });
};

describe('`breathe`', function () {
  beforeEach(function () {
    breathe.setBatchTime(17);
  });
  describe('`breathe.chain`', function () {

    it('should be able to resolve a value', function () {
      return breathe.chain(testValue).then(function (d) {
        assert.equal(d, testValue);
      });
    });

    it('should be able to resolve a promise', function () {
      return breathe.chain(Promise.resolve(testValue))
        .then(function (d) {
          assert.equal(d, testValue);
        });
    });

    it('should be able to resolve a pending promise', function () {
      return breathe.chain(delayedPromise(10, testValue))
        .then(function (d) {
          assert.equal(d, testValue);
        });
    });

    it('should not immediately resolve', function () {
      var c = initValue;
      var chain = breathe.chain(function (resolve, reject) {
        c = testValue;
        resolve();
      });
      assert.equal(c, initValue);
      return chain;
    });

    describe('`then`', function () {
      it('should be able to resolve a returned value', function () {
        return breathe.chain()
          .then(function () {
            return testValue;
          }).then(function (d) {
            assert.equal(d, testValue);
          });
      });

      it('should be able to resolve a returned promise', function () {
        return breathe.chain().then(function () {
          return Promise.resolve(testValue);
        }).then(function (d) {
          assert.equal(d, testValue);
        });
      });

      it('should be able to resolve a returned pending promise', function () {
        return breathe.chain().then(function () {
          return delayedPromise(10, testValue);
        }).then(function (d) {
          assert.equal(d, testValue);
        });
      });

      it('should be able to resolve a returned `breathe.chain`', function () {
        return breathe.chain().then(function () {
          return breathe.chain(testValue);
        }).then(function (d) {
          assert.equal(d, testValue);
        });
      });

      it('should relinquish the main thread when over batch time', function () {
        breathe.setBatchTime(5);
        var v = initValue;
        var d = blockingRecursiveChain(100);
        setTimeout(function () {
          v = testValue;
        }, 15);
        return d.then(function () {
          assert.equal(v, testValue);
        });
      });

      it('should not relinquish the main thread while under batch time', function () {
        breathe.setBatchTime(500);
        var v = initValue;
        var d = blockingRecursiveChain(100);
        setTimeout(function () {
          v = testValue;
        }, 15);
        return d.then(function () {
          assert.equal(v, initValue);
        });
      });

      it('should be able to catch thrown errors', function () {
        return breathe.chain(Promise.reject(testErrorMessage))
          .then(null, function (err) {
            assert.equal(testErrorMessage, err);
          });
      });

      it('should be able to catch thrown errors and then resolve values', function () {
        return breathe.chain(Promise.reject(testErrorMessage))
          .then(null, function (err) {
            return testValue;
          }).then(function (d) {
            assert.equal(d, testValue);
          });
      });

      it('should not catch errors thrown from the same `then` call', function () {
        var v = initValue;
        return breathe.chain()
          .then(function () {
            throw testErrorMessage;
          }, function (err) {
            assert(testErrorMessage !== err);
          }).then(null, function (err) {
            assert.equal(testErrorMessage, err);
          });
      });
    });

    describe('`catch`', function () {

      it('should be able to catch thrown errors', function () {
        return breathe.chain(Promise.reject(testErrorMessage))
          .catch(function (err) {
            assert.equal(testErrorMessage, err);
          });
      });

      it('should be able to resolve values', function () {
        return breathe.chain(Promise.reject(testErrorMessage))
          .catch(function (err) {
            return testValue;
          }).then(function (d) {
            assert.equal(d, testValue);
          });
      });

    });
  });

  describe('`breathe.loop`', function () {

    it('should repeat the body while the condition is true', function () {
      var i = 0;
      return breathe.loop(function () {
        return i < testIterations;
      }, function () {
        i++;
      }).then(function (d) {
        assert.equal(i, testIterations);
      });
    });

    it('can take a configuration object as an argument', function () {
      var i = 0;
      return breathe.loop({
          condition: function () {
              return i < testIterations;
            },
          body: function () {
              i++;
            }}).then(function (d) {
        assert.equal(i, testIterations);
      });
    });

    it('should not immediately run', function () {
      var i = 0, c = initValue;
      var loop = breathe.loop(function () {
        return i < testIterations;
      }, function () {
        i++;
        c = testValue;
      });
      assert.equal(c, initValue);
      return loop;
    });

    it('should wait for a returned promise to resolve before continuing', function () {
      var i = 0;
      var v = initValue;
      var iterations = 4;
      var timeout = 5;
      var t = getMilliseconds();
      return breathe.loop(function () {
        return i < iterations;
      }, function () {
        i++;
        assert.equal(v, initValue);
        v = testValue;
        return delayedPromise(timeout).then(function () {
          v = initValue;
        });
      }).then(function () {
        assert.equal(v, initValue);
        // may want to tweak reasonableTime if setTimeout isn't accurate
        var wiggleRoom = 3 / 4;
        var reasonableTime = (getMilliseconds() - t) > iterations * timeout * wiggleRoom;
        assert(reasonableTime);
      });
    });

    it('should relinquish the main thread when over batch time', function () {
      breathe.setBatchTime(5);
      var v = initValue;
      var i = 0;
      var ret = breathe.loop(function () {
        return i < 200;
      }, function () {
        i++;
        return blockingChain(1);
      });
      setTimeout(function () {
        v = testValue;
      }, 15);
      return ret.then(function () {
        assert.equal(v, testValue);
      });
    });

    it('should not relinquish the main thread while under batch time', function () {
      breathe.setBatchTime(500);
      var v = initValue;
      var i = 0;
      var ret = breathe.loop(function () {
        return i < 200;
      }, function () {
        i++;
        return blockingChain(1);
      });
      setTimeout(function () {
        v = testValue;
      }, 15);
      return ret.then(function () {
        assert.equal(v, initValue);
      });
    });

    it('should be able to throw errors', function () {
      var i = 0;
      return breathe.loop(function () {
        return i < 10;
      }, function () {
        i++;
        if (i === 4) {
          throw testErrorMessage;
        }
      }).then(function () {
        throw new Error('Loop should have thrown an error');
      }, function (err) {
        assert.equal(err, testErrorMessage);
      });
    });

    it('should be able to nest loops', function () {
      var counter = 0;
      var i, j;
      var outerLoopIterations = 6;
      var innerLoopIterations = 7;
      i = 0;
      return breathe.loop(function () {
        return i < outerLoopIterations;
      }, function () {
        i++;
        j = 0;
        return breathe.loop(function () {
          return j < innerLoopIterations;
        }, function () {
          j++;
          counter++;
        });
      }).then(function () {
        assert.equal(counter, outerLoopIterations * innerLoopIterations);
      });
    });

    describe('`then`', function () {

      it('should be able to resolve a value', function () {
        var i = 0;
        return breathe.loop(function () {
          return i < testIterations;
        }, function () {
          i++;
        }).then(function () {
          return i;
        }).then(function (d) {
          assert.equal(d, testIterations);
        });
      });

      it('should be able to resolve a promise', function () {
        var i = 0;
        return breathe.loop(function () {
          return i < testIterations;
        }, function () {
          i++;
        }).then(function () {
          return Promise.resolve(i);
        }).then(function (d) {
          assert.equal(d, testIterations);
        });
      });

    });

  });

  describe('`breathe.times`', function () {
    it('should repeat the body function for n iterations', function () {
      var i = 0;
      return breathe.times(testIterations, function () {
        i++;
      }).then(function (d) {
        assert.equal(i, testIterations);
      });
    });

    it('can take a configuration object as an argument', function () {
      var i = 0;
      return breathe.times({
          iterations: testIterations,
          body: function () {
              i++;
            }}).then(function (d) {
        assert.equal(i, testIterations);
      });
    });

    it('should pass the body function an incrementing, zero-based counter', function () {
      var previous;
      return breathe.times(testIterations, function (i) {
        if (previous === undefined) {
          assert.equal(0, i);
        } else {
          assert.equal(previous + 1, i);
        }
        previous = i;
      });
    });

    it('should not immediately run', function () {
      var c = initValue;
      var loop = breathe.chain(testIterations, function () {
        c = testValue;
      });
      assert.equal(c, initValue);
      return loop;
    });

    it('should wait for a returned promise to resolve before continuing', function () {
      var v = initValue;
      var iterations = 4;
      var timeout = 5;
      var t = getMilliseconds();
      return breathe.times(iterations, function () {
        assert.equal(v, initValue);
        v = testValue;
        return delayedPromise(timeout).then(function () {
          v = initValue;
        });
      }).then(function () {
        assert.equal(v, initValue);
        // may want to tweak reasonableTime if setTimeout isn't accurate
        var wiggleRoom = 3 / 4;
        var reasonableTime = (getMilliseconds() - t) > iterations * timeout * wiggleRoom;
        assert(reasonableTime);
      });
    });

    it('should relinquish the main thread when over batch time', function () {
      breathe.setBatchTime(5);
      var v = initValue;
      var ret = breathe.times(100, function () {
        return blockingChain(1);
      });
      setTimeout(function () {
        v = testValue;
      }, 15);
      return ret.then(function () {
        assert.equal(v, testValue);
      });
    });

    it('should not relinquish the main thread while under batch time', function () {
      breathe.setBatchTime(500);
      var v = initValue;
      var ret = breathe.times(100, function () {
        return blockingChain(1);
      });
      setTimeout(function () {
        v = testValue;
      }, 15);
      return ret.then(function () {
        assert.equal(v, initValue);
      });
    });

    it('should be able to throw errors', function () {
      return breathe.times(10, function (i) {
        if (i === 4) {
          throw testErrorMessage;
        }
      }).then(function () {
        throw new Error('breathe.times should have thrown an error');
      }, function (err) {
        assert.equal(err, testErrorMessage);
      });
    });

    it('should be able to nest loops', function () {
      var counter = 0;
      var outerLoopIterations = 6;
      var innerLoopIterations = 7;
      return breathe.times(outerLoopIterations, function (i) {
        return breathe.times(innerLoopIterations, function (j) {
          counter++;
        });
      }).then(function () {
        assert.equal(counter, outerLoopIterations * innerLoopIterations);
      });
    });

    describe('`then`', function () {
      it('should be able to resolve a value', function () {
        var i = 0;
        return breathe.times(testIterations, function () {
          i++;
        }).then(function () {
          return i;
        }).then(function (d) {
          assert.equal(d, testIterations);
        });
      });
      it('should be able to resolve a promise', function () {
        var i = 0;
        return breathe.times(testIterations, function () {
          i++;
        }).then(function () {
          return Promise.resolve(i);
        }).then(function (d) {
          assert.equal(d, testIterations);
        });
      });
    });

  });
});


text:
using System;
using SettlersOfCatanAnalysis.Objects;

namespace SettlersOfCatanAnalysis
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine("Welcome to this Analysis of Settlers of Catan");
            Console.WriteLine("Written in C# By Jack Moorhouse advised by Eleanor Partington");

            var game = new Game(true);
            game.Start();
        }
    }
}


text:
<?php

namespace Sistema\AdminBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Sistema\AdminBundle\Entity\Solicrep
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Solicrep
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $descripcion
     *
     * @ORM\Column(name="descripcion", type="string", length=255)
     */
    private $descripcion;

    /**
     * @ORM\ManyToOne(targetEntity="Ordvolvo", inversedBy="solicitudes")
     * @ORM\JoinColumn(name="ordvolvo_id", referencedColumnName="id")
     * @var type
     */
    private $ordvolvo;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set descripcion
     *
     * @param string $descripcion
     * @return Solicrep
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

    /**
     * Get descripcion
     *
     * @return string
     */
    public function getDescripcion()
    {
        return $this->descripcion;
    }

    /**
     * Set ordvolvo
     *
     * @param Sistema\AdminBundle\Entity\Ordvolvo $ordvolvo
     */
    public function setOrdvolvo(\Sistema\AdminBundle\Entity\Ordvolvo $ordvolvo)
    {
        $this->ordvolvo = $ordvolvo;
    }

    /**
     * Get ordvolvo
     *
     * @return Sistema\AdminBundle\Entity\Ordvolvo
     */
    public function getOrdvolvo()
    {
        return $this->ordvolvo;
    }
}


text:
import { ajax } from 'rxjs/observable/dom/ajax';
import { createAction } from 'redux-actions';

import { usersUrls } from '../../../../config/server-urls.constants'
import { fetchPatientContactsUpdateRequest } from './fetch-patient-contacts.duck'

export const FETCH_PATIENT_CONTACTS_DETAIL_EDIT_REQUEST = 'FETCH_PATIENT_CONTACTS_DETAIL_EDIT_REQUEST';
export const FETCH_PATIENT_CONTACTS_DETAIL_EDIT_SUCCESS = 'FETCH_PATIENT_CONTACTS_DETAIL_EDIT_SUCCESS';
export const FETCH_PATIENT_CONTACTS_DETAIL_EDIT_FAILURE = 'FETCH_PATIENT_CONTACTS_DETAIL_EDIT_FAILURE';

export const fetchPatientContactsDetailEditRequest = createAction(FETCH_PATIENT_CONTACTS_DETAIL_EDIT_REQUEST);
export const fetchPatientContactsDetailEditSuccess = createAction(FETCH_PATIENT_CONTACTS_DETAIL_EDIT_SUCCESS);
export const fetchPatientContactsDetailEditFailure = createAction(FETCH_PATIENT_CONTACTS_DETAIL_EDIT_FAILURE);

export const fetchPatientContactsDetailEditEpic = (action$, store) =>
  action$.ofType(FETCH_PATIENT_CONTACTS_DETAIL_EDIT_REQUEST)
    .mergeMap(({ payload }) =>
      ajax.put(`${usersUrls.PATIENTS_URL}/${payload.userId}/contacts/${payload.sourceId}`, payload, {
        Cookie: store.getState().credentials.cookie,
        'Content-Type': 'application/json',
      })
        .flatMap(({ response }) => {
          const userId = payload.userId;
          const sourceId = payload.sourceId;

          return [
            fetchPatientContactsDetailEditSuccess(response),
            fetchPatientContactsUpdateRequest({ userId, sourceId }),
          ];
        })
    );

export default function reducer(contactsDetailEdit = {}, action) {
  switch (action.type) {
    case FETCH_PATIENT_CONTACTS_DETAIL_EDIT_SUCCESS:
      return action.payload;
    default:
      return contactsDetailEdit;
  }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.ComponentModel.Composition;
using Microsoft.Common.Core.Diagnostics;
using Microsoft.Common.Core.Shell;
using Microsoft.Languages.Editor.ViewModel;
using Microsoft.Markdown.Editor.ContentTypes;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Utilities;

namespace Microsoft.Markdown.Editor.ViewModel {
    /// <summary>
    /// Editor instance factory. Typically imported via MEF
    /// in the host application editor factory such as in
    /// IVsEditorFactory.CreateEditorInstance.
    /// </summary>
    [Export(typeof(IEditorViewModelFactory))]
    [ContentType(MdContentTypeDefinition.ContentType)]
    internal class MdEditorViewModelFactory : IEditorViewModelFactory {
        private readonly ICoreShell _coreShell;

        [ImportingConstructor]
        public MdEditorViewModelFactory(ICoreShell coreShell) {
            _coreShell = coreShell;
        }

        public IEditorViewModel CreateEditorViewModel(ITextBuffer textBuffer) {
            Check.ArgumentNull(nameof(textBuffer), textBuffer);
            return new MdEditorViewModel(textBuffer, _coreShell.Services);
        }
    }
}


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

<title>Using the GNU Compiler Collection (GCC): Blackfin Built-in Functions</title>

<meta name="description" content="Using the GNU Compiler Collection (GCC): Blackfin Built-in Functions">
<meta name="keywords" content="Using the GNU Compiler Collection (GCC): Blackfin Built-in Functions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Target-Builtins.html#Target-Builtins" rel="up" title="Target Builtins">
<link href="FR_002dV-Built_002din-Functions.html#FR_002dV-Built_002din-Functions" rel="next" title="FR-V Built-in Functions">
<link href="AVR-Built_002din-Functions.html#AVR-Built_002din-Functions" rel="prev" title="AVR Built-in Functions">

Next: FR-V Built-in Functions, Previous: AVR Built-in Functions, Up: Target Builtins   [Contents][Index]

6.59.11 Blackfin Built-in Functions

Currently, there are two Blackfin-specific built-in functions.  These are
used for generating CSYNC and SSYNC machine insns without
using inline assembly; by using these built-in functions the compiler can
automatically add workarounds for hardware errata involving these
instructions.  These functions are named as follows:

void __builtin_bfin_csync (void)
void __builtin_bfin_ssync (void)


text:
package org.apache.pig.backend.hadoop.executionengine.mapReduceLayer;

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparator;
import org.apache.hadoop.mapred.JobConf;

import org.apache.pig.impl.io.NullableText;
import org.apache.pig.impl.util.ObjectSerializer;

public class PigTextRawComparator extends WritableComparator implements Configurable {

    private final Log mLog = LogFactory.getLog(getClass());
    private boolean[] mAsc;
    private Text.Comparator mWrappedComp;

    public PigTextRawComparator() {
        super(NullableText.class);
        mWrappedComp = new Text.Comparator();
    }

    public void setConf(Configuration conf) {
        if (!(conf instanceof JobConf)) {
            mLog.warn("Expected jobconf in setConf, got " +
                conf.getClass().getName());
            return;
        }
        JobConf jconf = (JobConf)conf;
        try {
            mAsc = (boolean[])ObjectSerializer.deserialize(jconf.get(
                "pig.sortOrder"));
        } catch (IOException ioe) {
            String msg = "Unable to deserialize pig.sortOrder";
            throw new RuntimeException(msg, ioe);
        }
        if (mAsc == null) {
            mAsc = new boolean[1];
            mAsc[0] = true;
        }
    }

    public Configuration getConf() {
        return null;
    }

    /**
     * Compare two NullableTextWritables as raw bytes.  If neither are null,
     * then IntWritable.compare() is used.  If both are null then the indices
     * are compared.  Otherwise the null one is defined to be less.
     */
    public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
        int rc = 0;

        // If either are null, handle differently.
        if (b1[s1] == 0 && b2[s2] == 0) {
            rc = mWrappedComp.compare(b1, s1 + 1, l1 - 2, b2, s2 + 1, l2 - 2);
        } else {
            // For sorting purposes two nulls are equal.
            if (b1[s1] != 0 && b2[s2] != 0) rc = 0;
            else if (b1[s1] != 0) rc = -1;
            else rc = 1;
        }
        if (!mAsc[0]) rc *= -1;
        return rc;
    }

    public int compare(Object o1, Object o2) {
        NullableText nt1 = (NullableText)o1;
        NullableText nt2 = (NullableText)o2;
        int rc = 0;

        // If either are null, handle differently.
        if (!nt1.isNull() && !nt2.isNull()) {
            rc = ((String)nt1.getValueAsPigType()).compareTo((String)nt2.getValueAsPigType());
        } else {
            // For sorting purposes two nulls are equal.
            if (nt1.isNull() && nt2.isNull()) rc = 0;
            else if (nt1.isNull()) rc = -1;
            else rc = 1;
        }
        if (!mAsc[0]) rc *= -1;
        return rc;
    }

}


text:
layout: sidebar-right
title: "Listen to some great recent soundtracks with our Freegal service"
date: 2019-08-02
author: lisa-brennan
category: articles
tag: elibrary
excerpt: "Add a touch of drama to your everyday life with the latest soundtracks on Freegal."
featured-image: /images/featured/featured-soundtracks-2.jpg
featured-alt: "Stranger Things: Soundtrack from the Netflix Original Series, Season 3, The Chaperone (Original Motion Picture Soundtrack)"
breadcrumb: articles
---

Add a touch of drama to your everyday life with the latest soundtracks on Freegal.

[Set up Freegal →](/elibrary/freegal/)

Thomas Newman - Tolkien (Original Motion Picture Soundtrack)

Timothy Williams - Brightburn (Original Motion Picture Soundtrack)

Various artists - The Chaperone (Original Motion Picture Soundtrack)

Benjamin Wallfisch - Hellboy (Original Motion Picture Soundtrack)

Joseph Bishara - The Prodigy (Original Motion Picture Soundtrack)

Michael Giachhino - Spider-Man: Far from Home (Original Motion Picture Soundtrack)

Andrew Lockington - Frontier (Original Series Soundtrack)

Various artists - Stranger Things: Soundtrack from the Netflix Original Series, Season 3


text:
/* global assert, process, setup, suite, test */
var entityFactory = require('../helpers').entityFactory;

suite('laser-controls', function () {
  var el;

  setup(function (done) {
    el = entityFactory();
    el.addEventListener('componentinitialized', function (evt) {
      if (evt.detail.name !== 'laser-controls') { return; }
      done();
    });
    el.setAttribute('laser-controls', '');
  });

  suite('init', function () {
    test('injects controllers', function () {
      assert.ok(el.components['daydream-controls']);
      assert.ok(el.components['gearvr-controls']);
      assert.ok(el.components['oculus-go-controls']);
      assert.ok(el.components['oculus-touch-controls']);
      assert.ok(el.components['vive-controls']);
      assert.ok(el.components['windows-motion-controls']);
    });

    test('does not inject cursor yet', function () {
      assert.notOk(el.components.cursor);
    });

    test('injects cursor when controller connected', function (done) {
      el.emit('controllerconnected', {name: 'vive-controls'});
      setTimeout(() => {
        var cursor = el.getAttribute('cursor');
        var raycaster = el.getAttribute('raycaster');
        assert.notOk(cursor.fuse);
        assert.ok(raycaster.showLine);
        assert.ok(cursor.downEvents.length);
        assert.ok(cursor.upEvents.length);
        done();
      });
    });

    test('configures raycaster for oculus-touch-controls', function (done) {
      el.emit('controllerconnected', {name: 'gearvr-controls'});
      setTimeout(() => {
        var raycaster = el.getAttribute('raycaster');
        assert.equal(raycaster.origin.x, 0);
        assert.equal(raycaster.origin.y, 0.0005);
        done();
      });
    });

    test('creates line', function (done) {
      el.emit('controllerconnected', {name: 'daydream-controls'});
      setTimeout(() => {
        assert.ok(el.getAttribute('line').color);
        done();
      });
    });

    test('respects set line color', function (done) {
      el.setAttribute('line', 'color', 'red');
      el.emit('controllerconnected', {name: 'daydream-controls'});
      setTimeout(() => {
        assert.equal(el.getAttribute('line').color, 'red');
        done();
      });
    });
  });
});


text:
import React from 'react';
import PropTypes from 'prop-types';

import Badge from '../Badge';
import Draggable from '../Draggable';

import dynamicsFont from '../../assets/DynamicsFont/DynamicsFont.scss';
import styles from './styles.scss';

export default function ActiveCallBadge(props) {
  return (
    <Draggable
      className={styles.root}
      onClick={props.onClick}
      positionOffsetX={props.offsetX}
      positionOffsetY={props.offsetY}
      updatePositionOffset={props.updatePositionOffset}
    >
      <Badge
        className={styles.badge}
        name={props.title}
      >
        <span className={styles.activeIcon}>
          <i className={dynamicsFont.callHover} />
        </span>
        {props.title}
      </Badge>
    </Draggable>
  );
}

ActiveCallBadge.propTypes = {
  onClick: PropTypes.func.isRequired,
  offsetX: PropTypes.number.isRequired,
  offsetY: PropTypes.number.isRequired,
  updatePositionOffset: PropTypes.func.isRequired,
  title: PropTypes.string,
};

ActiveCallBadge.defaultProps = {
  title: 'Active Call',
};


text:
class CJDebugType : public CJObjType {
 public:
  static CJObjTypeP instance(CJavaScript *js);

  CJDebugType(CJavaScript *js);

  CJValueP exec(CJavaScript *js, const std::string &name, const Values &values) override;

 private:
  static CJObjTypeP type_;
};

// Debug Object
class CJDebugObject : public CJObj {
 public:
  CJDebugObject(CJavaScript *js);

  CJDebugObject(const CJDebugObject &obj);

  CJValue *dup(CJavaScript *) const override { return new CJDebugObject(*this); }

  CJValueP execNameFn(CJavaScript *js, const std::string &name, const Values &values) override;

  std::string toString() const override;

  void print(std::ostream &os) const override;
};

#endif


text:
import template from './viewer.html';
import { LOADING_EVENT, GRAPH_EVENT } from '../../services/event-strings';

import '../../../assets/img/loading-crop.gif';

export const ViewerComponent = {

  template,
  bindings: {
    topology: '<',
    fwgraphs: '<',
    errors: '<',
    warnings: '<',
  },
  controller: class ViewerComponent {
    constructor($scope, ValidatorService) {
      'ngInject';

      this.scope = $scope;
      this.validatorService = ValidatorService;
      this.project = {
        name: '',
      };
      this.searchTerm = '';
      this.isLoading = false;
      this.scope.isValid = false;
    }

    $onInit() {
      this.scope.$on(LOADING_EVENT, (event, data) => {
        this.isLoading = data.isLoading;
        this.scope.isInvalid = data.isInvalid;
        this.scope.message = data.message;
      });

      this.scope.$on(GRAPH_EVENT.CAST, (event, data) => {
        if (this.scope.fwgraph.id !== data.id) {
          const found = this.fwgraphs.find(fwg => fwg.id === data.id);
          if (found) {
            found.isActive = data.visible;
            this.scope.fwgraph = found;
          }
        } else {
          this.scope.fwgraph.isActive = data.visible;
        }
      });
    }

    $onChanges(changesObj) {
      if (changesObj.errors) {
        this.tmperrors = changesObj.errors.currentValue;
      }

      if (changesObj.warnings) {
        this.tmpwarnings = changesObj.warnings.currentValue;
      }
      if (changesObj.topology && changesObj.topology.currentValue) {
        this.isLoading = false;
        this.scope.topology = changesObj.topology.currentValue;
        this.scope.errors = this.tmperrors;
        this.scope.warnings = this.tmpwarnings;
        this.scope.isValid = true;
      } else if (changesObj.topology) {
        if (changesObj.topology.currentValue === null) {
          this.clearData();
        }
      }

      if (changesObj.fwgraphs && changesObj.fwgraphs.currentValue) {
        this.fwgraphs = changesObj.fwgraphs.currentValue;
        this.scope.fwgraph = this.fwgraphs[0];
      }
    }

    clearData() {
      this.scope.topology = null;
      this.fwgraphs.length = 0;
      this.scope.fwgraph = null;
    }
  },
};

export default ViewerComponent;


text:
/********************************************************************************/
/*										*/
/*			     				*/
/*			     Written by Ken Goldman				*/
/*		       IBM Thomas J. Watson Research Center			*/
/*            $Id: StartAuthSession_fp.h 809 2016-11-16 18:31:54Z kgoldman $	*/
/*										*/
/*  Licenses and Notices							*/
/*										*/
/*  1. Copyright Licenses:							*/
/*										*/
/*  - Trusted Computing Group (TCG) grants to the user of the source code in	*/
/*    this specification (the "Source Code") a worldwide, irrevocable, 		*/
/*    nonexclusive, royalty free, copyright license to reproduce, create 	*/
/*    derivative works, distribute, display and perform the Source Code and	*/
/*    derivative works thereof, and to grant others the rights granted herein.	*/
/*										*/
/*  - The TCG grants to the user of the other parts of the specification 	*/
/*    (other than the Source Code) the rights to reproduce, distribute, 	*/
/*    display, and perform the specification solely for the purpose of 		*/
/*    developing products based on such documents.				*/
/*										*/
/*  2. Source Code Distribution Conditions:					*/
/*										*/
/*  - Redistributions of Source Code must retain the above copyright licenses, 	*/
/*    this list of conditions and the following disclaimers.			*/
/*										*/
/*  - Redistributions in binary form must reproduce the above copyright 	*/
/*    licenses, this list of conditions	and the following disclaimers in the 	*/
/*    documentation and/or other materials provided with the distribution.	*/
/*										*/
/*  3. Disclaimers:								*/
/*										*/
/*  - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF	*/
/*  LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH	*/
/*  RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES)	*/
/*  THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE.		*/
/*  Contact TCG Administration (admin@trustedcomputinggroup.org) for 		*/
/*  information on specification licensing rights available through TCG 	*/
/*  membership agreements.							*/
/*										*/
/*  - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED 	*/
/*    WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR 	*/
/*    FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR 		*/
/*    NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY 		*/
/*    OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE.		*/
/*										*/
/*  - Without limitation, TCG and its members and licensors disclaim all 	*/
/*    liability, including liability for infringement of any proprietary 	*/
/*    rights, relating to use of information in this specification and to the	*/
/*    implementation of this specification, and TCG disclaims all liability for	*/
/*    cost of procurement of substitute goods or services, lost profits, loss 	*/
/*    of use, loss of data or any incidental, consequential, direct, indirect, 	*/
/*    or special damages, whether under contract, tort, warranty or otherwise, 	*/
/*    arising in any way out of use or reliance upon this specification or any 	*/
/*    information herein.							*/
/*										*/
/*  (c) Copyright IBM Corp. and others, 2012-2015				*/
/*										*/
/********************************************************************************/

/* rev 119 */

#ifndef STARTAUTHSESSION_FP_H
#define STARTAUTHSESSION_FP_H

typedef struct {
    TPMI_DH_OBJECT		tpmKey;
    TPMI_DH_ENTITY		bind;
    TPM2B_NONCE			nonceCaller;
    TPM2B_ENCRYPTED_SECRET	encryptedSalt;
    TPM_SE			sessionType;
    TPMT_SYM_DEF		symmetric;
    TPMI_ALG_HASH		authHash;
} StartAuthSession_In;

typedef struct {
    TPMI_SH_AUTH_SESSION	sessionHandle;
    TPM2B_NONCE			nonceTPM;
} StartAuthSession_Out;

#define RC_StartAuthSession_tpmKey 		(TPM_RC_H + TPM_RC_1)
#define RC_StartAuthSession_bind 		(TPM_RC_H + TPM_RC_2)
#define RC_StartAuthSession_nonceCaller 	(TPM_RC_P + TPM_RC_1)
#define RC_StartAuthSession_encryptedSalt 	(TPM_RC_P + TPM_RC_2)
#define RC_StartAuthSession_sessionType 	(TPM_RC_P + TPM_RC_3)
#define RC_StartAuthSession_symmetric 		(TPM_RC_P + TPM_RC_4)
#define RC_StartAuthSession_authHash 		(TPM_RC_P + TPM_RC_5)

TPM_RC
TPM2_StartAuthSession(
		      StartAuthSession_In     *in,            // IN: input parameter buffer
		      StartAuthSession_Out    *out            // OUT: output parameter buffer
		      );

#endif