text:
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:

    3GPP TS 26.073
    ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
    Available from http://www.3gpp.org

(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
Permission to distribute, modify and use this file under the standard license
terms listed above has been obtained from the copyright holder.
****************************************************************************************/
/*
 Pathname: ./gsm-amr/c/src/div_s.c

------------------------------------------------------------------------------
 REVISION HISTORY

 Description: Created separate file for the div_s function. Sync'ed up
          with the current template and fixed tabs.

 Description: Making changes based on review meeting.

 Description: Made changes based on P3 review meeting.

 Description: Changing abort() to exit(0).

 Description: Made the following changes
              1. Unrolled the division loop to make three comparison per
                 pass, using only five iterations of the loop and saving
                 shifts cycles

 Who:                       Date:
 Description:

------------------------------------------------------------------------------
 INPUT AND OUTPUT DEFINITIONS

 Inputs:
    var1 = 16 bit signed integer (Word16) whose value falls in
           the range : 0x0000 <= var1 <= 0x7fff.
    var2 = 16 bit signed integer (Word16) whose value falls in
           the range : 0x0000 <= var1 <= 0x7fff.

 Local Stores/Buffers/Pointers Needed:
    None

 Global Stores/Buffers/Pointers Needed:
    None

 Outputs:
    var_out = quotient of var1 divided by var2 (Word16)

 Pointers and Buffers Modified:
    None

 Local Stores Modified:
    None

 Global Stores Modified:
    None

------------------------------------------------------------------------------
 FUNCTION DESCRIPTION

 This function produces a result which is the fractional integer division of
 var1 by var2; var1 and var2 must be positive and var2 must be greater or equal
 to var1; the result is positive (leading bit equal to 0) and truncated to 16
 bits. If var1 = var2 then div(var1,var2) = 32767.

------------------------------------------------------------------------------
 REQUIREMENTS

 None

------------------------------------------------------------------------------
 REFERENCES

 [1] basicop2.c, ETS Version 2.0.0, February 8, 1999

------------------------------------------------------------------------------
 PSEUDO-CODE

Word16 div_s (Word16 var1, Word16 var2)
{
    Word16 var_out = 0;
    Word16 iteration;
    Word32 L_num;
    Word32 L_denom;
    Word16 abort_flag = 0;

    if ((var1 > var2) || (var1 < 0))
    {
        printf ("Division Error var1=%d  var2=%d\n", var1, var2);
        abort_flag = 1;
        exit(0);
    }
    if ((var1 != 0) && (abort_flag == 0))
    {
        if (var1 == var2)
        {
            var_out = MAX_16;
        }
        else
        {
            L_num = (Word32) var1;
            L_denom = (Word32) var2;

            for (iteration = 15; iteration > 0; iteration--)
            {
                var_out <<= 1;
                L_num <<= 1;

                if (L_num >= L_denom)
                {
                    L_num -= L_denom;
                    var_out += 1;
                }
            }
        }
    }

#if (WMOPS)
    multiCounter[currCounter].div_s++;
#endif
    return (var_out);
}

------------------------------------------------------------------------------
 RESOURCES USED
   When the code is written for a specific target processor the
     the resources used should be documented below.

 STACK USAGE: [stack count for this module] + [variable to represent
          stack usage for each subroutine called]

     where: [stack usage variable] = stack usage for [subroutine
         name] (see [filename].ext)

 DATA MEMORY USED: x words

 PROGRAM MEMORY USED: x words

 CLOCK CYCLES: [cycle count equation for this module] + [variable
           used to represent cycle count for each subroutine
           called]

     where: [cycle count variable] = cycle count for [subroutine
        name] (see [filename].ext)

------------------------------------------------------------------------------
*/

/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include    "basic_op.h"

/*----------------------------------------------------------------------------
; MACROS
; Define module specific macros here
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; DEFINES
; Include all pre-processor statements here. Include conditional
; compile variables also.
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; LOCAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; LOCAL STORE/BUFFER/POINTER DEFINITIONS
; Variable declaration - defined here and used outside this module
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; EXTERNAL FUNCTION REFERENCES
; Declare functions defined elsewhere and referenced in this module
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
; Declare variables used in this module but defined elsewhere
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; FUNCTION CODE
----------------------------------------------------------------------------*/
Word16 div_s(Word16 var1, Word16 var2)
{
    /*----------------------------------------------------------------------------
    ; Define all local variables
    ----------------------------------------------------------------------------*/
    Word16 var_out = 0;
    Word16 iteration;
    Word32 L_num;
    Word32 L_denom;
    Word32 L_denom_by_2;
    Word32 L_denom_by_4;

    /*----------------------------------------------------------------------------
    ; Function body here
    ----------------------------------------------------------------------------*/
    if ((var1 > var2) || (var1 < 0))
    {
        return 0; // used to exit(0);
    }
    if (var1)
    {
        if (var1 != var2)
        {

            L_num = (Word32) var1;
            L_denom = (Word32) var2;
            L_denom_by_2 = (L_denom << 1);
            L_denom_by_4 = (L_denom << 2);
            for (iteration = 5; iteration > 0; iteration--)
            {
                var_out <<= 3;
                L_num   <<= 3;

                if (L_num >= L_denom_by_4)
                {
                    L_num -= L_denom_by_4;
                    var_out |= 4;
                }

                if (L_num >= L_denom_by_2)
                {
                    L_num -= L_denom_by_2;
                    var_out |=  2;
                }

                if (L_num >= (L_denom))
                {
                    L_num -= (L_denom);
                    var_out |=  1;
                }

            }
        }
        else
        {
            var_out = MAX_16;
        }
    }

#if (WMOPS)
    multiCounter[currCounter].div_s++;
#endif

    /*----------------------------------------------------------------------------
    ; Return nothing or data or data pointer
    ----------------------------------------------------------------------------*/
    return (var_out);
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright 2007-2014 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.Testing.TestInstanceConfigurators
{
    using ActionConfigurators;
    using Configurators;
    using ScenarioConfigurators;

    public interface ITestConfigurator<TScenario> :
        ITestConfigurator
        where TScenario : ITestScenario
    {
        void AddActionConfigurator(ITestActionConfigurator<TScenario> action);

        void AddScenarioConfigurator(IScenarioSpecification<TScenario> configurator);
    }
}


text:
<?php defined('SYSPATH') or die('No direct access allowed.');

return array(

	/**
	 * The maximum execution time, in seconds. If set to zero, no time limit is imposed.
	 * Note: http://php.net/manual/en/function.set-time-limit.php#84563
	 */
	'max_execution_time' => 0,

	/**
	 * Expand all benchmark details by default.
	 */
	'expand_all' => FALSE,

);


text:
import re
import json
import time

from reporting.utilities import getLogger, get_hostname
from reporting.exceptions import InputDataError

log = getLogger(__name__)

class IParser(object):
    def parse(self, data):
        assert 0, "This method must be defined."

class MatchParser(IParser):
    def __init__(self, pattern, transform):
        self.__pattern=pattern
        self.__transform=transform
    def parse(self, data):
        log.debug("match %s" % self.__pattern)
        match_obj = re.match(self.__pattern, data, re.M|re.I)
        match_groups = match_obj.groups()
        result = self.__transform.format(*match_groups)
        output = json.loads(result)
        output['timestamp'] = int(time.time())
        output['hostname'] = get_hostname()
        return output

class SplitParser(IParser):
    def __init__(self, delimiter, transform):
        self.__delimiter=delimiter
        self.__transform=transform
    def parse(self, data):
        log.debug("delimiter %s" % self.__delimiter)
        list = [item.strip() for item in re.split(self.__delimiter, data)]
        result = self.__transform.format(*list)
        log.debug("result %s"%result)
        output = json.loads(result)
        log.debug("output %s"%output)
        output['timestamp'] = int(time.time())
        output['hostname'] = get_hostname()
        return output

class DummyParser(IParser):
    def parse(self, data):
        output = {}
        output['timestamp'] = int(time.time())
        output['hostname'] = get_hostname()
        output['content'] = data.strip()
        return output

class JsonGrepParser(IParser):
    def __init__(self, pattern=None, list_name="list"):
        self.__pattern=pattern
        self.__list_name=list_name
    def parse(self, data):
        output = {}
        output['timestamp'] = int(time.time())
        output['hostname'] = get_hostname()
        try:
            j = json.loads(data)
        except ValueError as e:
            log.exception('Could not load JSON object from input data.')
            raise InputDataError()
        if self.__pattern and len(self.__pattern)>0:
            self.jsongrep(j, map(re.compile, self.__pattern.split(" ")), output)
            if self.__list_name in output and len(output[self.__list_name])==1:
                output[self.__list_name]=output[self.__list_name][0]
        else:
            if isinstance(j, list):
                output[self.__list_name]=j
            else:
                output.update(j)
        return output
    # from http://blogs.fluidinfo.com/terry/2010/11/25/jsongrep-py-python-for-extracting-pieces-of-json-objects/
    def jsongrep(self, d, patterns, output):
        #print "jsongrep %s" % d
        try:
            pattern = patterns.pop(0)
        except IndexError:
            if isinstance(d, dict):
                output.update(d)
            else:
                self.add_value(d, output)
        else:
            if isinstance(d, dict):
                #print "dict"
                keys = filter(pattern.match, d.keys())
            elif isinstance(d, list):
                #print "lsit"
                keys = map(int,
                           filter(pattern.match,
                                  ['%d' % i for i in range(len(d))]))
                #print keys
            else:
                #print "str "+str(d)
                if pattern.match(str(d)):
                    self.add_value(d, output)
                return
            for item in (d[key] for key in keys):
                self.jsongrep(item, patterns[:], output)
    def add_value(self, d, output):
        if not self.__list_name in output:
            output[self.__list_name]=[]
        #print output
        if isinstance(d, list):
            output[self.__list_name].extend(d)
        else:
            output[self.__list_name].append(d)


text:
package iso20022

// Choice of format to expressed a ratio.
type RatioFormat6Choice struct {

	// Ratio expressed as a quotient of quantities.
	QuantityToQuantity *QuantityToQuantityRatio1 `xml:"QtyToQty"`

	// Value of the ratio not specified.
	NotSpecifiedRate *RateValueType6Code `xml:"NotSpcfdRate"`

	// Ratio expressed as a quotient of amounts.
	AmountToAmount *AmountToAmountRatio2 `xml:"AmtToAmt"`

	// Ratio expressed as an amount to quantity ratio.
	AmountToQuantity *AmountAndQuantityRatio2 `xml:"AmtToQty"`

	// Ratio expressed as a quantity to amount ratio.
	QuantityToAmount *AmountAndQuantityRatio2 `xml:"QtyToAmt"`
}

func (r *RatioFormat6Choice) AddQuantityToQuantity() *QuantityToQuantityRatio1 {
	r.QuantityToQuantity = new(QuantityToQuantityRatio1)
	return r.QuantityToQuantity
}

func (r *RatioFormat6Choice) SetNotSpecifiedRate(value string) {
	r.NotSpecifiedRate = (*RateValueType6Code)(&value)
}

func (r *RatioFormat6Choice) AddAmountToAmount() *AmountToAmountRatio2 {
	r.AmountToAmount = new(AmountToAmountRatio2)
	return r.AmountToAmount
}

func (r *RatioFormat6Choice) AddAmountToQuantity() *AmountAndQuantityRatio2 {
	r.AmountToQuantity = new(AmountAndQuantityRatio2)
	return r.AmountToQuantity
}

func (r *RatioFormat6Choice) AddQuantityToAmount() *AmountAndQuantityRatio2 {
	r.QuantityToAmount = new(AmountAndQuantityRatio2)
	return r.QuantityToAmount
}


text:
=======
*pytsv*
=======

.. image:: https://img.shields.io/pypi/v/pytsv

.. image:: https://img.shields.io/github/license/veltzer/pytsv

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg

project website: https://veltzer.github.io/pytsv

author: Mark Veltzer

version: 0.1.67

	Mark Veltzer <mark.veltzer@gmail.com>, Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022


text:
package org.apache.tinkerpop.gremlin.util.function;

import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;

/**
 * @author Stephen Mallette (http://stephen.genoprime.com)
 */
public class BulkSetSupplierTest {
    @Test
    public void shouldSupplyBulkSet() {
        assertEquals(0, BulkSetSupplier.instance().get().size());
    }

    @Test
    public void shouldSupplyBulkSetInstance() {
        assertEquals(0, BulkSetSupplier.instance().get().size());
        assertThat(BulkSetSupplier.instance().get(), instanceOf(BulkSet.class));
    }

    @Test
    public void shouldSupplyNewBulkSetOnEachInvocation() {
        final BulkSet<Object> l1 = BulkSetSupplier.instance().get();
        final BulkSet<Object> l2 = BulkSetSupplier.instance().get();
        final BulkSet<Object> l3 = BulkSetSupplier.instance().get();

        assertNotSame(l1, l2);
        assertNotSame(l1, l3);
        assertNotSame(l2, l3);
    }
}


text:
TelerikAcademy
==============
This repository contains my homeworks, exam preparation and projects during my study in Telerik Sofware Academy.


text:
<?php

namespace Achopo\PosterBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class RegistrationFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        // add your custom field
        $builder->add('name', null, array('label' => 'form.name', 'translation_domain' => 'PosterBundle'));
        $builder->add('username', null, array('label' => 'form.username', 'translation_domain' => 'PosterBundle'));
        $builder->add('email', 'repeated', array(
                'type' => 'email',
                'options' => array('translation_domain' => 'PosterBundle'),
                'first_options' => array('label' => 'form.email'),
                'second_options' => array('label' => 'form.email_confirmation'),
                'invalid_message' => 'fos_user.email.mismatch',
            ));
        $builder->add('address', null, array('label' => 'form.address', 'translation_domain' => 'PosterBundle'));
        $builder->add('phone', null, array('label' => 'form.phone', 'translation_domain' => 'PosterBundle'));

    }

    public function getParent()
    {
        return 'fos_user_registration';
    }

    public function getName()
    {
        return 'achopo_user_registration';
    }
}


text:
namespace em = enterprise_management;

namespace enterprise_reporting {

ReportGenerator::ReportGenerator(ReportingDelegateFactory* delegate_factory)
    : delegate_(delegate_factory->GetReportGeneratorDelegate()),
      report_request_queue_generator_(delegate_factory),
      browser_report_generator_(delegate_factory) {}

ReportGenerator::~ReportGenerator() = default;

void ReportGenerator::Generate(ReportType report_type,
                               ReportCallback callback) {
  CreateBasicRequest(std::make_unique<ReportRequest>(report_type), report_type,
                     std::move(callback));
}

void ReportGenerator::CreateBasicRequest(
    std::unique_ptr<ReportRequest> basic_request,
    ReportType report_type,
    ReportCallback callback) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
  delegate_->SetAndroidAppInfos(basic_request.get());
#else
  basic_request->GetDeviceReportRequest().set_computer_name(
      this->GetMachineName());
  basic_request->GetDeviceReportRequest().set_os_user_name(GetOSUserName());
  basic_request->GetDeviceReportRequest().set_serial_number(GetSerialNumber());
  basic_request->GetDeviceReportRequest().set_allocated_os_report(
      GetOSReport().release());
  basic_request->GetDeviceReportRequest()
      .set_allocated_browser_device_identifier(
          policy::GetBrowserDeviceIdentifier().release());
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
  // 1. Async function base::SysInfo::SetHardwareInfo is called.
  // 2. ReportGenerator::SetHardwareInfo fills basic_report
  // 3. ReportGenerator::GenerateReport is called

  base::SysInfo::GetHardwareInfo(
      base::BindOnce(&ReportGenerator::SetHardwareInfo,
                     weak_ptr_factory_.GetWeakPtr(), std::move(basic_request),
                     base::BindOnce(&ReportGenerator::GenerateReport,
                                    weak_ptr_factory_.GetWeakPtr(), report_type,
                                    std::move(callback))));
#else
  GenerateReport(report_type, std::move(callback), std::move(basic_request));
#endif  // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
}

std::string ReportGenerator::GetMachineName() {
  return policy::GetMachineName();
}

std::string ReportGenerator::GetOSUserName() {
  return policy::GetOSUsername();
}

std::string ReportGenerator::GetSerialNumber() {
#if BUILDFLAG(IS_WIN)
  return base::WideToUTF8(
      base::win::WmiComputerSystemInfo::Get().serial_number());
#else
  return std::string();
#endif
}

void ReportGenerator::GenerateReport(
    ReportType report_type,
    ReportCallback callback,
    std::unique_ptr<ReportRequest> basic_request) {
  browser_report_generator_.Generate(
      ReportType::kFull,
      base::BindOnce(&ReportGenerator::OnBrowserReportReady,
                     weak_ptr_factory_.GetWeakPtr(), std::move(basic_request),
                     report_type, std::move(callback)));
}

void ReportGenerator::OnBrowserReportReady(
    std::unique_ptr<ReportRequest> basic_request,
    ReportType report_type,
    ReportCallback callback,
    std::unique_ptr<em::BrowserReport> browser_report) {
  basic_request->GetDeviceReportRequest().set_allocated_browser_report(
      browser_report.release());

  if (report_type != ReportType::kBrowserVersion) {
    // Generate a queue of requests containing detailed profile information.
    std::move(callback).Run(
        report_request_queue_generator_.Generate(*basic_request));
    return;
  }

  // Return a queue containing only the basic request and browser report without
  // detailed profile information.
  ReportRequestQueue requests;
  requests.push(std::move(basic_request));
  std::move(callback).Run(std::move(requests));
}

void ReportGenerator::SetHardwareInfo(
    std::unique_ptr<ReportRequest> basic_request,
    base::OnceCallback<void(std::unique_ptr<ReportRequest>)> callback,
    base::SysInfo::HardwareInfo hardware_info) {
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
  basic_request->GetDeviceReportRequest().set_brand_name(
      hardware_info.manufacturer);
  basic_request->GetDeviceReportRequest().set_device_model(hardware_info.model);
#endif  // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)

  std::move(callback).Run(std::move(basic_request));
}

}  // namespace enterprise_reporting


text:
require File.dirname(__FILE__) + '/spec_helper'

module Orangutan
  describe Expectation do
    before do
      @e = Expectation.new.receives(:foo)
    end

    it 'should not match when method is different' do
      @e.matches?(:bar).should == false
    end

    it 'should match when method matches and args are unspecified' do
      @e.matches?(:foo).should == true
    end

    it 'should match when method matches and args match' do
      @e.with(7).matches?(:foo, 7).should == true
    end

    it 'should not match when method matches but args do not match' do
      @e.with(7).matches?(:foo, 8).should == false
    end

    it 'should not yield by default' do
      @e.yield_container.should == nil
    end

    it 'should store yield value' do
      @e.yield(1).yield_container.should == Container.new([[1]])
    end

    it 'should store multiple yield values' do
      @e.yield(1,2).yield_container.should == Container.new([[1,2]])
    end

    it 'should not return by default' do
      @e.return_container.should == nil
    end

    it 'should store return value' do
      @e.return(1).return_container.should == Container.new([1])
    end

    it 'should store multiple return values' do
      @e.return(1,2).return_container.should == Container.new([1,2])
    end

    it 'should not raise by default' do
      @e.raiser.should == nil
    end

    it 'should store raiser' do
      @e.raise('description').raiser.should_not == nil
    end

    it 'should count matches' do
      (1..10).each do |i|
        @e.matches?(:foo)
        @e.count.should == i
      end
    end

    it 'should limit matches when given limit of once' do
      @e.once.should == @e
      @e.matches?(:foo).should == true
      @e.matches?(:foo).should == false
    end

    it 'should limit matches when given limit of twice' do
      @e.twice.should == @e
      2.times { @e.matches?(:foo).should == true }
      @e.matches?(:foo).should == false
    end

    it 'should limit matches' do
      @e.exactly(10).times.should == @e
      10.times { @e.matches?(:foo).should == true }
      @e.matches?(:foo).should == false
    end

    it 'should initially indicate that expectation was not matched' do
      @e.should_not be_matched
    end

    it 'should when no limit specified indicate that the expectation was matched once' do
      @e.matches?(:foo)
      @e.should be_matched
    end

    it 'should when a limit specified indicate that the expectation was not matched until the is limit reached' do
      @e.twice
      @e.matches?(:foo)
      @e.should_not be_matched
    end

    it 'should when a limit specified indicate that the expectation was matched once the is limit reached' do
      @e.twice
      2.times { @e.matches?(:foo) }
      @e.should be_matched
    end
  end
end


text:
package com.build.core.json;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;

/**
 * TODO JsonDateValueProcessor
 *
 * @author suns suntion@yeah.net
 * @since 2017年11月9日下午2:45:20
 */
public class JsonDateValueProcessor implements JsonValueProcessor {
    public static final String Default_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";

    private DateFormat dateFormat ;
    public JsonDateValueProcessor(String datePattern){
        try{
            dateFormat  = new SimpleDateFormat(datePattern);}
        catch(Exception e ){
            dateFormat = new SimpleDateFormat(Default_DATE_PATTERN);
        }
    }
    public Object processArrayValue(Object value, JsonConfig jsonConfig) {
        return process(value);
    }
    public Object processObjectValue(String key, Object value,JsonConfig jsonConfig) {
        return process(value);
    }
    private Object process(Object value){
        return dateFormat.format((Date)value);
    }
}


text:
package com.fineuploader;

import java.nio.file.Path;
import java.nio.file.Paths;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Upload server properties
 *
 * @author ovaldez
 */
@ConfigurationProperties("fineuploader")
public class UploadServerProperties {

    /**
     * Root upload directory.
     */
    private Path baseDir = Paths.get("./uploads");

    public Path getBaseDir() {
        return baseDir;
    }

    public void setBaseDir(Path baseDir) {
        this.baseDir = baseDir;
    }

}


text:
//
//  ALAssetsGroup.h
//  AssetsLibrary
//
//  Copyright 2010 Apple Inc. All rights reserved.
//
/*
 *
 * An ALAssetsGroup is a ordered set of assets. The order of its elements is the order that the user sees in the Photos application.
 * Groups are synced via iTunes, created on the device, created to hold the users saved photos, or created during camera import.
 * Synced groups cannot be directly modified using this API. Only user-created groups and the saved photos group can have assets added.
 */

#import <Foundation/Foundation.h>

#import <CoreGraphics/CoreGraphics.h>

#if __IPHONE_4_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED

@class ALAsset;
@class ALAssetsGroup;
@class ALAssetsFilter;

// This block is executed when a result is found. The result argument passed into the block is an ALAsset that
// matches the filter set by the caller.
// The index argument indicates which asset is being returned. In the case where no asset is found, index will be set to NSNotFound and stop to YES.
// When the enumeration is done, the block will be called with result set to nil and index set to NSNotFound.
// Setting the output argument stop to YES will finish the enumeration.
typedef void (^ALAssetsGroupEnumerationResultsBlock)(ALAsset *result, NSUInteger index, BOOL *stop) NS_DEPRECATED_IOS(4_0, 9_0, "Use the PHFetchResult returned by fetchAssetsInAssetCollection:options: on PHAsset from the Photos framework to enumerate the assets in an asset collection instead");

// Groups Properties
extern NSString *const ALAssetsGroupPropertyName NS_DEPRECATED_IOS(4_0, 9_0, "Use the localizedTitle property on a PHAssetCollection from the Photos framework instead");              // An NSString with the name of the group
extern NSString *const ALAssetsGroupPropertyType NS_DEPRECATED_IOS(4_0, 9_0, "Use the assetCollectionType and assetCollectionSubtype properties on a PHAssetCollection from the Photos framework instead");              // An ALAssetsGroupType wrapped in an NSNumber
extern NSString *const ALAssetsGroupPropertyPersistentID NS_DEPRECATED_IOS(4_0, 9_0, "Use the localIdentifier property on a PHAssetCollection from the Photos framework instead");      // An NSString with the group's persistent ID.
extern NSString *const ALAssetsGroupPropertyURL NS_DEPRECATED_IOS(5_0, 9_0, "Use the localIdentifier property on a PHAssetCollection from the Photos framework, or to lookup PHAssetCollections by a previously known ALAssetsGroupPropertyURL use fetchAssetCollectionsWithALAssetGroupURLs:options: instead");              // An NSURL that uniquely identifies the group

NS_CLASS_DEPRECATED_IOS(4_0, 9_0, "Use PHAssetCollection from the Photos framework instead")
@interface ALAssetsGroup : NSObject {
@package
    id _internal;
}

// Use this method to get information about the group.
- (id)valueForProperty:(NSString *)property NS_DEPRECATED_IOS(4_0, 9_0, "Use the class properties on a PHAssetCollection in the Photos framework instead");

// Returns a CGImage of the poster photo for the group.  The thumbnail will be in the correct orientation.
- (CGImageRef)posterImage NS_DEPRECATED_IOS(4_0, 9_0, "Use fetchKeyAssetsInAssetCollection:options: on PHAsset, then use the PHImageManager to request image data for key assets in the asset collection from the Photos framework instead");

// Set the ALAssetsFilter on the group to filter the group contents. This does not execute the filter.
// For that, -enumerateAssetsUsingBlock:doneBlock: or -numberOfAssets needs to be called.
// If no filter is set, the enumeration will return all the assets in the group.
// Only one filter is active at a time. Calling this method again resets the filter and does not affect any enumeration that may be in flight.
- (void)setAssetsFilter:(ALAssetsFilter *)filter NS_DEPRECATED_IOS(4_0, 9_0, "Use fetchAssetsInAssetCollection:options: on PHAsset with a predicate in the PHFetchOptions from the Photos framework to filter the assets in an asset collection instead");

// Get the number of assets in the group that match the filter.
// If no filter is set, it returns the count of all assets in the group.
- (NSInteger)numberOfAssets NS_DEPRECATED_IOS(4_0, 9_0, "Use the estimatedAssetCount on PHAssetCollection for a quick estimate of the total assets in a collection (or fetch the assets to get an exact value) from the Photos framework instead");

// These methods are used to retrieve the assets that match the filter.
// The caller can specify which results are returned using an NSIndexSet. The index set's count or lastIndex cannot exceed -numberOfAssets.
// 'enumerationBlock' is used to pass back results to the caller and provide the opportunity to stop the filter.
// When the enumeration is done, 'enumerationBlock' will be called with result set to nil and index set to NSNotFound.
// If the application has not been granted access to the data, 'enumerationBlock' will be called with result set to nil, index set to NSNotFound, and stop set to YES.
- (void)enumerateAssetsUsingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock NS_DEPRECATED_IOS(4_0, 9_0, "Use the PHFetchResult returned by fetchAssetsInAssetCollection:options: on PHAsset to enumerate the assets in an asset collection from the Photos framework instead");
- (void)enumerateAssetsWithOptions:(NSEnumerationOptions)options usingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock NS_DEPRECATED_IOS(4_0, 9_0, "Use the PHFetchResult returned by fetchAssetsInAssetCollection:options: on PHAsset to enumerate the assets in an asset collection from the Photos framework instead");
- (void)enumerateAssetsAtIndexes:(NSIndexSet *)indexSet options:(NSEnumerationOptions)options usingBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock NS_DEPRECATED_IOS(4_0, 9_0, "Use the PHFetchResult returned by fetchAssetsInAssetCollection:options: on PHAsset to enumerate the assets in an asset collection from the Photos framework instead");

// Returns YES if the application is able to edit the group.  Returns NO if the application is not able to edit the group.
@property (nonatomic, readonly, getter=isEditable) BOOL editable NS_DEPRECATED_IOS(5_0, 9_0, "Use canPerformEditOperation: on a PHAssetCollection from the Photos framework instead");

// Add an existing ALAsset to the group.  An asset can belong to multiple ALAssetsGroups.
// The caller should check the editable property of the group to see if it is possible to add an asset to the group.
// Returns YES if the asset was added successfully.  Returns NO if the group is not editable, or if the asset was not able to be added to the group.
- (BOOL)addAsset:(ALAsset *)asset NS_DEPRECATED_IOS(5_0, 9_0, "Use addAssets: on a PHAssetCollectionChangeRequest: created from a PHAssetCollection in the Photos framework instead");

@end

#endif


text:
.panel {
	border-radius: 0;
	-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.275);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.275);
}
.panel.panel-no-margin {
	margin:0 -16px;
	-webkit-box-shadow: none;
	box-shadow: none;
}
.panel-heading {
	border-top-right-radius: 0;
	border-top-left-radius: 0;
	height:58px;
	padding:0 25px;
	position:relative;
	overflow:hidden;
}
.panel-heading:before {
	position:absolute;
	left:0px;
	top:-5px;
	content:'';
	width: 250px;
	height: 100px;
	background: rgba(0,0,0,0.068);
	margin: 3px 0 0 30px;
	/* Rotate */
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	-ms-transform: rotate(-45deg);
	-o-transform: rotate(-45deg);
	transform: rotate(-45deg);
	/* Rotate Origin */
	-webkit-transform-origin: 0 100%;
	-moz-transform-origin: 0 100%;
	-ms-transform-origin: 0 100%;
	-o-transform-origin: 0 100%;
	transform-origin: 0 100%;
}
.panel-title {
	font-family: 'latoregular', Arial, sans-serif;
	font-weight: normal;
	margin:0;
	padding:0;
	font-size:26px;
	line-height:58px;
}
.panel-title .accordion-toggle {
	font-family: 'YanoneKaffeesatzRegular', Arial, sans-serif;
	font-weight: normal;
	color:rgba(255,255,255,0.3);
	display:block;
	-webkit-transition: all 0.8s ease;
	-moz-transition: all 0.8s ease;
	-o-transition: all 0.8s ease;
	-ms-transition: all 0.8s ease;
	transition: all 0.8s ease;
}
.panel-title .accordion-toggle:hover {
	color:rgba(255,255,255,0.9);
	text-decoration:none;
}
.panel-body {margin:0;}
.panel.panel-default {border-color: #9b9b9b;}

.panel > .panel-body{color: #454545;}
.panel.panel-dark > .panel-body,
.panel.panel-transparent > .panel-body,
.panel.panel-blank > .panel-body {color: #fdfdfd;}

.panel > .panel-heading,
.panel > .panel-footer {
	text-shadow:none;
	border-radius: 0;
	color:#fdfdfd;
}
.panel-default > .panel-heading,
.panel-default > .panel-footer {
	border-color: #9b9b9b;
	background-color:#9b9b9b;
}
.panel.panel-default.panel-dark {
	background-color:#9b9b9b;
}

.panel.panel-primary {
	border-color: #2470c4;
}
.panel.panel-primary.panel-dark {
	background-color:#2470c4;
}
.panel-primary > .panel-heading,
.panel-primary > .panel-footer {
	border-color: #2470c4;
	background-color:#2470c4;
}
.panel.panel-success {
	border-color: #27ae60;
}
.panel-success > .panel-heading,
.panel-success > .panel-footer {
	border-color: #27ae60;
	background-color:#27ae60;
}
.panel.panel-success.panel-dark {
	background-color:#27ae60;
}

.panel.panel-warning{
	border-color: #e67e22;
}
.panel-warning > .panel-heading,
.panel-warning > .panel-footer {
	border-color: #e67e22;
	background-color:#e67e22;
}
.panel.panel-warning.panel-dark {
	background-color:#e67e22;
}
.panel.panel-warning-alt{
	border-color: #f1c40f;
}
.panel-warning-alt > .panel-heading,
.panel-warning-alt > .panel-footer {
	border-color: #f1c40f;
	background-color:#f1c40f;
}
.panel.panel-warning-alt.panel-dark {
	background-color:#f1c40f;
}
.panel.panel-danger{
	border-color: #e74c3c;
}
.panel-danger > .panel-heading,
.panel-danger > .panel-footer {
	border-color: #e74c3c;
	background-color:#e74c3c;
}
.panel.panel-danger.panel-dark {
	background-color:#e74c3c;
}
.panel.panel-info{
	border-color: #a6b87a;
}
.panel-info > .panel-heading,
.panel-info > .panel-footer {
	border-color: #a6b87a;
	background-color:#a6b87a;
}
.panel.panel-info.panel-dark {
	background-color:#a6b87a;
}
.panel.panel-inverse{
	border-color: #34495e;
}
.panel-inverse > .panel-heading,
.panel-inverse > .panel-footer {
	border-color: #34495e;
	background-color:#34495e;
}
.panel.panel-inverse.panel-dark {
	background-color:#34495e;
}
.panel.panel-dark,
.panel.panel-dark > .panel-heading,
.panel.panel-dark > .panel-footer {
	border:0;
}
.panel.panel-dark > .panel-heading,
.panel.panel-dark > .panel-footer {
	background-color:rgba(0,0,0,0.4)!important;
}
.panel.panel-dark > .panel-body,
.panel.panel-transparent > .panel-body {
	color:rgba(255,255,255,0.85)!important;
}

.panel.panel-transparent {
	-webkit-box-shadow: none;
	box-shadow: none;
	border:0;
}
.panel.panel-transparent > .panel-heading,
.panel.panel-transparent > .panel-footer {
	border: 0;
}
.panel.panel-default.panel-transparent,
.panel-default.panel-transparent > .panel-heading,
.panel-default.panel-transparent > .panel-footer {
	background-color:rgba(0,0,0,0.34);
}
.panel.panel-primary.panel-transparent,
.panel-primary.panel-transparent > .panel-heading,
.panel-primary.panel-transparent > .panel-footer {
	background-color:rgba(36,112,196,0.34);
}

.panel.panel-success.panel-transparent,
.panel-success.panel-transparent > .panel-heading,
.panel-success.panel-transparent > .panel-footer {
	background-color:rgba(39,174,96,0.34);
}
.panel.panel-info.panel-transparent ,
.panel-info.panel-transparent > .panel-heading,
.panel-info.panel-transparent > .panel-footer {
	background-color:rgba(166,184,122,0.34);
}
.panel.panel-warning.panel-transparent ,
.panel-warning.panel-transparent > .panel-heading,
.panel-warning.panel-transparent > .panel-footer {
	background-color:rgba(230,126,34,0.34);
}
.panel.panel-warning-alt.panel-transparent ,
.panel-warning-alt.panel-transparent > .panel-heading,
.panel-warning-alt.panel-transparent > .panel-footer {
	background-color:rgba(241,196,15,0.34);
}
.panel.panel-danger.panel-transparent ,
.panel-danger.panel-transparent > .panel-heading,
.panel-danger.panel-transparent > .panel-footer {
	background-color:rgba(231,76,60,0.34);
}
.panel.panel-inverse.panel-transparent ,
.panel-inverse.panel-transparent > .panel-heading,
.panel-inverse.panel-transparent > .panel-footer {
	background-color:rgba(52,73,94,0.34);
}
.panel.panel-blank,
.panel.panel-blank > .panel-heading,
.panel.panel-blank > .panel-footer {
	background-color: transparent!important;
	background-image:none!important;
	border:0;
	-webkit-box-shadow: none!important;
	box-shadow: none!important;
	color:rgba(255,255,255,0.8)!important;
}
.panel.panel-blank {
	margin:0 0 15px 0;
}
.panel.panel-blank > .panel-heading {
	border-bottom:4px solid rgba(255,255,255,0.12);
	height:40px;
	margin-bottom:0;
	padding:0;
	display:inline-block;
}
.panel.panel-blank > .panel-heading > .panel-title {
	font-family: 'bebas_neueregular', Arial, sans-serif;
	font-weight: normal;
	line-height:40px;
	margin:0;
	text-shadow:1px 1px 0 rgba(0,0,0,0.4);
}
.panel.panel-blank > .panel-heading:before {display:none;}
.panel.panel-blank > .panel-body {padding:15px 0;}
.panel-children > .panel:last-child {margin:0!important;border-bottom:0;}
.panel.panel-blank > .panel-body > .hexagon-group {margin-top:15px;}

.panel-group .panel-heading + .panel-collapse .panel-body {
	border-top-color: rgba(0,0,0,0.29);
}


text:
package org.assertj.core.internal.longarrays;

import static org.assertj.core.error.ShouldContainExactly.elementsDifferAtIndex;
import static org.assertj.core.error.ShouldContainExactly.shouldContainExactly;
import static org.assertj.core.error.ShouldContainExactly.shouldHaveSameSize;
import static org.assertj.core.test.ErrorMessages.valuesToLookForIsNull;
import static org.assertj.core.test.LongArrays.arrayOf;
import static org.assertj.core.test.LongArrays.emptyArray;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.core.util.Lists.newArrayList;
import static org.mockito.Mockito.verify;

import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.LongArrays;
import org.assertj.core.internal.LongArraysBaseTest;
import org.assertj.core.internal.StandardComparisonStrategy;
import org.junit.Test;

/**
 * Tests for <code>{@link LongArrays#assertContainsExactly(AssertionInfo, long[], long[])}</code>.
 */
public class LongArrays_assertContainsExactly_Test extends LongArraysBaseTest {

  @Test
  public void should_pass_if_actual_contains_given_values_exactly() {
	arrays.assertContainsExactly(someInfo(), actual, arrayOf(6L, 8L, 10L));
  }

  @Test
  public void should_pass_if_actual_and_given_values_are_empty() {
	arrays.assertContainsExactly(someInfo(), emptyArray(), emptyArray());
  }

  @Test
  public void should_fail_if_actual_contains_given_values_exactly_but_in_different_order() {
	AssertionInfo info = someInfo();
	try {
	  arrays.assertContainsExactly(info, actual, arrayOf(6L, 10L, 8L));
	} catch (AssertionError e) {
	  verify(failures).failure(info, elementsDifferAtIndex(8L, 10L, 1));
	  return;
	}
	failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_arrays_have_different_sizes() {
	thrown.expect(AssertionError.class);
	arrays.assertContainsExactly(someInfo(), actual, arrayOf(6L, 8L));
  }

  @Test
  public void should_fail_if_array_of_values_to_look_for_is_empty_and_actual_is_not() {
	thrown.expect(AssertionError.class);
	arrays.assertContainsExactly(someInfo(), actual, emptyArray());
  }

  @Test
  public void should_throw_error_if_array_of_values_to_look_for_is_null() {
	thrown.expectNullPointerException(valuesToLookForIsNull());
	arrays.assertContainsExactly(someInfo(), actual, null);
  }

  @Test
  public void should_fail_if_actual_is_null() {
	thrown.expectAssertionError(actualIsNull());
	arrays.assertContainsExactly(someInfo(), null, arrayOf(8L));
  }

  @Test
  public void should_fail_if_actual_does_not_contain_given_values_exactly() {
	AssertionInfo info = someInfo();
	long[] expected = { 6L, 8L, 20L };
	try {
	  arrays.assertContainsExactly(info, actual, expected);
	} catch (AssertionError e) {
      verify(failures).failure(info, shouldContainExactly(actual, expected, newArrayList(20L), newArrayList(10L)));
	  return;
	}
	failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_actual_contains_all_given_values_but_size_differ() {
    AssertionInfo info = someInfo();
    long[] expected = { 6L, 8L };
    try {
      arrays.assertContainsExactly(info, actual, expected);
    } catch (AssertionError e) {
      verify(failures).failure(info,
                               shouldHaveSameSize(actual, expected, 3, 2, StandardComparisonStrategy.instance()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }

  // ------------------------------------------------------------------------------------------------------------------
  // tests using a custom comparison strategy
  // ------------------------------------------------------------------------------------------------------------------

  @Test
  public void should_pass_if_actual_contains_given_values_exactly_according_to_custom_comparison_strategy() {
	arraysWithCustomComparisonStrategy.assertContainsExactly(someInfo(), actual, arrayOf(6L, -8L, 10L));
  }

  @Test
  public void should_pass_if_actual_contains_given_values_exactly_in_different_order_according_to_custom_comparison_strategy() {
	AssertionInfo info = someInfo();
	long[] expected = { -6L, 10L, 8L };
	try {
	  arraysWithCustomComparisonStrategy.assertContainsExactly(someInfo(), actual, expected);
	} catch (AssertionError e) {
	  verify(failures).failure(info, elementsDifferAtIndex(8L, 10L, 1, absValueComparisonStrategy));
	  return;
	}
	failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_array_of_values_to_look_for_is_empty_and_actual_is_not_whatever_custom_comparison_strategy_is() {
	thrown.expect(AssertionError.class);
	arraysWithCustomComparisonStrategy.assertContainsExactly(someInfo(), actual, emptyArray());
  }

  @Test
  public void should_throw_error_if_array_of_values_to_look_for_is_null_whatever_custom_comparison_strategy_is() {
	thrown.expectNullPointerException(valuesToLookForIsNull());
	arraysWithCustomComparisonStrategy.assertContainsExactly(someInfo(), actual, null);
  }

  @Test
  public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
	thrown.expectAssertionError(actualIsNull());
	arraysWithCustomComparisonStrategy.assertContainsExactly(someInfo(), null, arrayOf(-8L));
  }

  @Test
  public void should_fail_if_actual_does_not_contain_given_values_exactly_according_to_custom_comparison_strategy() {
	AssertionInfo info = someInfo();
	long[] expected = { 6L, -8L, 20L };
	try {
	  arraysWithCustomComparisonStrategy.assertContainsExactly(info, actual, expected);
	} catch (AssertionError e) {
      verify(failures).failure(info,
                               shouldContainExactly(actual, expected, newArrayList(20L), newArrayList(10L),
                                                    absValueComparisonStrategy));
	  return;
	}
	failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_actual_contains_all_given_values_but_size_differ_according_to_custom_comparison_strategy() {
    AssertionInfo info = someInfo();
    long[] expected = { 6L, 8L };
    try {
      arraysWithCustomComparisonStrategy.assertContainsExactly(info, actual, expected);
    } catch (AssertionError e) {
      verify(failures).failure(info,
                               shouldHaveSameSize(actual, expected, 3, 2, absValueComparisonStrategy));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }

}


text:
extern crate rand;

struct Error;

#[derive(Default)]
struct Struct {
    x: Error //~ ERROR `core::default::Default` is not implemented
}

fn main() {}


text:
---
title: Blog Archive
layout: corporate
grid: 2-col
bodyclass:
herotype: title
navLevel1: 'section-blog'
navLevel2: 'subnav-blog-archive'
breadcrumb: [{"name":"Home","url":"/"},{"name":"Blog","url":"/blog/"},{"name":"Blog Archive"}]
---

      {{> blog-clippings }}

      {{> sample-pagination-initial }}

      {{> sidebar-cta-blog}}
      {{> sidebar-tags-blog}}


text:
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/bluetooth/resources/bluetooth-test.js"></script>
<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script>
<script>
'use strict';
bluetooth_test(async () => {
  await setBluetoothFakeAdapter('HeartRateAdapter');
  const device = await requestDeviceWithTrustedClick({
    filters: [{services: ['heart_rate']}],
    optionalServices: ['generic_access'],
  });
  const gattServer = await device.gatt.connect();
  const service = await gattServer.getPrimaryService('generic_access');
  const characteristic = await service.getCharacteristic('gap.device_name');
  await setBluetoothFakeAdapter('EmptyAdapter');
  await assert_promise_rejects_with_message(
      characteristic.writeValueWithResponse(new ArrayBuffer(1 /* length */)),
      new DOMException(
          'Bluetooth Device is no longer in range.', 'NetworkError'),
      'Device went out of range.');
}, 'Device goes out of range. Reject with NetworkError.');
</script>


text:
#include <aws/ce/model/CostAllocationTag.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace CostExplorer
{
namespace Model
{

CostAllocationTag::CostAllocationTag() :
    m_tagKeyHasBeenSet(false),
    m_type(CostAllocationTagType::NOT_SET),
    m_typeHasBeenSet(false),
    m_status(CostAllocationTagStatus::NOT_SET),
    m_statusHasBeenSet(false)
{
}

CostAllocationTag::CostAllocationTag(JsonView jsonValue) :
    m_tagKeyHasBeenSet(false),
    m_type(CostAllocationTagType::NOT_SET),
    m_typeHasBeenSet(false),
    m_status(CostAllocationTagStatus::NOT_SET),
    m_statusHasBeenSet(false)
{
  *this = jsonValue;
}

CostAllocationTag& CostAllocationTag::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("TagKey"))
  {
    m_tagKey = jsonValue.GetString("TagKey");

    m_tagKeyHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Type"))
  {
    m_type = CostAllocationTagTypeMapper::GetCostAllocationTagTypeForName(jsonValue.GetString("Type"));

    m_typeHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Status"))
  {
    m_status = CostAllocationTagStatusMapper::GetCostAllocationTagStatusForName(jsonValue.GetString("Status"));

    m_statusHasBeenSet = true;
  }

  return *this;
}

JsonValue CostAllocationTag::Jsonize() const
{
  JsonValue payload;

  if(m_tagKeyHasBeenSet)
  {
   payload.WithString("TagKey", m_tagKey);

  }

  if(m_typeHasBeenSet)
  {
   payload.WithString("Type", CostAllocationTagTypeMapper::GetNameForCostAllocationTagType(m_type));
  }

  if(m_statusHasBeenSet)
  {
   payload.WithString("Status", CostAllocationTagStatusMapper::GetNameForCostAllocationTagStatus(m_status));
  }

  return payload;
}

} // namespace Model
} // namespace CostExplorer
} // namespace Aws


text:
<menu xmlns:tools="http://schemas.android.com/tools"
    tools:context=".ChallengeNineActivity" >
</menu>


text:
<!doctype html>
<title>Range.commonAncestorContainer tests</title>
<link rel="author" title="Aryeh Gregor" href=ayg@aryeh.name>
<meta name=timeout content=long>


text:
package com.gelvt.gofdp.state;

/**
 * 客户端锁定状态
 * @author: Elvin Zeng
 * @date: 17-7-21.
 */
public class LockedState implements ClientState {

    private MessengerClient client;

    public LockedState(MessengerClient client) {
        this.client = client;
    }

    @Override
    public void showChatForm() {
        System.out.println("客户端被锁定了,请先解锁。");
    }

    @Override
    public void sendMessage(String message, String receiver) {
        System.out.println("锁定状态无法发送消息");
    }
}


text:
#include "SkBitmap.h"
#include "SkCommandLineFlags.h"
#include "SkCommonFlags.h"
#include "SkData.h"
#include "SkForceLinking.h"
#include "SkImage.h"
#include "SkStream.h"
#include "SkTypes.h"

#include "sk_tool_utils.h"

__SK_FORCE_IMAGE_DECODER_LINKING;

DEFINE_string(in, "input.png", "Input image");
DEFINE_string(out, "blurred.png", "Output image");
DEFINE_double(sigma, 1, "Sigma to be used for blur (> 0.0f)");

// This tool just performs a blur on an input image
// Return codes:
static const int kSuccess = 0;
static const int kError = 1;

int tool_main(int argc, char** argv);
int tool_main(int argc, char** argv) {
    SkCommandLineFlags::SetUsage("Brute force blur of an image.");
    SkCommandLineFlags::Parse(argc, argv);

    if (FLAGS_sigma <= 0) {
        if (!FLAGS_quiet) {
            SkDebugf("Sigma must be greater than zero (it is %f).\n", FLAGS_sigma);
        }
        return kError;
    }

    sk_sp<SkData> data(SkData::MakeFromFileName(FLAGS_in[0]));
    if (nullptr == data) {
        if (!FLAGS_quiet) {
            SkDebugf("Couldn't open file: %s\n", FLAGS_in[0]);
        }
        return kError;
    }

    sk_sp<SkImage> image(SkImage::MakeFromEncoded(data));
    if (!image) {
        if (!FLAGS_quiet) {
            SkDebugf("Couldn't create image for: %s.\n", FLAGS_in[0]);
        }
        return kError;
    }

    SkBitmap src;
    if (!image->asLegacyBitmap(&src, SkImage::kRW_LegacyBitmapMode)) {
        if (!FLAGS_quiet) {
            SkDebugf("Couldn't create bitmap for: %s.\n", FLAGS_in[0]);
        }
        return kError;
    }

    SkBitmap dst = sk_tool_utils::slow_blur(src, (float) FLAGS_sigma);

    if (!SkImageEncoder::EncodeFile(FLAGS_out[0], dst, SkImageEncoder::kPNG_Type, 100)) {
        if (!FLAGS_quiet) {
            SkDebugf("Couldn't write to file: %s\n", FLAGS_out[0]);
        }
        return kError;
    }

    return kSuccess;
}

#if !defined SK_BUILD_FOR_IOS
int main(int argc, char * const argv[]) {
    return tool_main(argc, (char**) argv);
}
#endif


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

import java.io.Serializable;

/**
 *

 * The ulimit settings to pass to the container.
 *

 */
public class Ulimit implements Serializable, Cloneable {

    /**
     *

     * The type of the ulimit.
     *

     */
    private String name;
    /**
     *

     * The soft limit for the ulimit type.
     *

     */
    private Integer softLimit;
    /**
     *

     * The hard limit for the ulimit type.
     *

     */
    private Integer hardLimit;

    /**
     *

     * The type of the ulimit.
     *

     *
     * @param name
     *        The type of the ulimit.
     * @see UlimitName
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * The type of the ulimit.
     *

     *
     * @return The type of the ulimit.
     * @see UlimitName
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The type of the ulimit.
     *

     *
     * @param name
     *        The type of the ulimit.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     * @see UlimitName
     */

    public Ulimit withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The type of the ulimit.
     *

     *
     * @param name
     *        The type of the ulimit.
     * @see UlimitName
     */

    public void setName(UlimitName name) {
        this.name = name.toString();
    }

    /**
     *

     * The type of the ulimit.
     *

     *
     * @param name
     *        The type of the ulimit.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     * @see UlimitName
     */

    public Ulimit withName(UlimitName name) {
        setName(name);
        return this;
    }

    /**
     *

     * The soft limit for the ulimit type.
     *

     *
     * @param softLimit
     *        The soft limit for the ulimit type.
     */

    public void setSoftLimit(Integer softLimit) {
        this.softLimit = softLimit;
    }

    /**
     *

     * The soft limit for the ulimit type.
     *

     *
     * @return The soft limit for the ulimit type.
     */

    public Integer getSoftLimit() {
        return this.softLimit;
    }

    /**
     *

     * The soft limit for the ulimit type.
     *

     *
     * @param softLimit
     *        The soft limit for the ulimit type.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public Ulimit withSoftLimit(Integer softLimit) {
        setSoftLimit(softLimit);
        return this;
    }

    /**
     *

     * The hard limit for the ulimit type.
     *

     *
     * @param hardLimit
     *        The hard limit for the ulimit type.
     */

    public void setHardLimit(Integer hardLimit) {
        this.hardLimit = hardLimit;
    }

    /**
     *

     * The hard limit for the ulimit type.
     *

     *
     * @return The hard limit for the ulimit type.
     */

    public Integer getHardLimit() {
        return this.hardLimit;
    }

    /**
     *

     * The hard limit for the ulimit type.
     *

     *
     * @param hardLimit
     *        The hard limit for the ulimit type.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public Ulimit withHardLimit(Integer hardLimit) {
        setHardLimit(hardLimit);
        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 (getName() != null)
            sb.append("Name: " + getName() + ",");
        if (getSoftLimit() != null)
            sb.append("SoftLimit: " + getSoftLimit() + ",");
        if (getHardLimit() != null)
            sb.append("HardLimit: " + getHardLimit());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof Ulimit == false)
            return false;
        Ulimit other = (Ulimit) obj;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null
                && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getSoftLimit() == null ^ this.getSoftLimit() == null)
            return false;
        if (other.getSoftLimit() != null
                && other.getSoftLimit().equals(this.getSoftLimit()) == false)
            return false;
        if (other.getHardLimit() == null ^ this.getHardLimit() == null)
            return false;
        if (other.getHardLimit() != null
                && other.getHardLimit().equals(this.getHardLimit()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode
                + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode
                + ((getSoftLimit() == null) ? 0 : getSoftLimit().hashCode());
        hashCode = prime * hashCode
                + ((getHardLimit() == null) ? 0 : getHardLimit().hashCode());
        return hashCode;
    }

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


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/white"
    android:minWidth="500dp"
    android:orientation="vertical"
    android:padding="@dimen/activity_vertical_margin">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/activity_vertical_margin">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily=""
            android:text="New Record"
            android:textColor="@android:color/black"
            android:textSize="24sp" />

        <TextView
            android:id="@+id/recordText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:textColor="@android:color/black"
            android:textSize="24sp" />

    </RelativeLayout>

    <EditText
        android:id="@+id/title_edit_text"
        style="@style/DialogEditTextStyle"
        android:layout_width="match_parent"
        android:hint="Title"
        android:maxLines="2" />

    <EditText
        android:id="@+id/comment_edit_text"
        style="@style/DialogEditTextStyle"
        android:layout_width="match_parent"
        android:hint="Comment"
        android:maxLines="2" />

    <!--<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <EditText
            android:id="@+id/tag_edit_text"
            style="@style/DialogEditTextStyle"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:hint="New Tag"
            android:maxLines="1" />

        <Button
            android:id="@+id/add_tag_button"
            style="?android:attr/borderlessButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/flat_button_selector"
            android:text="ADD"
            android:textColor="@color/primary" />

    </LinearLayout>-->

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/activity_vertical_margin">

        <Button
            android:id="@+id/save_record_button"
            style="?android:attr/borderlessButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:background="@drawable/flat_button_selector"
            android:text="SAVE"
            android:textColor="@color/start_fab_color" />

        <Button
            android:id="@+id/cancel_record_button"
            style="?android:attr/borderlessButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@+id/save_record_button"
            android:background="@drawable/flat_button_selector"
            android:text="CANCEL"
            android:textColor="@color/stop_fab_color" />

    </RelativeLayout>
</LinearLayout>


text:
Advanced Topics
===============

.. index:: single: Advanced Topics

- Use `watchdog <https://pypi.python.org/pypi/watchdog/0.8.3>`__ to automate CSS compilation.
- Learn about :doc:`clashing_aliases` and :doc:`property_aliases`.
- How to change settings in ``blowdrycss_settings.py``.
- Customizing the alias dictionary.
- Where are the semicolons?
- How to build a plugin. [todo]
- Pro-tip: Want to share your site with a client, co-worker, or colleague. Use `ngrok <https://ngrok.com/>`__.
- DRYness
- Syntax Guide

Automate CSS Compilation with Watchdog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. index:: single: Watchdog

- Having to run ``blowdrycss`` can annoying in a development environment.

- What if it were possible to auto-detect that ``index.html`` was saved and automatically run ``blowdrycss``?

- It is possible with `watchdog <https://pypi.python.org/pypi/watchdog/0.8.3>`__.

.. note::

    As of version ``0.1.3`` this is now much easier.

Enable watchdog
'''''''''''''''

- If the virtualenv is not already active, then activate the virtualenv with ``source/bin activate``.

- Navigate to ``<path>/blowdrycss_tutorial``.

- Open ``blowdrycss_settings.py``.

- Set ``auto_generate = True``.

- Run ``blowdrycss``.

- Notice that what is printed differs from the default mode.

- Test it by saving a change to one of the project files e.g. change ``<path>/blowdryexample/examplesite/index.html``.

Setting Customization
~~~~~~~~~~~~~~~~~~~~~

The first time the ``blowdrycss`` command is run a file is auto-generated in the current directory named
``blowdrycss_settings.py``. This file provide the ability to override the default settings for a given project.

It is possible to change the directories, file types to discover, unit conversion, output file type, media query
breakpoints, and more.

Find Non-matching classes
~~~~~~~~~~~~~~~~~~~~~~~~~

If the encoded class name contains a typo or invalid value e.g. ``ppadding-5``, ``margin-A``,
``font-color-h000rem``, or ``squirrel-gray`` it will be placed in ``removed_class_set``. The
variable ``removed_class_set`` is found in ``ClassPropertyParser()`` inside of ``classpropertyparser.py``.

One day this may be placed an HTML file for easier discovery of typos or invalid syntax.

Customize Aliases:
~~~~~~~~~~~~~~~~~~

New custom aliases can be assigned as shorthand abbreviation for an official CSS property.

- Open the auto-generated settings file ``blowdrycss_settings.py``.

- Edit ``custom_property_alias_dict``.

**Custom Alias Syntax:**

| custom_property_alias_dict (*dict*) -- Contains customized shorthand encodings for a CSS property name.
  e.g. ``'c-'`` is an alias for ``'color'``. This saves on typing.

| These encoded class selectors can be used inside of Web project files matching ``blowdrycss_settings.file_type``.
  They can be customized to your liking.

**Custom Alias Rules:**

- The dictionary ``key`` is the official `W3C CSS property name <https://www.w3.org/TR/CSS21/propidx.html>`__.
  Also the ``key`` must exist in the set ``datalibrary.DataLibrary.property_names``, as follows: ::

    {
        'azimuth', 'background', 'background-attachment',
        'background-color', 'background-image', 'background-position',
        'background-repeat', 'border', 'border-bottom',
        'border-bottom-color', 'border-bottom-style',
        'border-bottom-width', 'border-collapse', 'border-color',
        'border-left', 'border-left-color', 'border-left-style',
        'border-left-width', 'border-right', 'border-right-color',
        'border-right-style', 'border-right-width', 'border-spacing',
        'border-style', 'border-top', 'border-radius',
        'border-top-left-radius', 'border-top-right-radius',
        'border-bottom-right-radius', 'border-bottom-left-radius',
        'border-top-color', 'border-top-style', 'border-top-width',
        'border-width', 'bottom', 'caption-side', 'clear', 'clip',
        'color', 'content', 'counter-increment', 'counter-reset',
        'cue', 'cue-after', 'cue-before', 'cursor', 'direction',
        'display', 'elevation', 'empty-cells', 'float', 'font',
        'font-family', 'font-size', 'font-style', 'font-variant',
        'font-weight', 'height', 'left', 'letter-spacing',
        'line-height', 'list-style', 'list-style-image',
        'list-style-position', 'list-style-type', 'margin',
        'margin-bottom', 'margin-left', 'margin-right',
        'margin-top', 'max-height', 'max-width', 'min-height',
        'min-width', 'opacity', 'orphans', 'outline',
        'outline-color', 'outline-style', 'outline-width',
        'overflow', 'padding', 'padding-bottom', 'padding-left',
        'padding-right', 'padding-top', 'page-break-after',
        'page-break-before', 'page-break-inside', 'pause',
        'pause-after', 'pause-before', 'pitch', 'pitch-range',
        'play-during', 'position', 'quotes', 'richness',
        'right', 'speak', 'speak-header', 'speak-numeral',
        'speak-punctuation', 'speech-rate', 'stress',
        'table-layout', 'text-align', 'text-decoration',
        'text-indent', 'text-shadow', 'text-transform', 'top',
        'unicode-bidi', 'vertical-align', 'visibility',
        'voice-family', 'volume', 'white-space', 'widows',
        'width', 'word-spacing', 'z-index'
    }

.. note::

    If a new key is added to the official W3C CSS standard, but not listed here feel free to raise an issue in
    the `code repository <https://github.com/nueverest/blowdrycss>`__.

- The dictionary ``value`` is a ``set()`` of custom string aliases.  For example: ::

    {'bgc-', 'bg-c-', 'bg-color-', }

- When adding a new alias it must end with a ``'-'``. As an example, ``'bgc-'`` is a valid custom alias format.
  If the ``'-'`` is removed, then blowdrycss assumes that ``'bgc'`` expects it to be a valid and
  unique CSS property value (*which it is not*). An example of a valid, unique CSS property value would be ``'bold'``.

- An alias must be unique across all defined aliases. Any alias that clashes with an alias in this dictionary
  or the dictionary auto-generated by ``DataLibrary.initialize_property_alias_dict()`` is removed, and becomes unusable.

- Clashing aliases are:
    - Printed when ``get_clashing_aliases()`` is run.
    - Automatically added to the ``project_directory`` as ``clashing_alias.html``.
    - Automatically added to the sphinx docs and can be found under ``/docs/clashing_aliases.rst`` (*requires sphinx*).

**Custom Alias Examples:**

- To add a new alias ``'azi'`` for CSS property ``'azimuth'`` add the ``{key: value, }`` pair
  ``{'azimuth': {'azi-'}, }`` to custom_property_alias_dict. Defining ``'azi-'`` allows the following
  encoded class selector syntax:  ::

    'azi-left-side', 'azi-far-left', ..., 'azi-rightwards'

Azimuth applied to a DIV

**Aliases already known to clash are:**  ::

    'background-color': {'bc-'},
    'border-color': {'bc-', 'border-c-'},
    'border-collapse': {'bc-', 'border-c-'},
    'border-style': {'border-s-', 'bs-'},
    'border-spacing': {'border-s-', 'bs-'},
    'border-right': {'br-'},
    'background-repeat': {'br-'},
    'font-style': {'fs-', 'font-s-'},
    'font-size': {'fs-', 'font-s-'},
    'list-style': {'ls-'},
    'letter-spacing': {'ls-'},
    'max-height': {'mh-'},
    'min-height': {'mh-'},
    'max-width': {'mw-'},
    'min-width': {'mw-'},
    'pause-before': {'pb-'},
    'padding-bottom': {'pb-'},
    'padding-right': {'pr-'},
    'pitch-range': {'pr-'},
    'white-space': {'ws-'},
    'word-spacing': {'ws-'},

Where are the semicolons in the CSS file?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

After opening ``blowdry.css``, it becomes evident that semicolons are not used for most of the css rule declarations.

Sample ``blowdry.css`` contents ::

    .padding-5 {
        padding: 0.3125em
        }
    .margin-top-50px {
        margin-top: 3.125em
        }
    .t-align-center {
        text-align: center
        }
    .padding-10 {
        padding: 0.625em
        }
    .display-none {
        display: none
        }
    .height-150px {
        height: 9.375em
        }
    .margin-25 {
        margin: 1.5625em
        }

Why?
''''

- The only or last css rule { property: value } is not required to end with a semicolon.
  `See section 4.1.8 of the current CSS Standard. <http://www.w3.org/TR/CSS2/syndata.html#declaration>`__

- The auto--generated file ``blowdry.css`` is not intended to be human-editable. Any manual edits are
  over--written when ``blowdrycss`` is run. Generally, when building a CSS file by hand it is considered
  best practise to always include the final semicolon. The reason being that human--error is reduced the
  next time a person adds a rule to the CSS block. However, this does not apply for a file that is only
  machine--edited.

- It is compatible with all browsers.

- It results in slightly faster page loads due to smaller ``*.css`` file size.

DRY-ness must be balanced with other factors.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider the following:

.. code:: html

This is a case were the DRY principle is subsumed by the value of readability, brevity, and encapsulation.
Creating a custom CSS class selector in this case might be warranted.

Also, just because this tool can decode the class

.. code-block:: html

    t-shadow-n2px-2px-4px-rgba-0-0-0-0_5

that doesn't mean it is intended to be frequently used in this manner.

My CSS is DRY, but my HTML is not.
''''''''''''''''''''''''''''''''''

Copying and pasting something like

.. code-block:: html

    p-10-20-11-22 h-50 w-50 talign-center orange font-size-16 margin-top-30

twenty times in an HTML file is not that DRY from an HTML perspective. If this is happening, then it might be
valuable to pause and hand-craft a CSS class for this repeating class selector pattern.

Syntax Guide
~~~~~~~~~~~~

Continue to :doc:`syntax`.


text:
from __future__ import print_function
import sys, operator, argparse, os
from collections import defaultdict

# If you supply the <lang> directory (the one that corresponds to
# how you decoded the data) to this script, it assumes that the <lang>
# directory contains phones/align_lexicon.int, and it uses this to work
# out a reasonable guess of the non-scored phones, based on which have
# a single-word pronunciation that maps to a silence phone.
# It then uses the words.txt to work out the written form of those words.

parser = argparse.ArgumentParser(
    description = "This program works out a reasonable guess at a list of "
    "non-scored words (words that won't affect the WER evaluation): "
    "things like [COUGH], [NOISE] and so on.  This is useful because a list of "
    "such words is required by some other scripts (e.g. modify_ctm_edits.py), "
    "and it's inconvenient to have to specify the list manually for each language. "
    "This program writes out the words in text form, one per line.")

parser.add_argument("lang", type = str,
                    help = "The lang/ directory.  This program expects "
                    "lang/words.txt and lang/phones/silence.int and "
                    "lang/phones/align_lexicon.int to exist, and will use them to work "
                    "out a reasonable guess of the non-scored words  (as those whose "
                    "pronunciations are a single phone in the 'silphones' list)")

args = parser.parse_args()

non_scored_words = set()

def ReadLang(lang_dir):
    global non_scored_words

    if not os.path.isdir(lang_dir):
        sys.exit("modify_ctm_edits.py expected lang/ directory {0} to "
                 "exist.".format(lang_dir))
    for f in [ '/words.txt', '/phones/silence.int', '/phones/align_lexicon.int' ]:
        if not os.path.exists(lang_dir + f):
            sys.exit("modify_ctm_edits.py: expected file {0}{1} to exist.".format(
                    lang_dir, f))
    # read silence-phones.
    try:
        silence_phones = set()
        for line in open(lang_dir + '/phones/silence.int').readlines():
            silence_phones.add(int(line))
    except Exception as e:
        sys.exit("modify_ctm_edits.py: problem reading file "
                 "{0}/phones/silence.int: {1}".format(lang_dir, str(e)))

    # read align_lexicon.int.
    # format is: <word-index> <word-index> <phone-index1> <phone-index2> ..
    # We're looking for line of the form:
    # w w p
    # where w > 0 and p is in the set 'silence_phones'
    try:
        silence_word_ints = set()
        for line in open(lang_dir + '/phones/align_lexicon.int').readlines():
            a = line.split()
            if len(a) == 3 and a[0] == a[1] and int(a[0]) > 0 and \
                    int(a[2]) in silence_phones:
                silence_word_ints.add(int(a[0]))
    except Exception as e:
        sys.exit("modify_ctm_edits.py: problem reading file "
                 "{0}/phones/align_lexicon.int: "
                 "{1}".format(lang_dir, str(e)))

    try:
        for line in open(lang_dir + '/words.txt').readlines():
            [ word, integer ] = line.split()
            if int(integer) in silence_word_ints:
                non_scored_words.add(word)
    except Exception as e:
        sys.exit("modify_ctm_edits.py: problem reading file "
                 "{0}/words.txt.int: {1}".format(lang_dir, str(e)))

    if not len(non_scored_words) == len(silence_word_ints):
        sys.exit("modify_ctm_edits.py: error getting silence words, len({0}) != len({1})",
                 str(non_scored_words), str(silence_word_ints))
    for word in non_scored_words:
        print(word)

ReadLang(args.lang)


text:
package com.att.inno.env;

public interface DataFactory<T> {
	public abstract Data<T> newData();
	public abstract Data<T> newData(Env trans); // and Env or Trans object
	public abstract Class<T> getTypeClass();
}


text:
require 'pathname'
require 'CLIntegracon/diff'
require 'CLIntegracon/formatter'

module CLIntegracon
  # FileTreeSpec represents a single specification, which is mirrored
  # on the file system in the spec directory by a direct children.
  # It contains a before directory (#before_path) and an after
  # directory (#after_path) or if it is initialized with a #base_spec,
  # the before directory of this spec is used. The before directory
  # contents in the #spec_path of the child spec, can contain further
  # files, which overwrite, if given, the inherited contents.
  #
  class FileTreeSpec

    # @return [FileTreeSpecContext]
    #         The context, which configures path and file behaviors
    attr_reader :context

    # @return [String]
    #         The concrete spec folder
    attr_reader :spec_folder

    # @return [Pathname]
    #         The concrete spec path
    def spec_path
      context.spec_path + spec_folder
    end

    # @return [Pathname]
    #         The concrete before directory for this spec
    def before_path
      spec_path + context.before_dir
    end

    # @return [Pathname]
    #         The concrete after directory for this spec
    def after_path
      spec_path + context.after_dir
    end

    # @return [Pathname]
    #         The concrete temp directory for this spec
    def temp_path
      context.temp_path + spec_folder
    end

    # @return [Pathname]
    #         The concrete temp raw directory for this spec
    def temp_raw_path
      temp_path + 'raw'
    end

    # @return [Pathname]
    #         The concrete transformed temp directory for this spec
    def temp_transformed_path
      temp_path + 'transformed'
    end

    # @return [String|NilClass]
    #         The name of an optional #base_spec.
    attr_reader :base_spec_name

    # Return whether this spec is based on another spec.
    #
    # @return  [Bool]
    #
    def has_base?
      !base_spec_name.nil?
    end

    # @return [FileTreeSpec|NilClass]
    #         The spec on whose #after_path will be used as #before_path
    #         for this spec.
    def base_spec
      has_base? ? context.spec(base_spec_name) : nil
    end

    # Init a spec with a given context
    #
    # @param  [FileTreeSpecContext] context
    #         The context, which configures path and file behaviors
    #
    # @param  [String] spec_folder
    #         The concrete spec folder
    #
    # @param  [String] based_on
    #         @see #base_spec_name
    #
    def initialize(context, spec_folder, based_on: nil)
      @context = context
      @spec_folder = spec_folder
      @base_spec_name = based_on
    end

    # Run this spec
    #
    # @param  [Block<(FileTreeSpec)->()>] block
    #         The block, which will be executed after chdir into the created temporary
    #         directory. In this block you will likely run your modifications to the
    #         file system and use the received FileTreeSpec instance to make asserts
    #         with the test framework of your choice.
    #
    def run(&block)
      prepare!

      copy_files!

      Dir.chdir(temp_transformed_path) do
        block.call self
      end
    end

    # Compares the expected and produced directory by using the rules
    # defined in the context
    #
    # @param  [Block<(Diff)->()>] diff_block
    #         The block, where you will likely define a test for each file to compare.
    #         It will receive a Diff of each of the expected and produced files.
    #
    def compare(&diff_block)
      # Get a copy of the outputs before any transformations are applied
      FileUtils.cp_r("#{temp_transformed_path}/.", temp_raw_path)

      transform_paths!

      glob_all(after_path).each do |relative_path|
        expected = after_path + relative_path

        next unless expected.file?
        next if context.ignores?(relative_path)

        block = context.preprocessors_for(relative_path).first
        diff = diff_files(expected, relative_path, &block)

        diff_block.call diff
      end
    end

    # Compares the expected and produced directory by using the rules
    # defined in the context for unexpected files.
    #
    # This is separate because you probably don't want to define an extra
    # test case for each file, which wasn't expected at all. So you can
    # keep your test cases consistent.
    #
    # @param  [Block<(Array)->()>] diff_block
    #         The block, where you will likely define a test that no unexpected files exists.
    #         It will receive an Array.
    #
    def check_unexpected_files(&block)
      expected_files = glob_all after_path
      produced_files = glob_all
      unexpected_files = produced_files - expected_files

      # Select only files
      unexpected_files.select! { |path| path.file? }

      # Filter ignored paths
      unexpected_files.reject! { |path| context.ignores?(path) }

      block.call unexpected_files
    end

    # Return a Formatter
    #
    # @return [Formatter]
    #
    def formatter
      @formatter ||= Formatter.new(self)
    end

    protected

      # Prepare the temporary directory
      #
      def prepare!
        context.prepare!

        temp_path.rmtree if temp_path.exist?
        temp_path.mkdir
        temp_raw_path.mkdir
        temp_transformed_path.mkdir
      end

      # Copies the before subdirectory of the given tests folder in the raw
      # directory.
      #
      def copy_files!
        destination = temp_transformed_path

        if has_base?
          FileUtils.cp_r("#{base_spec.temp_raw_path}/.", destination)
        end

        begin
          FileUtils.cp_r("#{before_path}/.", destination)
        rescue Errno::ENOENT => e
          raise e unless has_base?
        end
      end

      # Applies the in the context configured transformations.
      #
      def transform_paths!
        glob_all.each do |path|
          context.transformers_for(path).each do |transformer|
            transformer.call(path) if path.exist?
          end
          path.rmtree if context.ignores?(path) && path.exist?
        end
      end

      # Searches recursively for all files and take care for including hidden files
      # if this is configured in the context.
      #
      # @param  [String] path
      #         The relative or absolute path to search in (optional)
      #
      # @return [Array<Pathname>]
      #
      def glob_all(path=nil)
        Dir.chdir path || '.' do
          Pathname.glob("**/*", context.include_hidden_files? ? File::FNM_DOTMATCH : 0).sort.reject do |p|
            %w(. ..).include?(p.basename.to_s)
          end
        end
      end

      # Compares two files to check if they are identical and produces a clear diff
      # to highlight the differences.
      #
      # @param  [Pathname] expected
      #         The file in the after directory
      #
      # @param  [Pathname] relative_path
      #         The file in the temp directory
      #
      # @param  [Block<(Pathname)->(to_s)>] block
      #         the block, which transforms the files in a better comparable form
      #
      # @return [Diff]
      #         An object holding a diff
      #
      def diff_files(expected, relative_path, &block)
        produced = temp_transformed_path + relative_path
        Diff.new(expected, produced, relative_path, &block)
      end

  end
end


text:
'use strict';

const privates = require('./private-map');
const request = require('request');

/**
 * @module users
 */

module.exports = {
  find: find
};

/**
  A function to get the all the role mappings of an user
  @param {string} realmName - The name of the realm (not the realmID) where the client roles exist - ex: master
  @param {string} userId - The id of the user whose role mappings should be found
  @returns {Promise} A promise that will resolve with the Array of role mappings
  @example
  keycloakAdminClient(settings)
    .then((client) => {
      client.users.roleMappings.find(realmName, userId)
        .then((userRoleMappings) => {
          console.log(userRoleMappings)
      })
    })
 */
function find (client) {
  return function find (realmName, userId) {
    return new Promise((resolve, reject) => {
      const req = {
        auth: {
          bearer: privates.get(client).accessToken
        },
        json: true
      };

      req.url = `${client.baseUrl}/admin/realms/${realmName}/users/${userId}/role-mappings`;

      request(req, (err, resp, body) => {
        if (err) {
          return reject(err);
        }

        if (resp.statusCode !== 200) {
          return reject(body);
        }

        return resolve(body);
      });
    });
  };
}


text:
//
// GameManager.cpp for  in /home/gandoulf/epitech/rtype/RtypeSRC/source/Rtype
//
// Made by Gandoulf
// Login   <gandoulf@epitech.net>
//
// Started on  Sat Dec 17 11:53:40 2016 Gandoulf
// Last update Thu Dec 29 11:15:16 2016 Gandoulf
//

#include "Rtype/GameManager.hpp"
#include "Server/Server.hpp"
#include "Utils/Vector.hpp"

namespace rtype
{
  GameManager::GameManager(std::string const &name, std::map<int, std::queue<IEvent *>> & event,
			   std::map<int, std::queue<IEvent *> > &clientInputs,
			   std::map<int, GameObject *> &clientGO)
    : _name(name), _synchroniser(event), _closing(false), _clientInputs(clientInputs),
      _clientGO(clientGO)
  {

  }

  GameManager::~GameManager()
  {
    //TODO delete all Go, message
  }

  void GameManager::start()
  {
    _game = instantiate("game.prefab", Vector2F(0,0));
  }

  void GameManager::stop()
  {
    Server::closeGameServer(_name);
    _closing = true;
  }

  void GameManager::managerUpdate()
  {
    if (_closing)
      return ;
    _chrono.update();
    if (!_deleteList.empty())
      {
	while (_deleteList.size() > 0)
	  {
	    std::cout << "deleted obj " << _deleteList.back()->getName() << std::endl;
	    _gameObjects.deleteObject(_deleteList.back()->getName());
	    delete _deleteList.back();
	    _deleteList.pop_back();
	  }
      }
    try {
      _gameObjects.update();
    } catch (std::exception e) {
      std::cout << e.what() << std::endl;
    }
  }

  std::queue<IEvent *>        *GameManager::getClientEvent(GameObject *go)
  {
    auto ite = _clientGO.begin();
    for (ite; ite != _clientGO.end(); ite++)
      if (ite->second->getName() == go->getName())
	break;
    if (ite != _clientGO.end())
      return (&_clientInputs.find(ite->first)->second);
    throw GetClientEventError();
  }

  Synchroniser        &GameManager::synchronise()
  {
    return (_synchroniser);
  }

  GameObjectManager   &GameManager::getGameObjects()
  {
    return (_gameObjects);
  }

  GameObject *GameManager::instantiate(std::string const &prefabFile,
				       Vector2F const &pos,
				       Vector2F const &scale)
  {
    GameObject *go = _prefabCreator.instantiate(prefabFile, pos, scale);
    if (go != NULL)
      {
	go->setGameManager(static_cast<IGameManager *>(this));
	_gameObjects.addObject(go, go->_dynamic);
      }
    return (go);
  }

  void                GameManager::destroy(GameObject *gameObject)
  {
    if (gameObject == NULL)
      return ;
    if (_gameObjects.getObject(gameObject->getName()) != NULL &&
	checkDeleteList(gameObject->getName()) == false)
      _deleteList.push_back(gameObject);
  }

  long double       GameManager::deltaTime()
  {
    return (_chrono.getDeltaTime() / 1000);
  }

  /* ----------------------------------private---------------------------------- */

  bool GameManager::checkDeleteList(std::string const &name)
  {
    for (int i = 0; i < _deleteList.size(); ++i)
      if (_deleteList[i]->getName() == name)
	{
	  return (true);
	}
    return (false);
  }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using DbShell.Driver.Common.AbstractDb;
using DbShell.Driver.Common.Sql;
using DbShell.Driver.Common.Utility;

namespace DbShell.Driver.Common.DmlFramework
{
    public static class DmlfExtension
    {
        public static bool IsValid(this DmlfColumnRef col)
        {
            return col != null && col.ColumnName != null;
        }

        public static void GenSql(this DmlfJoinType join, ISqlDumper dmp)
        {
            switch (join)
            {
                case DmlfJoinType.Inner:
                    dmp.Put("^inner ^join");
                    break;
                case DmlfJoinType.Left:
                    dmp.Put("^left ^join");
                    break;
                case DmlfJoinType.Right:
                    dmp.Put("^right ^join");
                    break;
                case DmlfJoinType.Outer:
                    dmp.Put("^full ^outer ^join");
                    break;
                case DmlfJoinType.CrossApply:
                    dmp.Put("^cross ^apply");
                    break;
                case DmlfJoinType.OuterApply:
                    dmp.Put("^outer ^apply");
                    break;
            }
        }

        public static void GenSql(this DmlfSortOrderType type, ISqlDumper dmp)
        {
            switch (type)
            {
                case DmlfSortOrderType.Ascending:
                    dmp.Put("^asc");
                    break;
                case DmlfSortOrderType.Descending:
                    dmp.Put("^desc");
                    break;
            }
        }

        public static DmlfSortOrderType GetOpposite(this DmlfSortOrderType type)
        {
            if (type == DmlfSortOrderType.Ascending) return DmlfSortOrderType.Descending;
            else return DmlfSortOrderType.Ascending;
        }

        //public static DmlfColumnRef FindColumn(this IEnumerable<DmlfSource> tables, string name, IDmlfHandler handler)
        //{
        //    name = (name ?? "").Trim();
        //    foreach (var tbl in tables)
        //    {
        //        var ts = handler.GetStructure(tbl == null ? null : tbl.TableOrView);
        //        foreach (var col in ts.Columns)
        //        {
        //            if (tbl != null)
        //            {
        //                string fullname = tbl.AliasOrName + "." + col.Name;
        //                if (String.Compare(fullname, name, true) == 0) return new DmlfColumnRef
        //                {
        //                    Source = tbl,
        //                    ColumnName = col.Name
        //                };
        //            }
        //            if (String.Compare(col.Name, name, true) == 0) return new DmlfColumnRef
        //            {
        //                Source = tbl,
        //                ColumnName = col.Name
        //            };
        //        }
        //    }
        //    return null;
        //}

        public static DmlfSource FindAnySource(this IEnumerable<DmlfEqualCondition> conditions, bool left, bool right)
        {
            foreach (var cond in conditions)
            {
                if (left)
                {
                    var ce = cond.LeftExpr as DmlfColumnRefExpression;
                    if (ce != null) return ce.Column.Source;
                }
                if (right)
                {
                    var ce = cond.RightExpr as DmlfColumnRefExpression;
                    if (ce != null) return ce.Column.Source;
                }
            }
            return null;
        }

        public static string ToSql(this IDmlfNode node, IDatabaseFactory factory)
        {
            if (factory == null) return "";
            var sw = new StringWriter();
            var dmp = factory.CreateDumper(new SqlOutputStream(factory.CreateDialect(), sw, SqlFormatProperties.Default), SqlFormatProperties.Default);
            node.GenSql(dmp);
            return sw.ToString();
        }

        public static string[] GetNames(this IEnumerable<DmlfColumnRef> cols)
        {
            var res = new List<string>();
            foreach (var col in cols) res.Add(col.ColumnName);
            return res.ToArray();
        }
    }
}


text:
class C {
    static class E extends Exception { }
    static class E1 extends E { }

    static class MyResource implements AutoCloseable {
        public MyResource() throws E1 { }
        public void close() throws E { }
    }

    void f() {
        try (<caret>MyResource r = new MyResource()) {
        } catch (E1 e) {
            e.printStackTrace();
        }
    }
}


text:
package com.tutsplus.mapsdemo;

import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;

/**
 * Created by Paul on 8/11/15.
 */
public class PlayServicesUnavailableDialogFragment extends DialogFragment {
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder builder = new AlertDialog.Builder( getActivity() );
        builder.setMessage( getResources().getString( R.string.dialog_play_services_unavailable ) );
        builder.setNegativeButton(R.string.dialog_close_program, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                dismiss();
                getActivity().finish();
            }
        });

        builder.setPositiveButton( R.string.dialog_download_play_services, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                Intent intent = new Intent( Intent.ACTION_VIEW );
                intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.gms&hl=en") );
                startActivity( intent );
            }
        });

        return builder.create();
    }
}


text:
package net.foreworld.rvt.service.impl;

import java.util.List;

import net.foreworld.rvt.model.Menu;
import net.foreworld.rvt.service.MenuService;

import org.springframework.stereotype.Service;

import tk.mybatis.mapper.entity.Example;

@Service("menuService")
public class MenuServiceImpl extends BaseService<Menu> implements MenuService {

	@Override
	public List<Menu> findByPid(String pid) {
		if (null == pid)
			pid = "0";
		// TODO
		Example example = new Example(Menu.class);
		Example.Criteria criteria = example.createCriteria();
		criteria.andEqualTo("pid", pid);
		example.setOrderByClause("sort asc");
		return selectByExample(example);
	}
}