text:
namespace ZooSystem.BLL.Entities.Animals.Mammals
{
    using System;

    public class Monkey : Animal
    {
        private const sbyte averageLifeSpan = 35;

        private const string MonkeySpeech = "HuhahuHhuahua!";

        /// <summary>
        /// Initializes a new instance of the <see cref="Monkey"/> class.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="age"></param>
        public Monkey(int id, string name, int age)
            :base(id, name, age, averageLifeSpan)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Monkey"/> class.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="age"></param>
        /// <param name="birthDay"></param>
        public Monkey(int id, string name, int age, DateTime birthDay)
            :base(id, name, age, averageLifeSpan, birthDay)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Monkey"/> class.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="age"></param>
        /// <param name="stamina"></param>
        /// <param name="birthDay"></param>
        public Monkey(int id, string name, int age, int stamina, DateTime birthDay)
            :base(id, name, age, stamina, averageLifeSpan, birthDay)
        {

        }

        public override Species Specie
        {
            get { return Species.Mammal; }
        }

        /// <summary>
        /// Feeds the monkey.
        /// </summary>
        /// <param name="food"></param>
        public override void Eat(AnimalFood food)
        {
            if (food.Type != FoodType.Crumbs)
            {
                Console.WriteLine("Give milk to the monkeys!");
                return;

            }

            Console.WriteLine(
                    "Monkey {0} got some fresh milk and increased its stamina with {1}.",
                    this.Name, food.RegenerateStamina());

            this.IncreaseStamina(food.RegenerateStamina());
        }

        /// <summary>
        /// Introduces monkey.
        /// </summary>
        /// <returns></returns>
        public override string Speak()
        {
            return string.Format("Monkey {0} says {1}:", this.Name, MonkeySpeech);
        }
    }
}


text:
@interface ViewController ()<Litt1erPro>
@property (nonatomic, strong) UIWebView *web;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

//
//    void (^block)() = nil;
//
//    sleep(10);
//    block = ^{
//        NSLog(@"1");
//    };
//    block();

//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];
//    webView.backgroundColor = [UIColor cyanColor];
//    [self.view addSubview:webView];
//
//    self.web = webView;
//    id arr = @[@"1"];
//    NSArray *testArr = Litt1erTest(arr);
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"账号或密码不正确" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"aaa");
    }];
    UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"找回密码" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"bbb");
        }];
    [alertController addAction:cancelAction];
    [alertController addAction:confirmAction];
    [self presentViewController:alertController animated:YES completion:nil];

}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
//    NSMutableString *name = [NSMutableString stringWithFormat:@"aaa"];
//    NSMutableString *name = [[NSMutableString alloc] initWithString:@"aaa"];
//
//    TestObject *test = [[TestObject alloc] init];
//    test.name = name;
//    NSLog(@"%p%p1---------------%@,   %p",name,test.name,test.name,test);
//   [name appendString:@"bbb"];
////    [name stringByAppendingString:@"22"];
////    test.name = name;
//    NSLog(@"%p%p2---------------%@,   %p",name,test.name,test.name,test);
//    NSString *name = @"aaaa";
//    NSLog(@"%p",name);
//    name = @"abbbb";
//    NSLog(@"%p",name);

//    NSMutableString *name = [NSMutableString stringWithFormat:@"aaa"];
//    NSLog(@"111-----%@    %p",[name valueForKey:@"retainCount"],name);
//    NSString *test = [name copy];
//    NSLog(@"222-----%@    %p",[name valueForKey:@"retainCount"],test);
//
//    NSString *st1 = [NSString stringWithFormat:@"st1"];
//    NSArray *a1 = [NSArray arrayWithObjects:st1, nil];
//    NSLog(@"a1-----%@    %p",[a1 valueForKey:@"retainCount"],a1);
//    NSArray *a2 = [a1 copy];
//    NSLog(@"a2-----%@    %p",[a1 valueForKey:@"retainCount"],a1);
//
//
//    NSMutableArray *arr = [[NSMutableArray alloc] init];
//    [arr addObject:[[NSMutableString alloc]initWithString:@"value1"]];
//    [arr addObject:[[NSMutableString alloc]initWithString:@"value2"]];
//    NSLog(@"111-----%@    %p",[arr valueForKey:@"retainCount"],arr);
//    NSArray *array = [arr copy];
//    NSLog(@"222-----%@    %p",[arr valueForKey:@"retainCount"],array);
//
//
//    NSString *str = @"sss";
//    NSLog(@"str-----%@    %p",[str valueForKey:@"retainCount"],str);
//    NSMutableString *ss = [str mutableCopy];
//    [ss appendString:@"bbb"];

    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"账号或密码不正确" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"aaa");
    }];
    UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"找回密码" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"bbb");
    }];
    [alertController addAction:cancelAction];
    [alertController addAction:confirmAction];
    [self presentViewController:alertController animated:YES completion:nil];
}

- (void)litt1er
{
    NSLog(@"litt1er");
}

NSArray * Litt1erTest (NSDictionary *test){
    if ([test isKindOfClass:[NSArray class]]) {
        NSLog(@"1111");
    }else{
        NSLog(@"22222");
    }
    return nil;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

redpajama_set_name: RedPajamaGithub


text:
require 'dfp_api'

def get_workflow_approval_requests(dfp)
  # Get the WorkflowRequestService.
  workflow_request_service = dfp.service(:WorkflowRequestService, API_VERSION)

  # Create a statement to select workflow requests.
  statement = dfp.new_statement_builder do |sb|
    sb.where = 'type = :type'
    sb.with_bind_variable('type', 'WORKFLOW_APPROVAL_REQUEST')
  end

  # Retrieve a small amount of workflow requests at a time, paging
  # through until all workflow requests have been retrieved.
  page = {:total_result_set_size => 0}
  begin
    page = workflow_request_service.get_workflow_requests_by_statement(
        statement.to_statement()
    )

    # Print out some information for each workflow request.
    unless page[:results].nil?
      page[:results].each_with_index do |workflow_request, index|
        puts ('%d) Workflow request with ID %d, entity type "%s", and entity ' +
            'ID %d was found.') % [index + statement.offset,
            workflow_request[:id], workflow_request[:entity_type],
            workflow_request[:entity_id]]
      end
    end

    # Increase the statement offset by the page size to get the next page.
    statement.offset += statement.limit
  end while statement.offset < page[:total_result_set_size]

  puts 'Total number of workflow requests: %d' % page[:total_result_set_size]
end

if __FILE__ == $0
  API_VERSION = :v201711

  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
  dfp = DfpApi::Api.new

  # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
  # the configuration file or provide your own logger:
  # dfp.logger = Logger.new('dfp_xml.log')

  begin
    get_workflow_approval_requests(dfp)

  # HTTP errors.
  rescue AdsCommon::Errors::HttpError => e
    puts "HTTP Error: %s" % e

  # API errors.
  rescue DfpApi::Errors::ApiException => e
    puts "Message: %s" % e.message
    puts 'Errors:'
    e.errors.each_with_index do |error, index|
      puts "\tError [%d]:" % (index + 1)
      error.each do |field, value|
        puts "\t\t%s: %s" % [field, value]
      end
    end
  end
end


text:
@class MSURLSessionDataTask;

#import "MSRequest.h"

@interface MSGraphGroupSubscribeByMailRequest : MSRequest

@property (readonly) NSMutableURLRequest *mutableRequest;

- (MSURLSessionDataTask *)executeWithCompletion:(void (^)(NSDictionary *response, NSError *error))completionHandler;

@end


text:
class AddDescriptionToOrganizations < ActiveRecord::Migration
  def change
    change_table :organizations do |t|
      t.string :description
      t.string :short_description
    end
  end
end


text:
using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
    /// <summary>
    /// Reserved to be used by the compiler for tracking metadata.
    /// This class should not be used by developers in source code.
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    internal static class IsExternalInit
    {
    }
}


text:
#include <aws/elasticloadbalancing/ElasticLoadBalancingEndpoint.h>
#include <aws/core/utils/memory/stl/AWSMap.h>

using namespace Aws;
using namespace Aws::ElasticLoadBalancing;

namespace Aws
{
namespace ElasticLoadBalancing
{
namespace ElasticLoadBalancingEndpoint
{
  Aws::String ForRegion(Region region)
  {
    switch(region)
    {
     case Region::US_EAST_1:
        return "elasticloadbalancing.us-east-1.amazonaws.com";
     case Region::US_WEST_1:
        return "elasticloadbalancing.us-west-1.amazonaws.com";
     case Region::US_WEST_2:
        return "elasticloadbalancing.us-west-2.amazonaws.com";
     case Region::EU_WEST_1:
        return "elasticloadbalancing.eu-west-1.amazonaws.com";
     case Region::EU_CENTRAL_1:
        return "elasticloadbalancing.eu-central-1.amazonaws.com";
     case Region::AP_SOUTHEAST_1:
        return "elasticloadbalancing.ap-southeast-1.amazonaws.com";
     case Region::AP_SOUTHEAST_2:
        return "elasticloadbalancing.ap-southeast-2.amazonaws.com";
     case Region::AP_NORTHEAST_1:
        return "elasticloadbalancing.ap-northeast-1.amazonaws.com";
     case Region::SA_EAST_1:
        return "elasticloadbalancing.sa-east-1.amazonaws.com";
     default:
        return "elasticloadbalancing.us-east-1.amazonaws.com";
    }
  }

} // namespace ElasticLoadBalancingEndpoint
} // namespace ElasticLoadBalancing
} // namespace Aws


text:
package com.softwaremill.macwire.dependencyLookup

import com.softwaremill.macwire.Debug
import com.softwaremill.macwire.Util._

import scala.reflect.macros.blackbox

private[macwire] class DependencyResolver[C <: blackbox.Context](
  val c: C,
  debug: Debug,
  wireWithImplicits: Boolean) {

  import c.universe._

  private lazy val implicitValuesFinder = new ImplicitValueOfTypeFinder[c.type](c, debug)
  private lazy val enclosingClassFinder = new ValuesOfTypeInEnclosingClassFinder[c.type](c, debug)
  private lazy val parentsMembersFinder = new ValuesOfTypeInParentsFinder[c.type](c, debug)

  private lazy val enclosingMethodsAndFuncsFinder = new ValuesOfTypeInEnclosingMethodsAndFunctionsFinder[c.type](c, debug)

  def resolve(param: Symbol, t: Type): Option[c.Tree] = {

    debug.withBlock(s"Trying to find value [${param.name}] of type: [$t]") {

      val results: List[Tree] = enclosingMethodsAndFuncsFinder.find(t, param) match {
        case Nil =>
          val implicitInferenceResults =
            if (wireWithImplicits || param.isImplicit) implicitValuesFinder.find(t)
            else None

          /* First, we perform plain, old, regular value lookup that will exclude found
           * implicit value if need */
          val regularLookupValues = firstNotEmpty[Tree](
            () => enclosingClassFinder.find(t, implicitInferenceResults),
            () => parentsMembersFinder.find(t, implicitInferenceResults)
          ).getOrElse(Nil)
          /* After regular lookup, we combine both results together.
           *
           * It's done as an separate step to prevent macro from resolving dependency too early
           * and thus shadowing non ambiguous resolution problems when:
           * 1) constructor parameter is marked as an implicit and
           * 2) there is no matching value in appropriate scope, but
           * 3) implicit value is present in some outer scope (parent, package/companion object,
           * explicit imports and so on).
           *
           * The implicit value tree may have been included if it was found as a regular value as well, hence
           * it has to be filtered out.
           */
          implicitInferenceResults.map(i => i :: regularLookupValues.filter(_ != i)).getOrElse(regularLookupValues)
        case values => values
      }

      results match {
        case Nil =>
          c.error(c.enclosingPosition, s"Cannot find a value of type: [$t]")
          None
        case value :: Nil =>
          debug(s"Found single value: [$value] of type [$t]")
          Some(value)
        case values =>
          c.error(c.enclosingPosition, s"Found multiple values of type [$t]: [$values]")
          None
      }
    }
  }
}


text:
// .NAME vtkProp3DFollower - a vtkProp3D that always faces the camera
// .SECTION Description
// vtkProp3DFollower is a type of vtkProp3D that always faces the camera.
// More specifically it will not change its position or scale,
// but it will continually update its orientation so that it is right side
// up and facing the camera. This is typically used for complex billboards
// or props that need to face the viewer at all times.
//
// Note: All of the transformations that can be made to a vtkProp3D will take
// effect with the follower. Thus, if you change the orientation of the
// follower by 90 degrees, then it will follow the camera, but be off by 90
// degrees.

// .SECTION see also
// vtkFollower vtkProp3D vtkCamera vtkProp3DAxisFollower

#ifndef vtkProp3DFollower_h
#define vtkProp3DFollower_h

#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkProp3D.h"

class vtkCamera;
class vtkMapper;

class VTKRENDERINGCORE_EXPORT vtkProp3DFollower : public vtkProp3D
{
 public:
  // Description:
  // Creates a follower with no camera set.
  static vtkProp3DFollower *New();

  // Description:
  // Standard VTK methods for type and printing.
  vtkTypeMacro(vtkProp3DFollower,vtkProp3D);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Set/Get the vtkProp3D to control (i.e., face the camera).
  virtual void SetProp3D(vtkProp3D *prop);
  virtual vtkProp3D *GetProp3D();

  // Description:
  // Set/Get the camera to follow. If this is not set, then the follower
  // won't know what to follow and will act like a normal vtkProp3D.
  virtual void SetCamera(vtkCamera*);
  vtkGetObjectMacro(Camera, vtkCamera);

  // Description:
  // This causes the actor to be rendered. It in turn will render the actor's
  // property, texture map and then mapper. If a property hasn't been
  // assigned, then the actor will create one automatically.
  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
  virtual int RenderVolumetricGeometry(vtkViewport *viewport);

  // Description:
  // Does this prop have some translucent polygonal geometry?
  virtual int HasTranslucentPolygonalGeometry();

  // Description:
  // Release any graphics resources associated with this vtkProp3DFollower.
  virtual void ReleaseGraphicsResources(vtkWindow*);

  // Description:
  // Generate the matrix based on ivars. This method overloads its superclasses
  // ComputeMatrix() method due to the special vtkProp3DFollower matrix operations.
  virtual void ComputeMatrix();

  // Description:
  // Shallow copy of a follower. Overloads the virtual vtkProp method.
  void ShallowCopy(vtkProp *prop);

  // Description:
  // Return the bounds of this vtkProp3D.
  virtual double *GetBounds();

  // Description:
  // Overload vtkProp's method for setting up assembly paths. See
  // the documentation for vtkProp.
  void InitPathTraversal();
  virtual vtkAssemblyPath *GetNextPath();

protected:
  vtkProp3DFollower();
  ~vtkProp3DFollower();

  vtkCamera *Camera;
  vtkProp3D  *Device;

  //Internal matrices to avoid New/Delete for performance reasons
  vtkMatrix4x4 *InternalMatrix;

private:
  vtkProp3DFollower(const vtkProp3DFollower&);  // Not implemented.
  void operator=(const vtkProp3DFollower&);  // Not implemented.
};

#endif


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%blog_post}}".
 *
 * @property integer $id
 * @property string $title
 * @property string $content
 * @property integer $category_id
 * @property integer $status
 * @property integer $created_at
 * @property integer $updated_at
 */
class BlogPost extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%blog_post}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'content', 'category_id', 'status', 'created_at', 'updated_at'], 'required'],
            [['content'], 'string'],
            [['category_id', 'status', 'created_at', 'updated_at'], 'integer'],
            [['title'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'content' => 'Content',
            'category_id' => 'Category ID',
            'status' => 'Status',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}


text:
// -   Project: scalajs-angulate (https://github.com/jokade/scalajs-angulate)
// Description: API for Angular $animate service
//
// Distributed under the MIT License (see included file LICENSE)
package biz.enef.angulate.core

import org.scalajs.dom.Element

import scala.scalajs.js

/**
 * API for Angular \$animate service.
 *
 * @see [[https://docs.angularjs.org/api/ng/service/\$animate]]
 */
@js.native
trait AnimateService  extends ProvidedService {

  def enter(element: Element, parent: Element, after: Element) : QPromise = js.native
  def enter(element: Element, parent: Element, after: Element, options: js.Object) : QPromise = js.native

  def leave(element: Element) : QPromise = js.native
  def leave(element: Element, options: js.Object) : QPromise = js.native

  def move(element: Element, parent: Element, after: Element) : QPromise = js.native
  def move(element: Element, parent: Element, after: Element, options: js.Object) : QPromise = js.native

  def addClass(element: Element, className: String) : QPromise = js.native
  def addClass(element: Element, className: String, options: js.Object) : QPromise = js.native

  def removeClass(element: Element, className: String) : QPromise = js.native
  def removeClass(element: Element, className: String, options: js.Object) : QPromise = js.native

  def setClass(element: Element, add: String, remove: String) : QPromise = js.native
  def setClass(element: Element, add: String, remove: String, options: js.Object) : QPromise = js.native

}


text:
"""
Integration tests for ``txaws.testing.ec2``.
"""

from txaws.testing.integration import get_memory_service
from txaws.testing.ec2_tests import ec2_integration_tests

def get_memory_client(case):
    return get_memory_service(case).get_ec2_client()

class MemoryEC2TestCase(ec2_integration_tests(get_memory_client)):
    """
    Tests for the in-memory EC2 test double.
    """


text:
{% extends "base.html" %}

{% block content %}

<input type="text" name="title" value="{{questionnaire.title}}" class="" >

		<textarea class="form-control col-xs-12" >{{questionnaire.description}}</textarea>

	{% for question in questionnaire.questions.all %}

			<input type="text" value="{{question.question}}" class="form-control" >
			{% for option in question.options.all %}

					<input type="radio" disabled name="q_{{question.id}}" id="q_{{question.id}}_{{option.id}}" value="{{option.id}}" >
					<input type="text" class="field-text form-control" value="{{option.text}}">
					<input type="text" class="field-value form-control" value="{{option.value}}">

			{% empty %}

					<input type="text" class="form-control" disabled id="q_{{question.id}}" name="q_{{question.id}}" >

			{% endfor %}

				<button class="btn col-xs-12 btn-success" id="add_question">Add Option</button>

	{% endfor %}

		<button class="btn col-xs-12 btn-success" id="add_question">Add Question</button>

		<button class="btn col-xs-12">Submit</button>

{% endblock content %}


text:
using namespace epee;

#include <functional>

namespace daemonize {

struct t_internals {
private:
  t_protocol protocol;
public:
  t_core core;
  t_p2p p2p;
  t_rpc rpc;

  t_internals(
      boost::program_options::variables_map const & vm
    )
    : core{vm}
    , protocol{vm, core}
    , p2p{vm, protocol}
    , rpc{vm, core, p2p}
  {
    // Handle circular dependencies
    protocol.set_p2p_endpoint(p2p.get());
    core.set_protocol(protocol.get());
  }
};

void t_daemon::init_options(boost::program_options::options_description & option_spec)
{
  t_core::init_options(option_spec);
  t_p2p::init_options(option_spec);
  t_rpc::init_options(option_spec);
}

t_daemon::t_daemon(
    boost::program_options::variables_map const & vm
  )
  : mp_internals{new t_internals{vm}}
{}

t_daemon::~t_daemon() = default;

// MSVC is brain-dead and can't default this...
t_daemon::t_daemon(t_daemon && other)
{
  if (this != &other)
  {
    mp_internals = std::move(other.mp_internals);
    other.mp_internals.reset(nullptr);
  }
}

// or this
t_daemon & t_daemon::operator=(t_daemon && other)
{
  if (this != &other)
  {
    mp_internals = std::move(other.mp_internals);
    other.mp_internals.reset(nullptr);
  }
  return *this;
}

bool t_daemon::run(bool interactive)
{
  if (nullptr == mp_internals)
  {
    throw std::runtime_error{"Can't run stopped daemon"};
  }
  tools::signal_handler::install(std::bind(&daemonize::t_daemon::stop_p2p, this));

  try
  {
    if (!mp_internals->core.run())
      return false;
    mp_internals->rpc.run();

    daemonize::t_command_server* rpc_commands;

    if (interactive)
    {
      rpc_commands = new daemonize::t_command_server(0, 0, "", false, mp_internals->rpc.get_server());
      rpc_commands->start_handling(std::bind(&daemonize::t_daemon::stop_p2p, this));
    }

    mp_internals->p2p.run(); // blocks until p2p goes down

    if (interactive)
    {
      rpc_commands->stop_handling();
    }

    mp_internals->rpc.stop();
    LOG_PRINT("Node stopped.", LOG_LEVEL_0);
    return true;
  }
  catch (std::exception const & ex)
  {
    LOG_ERROR("Uncaught exception! " << ex.what());
    return false;
  }
  catch (...)
  {
    LOG_ERROR("Uncaught exception!");
    return false;
  }
}

void t_daemon::stop()
{
  if (nullptr == mp_internals)
  {
    throw std::runtime_error{"Can't stop stopped daemon"};
  }
  mp_internals->p2p.stop();
  mp_internals->rpc.stop();
  mp_internals.reset(nullptr); // Ensure resources are cleaned up before we return
}

void t_daemon::stop_p2p()
{
  if (nullptr == mp_internals)
  {
    throw std::runtime_error{"Can't send stop signal to a stopped daemon"};
  }
  mp_internals->p2p.get().send_stop_signal();
}

} // namespace daemonize


text:
require 'rails_helper'

describe TemplateAssets::Configuration do

  context '#cache_store' do
    context 'in Rails.env.production' do
      it 'defaults to MemoryStore of 1MB' do
        allow(Rails).to receive(:env) do
          ActiveSupport::StringInquirer.new('production')
        end

        config = TemplateAssets::Configuration.new
        expect(config.cache_store).to be_a(ActiveSupport::Cache::MemoryStore)
      end
    end

    context 'in Rails.env.development' do
      it 'defaults to NullStore' do
        allow(Rails).to receive(:env) do
          ActiveSupport::StringInquirer.new('development')
        end

        config = TemplateAssets::Configuration.new
        expect(config.cache_store).to be_a(ActiveSupport::Cache::NullStore)
      end
    end

    context 'in Rails.env.test' do
      it 'default to NullStore' do
        allow(Rails).to receive(:env) do
          ActiveSupport::StringInquirer.new('test')
        end

        config = TemplateAssets::Configuration.new
        expect(config.cache_store).to be_a(ActiveSupport::Cache::NullStore)
      end
    end

  end

  context '#assets_dir' do
    it 'defaults to "views"' do
      config = TemplateAssets::Configuration.new
      expect(config.assets_dir).to eq 'views'
    end

    it 'can be overriden' do
      config = TemplateAssets::Configuration.new(assets_dir: 'overriden')
      expect(config.assets_dir).to eq 'overriden'
    end
  end

end


text:
import * as T from './../src/index';
export declare function setDirName(dirName: string): any;
export declare function serve<T, TQuery, TBody>(functions: {
    name: string;
    main: T.MainEntryPoint<any, any, any>;
}[], port?: number): void;


text:
<?php while($the_query->have_posts()) : $the_query->the_post(); ?>

		<?php
			$categories = get_the_category();
			$catMeta = get_option("category_" . $categories[0]->cat_ID);
			$color = (isset($catMeta['mb_colour']) && !empty($catMeta['mb_colour'])) ? esc_attr($catMeta['mb_colour']) : '';
		?>
		<?php if(has_post_thumbnail()) : ?>

				<?php the_post_thumbnail('full', array('class' => 'img-responsive')); ?>

		<?php endif; ?>

				<a href="<?php echo get_category_link($categories[0]->cat_ID); ?>" style="background-color: <?php echo $color; ?>"><?php echo $categories[0]->name; ?>
				Por <?php the_author_posts_link(); ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

			<?php the_content('[leer más]'); ?>

<?php endwhile; ?>


text:
from numbers import Real
from math import isnan

#: A constant representing unknown value (NaN). Use this for storing unknowns,
#: but not for checking for unknowns.
Unknown = float("nan")

class Value(float):
    """
    The class representing a value. The class is not used to store values but
    only to return them in contexts in which we want the value to be accompanied
    with the descriptor, for instance to print the symbolic value of discrete
    variables.

    The class is derived from `float`, with an additional attribute `variable`
    which holds the descriptor of type :obj:`Orange.data.Variable`. If the
    value continuous or discrete, it is stored as a float. Other types of
    values, like strings, are stored in the attribute `value`.

    The class overloads the methods for printing out the value:
    `variable.repr_val` and `variable.str_val` are used to get a suitable
    representation of the value.

    Equivalence operator is overloaded as follows:

    - unknown values are equal; if one value is unknown and the other is not,
      they are different;

    - if the value is compared with the string, the value is converted to a
      string using `variable.str_val` and the two strings are compared

    - if the value is stored in attribute `value`, it is compared with the
      given other value

    - otherwise, the inherited comparison operator for `float` is called.

    Finally, value defines a hash, so values can be put in sets and appear as
    keys in dictionaries.

    .. attribute:: variable (:obj:`Orange.data.Variable`)

        Descriptor; used for printing out and for comparing with strings

    .. attribute:: value

        Value; the value can be of arbitrary type and is used only for variables
        that are neither discrete nor continuous. If `value` is `None`, the
        derived `float` value is used.
    """
    __slots__ = "variable", "_value"

    def __new__(cls, variable, value=Unknown):
        """
        Construct a new instance of Value with the given descriptor and value.
        If the argument `value` can be converted to float, it is stored as
        `float` and the attribute `value` is set to `None`. Otherwise, the
        inherited float is set to `Unknown` and the value is held by the
        attribute `value`.

        :param variable: descriptor
        :type variable: Orange.data.Variable
        :param value: value
        """
        if not isinstance(value, str):
            try:
                self = super().__new__(cls, value)
                self.variable = variable
                return self
            except:
                pass
        self = super().__new__(cls, -1)
        self._value = value
        self.variable = variable
        return self

    def __init__(self, _, __=Unknown):
        pass

    def __repr__(self):
        return "Value('%s', %s)" % (self.variable.name,
                                    self.variable.repr_val(self))

    def __str__(self):
        return self.variable.str_val(self)

    def __eq__(self, other):
        if isinstance(self, Real) and isnan(self):
            return (isinstance(other, Real) and isnan(other)
                    or other in self.variable.unknown_str)
        if isinstance(other, str):
            return self.variable.str_val(self) == other
        if isinstance(other, Value):
            return self.value == other.value
        return super().__eq__(other)

    def __contains__(self, other):
        if (self.value is not None
                and isinstance(self.value, str)
                and isinstance(other, str)):
            return other in self.value
        raise TypeError("invalid operation on Value()")

    def __hash__(self):
        if self.value is None:
            return super().__hash__()
        else:
            return super().__hash__() ^ hash(self.value)

    @property
    def value(self):
        from . import DiscreteVariable, StringVariable
        if isinstance(self.variable, DiscreteVariable):
            return self.variable.values[int(self)]
        if isinstance(self.variable, StringVariable):
            return self._value
        return float(self)

    def __getnewargs__(self):
        return self.variable, float(self)

    def __getstate__(self):
        return dict(value=getattr(self, '_value', None))

    def __setstate__(self, state):
        self._value = state.get('value', None)


text:
function Player(params) {

    // construction

    this.name =
        typeof params.name !== 'undefined' ? params.name : '';
    // default new blobs to 'blieque turquoise'
    this.colour =
        typeof params.colour !== 'undefined' ? params.colour : '#69af98';
    // default new blobs to the centre of the screen
    this.positionX =
        typeof params.positionX !== 'undefined' ? params.positionX : 0.5;
    this.positionY =
        typeof params.positionY !== 'undefined' ? params.positionY : 0.5;

    // methods

    this.setName = function(name) {
        if (typeof name === 'string' &&
            name.length > 0) {
            this.name = name;
            return true;
        } else {
            return false;
        }
    }

}


text:
'use strict';

angular.module('ngGcDashToSpace', [
  'ngGcSafeString'
]).filter('dashToSpace', [
  'safeStringFilter',
  function dashToSpace(safeStringFilter) {

    return function dashToSpaceFilter(input) {
      return safeStringFilter(input).replace(/-/g, ' ');
    };

  }
]);


text:
///#begin zh-cn
//
//  Created by ShareSDK.cn on 13-1-14.
//  官网地址:http://www.ShareSDK.cn
//  技术支持邮箱:support@sharesdk.cn
//  官方微信:ShareSDK   (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
//  商务QQ:4006852216
//  Copyright (c) 2013年 ShareSDK.cn. All rights reserved.
//
///#end
///#begin en
//
//  Created by ShareSDK.cn on 13-1-14.
//  website:http://www.ShareSDK.cn
//  Support E-mail:support@sharesdk.cn
//  WeChat ID:ShareSDK   (If publish a new version, we will be push the updates content of version to you. If you have any questions about the ShareSDK, you can get in touch through the WeChat with us, we will respond within 24 hours)
//  Business QQ:4006852216
//  Copyright (c) 2013年 ShareSDK.cn. All rights reserved.
//
///#end

#import <Foundation/Foundation.h>
#import "SSEverNoteLazyMapReader.h"

///#begin zh-cn
/**
 *	@brief	笔记属性集合读取器
 */
///#end
///#begin en
/**
 *	@brief	Note attributes reader.
 */
///#end
@interface SSEverNoteNoteAttributesReader : NSObject
{
@private
    NSDictionary *_sourceData;
}

///#begin zh-cn
/**
 *	@brief	源数据
 */
///#end
///#begin en
/**
 *	@brief	Raw data.
 */
///#end
@property (nonatomic,readonly) NSDictionary *sourceData;

///#begin zh-cn
/**
 *	@brief	time that the note refers to
 */
///#end
///#begin en
/**
 *	@brief	time that the note refers to
 */
///#end
@property (nonatomic,readonly) long long subjectDate;

///#begin zh-cn
/**
 *	@brief	the latitude where the note was taken
 */
///#end
///#begin en
/**
 *	@brief	the latitude where the note was taken
 */
///#end
@property (nonatomic,readonly) double latitude;

///#begin zh-cn
/**
 *	@brief	the longitude where the note was taken
 */
///#end
///#begin en
/**
 *	@brief	the longitude where the note was taken
 */
///#end
@property (nonatomic,readonly) double longitude;

///#begin zh-cn
/**
 *	@brief	the altitude where the note was taken
 */
///#end
///#begin en
/**
 *	@brief	the altitude where the note was taken
 */
///#end
@property (nonatomic,readonly) double altitude;

///#begin zh-cn
/**
 *	@brief	the author of the content of the note
 */
///#end
///#begin en
/**
 *	@brief	the author of the content of the note
 */
///#end
@property (nonatomic,readonly) NSString *author;

///#begin zh-cn
/**
 *	@brief	the method that the note was added to the account, if the note wasn't directly authored in an Evernote desktop client.
 */
///#end
///#begin en
/**
 *	@brief	the method that the note was added to the account, if the note wasn't directly authored in an Evernote desktop client.
 */
///#end
@property (nonatomic,readonly) NSString *source;

///#begin zh-cn
/**
 *	@brief	the original location where the resource was hosted. For web clips, this will be the URL of the page that was clipped.
 */
///#end
///#begin en
/**
 *	@brief	the original location where the resource was hosted. For web clips, this will be the URL of the page that was clipped.
 */
///#end
@property (nonatomic,readonly) NSString *sourceURL;

///#begin zh-cn
/**
 *	@brief	an identifying string for the application that created this note.
 *          This string does not have a guaranteed syntax or structure -- it is intended for human inspection and tracking.
 */
///#end
///#begin en
/**
 *	@brief	an identifying string for the application that created this note.
 *          This string does not have a guaranteed syntax or structure -- it is intended for human inspection and tracking.
 */
///#end
@property (nonatomic,readonly) NSString *sourceApplication;

///#begin zh-cn
/**
 *	@brief	The date and time when this note was directly shared via its own URL.
 *          This is only set on notes that were individually shared - it is independent of any notebook-level sharing of the containing notepbook.
 *          This field is treated as "read-only" for clients; the server will ignore changes to this field from an external client.
 */
///#end
///#begin en
/**
 *	@brief	The date and time when this note was directly shared via its own URL.
 *          This is only set on notes that were individually shared - it is independent of any notebook-level sharing of the containing notepbook.
 *          This field is treated as "read-only" for clients; the server will ignore changes to this field from an external client.
 */
///#end
@property (nonatomic,readonly) long long shareDate;

///#begin zh-cn
/**
 *	@brief	Allows the user to assign a human-readable location name associated with a note.
 *          Users may assign values like 'Home' and 'Work'.
 *          Place names may also be populated with values from geonames database (e.g., a restaurant name).
 *          Applications are encouraged to normalize values so that grouping values by place name provides a useful result.
 *          Applications MUST NOT automatically add place name values based on geolocation without confirmation from the user;
 *          that is, the value in this field should be more useful than a simple automated lookup based on the note's latitude and longitude.
 */
///#end
///#begin en
/**
 *	@brief	Allows the user to assign a human-readable location name associated with a note.
 *          Users may assign values like 'Home' and 'Work'.
 *          Place names may also be populated with values from geonames database (e.g., a restaurant name).
 *          Applications are encouraged to normalize values so that grouping values by place name provides a useful result.
 *          Applications MUST NOT automatically add place name values based on geolocation without confirmation from the user;
 *          that is, the value in this field should be more useful than a simple automated lookup based on the note's latitude and longitude.
 */
///#end
@property (nonatomic,readonly) NSString *placeName;

///#begin zh-cn
/**
 *	@brief	The class (or type) of note. This field is used to indicate to clients that special structured information
 *          is represented within the note such that special rules apply when making modifications.
 *          If contentClass is set and the client application does not specifically support the specified class,
 *          the client MUST treat the note as read-only. In this case, the client MAY modify the note's notebook and tags via the Note.
 *          notebookGuid and Note.tagGuids fields.
 *          Applications should set contentClass only when they are creating notes that contain structured information that needs
 *          to be maintained in order for the user to be able to use the note within that application.
 *          Setting contentClass makes a note read-only in other applications, so there is a trade-off when an application chooses to use contentClass.
 *          Applications that set contentClass when creating notes must use a contentClass string of the
 *          form CompanyName.ApplicationName to ensure uniqueness.
 */
///#end
///#begin en
/**
 *	@brief	The class (or type) of note. This field is used to indicate to clients that special structured information
 *          is represented within the note such that special rules apply when making modifications.
 *          If contentClass is set and the client application does not specifically support the specified class,
 *          the client MUST treat the note as read-only. In this case, the client MAY modify the note's notebook and tags via the Note.
 *          notebookGuid and Note.tagGuids fields.
 *          Applications should set contentClass only when they are creating notes that contain structured information that needs
 *          to be maintained in order for the user to be able to use the note within that application.
 *          Setting contentClass makes a note read-only in other applications, so there is a trade-off when an application chooses to use contentClass.
 *          Applications that set contentClass when creating notes must use a contentClass string of the
 *          form CompanyName.ApplicationName to ensure uniqueness.
 */
///#end
@property (nonatomic,readonly) NSString *contentClass;

///#begin zh-cn
/**
 *	@brief	Provides a location for applications to store a relatively small (4kb)
 *          blob of data that is not meant to be visible to the user and that is opaque to the Evernote service.
 *          A single application may use at most one entry in this map, using its API consumer key as the map key.
 *          See the documentation for LazyMap for a description of when the actual map values are returned by the service.
 *          To safely add or modify your application's entry in the map, use NoteStore.setNoteApplicationDataEntry.
 *          To safely remove your application's entry from the map, use NoteStore.unsetNoteApplicationDataEntry.
 */
///#end
///#begin en
/**
 *	@brief	Provides a location for applications to store a relatively small (4kb)
 *          blob of data that is not meant to be visible to the user and that is opaque to the Evernote service.
 *          A single application may use at most one entry in this map, using its API consumer key as the map key.
 *          See the documentation for LazyMap for a description of when the actual map values are returned by the service.
 *          To safely add or modify your application's entry in the map, use NoteStore.setNoteApplicationDataEntry.
 *          To safely remove your application's entry from the map, use NoteStore.unsetNoteApplicationDataEntry.
 */
///#end
@property (nonatomic,readonly) SSEverNoteLazyMapReader *applicationData;

///#begin zh-cn
/**
 *	@brief	An indication of who made the last change to the note.
 *          If you are accessing the note via a shared notebook to which you have modification rights,
 *          or if you are the owner of the notebook to which the note belongs, then you have access to the value.
 *          In this case, the value will be unset if the owner of the notebook containing the note was the last to make the modification,
 *          else it will be a string describing the guest who made the last edit. If you do not have access to this value,
 *          it will be left unset. This field is read-only by clients. The server will ignore all values set by clients into this field.
 */
///#end
///#begin en
/**
 *	@brief	An indication of who made the last change to the note.
 *          If you are accessing the note via a shared notebook to which you have modification rights,
 *          or if you are the owner of the notebook to which the note belongs, then you have access to the value.
 *          In this case, the value will be unset if the owner of the notebook containing the note was the last to make the modification,
 *          else it will be a string describing the guest who made the last edit. If you do not have access to this value,
 *          it will be left unset. This field is read-only by clients. The server will ignore all values set by clients into this field.
 */
///#end
@property (nonatomic,readonly) NSString *lastEditedBy;

///#begin zh-cn
/**
 *	@brief	A map of classifications applied to the note by clients or by the Evernote service.
 *          The key is the string name of the classification type, and the value is a constant that begins with CLASSIFICATION_.
 */
///#end
///#begin en
/**
 *	@brief	A map of classifications applied to the note by clients or by the Evernote service.
 *          The key is the string name of the classification type, and the value is a constant that begins with CLASSIFICATION_.
 */
///#end
@property (nonatomic,readonly) NSDictionary *classifications;

///#begin zh-cn
/**
 *	@brief	初始化读取器
 *
 *	@param 	sourceData 	原数据
 *
 *	@return	读取器实例对象
 */
///#end
///#begin en
/**
 *	@brief	Initialize Reader.
 *
 *	@param 	sourceData 	Raw data
 *
 *	@return	Reader object.
 */
///#end
- (id)initWithSourceData:(NSDictionary *)sourceData;

///#begin zh-cn
/**
 *	@brief	创建笔记属性集合读取器
 *
 *	@param 	sourceData 	原数据
 *
 *	@return	读取器实例对象
 */
///#end
///#begin en
/**
 *	@brief	Create an note attributes reader
 *
 *	@param 	sourceData 	Raw data.
 *
 *	@return	Reader object.
 */
///#end
+ (SSEverNoteNoteAttributesReader *)readerWithSourceData:(NSDictionary *)sourceData;

@end