text:
package com.capitalone.dashboard.request;

import javax.validation.constraints.NotNull;

public class DeployDataCreateRequest {
    @NotNull
    private String executionId;
    @NotNull
    private String jobUrl;
    @NotNull
    private String appName;
    @NotNull
    private String envName;
    @NotNull
    private String artifactName;
    @NotNull
    private String artifactVersion;
    @NotNull
    private String jobName;
    @NotNull
    private String instanceUrl;
    @NotNull
    private String deployStatus;
    @NotNull
    private long startTime;

    private String artifactGroup;
    private String hygieiaId;
    private long endTime;
    private long duration;
    private String startedBy;
    private String collectorName;
    private String niceName;

    public String getExecutionId() {
        return executionId;
    }

    public void setExecutionId(String executionId) {
        this.executionId = executionId;
    }

    public String getJobUrl() {
        return jobUrl;
    }

    public void setJobUrl(String jobUrl) {
        this.jobUrl = jobUrl;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getEnvName() {
        return envName;
    }

    public void setEnvName(String envName) {
        this.envName = envName;
    }

    public String getArtifactName() {
        return artifactName;
    }

    public void setArtifactName(String artifactName) {
        this.artifactName = artifactName;
    }

    public String getArtifactVersion() {
        return artifactVersion;
    }

    public void setArtifactVersion(String artifactVersion) {
        this.artifactVersion = artifactVersion;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getInstanceUrl() {
        return instanceUrl;
    }

    public void setInstanceUrl(String instanceUrl) {
        this.instanceUrl = instanceUrl;
    }

    public String getDeployStatus() {
        return deployStatus;
    }

    public void setDeployStatus(String deployStatus) {
        this.deployStatus = deployStatus;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public String getArtifactGroup() {
        return artifactGroup;
    }

    public void setArtifactGroup(String artifactGroup) {
        this.artifactGroup = artifactGroup;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public String getStartedBy() {
        return startedBy;
    }

    public void setStartedBy(String startedBy) {
        this.startedBy = startedBy;
    }

    public String getCollectorName() {
        return collectorName;
    }

    public void setCollectorName(String collectorName) {
        this.collectorName = collectorName;
    }

    public String getHygieiaId() {
        return hygieiaId;
    }

    public void setHygieiaId(String hygieiaId) {
        this.hygieiaId = hygieiaId;
    }

    public String getNiceName() {
        return niceName;
    }

    public void setNiceName(String niceName) {
        this.niceName = niceName;
    }
}


text:
rcube2pam
==============

more secure way to change linux user passwords from roundcube.

1. change UNIX user password without disabling selinux and enablig dangerous PHP functions.
2. async.
3. Linux service (runs in background).
4. Small footprint.
5. Events loging.
6. Includes: LSB service and php driver for roundcube password plugin.

redpajama_set_name: RedPajamaGithub


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v10/errors/bidding_strategy_error.proto

namespace Google\Ads\GoogleAds\V10\Errors\BiddingStrategyErrorEnum;

use UnexpectedValueException;

/**
 * Enum describing possible bidding strategy errors.
 *
 * Protobuf type google.ads.googleads.v10.errors.BiddingStrategyErrorEnum.BiddingStrategyError
 */
class BiddingStrategyError
{
    /**
     * Enum unspecified.
     *
     * Generated from protobuf enum UNSPECIFIED = 0;
     */
    const UNSPECIFIED = 0;
    /**
     * The received error code is not known in this version.
     *
     * Generated from protobuf enum UNKNOWN = 1;
     */
    const UNKNOWN = 1;
    /**
     * Each bidding strategy must have a unique name.
     *
     * Generated from protobuf enum DUPLICATE_NAME = 2;
     */
    const DUPLICATE_NAME = 2;
    /**
     * Bidding strategy type is immutable.
     *
     * Generated from protobuf enum CANNOT_CHANGE_BIDDING_STRATEGY_TYPE = 3;
     */
    const CANNOT_CHANGE_BIDDING_STRATEGY_TYPE = 3;
    /**
     * Only bidding strategies not linked to campaigns, adgroups or adgroup
     * criteria can be removed.
     *
     * Generated from protobuf enum CANNOT_REMOVE_ASSOCIATED_STRATEGY = 4;
     */
    const CANNOT_REMOVE_ASSOCIATED_STRATEGY = 4;
    /**
     * The specified bidding strategy is not supported.
     *
     * Generated from protobuf enum BIDDING_STRATEGY_NOT_SUPPORTED = 5;
     */
    const BIDDING_STRATEGY_NOT_SUPPORTED = 5;
    /**
     * The bidding strategy is incompatible with the campaign's bidding
     * strategy goal type.
     *
     * Generated from protobuf enum INCOMPATIBLE_BIDDING_STRATEGY_AND_BIDDING_STRATEGY_GOAL_TYPE = 6;
     */
    const INCOMPATIBLE_BIDDING_STRATEGY_AND_BIDDING_STRATEGY_GOAL_TYPE = 6;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::DUPLICATE_NAME => 'DUPLICATE_NAME',
        self::CANNOT_CHANGE_BIDDING_STRATEGY_TYPE => 'CANNOT_CHANGE_BIDDING_STRATEGY_TYPE',
        self::CANNOT_REMOVE_ASSOCIATED_STRATEGY => 'CANNOT_REMOVE_ASSOCIATED_STRATEGY',
        self::BIDDING_STRATEGY_NOT_SUPPORTED => 'BIDDING_STRATEGY_NOT_SUPPORTED',
        self::INCOMPATIBLE_BIDDING_STRATEGY_AND_BIDDING_STRATEGY_GOAL_TYPE => 'INCOMPATIBLE_BIDDING_STRATEGY_AND_BIDDING_STRATEGY_GOAL_TYPE',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }

    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BiddingStrategyError::class, \Google\Ads\GoogleAds\V10\Errors\BiddingStrategyErrorEnum_BiddingStrategyError::class);


text:
import json
from rest_framework import serializers
from models import (Article, Topic, Question, Answer,
                    ArticleHighlight, HighlightGroup,
                    QuizTaskRun, SubmittedAnswer,
                    NLPHints, Project, Contributor)

# Custom JSON field
# All JSON now using native JSONB fields in Postgres.
# Just keeping this function for reference.
class JSONSerializerField(serializers.Field):
    """
    A field which seralizes text fields into valid JSON
    """
    def to_representation(self, obj):
        if obj:
            try:
                return json.loads(obj)
            except ValueError:
                if obj[0:1] == '[':
                    return []
        return {}

    def to_internal_value(self, data):
        return json.dumps(data)

# Serializers define the API representation of the models.

class ProjectSerializer(serializers.ModelSerializer):
    class Meta:
        model = Project
        fields = ('id', 'task_type', 'task_config',
                  'short_name', 'name', 'description')

class ContributorSerializer(serializers.ModelSerializer):
    unique_label = serializers.SerializerMethodField()

    def get_unique_label(self, obj):
        if obj.username:
            return obj.username
        elif obj.pybossa_user_id:
            return str(obj.pybossa_user_id)
        else:
            return str(obj.id)

    class Meta:
        model = Contributor
        fields = ('id', 'unique_label')

class SubmittedAnswerSerializer(serializers.ModelSerializer):
    class Meta:
        model = SubmittedAnswer
        fields = ('id', 'answer')

class HighlightGroupSerializer(serializers.ModelSerializer):
    topic_name = serializers.SerializerMethodField()
    topic_number = serializers.SerializerMethodField()

    def get_topic_name(self, obj):
        return obj.topic.name

    def get_topic_number(self, obj):
        return obj.topic.topic_number

    class Meta:
        model = HighlightGroup
        fields = ('id', 'article_highlight', 'topic',
                   'topic_name', 'topic_number',
                   'case_number', 'offsets')

class ArticleHighlightSerializer(serializers.ModelSerializer):
    highlights = HighlightGroupSerializer(many=True)
    contributor = ContributorSerializer(many=False)

    class Meta:
        model = ArticleHighlight
        fields = ('id', 'article', 'contributor', 'highlights')

class ArticleSerializer2(serializers.ModelSerializer):
    highlight_taskruns = ArticleHighlightSerializer(many=True)

    class Meta:
        model = Article
        fields = ('id', 'article_number', 'batch_name', 'text', 'metadata',
                  'highlight_taskruns')

class ArticleSerializer(serializers.ModelSerializer):
    class Meta:
        model = Article
        fields = ('id', 'article_number', 'batch_name', 'text', 'metadata')

class AnswerSerializer(serializers.ModelSerializer):
    class Meta:
        model = Answer
        fields = ('id', 'answer_number', 'answer_content', 'next_questions',
                  'options', 'question_id')

class QuestionSerializer(serializers.ModelSerializer):
    # A nested serializer for all the answers (if any)
    answers = AnswerSerializer(many=True)

    class Meta:
        model = Question
        fields = ('id', 'question_number', 'question_type', 'question_text',
                  'next_questions', 'hint_type', 'answers')

# Used to export questions in format recognized by NLP-Hints program
class NLPQuestionSerializer(serializers.Serializer):
    ID = serializers.SerializerMethodField()
    Question = serializers.SerializerMethodField()

    def get_ID(self, obj):
        return obj.id

    def get_Question(self, obj):
        return obj.hint_type

class TopicSerializer2(serializers.ModelSerializer):
    # A nested serializer for all the questions
    questions = QuestionSerializer(many=True)

    class Meta:
        model = Topic
        fields = ('id', 'name', 'namespace', 'topic_number',
                  'glossary', 'instructions',
                  'questions')

class TopicSerializer(serializers.ModelSerializer):
    class Meta:
        model = Topic
        fields = ('id', 'name', 'namespace', 'topic_number',
                  'glossary', 'instructions')

class NLPHintSerializer(serializers.ModelSerializer):
    class Meta:
        model = NLPHints
        fields = ('id', 'article', 'hint_type', 'offsets')


text:
Imports SistFoncreagro.BussinessEntities
Imports System.Data.SqlClient
Imports System.Data

Public Class GradoSalarialRepository : Inherits MasterDataAccess : Implements IGradoSalarialRepository

    Public Sub DeleteGradoSalarial(ByVal idGradoSalarial As Integer) Implements IGradoSalarialRepository.DeleteGradoSalarial
        Dim command As SqlCommand = MyBase.CreateSPCommand("DeleteGRADOSALARIAL")
        command.Parameters.AddWithValue("IdgradoSalarial", idGradoSalarial)
        MyBase.ExecuteNonQuery(command)
    End Sub

    Public Function GetAllFromGRADOSALARIAL() As System.Collections.Generic.List(Of BussinessEntities.GradoSalarial) Implements IGradoSalarialRepository.GetAllFromGRADOSALARIAL
        Dim command As SqlCommand = MyBase.CreateSPCommand("GetAllFromGRADOSALARIAL")
        Return SelectObjectFactory(command)
    End Function

    Public Function GetGradoSalarialByGrado(ByVal Grado As String) As BussinessEntities.GradoSalarial Implements IGradoSalarialRepository.GetGradoSalarialByGrado
        Dim command As SqlCommand = MyBase.CreateSPCommand("GetGradoSalarialByGrado")
        command.Parameters.AddWithValue("grado", Grado)
        Return SelectObjectFactory(command).SingleOrDefault
    End Function

    Public Function GetGradoSalarialByIdGradoSalarial(ByVal IdGradoSalarial As Integer) As BussinessEntities.GradoSalarial Implements IGradoSalarialRepository.GetGradoSalarialByIdGradoSalarial
        Dim command As SqlCommand = MyBase.CreateSPCommand("GetGradoSalarialByIdGradoSalarial")
        command.Parameters.AddWithValue("IdGradoSalarial", IdGradoSalarial)
        Return SelectObjectFactory(command).SingleOrDefault
    End Function
    Public Function GetGradoSalarialSinSubsecuente() As BussinessEntities.GradoSalarial Implements IGradoSalarialRepository.GetGradoSalarialSinSubsecuente
        Dim command As SqlCommand = MyBase.CreateSPCommand("GetGradoSalarialSinSubsecuente()")
        Return SelectObjectFactory(command).SingleOrDefault
    End Function

    Public Function SaveGRADOSALARIAL(ByVal GradoSalarial As BussinessEntities.GradoSalarial) As Integer Implements IGradoSalarialRepository.SaveGRADOSALARIAL
        Dim command As SqlCommand = MyBase.CreateSPCommand("SaveGRADOSALARIAL")
        command.Parameters.AddWithValue("Grado", GradoSalarial.Grado)
        command.Parameters.AddWithValue("IdGradoSalarial", GradoSalarial.IdGradoSalarial)
        command.Parameters.AddWithValue("RemuneracionMaxima", GradoSalarial.RemuneracionMaxima)
        command.Parameters.AddWithValue("RemuneracionMinima", GradoSalarial.RemuneracionMinima)
        command.Parameters.AddWithValue("RemuneracionPromedio", GradoSalarial.RemuneracionPromedio)

        'command.Parameters("idCargo").Direction = ParameterDirection.Output

        'MyBase.ExecuteNonQuery(command)
        Dim i As Int32
        Using reader As SqlDataReader = MyBase.ExecuteReader(command)
            If reader.Read Then
                If Not reader.IsDBNull(0) Then
                    i = reader.GetValue(0)
                End If
            Else
                i = 0 'command.Parameters("idCargo").Value
            End If
        End Using

        Return i
        'command.ExecuteReader(CommandBehavior.SingleRow).Item(0)
    End Function

    Private Function SelectObjectFactory(ByVal command As SqlCommand) As List(Of GradoSalarial)
        Dim lista As New List(Of GradoSalarial)
        Using reader As SqlDataReader = MyBase.ExecuteReader(command)
            While reader.Read
                Dim entity As New GradoSalarial
                If Not reader.IsDBNull(reader.GetOrdinal("Grado")) Then
                    entity.Grado = reader.GetValue(reader.GetOrdinal("Grado"))
                End If
                If Not reader.IsDBNull(reader.GetOrdinal("IdGradoSalarial")) Then
                    entity.IdGradoSalarial = reader.GetValue(reader.GetOrdinal("IdGradoSalarial"))
                End If
                If Not reader.IsDBNull(reader.GetOrdinal("RemuneracionMaxima")) Then
                    entity.RemuneracionMaxima = reader.GetValue(reader.GetOrdinal("RemuneracionMaxima"))
                End If
                If Not reader.IsDBNull(reader.GetOrdinal("RemuneracionMinima")) Then
                    entity.RemuneracionMaxima = reader.GetValue(reader.GetOrdinal("RemuneracionMinima"))
                End If
                If Not reader.IsDBNull(reader.GetOrdinal("RemuneracionPromedio")) Then
                    entity.RemuneracionMaxima = reader.GetValue(reader.GetOrdinal("RemuneracionPromedio"))
                End If
                If Not reader.IsDBNull(reader.GetOrdinal("IdSecuencia")) Then
                    entity.RemuneracionMaxima = reader.GetValue(reader.GetOrdinal("IdSecuencia"))
                End If
                lista.Add(entity)
            End While
        End Using
        'El indice depende de la columna con la que este en el SP
        Return lista
        '
    End Function

End Class


text:
'use strict';

var _ = require('lodash');

module.exports = function(ngModule) {
  ngModule.service('entityTracker', function(gameService, selectionService) {
    var entities = [];

    // This gets exported as the service below.
    var entityTracker = {
      each: function(iterator) {
        _.each(entities, iterator);
      },
      find: function(callback) {
        return _.find(entities, callback);
      }
    };

    // Subscribed to entity draw event.
    function onEntityDraw(entity, context) {
      context.save();
      if (selectionService.isSelected(entity)) {
        context.strokeStyle = '#f33';
      } else {
        context.strokeStyle = '#666';
      }
      context.strokeRect(
        entity.pos.x, entity.pos.y, entity.size.x, entity.size.y);
      context.restore();
    }

    function onEntityAdded(entity) {
      entities.push(entity);
      var boundDraw = entity.draw.bind(entity);
      game.on('draw', boundDraw);
      entity.on('draw', onEntityDraw.bind(null, entity));
      // Be sure to remove all this when entity is killed.
      entity.on('kill', function() {
        game.removeListener('draw', boundDraw);
        _.pull(entities, entity);
      });
    }

    // Listen for entities being added and bind their draw events to draw the
    // selection handle, active or not.
    var game = gameService.get();
    game.on('entityAdded', onEntityAdded);

    return entityTracker;
  });
};


text:
<?php return array (
  'providers' =>
  array (
    0 => 'Illuminate\\Auth\\AuthServiceProvider',
    1 => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
    2 => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
    3 => 'Illuminate\\Bus\\BusServiceProvider',
    4 => 'Illuminate\\Cache\\CacheServiceProvider',
    5 => 'Illuminate\\Cookie\\CookieServiceProvider',
    6 => 'Illuminate\\Encryption\\EncryptionServiceProvider',
    7 => 'Illuminate\\Filesystem\\FilesystemServiceProvider',
    8 => 'Illuminate\\Hashing\\HashServiceProvider',
    9 => 'Illuminate\\Log\\LogServiceProvider',
    10 => 'Illuminate\\Mail\\MailServiceProvider',
    11 => 'Illuminate\\Notifications\\NotificationServiceProvider',
    12 => 'Illuminate\\Pagination\\PaginationServiceProvider',
    13 => 'Illuminate\\Pipeline\\PipelineServiceProvider',
    14 => 'Illuminate\\Queue\\QueueServiceProvider',
    15 => 'Illuminate\\Redis\\RedisServiceProvider',
    16 => 'Illuminate\\Session\\SessionServiceProvider',
    17 => 'Illuminate\\Validation\\ValidationServiceProvider',
    18 => 'Pluma\\Providers\\ViewServiceProvider',
    19 => 'Pluma\\Providers\\ApplicationServiceProvider',
    20 => 'Pluma\\Providers\\DatabaseServiceProvider',
    21 => 'Pluma\\Providers\\FilesystemServiceProvider',
    22 => 'Pluma\\Providers\\EncryptionServiceProvider',
    23 => 'Pluma\\Providers\\EventServiceProvider',
    24 => 'Pluma\\Providers\\TranslationServiceProvider',
    25 => 'Pluma\\Providers\\ModuleServiceProvider',
    26 => 'Pluma\\Providers\\FormRequestServiceProvider',
    27 => 'Pluma\\Support\\Installation\\Providers\\InstallationServiceProvider',
    28 => 'Pluma\\Support\\Broadcast\\BroadcastServiceProvider',
    29 => 'Blacksmith\\Providers\\ConsoleSupportServiceProvider',
  ),
  'eager' =>
  array (
    0 => 'Illuminate\\Auth\\AuthServiceProvider',
    1 => 'Illuminate\\Cookie\\CookieServiceProvider',
    2 => 'Illuminate\\Encryption\\EncryptionServiceProvider',
    3 => 'Illuminate\\Filesystem\\FilesystemServiceProvider',
    4 => 'Illuminate\\Log\\LogServiceProvider',
    5 => 'Illuminate\\Notifications\\NotificationServiceProvider',
    6 => 'Illuminate\\Pagination\\PaginationServiceProvider',
    7 => 'Illuminate\\Session\\SessionServiceProvider',
    8 => 'Pluma\\Providers\\ViewServiceProvider',
    9 => 'Pluma\\Providers\\ApplicationServiceProvider',
    10 => 'Pluma\\Providers\\DatabaseServiceProvider',
    11 => 'Pluma\\Providers\\FilesystemServiceProvider',
    12 => 'Pluma\\Providers\\EncryptionServiceProvider',
    13 => 'Pluma\\Providers\\EventServiceProvider',
    14 => 'Pluma\\Providers\\ModuleServiceProvider',
    15 => 'Pluma\\Providers\\FormRequestServiceProvider',
    16 => 'Pluma\\Support\\Installation\\Providers\\InstallationServiceProvider',
    17 => 'Pluma\\Support\\Broadcast\\BroadcastServiceProvider',
  ),
  'deferred' =>
  array (
    'auth.password' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
    'auth.password.broker' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
    'Illuminate\\Broadcasting\\BroadcastManager' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
    'Illuminate\\Contracts\\Broadcasting\\Factory' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
    'Illuminate\\Contracts\\Broadcasting\\Broadcaster' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
    'Illuminate\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
    'Illuminate\\Contracts\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
    'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
    'cache' => 'Illuminate\\Cache\\CacheServiceProvider',
    'cache.store' => 'Illuminate\\Cache\\CacheServiceProvider',
    'memcached.connector' => 'Illuminate\\Cache\\CacheServiceProvider',
    'hash' => 'Illuminate\\Hashing\\HashServiceProvider',
    'hash.driver' => 'Illuminate\\Hashing\\HashServiceProvider',
    'mailer' => 'Illuminate\\Mail\\MailServiceProvider',
    'swift.mailer' => 'Illuminate\\Mail\\MailServiceProvider',
    'swift.transport' => 'Illuminate\\Mail\\MailServiceProvider',
    'Illuminate\\Mail\\Markdown' => 'Illuminate\\Mail\\MailServiceProvider',
    'Illuminate\\Contracts\\Pipeline\\Hub' => 'Illuminate\\Pipeline\\PipelineServiceProvider',
    'queue' => 'Illuminate\\Queue\\QueueServiceProvider',
    'queue.worker' => 'Illuminate\\Queue\\QueueServiceProvider',
    'queue.listener' => 'Illuminate\\Queue\\QueueServiceProvider',
    'queue.failer' => 'Illuminate\\Queue\\QueueServiceProvider',
    'queue.connection' => 'Illuminate\\Queue\\QueueServiceProvider',
    'redis' => 'Illuminate\\Redis\\RedisServiceProvider',
    'redis.connection' => 'Illuminate\\Redis\\RedisServiceProvider',
    'validator' => 'Illuminate\\Validation\\ValidationServiceProvider',
    'validation.presence' => 'Illuminate\\Validation\\ValidationServiceProvider',
    'translator' => 'Pluma\\Providers\\TranslationServiceProvider',
    'translation.loader' => 'Pluma\\Providers\\TranslationServiceProvider',
  ),
  'when' =>
  array (
    'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider' =>
    array (
    ),
    'Illuminate\\Broadcasting\\BroadcastServiceProvider' =>
    array (
    ),
    'Illuminate\\Bus\\BusServiceProvider' =>
    array (
    ),
    'Illuminate\\Cache\\CacheServiceProvider' =>
    array (
    ),
    'Illuminate\\Hashing\\HashServiceProvider' =>
    array (
    ),
    'Illuminate\\Mail\\MailServiceProvider' =>
    array (
    ),
    'Illuminate\\Pipeline\\PipelineServiceProvider' =>
    array (
    ),
    'Illuminate\\Queue\\QueueServiceProvider' =>
    array (
    ),
    'Illuminate\\Redis\\RedisServiceProvider' =>
    array (
    ),
    'Illuminate\\Validation\\ValidationServiceProvider' =>
    array (
    ),
    'Pluma\\Providers\\TranslationServiceProvider' =>
    array (
    ),
    'Blacksmith\\Providers\\ConsoleSupportServiceProvider' =>
    array (
    ),
  ),
);


text:
#include <algorithm>
#include <iostream>
#include <random>
#include "jobs.hpp"
#include "main.hpp"
#include "paratec.h"
#include "signal.hpp"

extern "C" {
#ifdef PT_LINUX

/**
 * There's something weird going on with GCC/LD on Linux: when not using a
 * pointer, anything larger than a few words causes the section to be
 * misaligned, and you can't access anything.
 */
extern struct _paratec *__start_paratec;
extern struct _paratec *__stop_paratec;

#elif defined(PT_DARWIN)

extern struct _paratec *
	__start_paratec __asm("section$start$__DATA$" PT_SECTION_NAME);
extern struct _paratec *
	__stop_paratec __asm("section$end$__DATA$" PT_SECTION_NAME);

#endif
}

namespace pt
{

Main::Main()
{
	_paratec **sp;

	sp = &__start_paratec;
	while (sp < &__stop_paratec) {
		this->tests_.emplace_back(mksp<Test>(**sp));
		sp++;
	}
}

Results Main::main(std::ostream &os, int argc, char **argv)
{
	int i;
	std::vector<const char *> args;

	for (i = 0; i < argc; i++) {
		args.push_back(argv[i]);
	}

	return this->run(os, args);
}

Main::~Main()
{
	sig::reset();
}

Results Main::run(std::ostream &os, const std::vector<const char *> &args)
{
	int err;
	std::vector<sp<const Test>> tests;

	this->opts_->parse(std::move(args));
	auto rslts = mksp<Results>(this->opts_, os);

	auto addTest = [&](sp<const Test> t) {
		rslts->inc(t->enabled());
		tests.push_back(std::move(t));
	};

	for (auto &test : this->tests_) {
		bool ranged;
		int64_t low;
		int64_t high;
		std::tie(ranged, low, high) = test->getRange();

		if (!ranged) {
			addTest(test->bindTo(0, this->opts_));
		} else {
			int64_t i;
			for (i = low; i < high; i++) {
				addTest(test->bindTo(i, this->opts_));
			}
		}
	}

	// Shuffle tests on each run to ensure that tests don't accidentally rely
	// on implied ordering.
	std::shuffle(tests.begin(), tests.end(), std::random_device());

	if (this->opts_->capture_) {
		err = setenv("LIBC_FATAL_STDERR_", "1", 1);
		OSErr(err, {}, "failed to set LIBC_FATAL_STDERR_");
	}

	if (this->opts_->fork_) {
		auto jobs = mksp<Jobs>(this->opts_, rslts, std::move(tests));
		sig::takeover(jobs);
		rslts->startTimer();
		jobs->run();
	} else {
		rslts->startTimer();
		for (auto &test : tests) {
			BasicJob(0, this->opts_, rslts).run(test);
		}
	}

	rslts->dump();

	return *rslts;
}
}

int main(int argc, char **argv)
{
	auto res = pt::Main().main(std::cout, argc, argv);
	return res.exitCode();
}


text:
#include "RegisterCS.h"
#include "func.h"
#include <time.h>

#include <iostream>
//extern struct tm*				uni_tm;
//time_t					current_time;
using namespace resip;
using namespace std;
#define RESIPROCATE_SUBSYSTEM Subsystem::APP

void ConvStrtoByte(CHAR* ptag,const CHAR* psrc)
{
	INT j,len;
	CHAR ucaTemp[3];
	len=strlen(psrc)/2;
	ptag[0] = 0;
	ucaTemp[2] = 0;
	for(j=0; j<len; j++)
    {
    	strncpy(ucaTemp,psrc+j*2,2);
    	ptag[j]=strtol(ucaTemp,NULL,16);
//      sprintf((CHAR*)ucaTemp, "%.2x", psrc[j]);     //<-<-<-<-<-<-<-<-<-<-
//      strcat((CHAR*)ptag, (CHAR*)ucaTemp);          //<-<-<-<-<-<-<-<-<-<-
    }
}

void ConvBytetoStr(UCHAR* ptag,const UCHAR* psrc,INT len)
{
	INT j;
	CHAR ucaTemp[3];
	ptag[0] = 0;
	ucaTemp[2] = 0;
	for(j=0; j<len; j++)
    {

      sprintf((CHAR*)ucaTemp, "%.2x", psrc[j]);     //<-<-<-<-<-<-<-<-<-<-
      strcat((CHAR*)ptag, (CHAR*)ucaTemp);          //<-<-<-<-<-<-<-<-<-<-
    }
//    ptag[j]=0;
}

CRegCallService::CRegCallService()
{
//	cleanSQLStatement();
//	sprintf(m_cSQLStatement,"SELECT maxactiveuser FROM qos;");
//	if (CDB::instance()->execSQL(m_cSQLStatement))
//	{
//		selectResult = CDB::instance()->getSelectResult();
//		if ((selectResult!=NULL)&&(selectResult->rowNum>0))
//		{
//			row = selectResult->pRows;
//			MaxRegisterUserNum = row->arrayField[0].value.intValue;
//		}
//	}
	MaxRegisterUserNum=0;

}

SREGISTER CRegCallService::CS_DIRECTREGISTER(const CHAR* UserNo, const SSIPContact *Contact, const CSIPCredentials *Credentials, CDB *db, bool &isAuthorization, CSIPRegDialogInfo &regsipdialog)
{
	SREGISTER registerres;
	REGACTION regType=QUERYREG;

        bool isMyRequest = true;

	char *usernum,*passwd;
      //  cout<<"username"<<regsipdialog.username.c_str()<<endl;
      //  cout<<"password"<<regsipdialog.password.c_str()<<endl;
        isAuthorization = regsipdialog.isAuth;
	if (!cs_Auth(usernum=(char*)regsipdialog.username.c_str(), passwd=(char*)regsipdialog.password.c_str(), Credentials))
	{
             //   cout<<"auth test"<<endl;
		registerres.result =  AUTHFAIL;
                return registerres;
        }
	if(Contact!=NULL)
	{
         		if(Contact->expires>0)
			{	//expire!=0 意味着用户登记注册
				if(strcmp(Credentials->GetNonceRef().c_str(),regsipdialog.nonce.c_str()) != 0)
                                        regType=ADDNEWREG;
                                else
                                        regType=REFREASHREG;
			}
			else
			{
				//expire=0 意味着注销,但由于没有活动记录,因此直接判断为成功
				regType=DELREG;
 				if(strcmp(Credentials->GetNonceRef().c_str(),regsipdialog.nonce.c_str()) == 0)
			        {
                                        isMyRequest = true;
                                }else
                                        isMyRequest = false;

			}

/*		if (!cs_CheckActiveUser(UserNo, db))
		{

			if(Contact->expires>0)
			{	//expire!=0 意味着用户登记注册
				if(strcmp(Credentials->GetNonceRef().c_str(),regsipdialog.nonce.c_str()) != 0)
                                        regType=ADDNEWREG;
                                else
                                        regType=REFREASHREG;
			}
			else
			{
				//expire=0 意味着注销,但由于没有活动记录,因此直接判断为成功
				regType=QUERYREG;
			}
		}
		else
		{
			if(Contact->expires>0)
			{	//expire!=0意味着刷新用户登记注册信息
				regType=REFREASHREG;
			}
			else
			{
				//expire=0 意味着注销
				regType=DELREG;
				if(strcmp(Credentials->GetNonceRef().c_str(),regsipdialog.nonce.c_str()) == 0)
			        {
                                        isMyRequest = true;
                                }else
                                        isMyRequest = false;
			}
		}*/
	}
	else
	{
		regType=QUERYREG;
	}
	switch(regType)
	{
		case ADDNEWREG:
//                        cout<<"addnewreg way"<<endl;
			registerres.result=cs_RegUser(UserNo, Contact, db);
			regsipdialog.nonce = Credentials->GetNonceRef();
                        regsipdialog.regtime = time(0);
			break;
		case REFREASHREG:
                       // cout<<"direct refresh"<<endl;
                        //regsipdialog.regtime = time(0) + Contact->expires+1;
			registerres.result =  REGSUCC;
			break;
		case DELREG:

    //                    cout<<"delete way"<<endl;
                        if(isMyRequest)
                        {
                                //cout<<"direct unregister"<<endl;
			        registerres.result=cs_UnRegUser(UserNo, Contact, db);

                        }else
                        {
                                registerres.result = UNREGSUCC;
                        }
			break;
		case QUERYREG:
			registerres.result =  REGQUERY;
	}
	if ((REGSUCC==registerres.result)||(REGQUERY==registerres.result)||(UNREGSUCC==registerres.result))
	{
		cleanSQLStatement();
		sprintf(m_cSQLStatement,"SELECT ipAddr,port,unregistertime,nonce FROM registeruser WHERE userno=\'%s\';", UserNo);
		if (db->execSQL(m_cSQLStatement))
		{
			selectResult = db->getSelectResult();
			if ((selectResult!=NULL)&&(selectResult->rowNum>0))
			{
				row = selectResult->pRows;
				while (row != NULL)
				{
					registerres.contact.host.SetVarCharContent(row->arrayField[0].value.stringValue ,strlen(row->arrayField[0].value.stringValue));
					registerres.contact.port = row->arrayField[1].value.intValue;
                                        //向注册dialog中插入用户信息
                                       // regsipdialog.ipAddr = registerres.contact.host.c_str();
                                       // regsipdialog.port = registerres.contact.port;
					registerres.contact.mAllContacts=false;
					if(REGQUERY==registerres.result)
						registerres.contact.expires=row->arrayField[2].value.intValue-time(0);
					else
						registerres.contact.expires = Contact->expires;
                                       // regsipdialog.nonce = row->arrayField[3].value.stringValue;
                                        registerres.contact.nonce = row->arrayField[3].value.stringValue;
					row = row->next;
				}
				//registerres.result = AUTHSUCC;	//成功的话,保留原来成功注册注销的返回类型
			}
			//else
			//{
			//	registerres.result = NOTREG;
			//}
		}
	}

	return registerres;

}

SREGISTER CRegCallService::CS_REGISTER(const CHAR *UserNo, const SSIPContact *Contact, const CSIPCredentials *Credentials, CDB *db, bool &isAuthorization, CSIPRegDialogInfo &regsipdialog)
{
	SUSER UserItem;
	SREGISTER registerres;

	//REGNEW: 新注册登录用户;
	//REFREASHREG: 已经注册登录了,刷新注册登录;
	//UNREGACTIVE: 已经注册登录了,删除登录记录;
	//UNREGNEW: 还没有注册登录,却要删除登录记录;
	REGACTION regType=QUERYREG;

        isAuthorization = false;
//检查用户是否注册,检查当前登录用户数量,清理过期用户,检查是否过载
	if (cs_QueryUser(UserNo, UserItem, db))
	{
                /*if(cs_CheckNonce(UserNo, Credentials->GetNonceRef().c_str(), db))
                {
                        registerres.result =  AUTHFAIL;
			return registerres;

                }*/
		if(Contact!=NULL)
		{
			if(Contact->expires>0)
			{	//expire!=0 意味着用户登记注册
				regType=ADDNEWREG;
			}
			else
			{
				//expire=0 意味着注销,但由于没有活动记录,因此直接判断为成功
				regType=DELREG;
			}

			//µ±Ç° ·¢Æð×¢²áÇëÇóµÄÊÇÒѵǼÇÓû§£¬ÅжÏÊÇ·ñÒѾ×¢²á
		/*	if (!cs_CheckActiveUser(UserNo, db))
			{

				if(Contact->expires>0)
				{	//expire!=0 意味着用户登记注册
					regType=ADDNEWREG;
				}
				else
				{
					//expire=0 意味着注销,但由于没有活动记录,因此直接判断为成功
					regType=QUERYREG;
				}
			}
			else
			{
				if(Contact->expires>0)
				{	//expire!=0意味着刷新用户登记注册信息
					regType=REFREASHREG;
				}
				else
				{
					//expire=0 意味着注销
					regType=DELREG;
				}
			}*/
		}
		else
		{
			regType=QUERYREG;
		}

		if (UserItem.Authorization!=0)
		{
                        isAuthorization = true;
		//如果用户需要鉴权的话,执行鉴权
			char *usernum,*passwd;
			if(Credentials==NULL)
			{
				registerres.result =  NEEDAUTH;
				return registerres;
			}
			if(!Credentials->valid)
			{
				UniDEBUG("User need Auth: User=%s",UserItem.UserNo.c_str());
				registerres.result =  NEEDAUTH;
				return registerres;
			}

			if (!cs_Auth(usernum=(char*)UserItem.UserNo.c_str(), passwd=(char*)UserItem.Password.c_str(), Credentials))
			{
                                UniDEBUG("AUTH: User Auth Faile User=%s",UserItem.UserNo.c_str());
				registerres.result =  AUTHFAIL;
				return registerres;
			}
                        regsipdialog.username = UserItem.UserNo.c_str();
                        regsipdialog.password = UserItem.Password.c_str();
		}
		regsipdialog.isAuth = true;
/*
		if(regType==ADDNEWREG)
		{
			//新登记的用户需要过载检查
			//登记过的用户就不用过载检查了
			cleanSQLStatement();
			sprintf(m_cSQLStatement,"SELECT count(*) FROM registeruser;");
			if(db->execSQL(m_cSQLStatement))
			{
				selectResult = db->getSelectResult();
				if ((selectResult!=NULL)&&(selectResult->rowNum>0))
				{
					row = selectResult->pRows;
					unsigned int currusernum = row->arrayField[0].value.intValue;
					if(currusernum>=MaxRegisterUserNum)
					{
					    UniDEBUG("test:%d",MaxRegisterUserNum);
						registerres.result =OVERLOAD;
						return registerres;
					}
				}
			}
		}*/
		//执行用户登录或刷新

		switch(regType)
		{
			case ADDNEWREG:
				registerres.result=cs_RegUser(UserNo, Contact, db);
				break;
			case REFREASHREG:
				regsipdialog.ipAddr = Contact->host.c_str();
				regsipdialog.port = Contact->port;
				regsipdialog.regtime = time(0) ;
                                regsipdialog.nonce = Credentials->GetNonceRef();
				registerres.result =  REGSUCC;
				break;
			case DELREG:
			    	registerres.result=cs_UnRegUser(UserNo, Contact, db);
			    //    registerres.result = UNREGSUCC;
				break;
			case QUERYREG:
				registerres.result =  REGQUERY;
		}
	}
	else
	{
	//没有用户注册记录,需要拒绝
		registerres.result =  NOTEXIST;
		return registerres;
	}

	//目前只支持一个用户注册,以后如果支持多个的话,就需要重新查询了
	if ((REGSUCC==registerres.result)||(REGQUERY==registerres.result)||(UNREGSUCC==registerres.result))
	{
		cleanSQLStatement();
		sprintf(m_cSQLStatement,"SELECT ipAddr,port,unregistertime,nonce transport FROM registeruser WHERE userno=\'%s\';", UserNo);
		if (db->execSQL(m_cSQLStatement))
		{
			selectResult = db->getSelectResult();
			if ((selectResult!=NULL)&&(selectResult->rowNum>0))
			{
				row = selectResult->pRows;
				while (row != NULL)
				{
					registerres.contact.host.SetVarCharContent(row->arrayField[0].value.stringValue ,strlen(row->arrayField[0].value.stringValue));
					registerres.contact.port = row->arrayField[1].value.intValue;
                                        //向注册dialog中插入用户信息
                                        regsipdialog.ipAddr = registerres.contact.host.c_str();
                                        regsipdialog.port = registerres.contact.port;
					registerres.contact.mAllContacts=false;
					if(REGQUERY==registerres.result)
						registerres.contact.expires=row->arrayField[2].value.intValue-time(0);
					else
						registerres.contact.expires = Contact->expires;
                                        regsipdialog.nonce = row->arrayField[3].value.stringValue;
                                        registerres.contact.nonce = row->arrayField[3].value.stringValue;
                                        registerres.contact.transport = row->arrayField[4].value.intValue;
                                        regsipdialog.transport = row->arrayField[4].value.intValue;
					row = row->next;
				}
				//registerres.result = AUTHSUCC;	//成功的话,保留原来成功注册注销的返回类型
			}
			//else
			//{
			//	registerres.result = NOTREG;
			//}
		}
	}

	return registerres;

}
/*
INT CRegCallService::CS_3ptyREGISTER(const CHAR *UserNo, S3ptyREGISTER& reglist, CDB* db)
{

	cleanSQLStatement();
	sprintf(m_cSQLStatement,"SELECT category.ipaddr, category.port FROM category, stlist WHERE stlist.servReg=1 and stlist.STPrefix=\'%s\' and (stlist.userType=1 or stlist.userType=2) and stlist.AppServID=category.appservid;", UserNo);
	if (db->execSQL(m_cSQLStatement))
	{
		selectResult = db->getSelectResult();
		if ((selectResult!=NULL)&&(selectResult->rowNum>0))
		{
			row = selectResult->pRows;
			int i=0;
			while (row != NULL && i<32)
			{
				reglist.servAddr[i].host.SetVarCharContent(row->arrayField[0].value.stringValue ,strlen(row->arrayField[0].value.stringValue));
				reglist.servAddr[i].port = row->arrayField[1].value.intValue;
				i++;
				row = row->next;
			}
			reglist.servnum=i;
		}
		else
		{
			reglist.servnum=0;
		}
	}
	else
	{
		reglist.servnum=0;
	}

	return reglist.servnum;
}

*/
BOOL CRegCallService::cs_QueryUser(const CHAR* UserNo, SUSER &UserItem, CDB* db)
{
	cleanSQLStatement();
	sprintf(m_cSQLStatement,"SELECT password,authorization FROM user WHERE userno=\'%s\';", UserNo);
//	cout<<"QueryUser:"<<m_cSQLStatement;
	if (db->execSQL(m_cSQLStatement))
	{
		selectResult = db->getSelectResult();
		if ((selectResult!=NULL)&&(selectResult->rowNum>0))
		{
			row = selectResult->pRows;
			while (row != NULL)
			{
				UserItem.Password.SetVarCharContent(row ->arrayField[0].value.stringValue, strlen(row ->arrayField[0].value.stringValue));
				UserItem.Authorization = row->arrayField[1].value.intValue;
				row = row->next;
			}
			UserItem.UserNo.SetVarCharContent(UserNo, strlen(UserNo));

			return TRUE;
		}
	}
	return FALSE;
}

REG CRegCallService::cs_RegUser(const CHAR *UserNo,const SSIPContact *Contact,CDB* db)
{
	time_t regtime;
	if (NULL==Contact || UserNo==NULL)
		return REGFAIL;

	regtime = time(0);

//		cleanSQLStatement();
//		sprintf(m_cSQLStatement,"SELECT UserNo FROM registeruser WHERE UserNo=\'%s\';", UserNo);
//		if (CDB::instance()->execSQL(m_cSQLStatement))
//		{
//			selectResult = CDB::instance()->getSelectResult();
//			if ((selectResult!=NULL)&&(selectResult->rowNum>0))
//			{
//				cleanSQLStatement();
//				sprintf(m_cSQLStatement,"UPDATE registeruser SET ipaddr=\'%s\',port=\'%d\',unregisterTime=\'%d\'  WHERE userno=\'%s\';", \
//						Contact->host.c_str(),Contact->port,regtime,UserNo);
//				if (!CDB::instance()->execSQL(m_cSQLStatement))
//					printf("\nDB ERROR\n");
//			}
//			else
//			{

	cleanSQLStatement();
	sprintf(m_cSQLStatement,"DELETE FROM registeruser WHERE userno = \'%s\'",UserNo);
	if (db->execSQL(m_cSQLStatement))
	{
		//cout<<"delete success"<<endl;
	}

	cleanSQLStatement();
	sprintf(m_cSQLStatement,"INSERT INTO registeruser (userno, sourceid, ipaddr, port, unregistertime, userstate, nonce, transport) VALUES(\'%s\',\'%d\',\'%s\',\'%d\',\'%d\',\'%d\',\'%s\',\'%d\');",
			UserNo,Contact->sourceid,Contact->host.c_str(),Contact->port,regtime, 0, Contact->nonce.c_str(), Contact->transport);
	if (!db->execSQL(m_cSQLStatement))
	{
		printf("\nDB ERROR: %s\n",db->getErrMsg());
		return REGFAIL;
	}
	else
	{
		return REGSUCC;
	}
}

REG CRegCallService::cs_RefreashUser(const CHAR *UserNo,const SSIPContact *Contact, CDB* db)
{
	time_t regtime;
	if (NULL==Contact || UserNo==NULL)
		return REGFAIL;

	regtime = time(0);
	cleanSQLStatement();
	sprintf(m_cSQLStatement,"UPDATE registeruser SET ipaddr=\'%s\',port=\'%d\',unregisterTime=\'%d\'  WHERE userno=\'%s\';", \
				Contact->host.c_str(),Contact->port,regtime,UserNo);
	if (!db->execSQL(m_cSQLStatement))
	{
		printf("\nDB ERROR: %s\n",db->getErrMsg());
		return REGFAIL;
	}
	else
	{
		return REGSUCC;
	}

}

REG CRegCallService::cs_UnRegUser(const CHAR *UserNo,const SSIPContact *Contact, CDB* db)
{
	time_t regtime;
	if (NULL==Contact || UserNo==NULL)
		return REGFAIL;

	//×¢Ïú
	if(TRUE == Contact->mAllContacts)
	{
		cleanSQLStatement();
		sprintf(m_cSQLStatement,"DELETE FROM registeruser WHERE userno=\'%s\';", UserNo);
		if (db->execSQL(m_cSQLStatement))
		{

			return UNREGSUCC;
		}
		else
		{
			printf("\nDB ERROR: %s\n",db->getErrMsg());
			return UNREGFAIL;
		}
	}
	else
	{
			cleanSQLStatement();
			sprintf(m_cSQLStatement,"DELETE FROM registeruser WHERE userno=\'%s\' AND ipaddr=\'%s\' AND port=%d;", UserNo,Contact->host.c_str(),Contact->port);
			if (db->execSQL(m_cSQLStatement))
			{
				return UNREGSUCC;
			}
			else
			{
				printf("\nDB ERROR: %s\n",db->getErrMsg());
				return REGFAIL;
			}
	}
}

BOOL CRegCallService::cs_UpdateDialogToDB(CSIPRegDialogInfo &regsipdialog , CDB* db)
{
	cleanSQLStatement();
	sprintf(m_cSQLStatement,"UPDATE registeruser SET unregisterTime=\'%d\'  WHERE userno=\'%s\';", \
				time(0),regsipdialog.username.c_str());
	if (!db->execSQL(m_cSQLStatement))
	{
		printf("\nDB ERROR: %s\n",db->getErrMsg());
		return false;
	}
	else
	{
		return true;
	}
        return false;

}
BOOL CRegCallService::cs_CheckActiveUser(const CHAR *UserNo, CDB* db)
{
	time_t currtime;
	currtime=time(0);

	cleanSQLStatement();
	sprintf(m_cSQLStatement,"SELECT ipAddr,port,unregistertime FROM registeruser WHERE userno=\'%s\';", UserNo);
	if (db->execSQL(m_cSQLStatement))
	{
		selectResult = db->getSelectResult();
		if ((selectResult!=NULL)&&(selectResult->rowNum>0))
		{
			return TRUE;
		}
	}
	else
	{
		UniERROR("CheckActiveUser_select active items Error - DB ERROR:%s ", db->getErrMsg());
	}

	return FALSE;
}

////////////////////////////////////////////////////////////
// Function£ºCheckPwd
// Description:½øÐжÔSIPÓû§ÃÜÂëµÄºË¶Ô
// Args:
//        struCredentials£ºÓû§ÌṩµÄÈÏÖ¤Êé
// Return Values:BOOL
//        ÈôÃÜÂë¼ì²éÕýÈ·£¬Ôò·µ»ØTRUE£»ÈôÃÜÂë¼ì²é´íÎó£¬Ôò·µ»ØFALSE
////////////////////////////////////////////////////////////
//modified by zhgsh 2004.9.16
BOOL CRegCallService::cs_Auth(const CHAR *cUserName,const CHAR *cPassword,const CSIPCredentials *sipCredentials)
{
	CMD5 tmpCmd5;
	UCHAR* tmpDegist;
	UCHAR  tmpDegistBuf[512];

	UCHAR *tmpInputA1,*tmpInputA2;
	UCHAR ucMd5DigestA1[257];
	//pcMd5DigestA1[0] = '\0';
	UCHAR ucMd5DigestA2[257];
	//  pcMd5DigestA2[0] = '\0';
	UCHAR ucInputDigestA1[257];
	//  pcInputDigestA1[0] = '\0';
	tmpInputA1 = ucInputDigestA1;
	UCHAR ucInputDigestA2[257];
	//  pcInputDigestA2[0] = '\0';
	tmpInputA2 = ucInputDigestA2;
	UCHAR cCodeA1[257];
	UCHAR intCharStr[33];
	UCHAR MD5HA[33];
	UCHAR DigestRes[33];

	if (NULL==sipCredentials)
		return FALSE;

	//录脝脣茫A1
	/* DigestCalcHA1("111",sipCredentials,
	   tmpInputA1,
	   MD5HA,
	   ucInputDigestA1,
	   cCodeA1,
	   tmpCmd5);
	   cout<<"DegistHA1="<<MD5HA<<endl;
	   */

	//录脝脣茫A2
	DigestCalcHA2(sipCredentials,
			tmpInputA2,
			MD5HA,
			ucInputDigestA2,
			tmpCmd5);
	tmpDegist=tmpDegistBuf;
	memcpy(tmpDegist,cPassword,strlen(cPassword));
	tmpDegist += 32;

	tmpDegist[0] = ':';
	tmpDegist += 1;

	memcpy(tmpDegist,(sipCredentials->GetNonceRef().c_str())
			,(sipCredentials->GetNonceRef().length()));
	tmpDegist += (sipCredentials->GetNonceRef().length());

	tmpDegist[0] = ':';
	tmpDegist += 1;

	if(sipCredentials->GetQopRef()=="auth" )
	{

		memcpy(tmpDegist,(sipCredentials->GetNonceCountRef().c_str()) ,(sipCredentials->GetNonceCountRef().length()));
		tmpDegist += (sipCredentials->GetNonceCountRef().length());

		tmpDegist[0] = ':';
		tmpDegist += 1;

		memcpy(tmpDegist,(sipCredentials->GetCNonceRef().c_str()),(sipCredentials->GetCNonceRef().length()));
		tmpDegist += (sipCredentials->GetCNonceRef().length());

		tmpDegist[0] = ':';
		tmpDegist += 1;

		memcpy(tmpDegist,(sipCredentials->GetQopRef().c_str()),(sipCredentials->GetQopRef().length()));
                tmpDegist += (sipCredentials->GetQopRef().length());

		tmpDegist[0] = ':';
		tmpDegist += 1;
	}
	memcpy(tmpDegist,MD5HA,32);
	tmpDegist +=32;
        tmpDegist[0] = 0;

	memcpy(DigestRes,tmpCmd5.GetDigest(tmpDegistBuf, tmpDegist-tmpDegistBuf,1),32);
	DigestRes[32]=0;

	int result=memcmp(DigestRes,(UCHAR*)sipCredentials->GetResponseRef().c_str(),32);
	if(0==result)
	{
		UniDEBUG("Checkpassword Successful, User=%s",cUserName);
		return TRUE;
	}
	else
	{
		UniDEBUG("Checkpassword Failed, User=%s",cUserName);
		return FALSE;
	}

}

/* calculate H(A1) as per spec */
//added by zhgsh 2004.9.16

void CRegCallService::DigestCalcHA1(
	const CHAR* cPassword,
	const CSIPCredentials *sipCredentials,
	UCHAR* tmpInputA1,
	UCHAR* ucMd5DigestA1,
	UCHAR* ucInputDigestA1,
	UCHAR* cCodeA1,
	CMD5 &tmpCmd5)
{
    memcpy(tmpInputA1,sipCredentials->GetUserNameRef().c_str()
            ,sipCredentials->GetUserNameRef().size());
    tmpInputA1 += sipCredentials->GetUserNameRef().size();

    tmpInputA1[0] = ':';
    tmpInputA1 += 1;

    memcpy(tmpInputA1,sipCredentials->GetRealmRef().c_str()
    ,sipCredentials->GetRealmRef().size());
    tmpInputA1 += sipCredentials->GetRealmRef().size();

    tmpInputA1[0] = ':';
    tmpInputA1 += 1;

    memcpy(tmpInputA1,cPassword,strlen(cPassword));
    tmpInputA1 += strlen(cPassword);

   	//H( unq(username-value) ":" unq(realm-value)":" passwd )
    memcpy(ucMd5DigestA1,
    	tmpCmd5.GetDigest(ucInputDigestA1,tmpInputA1-ucInputDigestA1),16);

}

/* calculate H(A2) as per spec */
//modify by zhgsh 2004.9.16

void CRegCallService::DigestCalcHA2(
	const CSIPCredentials *sipCredentials,
	UCHAR* tmpInputA2,
	UCHAR* ucMd5DigestA2,
	UCHAR* ucInputDigestA2,
	CMD5 &tmpCmd5)
{
    switch (sipCredentials->GetMsgType())
    {
      case resip::INVITE:
        memcpy(tmpInputA2,"INVITE",strlen("INVITE"));
        tmpInputA2 += strlen("INVITE");

        break;
      case resip::ACK:
        memcpy(tmpInputA2,"ACK",strlen("ACK"));
        tmpInputA2 += strlen("ACK");

        break;
      case resip::OPTIONS:
        memcpy(tmpInputA2,"OPTIONS",strlen("OPTIONS"));
        tmpInputA2 += strlen("OPTIONS");

        break;
      case resip::BYE:
        memcpy(tmpInputA2,"BYE",strlen("BYE"));
        tmpInputA2 += strlen("BYE");

        break;
      case resip::CANCEL:
        memcpy(tmpInputA2,"CANCEL",strlen("CANCEL"));
        tmpInputA2 += strlen("CANCEL");

        break;
      case resip::REGISTER:
        memcpy(tmpInputA2,"REGISTER",strlen("REGISTER"));
        tmpInputA2 += strlen("REGISTER");

        break;
	case resip::SUBSCRIBE:
        memcpy(tmpInputA2,"SUBSCRIBE",strlen("SUBSCRIBE"));
        tmpInputA2 += strlen("SUBSCRIBE");

        break;
	case resip::PUBLISH:
        memcpy(tmpInputA2,"PUBLISH",strlen("PUBLISH"));
        tmpInputA2 += strlen("PUBLISH");

        break;
	case resip::MESSAGE:
        memcpy(tmpInputA2,"MESSAGE",strlen("MESSAGE"));
        tmpInputA2 += strlen("MESSAGE");

        break;
      default:
        break;
    }

    tmpInputA2[0] = ':';
    tmpInputA2 += 1;

    memcpy(tmpInputA2,(sipCredentials->GetURIRef().c_str())
    	,(sipCredentials->GetURIRef().length()));
    tmpInputA2 += (sipCredentials->GetURIRef().length());
    //H(A2)
    memcpy(ucMd5DigestA2,tmpCmd5.GetDigest(ucInputDigestA2,tmpInputA2-ucInputDigestA2,1),32 );

}

void CRegCallService::CvtHex(const UCHAR *Bin, UCHAR *Hex)
{
    unsigned short i;
    unsigned char j;

    for (i = 0; i < 16; i++)
   {
        j = (Bin[i] >> 4) & 0xf;
        if (j <= 9)
            Hex[i*2] = (j + '0');
         else
            Hex[i*2] = (j + 'a' - 10);
        j = Bin[i] & 0xf;
        if (j <= 9)
            Hex[i*2+1] = (j + '0');
         else
            Hex[i*2+1] = (j + 'a' - 10);
    }
    Hex[32]='\0';
};

bool CRegCallService::cs_CheckNonce(const CHAR* UserNo, const CHAR* nonce, CDB* db )
{
	cleanSQLStatement();
	sprintf(m_cSQLStatement,"SELECT nonce FROM registeruser WHERE userno=\'%s\';", UserNo);
	if (db->execSQL(m_cSQLStatement))
	{
		selectResult = db->getSelectResult();
		if ((selectResult!=NULL)&&(selectResult->rowNum>0))
		{
                        TRow *row = selectResult->pRows;
                        while(row != NULL)
                        {
//                                cout<<nonce<<endl;
//                                cout<<row->arrayField[0].value.stringValue<<endl;
				if( strcmp(row->arrayField[0].value.stringValue, nonce)== 0)
                                        return true;
                                row = row->next;
			}

		}
	}
        return false;

}


text:
require 'test_helper'

class CommerceTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end
end


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Tup.Utilities.UnitTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("新华教育集团")]
[assembly: AssemblyProduct("Tup.Utilities.UnitTest")]
[assembly: AssemblyCopyright("Copyright © 新华教育集团 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: Guid("01377ae3-9f0e-4688-a1b6-70c27a2e0832")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


text:
"use strict";

var test = require('./../helper.js');

describe('Documents clean institutes', function () {
    before(test.cleanDb);

    const documentsData = test.getAllDocumentData();
    const [user1Data, user2Data, user3Data] = test.getAllUserData();
    const institutesData = test.getAllInstituteData();
    const sourcesData = test.getAllSourceData();
    let user1, user2, user3, draft1, draft2, draft3, document1, document2, document3, externalDocument;
    let iit, unige, iit2, iit3;

    it("should remove institutes if scopusId is equal to a different one", async function () {
        const newTitle = 'test';
        user1 = await User.registerUser(user1Data);
        user2 = await User.registerUser(user2Data);
        user3 = await User.registerUser(user3Data);
        [iit, unige, iit2, iit3] = await Promise.all(institutesData.map(i => Institute.create(i)));
        await Institute.update({id: iit3.id}, {parentId: iit.id});

        const journal = await Source.create(sourcesData[0]);
        const doc1 = documentsData[0];
        doc1.source = journal.id;
        doc1.authorships = [{corresponding: true, affiliations: [iit.id], position: 1}];

        draft1 = await User.createDraft(User, user1.id, doc1);
        document1 = await User.verifyDraft(User, user1.id, draft1.id, {
            position: 0,
            affiliationInstituteIds: [iit.id],
            corresponding: true,
            synchronize: true
        });

        doc1.title = newTitle;
        draft2 = await User.createDraft(User, user2.id, doc1);
        document2 = await User.verifyDraft(User, user2.id, draft2.id, {
            position: 1,
            affiliationInstituteIds: [iit2.id],
            corresponding: true,
            synchronize: true
        });

        doc1.title = 'test2';
        draft3 = await User.createDraft(User, user3.id, doc1);
        document3 = await User.verifyDraft(User, user3.id, draft3.id, {
            position: 1,
            affiliationInstituteIds: [iit3.id],
            corresponding: true,
            synchronize: true
        });

        let allInstitutes = await Institute.find();
        allInstitutes.length.should.equal(institutesData.length);

        let user1Documents = await test.getUserDocuments(user1, ['affiliations']);
        let doc1instituteId = user1Documents.items[0].affiliations.find(a => a.institute).institute;
        let user2Documents = await test.getUserDocuments(user2, ['affiliations']);
        let doc2instituteId = user2Documents.items[0].affiliations.find(a => a.institute).institute;
        let user3Documents = await test.getUserDocuments(user2, ['affiliations']);
        let doc3instituteId = user3Documents.items[0].affiliations.find(a => a.institute).institute;

        doc1instituteId.should.not.equal(doc2instituteId);
        doc1instituteId.should.not.equal(doc3instituteId);

        await Cleaner.cleanInstituteCopies();

        const allDocuments = await Document.find();
        allDocuments.length.should.equal(3);

        allInstitutes = await Institute.find();
        allInstitutes.length.should.equal(institutesData.length-1);

        user1Documents = await test.getUserDocuments(user1, ['affiliations']);
        doc1instituteId = user1Documents.items[0].affiliations.find(a => a.institute).institute;
        user2Documents = await test.getUserDocuments(user2, ['affiliations']);
        doc2instituteId = user2Documents.items[0].affiliations.find(a => a.institute).institute;
        user3Documents = await test.getUserDocuments(user3, ['affiliations']);
        doc3instituteId = user3Documents.items[0].affiliations.find(a => a.institute).institute;

        doc1instituteId.should.equal(doc2instituteId);
        doc1instituteId.should.equal(doc3instituteId);
    });

});


text:
/**
 * @name ngmReportHub.factory:ngmClusterHelperNgWash
 * @description
 * # ngmClusterWashHelper
 * Manages browser local storage
 *
 */
angular.module( 'ngmReportHub' )
	.factory( 'ngmClusterHelperNgWash',
			[ '$http',
				'$filter',
				'$timeout',
 				'$injector',
				'ngmAuth',
				'ngmClusterHelperNgWashKeys',
				'ngmClusterHelperNgWashLists',
				'ngmClusterHelperNgWashValidation',
				function( $http, $filter, $timeout, $injector, ngmAuth, ngmClusterHelperNgWashKeys, ngmClusterHelperNgWashLists, ngmClusterHelperNgWashValidation ) {

		// definition
		var ngmClusterHelperNgWash = {

			// NG and WASH
			templateUrl: 'beneficiaries/NG/wash/',

			// beneficiaries calculations
			ratios: {

				// defaults
				hhs: 0.1666666666667, // 1/6
				boys: 0.2538,
				girls: 0.2862,
				men: 0.1833,
				women: 0.2067,
				elderly_men: 0.0329,
				elderly_women: 0.0371,
				beneficiaries: 66.6667,

				// beneficiary ratios
				// water
				water:{
					keys: [ 'quantity' ],
					beneficiaries: 66.6667
				},
				taps:{
					keys: [ 'quantity' ],
					beneficiaries: 250
				},
				tablets:{
					keys: [ 'quantity' ],
					beneficiaries: 1.33333333
				},
				// sanitation
				// latrines
				households:{
					keys: [ 'quantity' ],
					beneficiaries: 6
				},
				latrines:{
					keys: [ 'male', 'female', 'male_disabled', 'female_disabled' ],
					beneficiaries: 50
				},
				desludged:{
					keys: [ 'quantity' ],
					beneficiaries: 50
				},
				hand_washing:{
					keys: [ 'quantity' ],
					beneficiaries: 50
				},
				// showers
				showers:{
					keys: [ 'male', 'female', 'male_disabled', 'female_disabled' ],
					beneficiaries: 100
				},
				// Hygiene
				// kit
				kits:{
					keys: [ 'quantity' ],
					beneficiaries: 6
				},
				monitoring:{
					keys: [ 'quantity' ],
					beneficiaries: 1
				},
				// CTP
				// cash
				cash:{
					keys: [ 'households' ],
					beneficiaries: 6
				},
				// accountability
				complaints:{
					keys: [ 'complaints_recieved' ],
					beneficiaries: 1
				}
			},

			// TEMPLATES

			// show template
			getTemplate: function( beneficiary ){
				if ( beneficiary &&
							beneficiary.activity_detail_id &&
							ngmClusterHelperNgWashKeys.keys[ beneficiary.activity_detail_id ].template ) {
					return ngmClusterHelperNgWashKeys.keys[ beneficiary.activity_detail_id ].template
				} else {
					return false;
				}
			},

			// UI UPDATES

			// reset form
			init_material_select: function(){
				$timeout(function(){
					$( '.input-field input' ).removeClass( 'invalid' );
					$( '.input-field input' ).removeClass( 'ng-touched' );
					// $( '.input-field select' ).material_select();
					$('.input-field select').formSelect();
				}, 10 );
			},

			// set input style
			inputChange: function( label ){
				$("label[for='" + label + "']").removeClass('error');
				$("label[for='" + label + "']").addClass('active');
			},

			// update display name in object on select change
			selectChange: function( d, list, key, name, label ){
				if ( d[ key ] ) {
					var id = d[ key ];
					var obj = {}
					var search_list = ngmClusterHelperNgWashLists.lists[ list ];
					// this approach does NOT break gulp!
					obj[key] = id;
					var filter = $filter('filter')( search_list, obj, true );
					// set name
					d[ name ] = filter[0][ name ];
					$("label[for='" + label + "']").removeClass('error');
					$("label[for='" + label + "']").addClass('active');
					ngmClusterHelperNgWash.init_material_select();
				}
			},

			// add beneficiary
			addBeneficiary: function ( beneficiaries ) {

				// clone
				var length = beneficiaries.length;

				// inserted
				var inserted = {};
				var sadd = {
					cash_amount: 0,
					households: 0,
					boys: 0,
					girls: 0,
					men: 0,
					women: 0,
					elderly_men: 0,
					elderly_women: 0,
					total_beneficiaries: 0
				};

				// merge
				angular.merge( inserted, sadd );

				// if previous beneficiaries
				if ( length ) {

					var b = angular.copy( beneficiaries[ length - 1 ] );
					var keys = ngmClusterHelperNgWashKeys.keys[ b.activity_detail_id ];
					var defaults = ngmClusterHelperNgWashKeys.keys.defaults;

					// associations
					delete b.id;
					inserted = angular.merge( inserted, b, sadd );
					angular.forEach( inserted, function( d, i ){
						if ( Array.isArray( d ) ) {
							// associations
							if ( i === 'water' ||
										i === 'boreholes' ||
										i === 'sanitation' ||
										i === 'hygiene' ||
										i === 'cash' ||
										i === 'accountability') {
								angular.forEach( d, function( e, j ){
									delete e.id;
									delete e.createdAt;
									delete e.updatedAt;
									// to copy
									// e = angular.merge( {}, keys.measurement, defaults );
									angular.merge( e, keys.measurement, defaults );
								});
							}
						}
					});
				}

				// refresh UI
				ngmClusterHelperNgWash.init_material_select();

				// return
				return inserted;

			},

			// add initial object
			detailsChange: function( locations, $location, $beneficiary ){

				// slight timeout to capture UI changes
				$timeout(function(){

					// beneficiary
					if ( $beneficiary.activity_detail_id ) {

						// ngmClusterHelperNgWash keys
						var keys = ngmClusterHelperNgWashKeys.keys[ $beneficiary.activity_detail_id ];
						var defaults = ngmClusterHelperNgWashKeys.keys.defaults;

						// remove all previous entries
						$beneficiary.water = [];
						$beneficiary.boreholes = [];
						$beneficiary.sanitation = [];
						$beneficiary.hygiene = [];
						$beneficiary.cash = [];
						$beneficiary.accountability = [];
						ngmClusterHelperNgWashLists.details = [];

						// add new
						ngmClusterHelperNgWash.addActivity( locations, $location, $beneficiary, keys.association );

					}
				}, 10 );
			},

			clearAssociations: function ( $beneficiary ) {
				// clear
				['water', 'boreholes', 'sanitation', 'hygiene', 'cash', 'accountability'].map(a => { if ($beneficiary && $beneficiary[a]) { $beneficiary[a] = [] } });
			},

			// ADD RECORDS

			// add activity ( reticulation, service, maintenance )
			addActivity: function( locations, location, beneficiary, association, btn_id ) {

				// based on association and activity_detail
				var length = beneficiary[ association ] ? beneficiary[ association ].length : 0;
				var keys = ngmClusterHelperNgWashKeys.keys[ beneficiary.activity_detail_id ];
				var defaults = ngmClusterHelperNgWashKeys.keys.defaults;

				// create model using ngmClusterHelperNgWash keys ( based on activity_detail )
				var activity = angular.merge( {}, keys.measurement, defaults );

				// in case of boreholes ( only saved ay db level if boreholes )
				activity.borehole_lng = location.site_lng;
				activity.borehole_lat = location.site_lat;

				// set association
				if ( !length ){
					beneficiary[ association ] = [];
				}

				// copy previous
				if ( length ) {
					var a = angular.copy( beneficiary[ association ][ length - 1 ] );
					delete a.id;
					delete a.details;
					delete a.createdAt;
					delete a.updatedAt;
					activity = angular.merge( {}, a, activity );
				}

				// push
				beneficiary[ association ].push( activity );
				ngmClusterHelperNgWash.setActivityBeneficiaries( locations );

				// ensures page does not scroll to 5W activity input form
				// if ( btn_id ) {
				// 	$( '#' + btn_id ).animatescroll();
				// }

				// init
				ngmClusterHelperNgWash.init_material_select();

			},

			// add new details
			addDetails: function( d, obj ){
				d.details.push( obj );
				// ngmClusterHelperNgWash.init_material_select();
			},

      // remove kit-details
      removeDetail: function( d, $locationIndex, $beneficiaryIndex, $index ) {
        d.details.splice( $index, 1);
        if ( ngmClusterHelperNgWashLists.details[ $locationIndex ] && ngmClusterHelperNgWashLists.details[ $locationIndex ][ $beneficiaryIndex ] ) {
        	ngmClusterHelperNgWashLists.details[ $locationIndex ][ $beneficiaryIndex ].splice( $index, 1 );
        }
		// Materialize.toast( 'Please save to commit changes!' , 6000, 'note' );
		  M.toast({ html: 'Please save to commit changes!', displayLength: 6000, classes: 'note' });
      },

			// REMOVE RECORDS

			// remove beneficiary nodal
			removeModal: function( project, beneficiary, $index, association, modal ) {
				ngmClusterHelperNgWash.project = project;
				ngmClusterHelperNgWash.beneficiary = beneficiary;
				ngmClusterHelperNgWash.removeIndex = $index;
				ngmClusterHelperNgWash.association = association;
				// $( modal ).openModal({ dismissible: false });
				$( modal).modal({ dismissible: false });
				$( modal).modal('open');
			},

			// remove borehole
			remove: function(){

				// get id
				var id = ngmClusterHelperNgWash.beneficiary[ ngmClusterHelperNgWash.association ][ ngmClusterHelperNgWash.removeIndex ].id;
				ngmClusterHelperNgWash.beneficiary[ ngmClusterHelperNgWash.association ].splice( ngmClusterHelperNgWash.removeIndex, 1 );

				// calculate location totals
				ngmClusterHelperNgWash.setActivityBeneficiaries( ngmClusterHelperNgWash.project.report.locations );

				// update db if id exists (stored in db)
				if ( id ) {
					ngmClusterHelperNgWash.project.save( false, false );
				}
			},

			// CALCULATIONS

			// get sadd breakdowns
			bSadd: function( b ){
				var ratios = ngmClusterHelperNgWash.ratios;
				// sadd
				b.households = Math.round( b.total_beneficiaries * ratios.hhs );
				b.boys = Math.round( b.total_beneficiaries * ratios.boys );
				b.girls = Math.round( b.total_beneficiaries * ratios.girls );
				b.men = Math.round( b.total_beneficiaries * ratios.men );
				b.women = Math.round( b.total_beneficiaries * ratios.women );
				b.elderly_men = Math.round( b.total_beneficiaries * ratios.elderly_men );
				b.elderly_women = Math.round( b.total_beneficiaries * ratios.elderly_women );
				b.total_beneficiaries = Math.round( b.total_beneficiaries );
			},

			// borehole
			// m3 = yield*hrs*3600secs
			boreholeOutput: function( locations, b ){
				if ( b.borehole_yield_ltrs_second >=0 &&
							b.borehole_pumping_ave_daily_hours >=0 ) {
					// metrics
					b.borehole_m3 = b.borehole_yield_ltrs_second * b.borehole_pumping_ave_daily_hours * 3600;
					b.total_beneficiaries = ( b.borehole_m3 * ngmClusterHelperNgWash.ratios.beneficiaries ) * 0.001;
					// sadd
					ngmClusterHelperNgWash.bSadd( b );
					// calculate location totals
					ngmClusterHelperNgWash.setActivityBeneficiaries( locations );
				}
			},

			// taps * 250
			indicatorOutput: function( locations, b, key ){
				if ( b.quantity >=0 ) {
					// calculate metrics
					b.total_beneficiaries = 0;
					// add each key
					angular.forEach( ngmClusterHelperNgWash.ratios[ key ].keys, function( d, i ){
						b.total_beneficiaries += b[ d ];
					});
					// times ratio
					b.total_beneficiaries *= ngmClusterHelperNgWash.ratios[ key ].beneficiaries;
					// make it sadd
					ngmClusterHelperNgWash.bSadd( b );
					// calculate beneficairy totals
					ngmClusterHelperNgWash.setActivityBeneficiaries( locations );
				}
			},

			// TOTAL BENEFICIARIES

			// set total beneficiaries
			setActivityBeneficiaries: function( locations ){
				// set beneficiary populations
				angular.forEach( locations, function( l, i ){
					angular.forEach( l.beneficiaries, function( b, j ){
						if (
									// water - ops and maintenance
									b.activity_detail_id === 'washcoms_establishment_training' ||
									b.activity_detail_id === 'operation_maintenance_monitoring' ||
									b.activity_detail_id === 'maintenance_repair_kits_provision_to_washcoms' ||
									b.activity_detail_id === 'maintenance_repair_replacement_water_systems' ||

									// sanitation - latrines
									b.activity_detail_id === 'latrine_sludge_dumping_site' ||
									b.activity_detail_id === 'latrine_monitoring' ||

									// sanitation - waste management
									b.activity_detail_id === 'cleaning_campaigns' ||
									b.activity_detail_id === 'communal_refuse_pit_excavation_for_incineration_burial' ||
									b.activity_detail_id === 'establishment_training_rotational_waste_management_committee' ||

									// sanitation - committee
									b.activity_detail_id === 'establishment_training_rotational_sanitation_committee' ||

									// hygiene - hygiene_promotion
									b.activity_detail_id === 'leaflet_flyer_distribution' ||
									b.activity_detail_id === 'focus_group_sessions' ||
									b.activity_detail_id === 'mass_campaigns' ||
									b.activity_detail_id === 'speaker_campaigns' ||
									b.activity_detail_id === 'other_campaigns' ||
									b.activity_detail_id === 'hygiene_promotion_volunteers_recruitment_training' ||
									b.activity_detail_id === 'hygiene_promotion_volunteers_kit_distribution' ||
									b.activity_detail_id === 'hygiene_promotion_monitoring_visits' // ||

									// much easier - by description
									// b.activity_description_id === 'community_participation' ||
									// b.activity_description_id === 'transparency'
								) {
							ngmClusterHelperNgWash.setActivityBeneficiariesBySite( l, b );
						} else {
							ngmClusterHelperNgWash.sumActivityBeneficiaries( b );
						}
					});
				});
			},

			// sum beneficiaries
			setActivityBeneficiariesBySite: function( l, b ) {

				// set beneficiaries
				b.households = l.households;
				b.boys = l.boys;
				b.girls = l.girls;
				b.men = l.men;
				b.women = l.women;
				b.elderly_men = l.elderly_men;
				b.elderly_women = l.elderly_women;
				b.total_beneficiaries = l.site_population;

				// each association
				angular.forEach( b, function( d, k ){
					if ( Array.isArray( d ) ) {
						// associations
						if ( k === 'water' ||
									k === 'boreholes' ||
									k === 'sanitation' ||
									k === 'hygiene' ||
									k === 'accountability') {
							angular.forEach( d, function( activity, l ){
								activity.households = l.households;
								activity.boys = l.boys;
								activity.girls = l.girls;
								activity.men = l.men;
								activity.women = l.women;
								activity.elderly_men = l.elderly_men;
								activity.elderly_women = l.elderly_women;
								activity.total_beneficiaries = l.site_population;
							});
						}
					}
				});
			},

			// sum beneficiaries
			sumActivityBeneficiaries: function( b ) {

				// set beneficiaries
				b.cash_amount = 0;
				b.households = 0;
				b.boys = 0;
				b.girls = 0;
				b.men = 0;
				b.women = 0;
				b.elderly_men = 0;
				b.elderly_women = 0;
				b.total_beneficiaries = 0;

				// each association
				angular.forEach( b, function( d, k ){
					if ( Array.isArray( d ) ) {
						// associations
						if ( k === 'water' ||
									k === 'boreholes' ||
									k === 'sanitation' ||
									k === 'hygiene' ||
									k === 'cash' ||
									k === 'accountability') {
							angular.forEach( d, function( activity, l ){
								b.cash_amount += activity.cash_amount ? activity.cash_amount : 0;
								b.households += activity.households ? activity.households : 0;
								b.boys += activity.boys;
								b.girls += activity.girls;
								b.men += activity.men;
								b.women += activity.women;
								b.elderly_men += activity.elderly_men;
								b.elderly_women += activity.elderly_women;
								b.total_beneficiaries += activity.total_beneficiaries;
							});
						}
					}
				});
			}

		}

		// return
		return ngmClusterHelperNgWash;

	}]);


text:
#!/usr/bin/env python
import os
import glob
import argparse

def read_nmi(file):
    experiment = file.split('/')[-3]
    with open(file) as fp:
        lines = fp.readlines()
        for line in lines:
            line_split = line.split()
            if line_split[0] == 'I(X;Y)/(H(X)):':
                return (experiment, float(line_split[1]))

def read_abx_scores(file):
    output_measures = {'within_talkers', 'across_talkers'}
    experiment = file.split('/')[-3]
    try:
        with open(file) as fp:
            lines = fp.readlines()
            result = [float(line_split[1]) for line_split in [line.split() for line in lines]
                     if len(line_split) > 1 and len(line_split[0]) > 13 and line_split[0][-15:-1] in output_measures]
            return (experiment, result)
    except IOError:
            return (experiment, [])

def read_eval2_measure(file):
    output_measures = {'precision', 'recall', 'fscore', 'NED', 'coverage'}
    experiment = '_'.join(file.split('/')[-4:-2])
    try:
        with open(file) as fp:
            lines = fp.readlines()
            result = [float(line_split[1]) for line_split in [line.split() for line in lines]
                     if len(line_split) > 1 and line_split[0] in output_measures]
            return (experiment, result)
    except IOError:
            return (experiment, [])

def main():
    # paramter parsing
    parser = argparse.ArgumentParser()
    parser.add_argument('experiment_dir', help='Experiment directory')
    parser.add_argument('--nmi', action='store_true', help='Collect NMI stats')
    parser.add_argument('--eval1', action='store_true', help='Colltct eval1 results')
    parser.add_argument('--eval2', action='store_true', help='Collect eval2 results')
    args = parser.parse_args()

    experiment_dir = args.experiment_dir

    baseline_header = ['Experiment']

    if args.nmi:
        # nmi stats
        unigram_labels_nmi_file = os.path.join(experiment_dir, 'unigram_labels_nmi/scores')
        unigram_lattices_nmi_file = os.path.join(experiment_dir, 'unigram_lattices_nmi/scores')
        bigram_labels_nmi_file = os.path.join(experiment_dir, 'bigram_labels_nmi/scores')
        bigram_lattices_nmi_file = os.path.join(experiment_dir, 'bigram_lattices_nmi/scores')
        baseline_header += ['NMI (labels)', 'NMI (lattices)']

        baseline_nmi = {'unigram': [read_nmi(unigram_labels_nmi_file)[1], read_nmi(unigram_lattices_nmi_file)[1]],
                        'bigram': [read_nmi(bigram_labels_nmi_file)[1], read_nmi(bigram_lattices_nmi_file)[1]]}

    if args.eval1:
        # eval 1 evaluation
        unigram_states_abx_file = os.path.join(experiment_dir, 'unigram_eval1/unigram_gmm_posts_txt/results.txt')
        unigram_units_abx_file = os.path.join(experiment_dir, 'unigram_eval1/unigram_unit_gmm_posts_txt/results.txt')
        bigram_states_abx_file = os.path.join(experiment_dir, 'bigram_eval1/bigram_gmm_posts_txt/results.txt')
        bigram_units_abx_file = os.path.join(experiment_dir, 'bigram_eval1/bigram_unit_gmm_posts_txt/results.txt')
        baseline_header += ['State ABX (within)', 'State ABX (across)',
                            'Unit ABX (within)', 'Unit ABX (across)']

        baseline_abx = {'unigram': read_abx_scores(unigram_states_abx_file)[1] + read_abx_scores(unigram_units_abx_file)[1],
                        'bigram': read_abx_scores(bigram_states_abx_file)[1] + read_abx_scores(bigram_units_abx_file)[1]}

    # eval 2 evaluation
    if args.eval2:
        eval2_base = 'bigram_ws_eval2/bigram_ws/*/*/TimedSentences_Iter_150'
        eval2_directories = glob.glob(os.path.join(experiment_dir, eval2_base))

        eval2_measures = ['boundary', 'group', 'matching', 'nlp', 'token_type']
        result_header = ['Experiment',
                        'Boundary precision (total)', 'Boundary recall (total)', 'Boundary fscore (total)',
                        'Boundary precision (within)', 'Boundary recall (within)', 'Boundary fscore (within)',
                        'Grouping precision (total)', 'Grouping recall (total)', 'Grouping fscore (total)',
                        'Grouping precision (within)', 'Grouping recall (within)', 'Grouping fscore (within)',
                        'Matching precision (total)', 'Matching recall (total)', 'Matching fscore (total)',
                        'Matching precision (within)', 'Matching recall (within)', 'Matching fscore (within)',
                        'NED (total)', 'Coverage (total)',
                        'NED (within)', 'Coverage (within)',
                        'Token precision (total)', 'Token recall (total)', 'Token fscore (total)',
                        'Type precision (total)', 'Type recall (total)', 'Type fscore (total)',
                        'Token precision (within)', 'Token recall (within)', 'Token fscore (within)',
                        'Type precision (within)', 'Type recall (within)', 'Type fscore (within)']

        eval2_results =  {measure: {experiment: result for experiment, result in
                                    [read_eval2_measure(os.path.join(directory, measure)) for directory in eval2_directories]}
                          for measure in eval2_measures}

    # summarize results
    if args.eval2:
        results = dict()

        for measure in eval2_measures:
            for experiment, result in eval2_results[measure].items():
                if len(result) == 0:
                    if measure == 'nlp':
                        result = [1, 0]*2
                    else:
                        result = [0]*6
                try:
                    results[experiment] += result
                except KeyError:
                    results[experiment] = result

    if args.nmi and args.eval1:
        baseline_results = {experiment: baseline_nmi[experiment] + baseline_abx[experiment] for experiment in baseline_nmi}
    elif args.nmi:
        baseline_results = baseline_nmi
    elif args.eval1:
        baseline_results = baseline_abx
    else:
        baseline_results = dict()

    # write out results
    with open(os.path.join(experiment_dir, 'results.csv'), 'w') as fid:
        if args.eval2:
            string_format = '{}' + ';{}'*(len(result_header) - 1) + '\n'
            fid.write(string_format.format(*result_header))
            for experiment, result in results.items():
                fid.write(string_format.format(experiment, *result))

            fid.write('\n')

        if args.nmi or args.eval1:
            string_format = '{}' + ';{}'*(len(baseline_header) - 1) + '\n'
            fid.write(string_format.format(*baseline_header))
            for experiment, result in baseline_results.items():
                fid.write(string_format.format(experiment, *result))

if __name__ == '__main__':
    main()


text:
var _preview = {
  init: function () {

    console.log('preview init');

    /*Only needed for the controls*/
    var iframe = document.getElementById("editor.pages.preview.webview");
    var phone = document.getElementById("editor.pages.preview.phone_1");

    _preview.updateIframe(phone);
    _preview.events(phone, iframe);

     if (iframe.attachEvent){
         iframe.attachEvent("onload", function(){
             _preview.afterLoading(phone);
         });
     } else {
         iframe.onload = function(){
             _preview.afterLoading(phone);
         };
     }

  },
  events: function (phone, iframe) {

    document.getElementById("editor.pages.preview.views").addEventListener("click", function(evt) {
      console.log('views click');
      _preview.updateView(evt.target.value, phone);
    });

    document.getElementById("editor.pages.preview.phones").addEventListener("click", function(evt) {

      console.log('phone click');

      if(evt.target.value == 1){
        // iphone 6
        width = 375;
        height = 667;
      }

      if(evt.target.value == 2){
        // samsung
        width = 400;
        height = 640;
      }

      if(evt.target.value == 3){
        // microsoft
        width = 320;
        height = 480;
      }

      if(evt.target.value == 4){
        // htc
        width = 360;
        height = 640;
      }

      if(evt.target.value == 5){
        // ipad mini
        width = 768;
        height = 1024;
      }

      phone.style.width = width + "px";
      phone.style.height = height + "px";

      iframe.style.width = width + "px";
      iframe.style.height = height + "px";

      iframe.minwidth = width;
      iframe.minheight = height;

    });

  },
  updateIframe: function (phone) {

    console.log('updateIframe',phone);

    // preload iphone width and height
    phone.style.width = "375px";
    phone.style.height = "667px";

  },
  updateView: function (view, phone) {
    console.log('updateView',view,phone);
    if (view) {
      phone.className = "phone view_" + view;
    }
  },
  afterLoading: function (phone){
      console.log('afterLoading',phone);
      setTimeout(function() {
          phone.className = "phone view_1";
          setTimeout(function() {
              // do second thing
              phone.className = "phone view_1 rotate";
          }, 1000);
      }, 1000);

  }

};


text:
package net.devh.boot.grpc.examples.local.server;

import io.grpc.stub.StreamObserver;
import net.devh.boot.grpc.examples.lib.HelloReply;
import net.devh.boot.grpc.examples.lib.HelloRequest;
import net.devh.boot.grpc.examples.lib.SimpleGrpc;
import net.devh.boot.grpc.server.service.GrpcService;

/**
 * @author Michael (yidongnan@gmail.com)
 * @since 2016/11/8
 */

@GrpcService
public class GrpcServerService extends SimpleGrpc.SimpleImplBase {

    @Override
    public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
        HelloReply reply = HelloReply.newBuilder().setMessage("Hello ==> " + req.getName()).build();
        responseObserver.onNext(reply);
        responseObserver.onCompleted();
    }

}


text:
from __future__ import absolute_import, print_function

import ConfigParser as configparser
import argparse
import logging
import os
import random
import sys
import tempfile
import time

import boto.dynamodb2
import boto.dynamodb2.table
import boto.utils

log_handler = logging.handlers.SysLogHandler(address="/dev/log")
log_handler.setFormatter(logging.Formatter("%(name)s: %(levelname)s: %(message)s"))
log = logging.getLogger("namer")
log.addHandler(log_handler)
log.setLevel(logging.DEBUG)

def main():
	parser = argparse.ArgumentParser()
	parser.add_argument("dynamodbtable")
	parser.add_argument("conffiles", nargs="+")
	args = parser.parse_args()

	identity = boto.utils.get_instance_identity()["document"]
	instance = identity["instanceId"]
	conn = boto.dynamodb2.connect_to_region(identity["region"])
	table = boto.dynamodb2.table.Table(args.dynamodbtable, connection=conn)

	config = configparser.SafeConfigParser()
	config.read(args.conffiles)

	retval = 0

	for section in config.sections():
		log.info("registering %s", section)

		while True:
			try:
				name = None
				names = set()
				for result in table.query(consistent=True, type__eq=section):
					n = int(result["name"])
					i = result.get("instance")
					if i and i == instance:
						name = n
						break
					names.add(n)

				if name is not None:
					log.info("%s %d already registered", section, name)
					break

				name = 1
				while name in names:
					name += 1

				if table.put_item(dict(type=section, name=name, instance=instance)):
					log.info("%s %d registered", section, name)
					break

				log.warning("%s registration conflict: %d", section, name)
			except Exception:
				log.exception(section)

			time.sleep(1 + random.random())
			log.info("retrying %s registration", section)

		ok = False

		for path, fmt in config.items(section):
			try:
				dirname = os.path.dirname(path)
				basename = os.path.basename(path)
				content = fmt.format(name)

				with tempfile.NamedTemporaryFile(prefix="." + basename, dir=dirname) as temp:
					print(content, file=temp)
					temp.flush()
					os.chmod(temp.name, 0644)
					os.rename(temp.name, path)
					temp.delete = False
					ok = True
			except Exception:
				log.exception(path)

		if ok:
			print(section)
		else:
			log.warning("unregistering %s %d", section, name)
			table.delete_item(type=section, name=name)
			retval = 1

	return retval

if __name__ == "__main__":
	try:
		retval = main()
	except Exception:
		log.exception("failed")
		retval = 1

	sys.exit(retval)


text:
package com.amazonaws.services.route53.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * A complex type that contains the response information for the specified geolocation code.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetGeoLocationResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * A complex type that contains the codes and full continent, country, and subdivision names for the specified
     * geolocation code.
     *

     */
    private GeoLocationDetails geoLocationDetails;

    /**
     *

     * A complex type that contains the codes and full continent, country, and subdivision names for the specified
     * geolocation code.
     *

     *
     * @param geoLocationDetails
     *        A complex type that contains the codes and full continent, country, and subdivision names for the
     *        specified geolocation code.
     */

    public void setGeoLocationDetails(GeoLocationDetails geoLocationDetails) {
        this.geoLocationDetails = geoLocationDetails;
    }

    /**
     *

     * A complex type that contains the codes and full continent, country, and subdivision names for the specified
     * geolocation code.
     *

     *
     * @return A complex type that contains the codes and full continent, country, and subdivision names for the
     *         specified geolocation code.
     */

    public GeoLocationDetails getGeoLocationDetails() {
        return this.geoLocationDetails;
    }

    /**
     *

     * A complex type that contains the codes and full continent, country, and subdivision names for the specified
     * geolocation code.
     *

     *
     * @param geoLocationDetails
     *        A complex type that contains the codes and full continent, country, and subdivision names for the
     *        specified geolocation code.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public GetGeoLocationResult withGeoLocationDetails(GeoLocationDetails geoLocationDetails) {
        setGeoLocationDetails(geoLocationDetails);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getGeoLocationDetails() != null)
            sb.append("GeoLocationDetails: ").append(getGeoLocationDetails());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof GetGeoLocationResult == false)
            return false;
        GetGeoLocationResult other = (GetGeoLocationResult) obj;
        if (other.getGeoLocationDetails() == null ^ this.getGeoLocationDetails() == null)
            return false;
        if (other.getGeoLocationDetails() != null && other.getGeoLocationDetails().equals(this.getGeoLocationDetails()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getGeoLocationDetails() == null) ? 0 : getGeoLocationDetails().hashCode());
        return hashCode;
    }

    @Override
    public GetGeoLocationResult clone() {
        try {
            return (GetGeoLocationResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
namespace glsp {

IAppFramework* IAppFramework::sAppFramework(nullptr);

void GlspApp::run()
{
	IAppFramework *app_fw = IAppFramework::open();

	if (app_fw->AttachApp(this) == false)
	{
		IAppFramework::close();
		return;
	}

	INativeWindowManager::get()->EnterLoop();
	IAppFramework::close();
}

bool GlspApp::Init()
{
	bool ret = onInit();

	if (mWidth <= 0 || mHeight <= 0 || !mName)
		ret = false;

	return ret;
}

void GlspApp::Render()
{
	onRender();
	INativeWindowManager::get()->FinishFrame();
}

IAppFramework* IAppFramework::open()
{
	if (!sAppFramework)
	{
		sAppFramework = OpenAppFramework();
	}

	return sAppFramework;
}

IAppFramework::IAppFramework():
	mNWM(nullptr),
	mApp(nullptr)
{
}

IAppFramework::~IAppFramework()
{
	if (mNWM)
	{
		mNWM->release();
		mNWM = nullptr;
	}
}

bool IAppFramework::AttachApp(GlspApp *app)
{
	assert(app);

	mApp = app;
	mNWM = INativeWindowManager::get();
	//mAppHandle = GetAppHandle(app);
	mNWM->SetAppFramework(this);

	bool ret = mNWM->InitDrawEngine();
	if (!ret)
		return false;

	// call this between InitDrawEngine and AFWCreateWindow because
	// app's onInit will call into glsp render and will set window
	// information for AFWCreateWindow.
	ret = mApp->Init();
	if (!ret)
		return false;

	return AFWCreateWindow(app->mWidth, app->mHeight, app->mName);
}

void IAppFramework::close()
{
	if (sAppFramework)
	{
		delete sAppFramework;
		sAppFramework = nullptr;
	}
}

} // namespace glsp


text:
export abstract class RouteParams {
  [key: string]: string;
}

export function routeParamsFactory(i: any) {
  return i.get('$routeParams');
}

export const routeParamsProvider = {
  provide: RouteParams,
  useFactory: routeParamsFactory,
  deps: ['$injector']
};


text:
from heat.common import exception
from heat.engine import clients
from heat.engine import properties
from heat.engine.resources.neutron import neutron

if clients.neutronclient is not None:
    from neutronclient.common.exceptions import NeutronClientException

class ExtraRoute(neutron.NeutronResource):

    PROPERTIES = (
        ROUTER_ID, DESTINATION, NEXTHOP,
    ) = (
        'router_id', 'destination', 'nexthop',
    )

    properties_schema = {
        ROUTER_ID: properties.Schema(
            properties.Schema.STRING,
            description=_('The router id.'),
            required=True),
        DESTINATION: properties.Schema(
            properties.Schema.STRING,
            description=_('Network in CIDR notation.'),
            required=True),
        NEXTHOP: properties.Schema(
            properties.Schema.STRING,
            description=_('Nexthop IP adddress.'),
            required=True)
    }

    def add_dependencies(self, deps):
        super(ExtraRoute, self).add_dependencies(deps)
        for resource in self.stack.itervalues():
            # depend on any RouterInterface in this template with the same
            # router_id as this router_id
            if (resource.has_interface('OS::Neutron::RouterInterface') and
                resource.properties['router_id'] ==
                    self.properties['router_id']):
                        deps += (self, resource)
            # depend on any RouterGateway in this template with the same
            # router_id as this router_id
            elif (resource.has_interface('OS::Neutron::RouterGateway') and
                  resource.properties['router_id'] ==
                    self.properties['router_id']):
                        deps += (self, resource)

    def handle_create(self):
        router_id = self.properties.get(self.ROUTER_ID)
        routes = self.neutron().show_router(
            router_id).get('router').get('routes')
        if not routes:
            routes = []
        new_route = {'destination': self.properties[self.DESTINATION],
                     'nexthop': self.properties[self.NEXTHOP]}
        if new_route in routes:
            msg = _('Route duplicates an existing route.')
            raise exception.Error(msg)
        routes.append(new_route)
        self.neutron().update_router(router_id, {'router':
                                     {'routes': routes}})
        new_route['router_id'] = router_id
        self.resource_id_set(
            '%(router_id)s:%(destination)s:%(nexthop)s' % new_route)

    def handle_delete(self):
        if not self.resource_id:
            return
        (router_id, destination, nexthop) = self.resource_id.split(':')
        try:
            routes = self.neutron().show_router(
                router_id).get('router').get('routes', [])
            try:
                routes.remove({'destination': destination,
                               'nexthop': nexthop})
            except ValueError:
                return
            self.neutron().update_router(router_id, {'router':
                                         {'routes': routes}})
        except NeutronClientException as ex:
            self._handle_not_found_exception(ex)

def resource_mapping():
    if clients.neutronclient is None:
        return {}

    return {
        'OS::Neutron::ExtraRoute': ExtraRoute,
    }


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="vn.cusc.game2d"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="13"
        android:targetSdkVersion="20" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".GiaoDienChinh"
            android:label="@string/app_name"
            android:screenOrientation="portrait"></activity>
        <activity
            android:name=".FlashScreen"
            android:label="@string/title_activity_flash_screen"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".GameOver"
            android:label="@string/title_activity_game_over"
            android:screenOrientation="portrait"></activity>

        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />

    </application>

</manifest>