text:
public class MyClass
{
    // ! backing member for the public property
    private short myProperty = 0;

    // * Available for public use
    public short MyProperty
    {
        // TODO add some better comments
        get { return this.myProperty; }

        // ? should this value be transformed first?
        set { this.myProperty = value; }

    }

    public constructor()
    {
        this.MyProperty = 1;
    }

    public void DoSomeStuff(string myParameter)
    {

    }

    private boolean doSomePrivateStuff()
    {

    }
}

/*
 This is my class
    ! This class is not for public use
    TODO Create some copyright notices
    * Highlight to draw attention
    ? Maybe I should indent less
 */
public class MyClass
{
    // ! backing member for the public property
    private short myProperty = 0;

    // * Available for public use
    public short MyProperty
    {
        // TODO add some better comments
        get { return this.myProperty; }

        // ? should this value be transformed first?
        set { this.myProperty = value; }

    }

    public constructor()
    {
        this.MyProperty = 1;
    }

    public void DoSomeStuff(string myParameter)
    {

    }

    private boolean doSomePrivateStuff()
    {

    }
}

/*
 This is my class
    ! This class is not for public use
    TODO Create some copyright notices
    * Highlight to draw attention
    ? Maybe I should indent less
 */
public class MyClass
{
    // ! backing member for the public property
    private short myProperty = 0;

    // * Available for public use
    public short MyProperty
    {
        // TODO add some better comments
        get { return this.myProperty; }

        // ? should this value be transformed first?
        set { this.myProperty = value; }

    }

    public constructor()
    {
        this.MyProperty = 1;
    }

    public void DoSomeStuff(string myParameter)
    {

    }

    private boolean doSomePrivateStuff()
    {

    }
}

/*
 This is my class
    ! This class is not for public use
    TODO Create some copyright notices
    * Highlight to draw attention
    ? Maybe I should indent less
 */
public class MyClass
{
    // ! backing member for the public property
    private short myProperty = 0;

    // * Available for public use
    public short MyProperty
    {
        // TODO add some better comments
        get { return this.myProperty; }

        // ? should this value be transformed first?
        set { this.myProperty = value; }

    }

    public constructor()
    {
        this.MyProperty = 1;
    }

    public void DoSomeStuff(string myParameter)
    {

    }

    private boolean doSomePrivateStuff()
    {

    }
}

/*
 This is my class
    ! This class is not for public use
    TODO Create some copyright notices
    * Highlight to draw attention
    ? Maybe I should indent less
 */
public class MyClass
{
    // ! backing member for the public property
    private short myProperty = 0;

    // * Available for public use
    public short MyProperty
    {
        // TODO add some better comments
        get { return this.myProperty; }

        // ? should this value be transformed first?
        set { this.myProperty = value; }

    }

    public constructor()
    {
        this.MyProperty = 1;
    }

    public void DoSomeStuff(string myParameter)
    {

    }

    private boolean doSomePrivateStuff()
    {

    }
}

/*
 This is my class
    ! This class is not for public use
    TODO Create some copyright notices
    * Highlight to draw attention
    ? Maybe I should indent less
 */
public class MyClass
{
    // ! backing member for the public property
    private short myProperty = 0;

    // * Available for public use
    public short MyProperty
    {
        // TODO add some better comments
        get { return this.myProperty; }

        // ? should this value be transformed first?
        set { this.myProperty = value; }

    }

    public constructor()
    {
        this.MyProperty = 1;
    }

    public void DoSomeStuff(string myParameter)
    {

    }

    private boolean doSomePrivateStuff()
    {

    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

const fs = require('fs');
const path = require('path');
const assert = require('assert');
const coffee = require('coffee');
const mm = require('mm');

describe('test/lib/cmd/cov.test.js', () => {
  const eggBin = require.resolve('../../../bin/egg-bin.js');
  const cwd = path.join(__dirname, '../../fixtures/test-files');

  afterEach(mm.restore);

  // `cov` is replace with `test` at win32, so we need to skip it
  if (process.platform !== 'win32') {
    describe('cov at not-win32', () => {
      it('should success', done => {
        mm(process.env, 'TESTS', 'test/**/*.test.js');
        coffee.fork(eggBin, [ 'cov' ], { cwd })
          .coverage(false)
          // .debug()
          .expect('stdout', /\/test\/fixtures\/test-files\/\.tmp true/)
          .expect('stdout', /should success/)
          .expect('stdout', /a\.test\.js/)
          .expect('stdout', /b\/b\.test\.js/)
          .notExpect('stdout', /a.js/)
          .expect('stdout', /Statements {3}: 80% \( 4\/5 \)/)
          .expect('code', 0)
          .end(err => {
            assert.ifError(err);
            assert.ok(fs.existsSync(path.join(cwd, 'coverage/coverage-final.json')));
            assert.ok(fs.existsSync(path.join(cwd, 'coverage/lcov-report/index.html')));
            assert.ok(fs.existsSync(path.join(cwd, 'coverage/lcov.info')));
            assert.ok(!fs.existsSync(path.join(cwd, '.tmp')));
            done();
          });
      });

      it('should success with COV_EXCLUDES', function* () {
        mm(process.env, 'TESTS', 'test/**/*.test.js');
        mm(process.env, 'COV_EXCLUDES', 'ignore/*');
        yield coffee.fork(eggBin, [ 'cov' ], { cwd })
          .coverage(false)
          // .debug()
          .expect('stdout', /\/test\/fixtures\/test-files\/\.tmp true/)
          .expect('stdout', /should success/)
          .expect('stdout', /a\.test\.js/)
          .expect('stdout', /b\/b\.test\.js/)
          .notExpect('stdout', /a.js/)
          .expect('stdout', /Statements {3}: 75% \( 3\/4 \)/)
          .expect('code', 0)
          .end();
        assert(fs.existsSync(path.join(cwd, 'coverage/coverage-final.json')));
        assert(fs.existsSync(path.join(cwd, 'coverage/lcov-report/index.html')));
        assert(fs.existsSync(path.join(cwd, 'coverage/lcov.info')));
        assert(!fs.existsSync(path.join(cwd, '.tmp')));
        const lcov = fs.readFileSync(path.join(cwd, 'coverage/lcov.info'), 'utf8');
        assert(!/ignore\/a.js/.test(lcov));
      });

      it('should success with -x to ignore files', function* () {
        yield coffee.fork(eggBin, [ 'cov', '-x', 'ignore/*', 'test/**/*.test.js' ], { cwd })
          .coverage(false)
          // .debug()
          .expect('stdout', /\/test\/fixtures\/test-files\/\.tmp true/)
          .expect('stdout', /should success/)
          .expect('stdout', /a\.test\.js/)
          .expect('stdout', /b\/b\.test\.js/)
          .notExpect('stdout', /a.js/)
          .expect('stdout', /Statements {3}: 75% \( 3\/4 \)/)
          .expect('code', 0)
          .end();
        assert(fs.existsSync(path.join(cwd, 'coverage/coverage-final.json')));
        assert(fs.existsSync(path.join(cwd, 'coverage/lcov-report/index.html')));
        assert(fs.existsSync(path.join(cwd, 'coverage/lcov.info')));
        assert(!fs.existsSync(path.join(cwd, '.tmp')));
        const lcov = fs.readFileSync(path.join(cwd, 'coverage/lcov.info'), 'utf8');
        assert(!/ignore\/a.js/.test(lcov));
      });

      it('should fail when test fail', done => {
        mm(process.env, 'TESTS', 'test/fail.js');
        coffee.fork(eggBin, [ 'cov' ], { cwd })
          .coverage(false)
          // .debug()
          .expect('stdout', /1\) should fail/)
          .expect('stdout', /1 failing/)
          .expect('code', 1)
          .end(done);
      });

      it('should fail when test fail with power-assert', done => {
        mm(process.env, 'TESTS', 'test/power-assert-fail.js');
        coffee.fork(eggBin, [ 'cov' ], { cwd })
          .coverage(false)
          // .debug()
          .expect('stdout', /1\) should fail/)
          .expect('stdout', /1 failing/)
          .expect('stdout', /assert\(1 === 2\)/)
          .expect('code', 1)
          .end(done);
      });

      it('should warn when require intelli-espower-loader', done => {
        mm(process.env, 'TESTS', 'test/power-assert-fail.js');
        coffee.fork(eggBin, [ 'cov', '-r', 'intelli-espower-loader' ], { cwd })
          .coverage(false)
          // .debug()
          .expect('stderr', /manually require `intelli-espower-loader`/)
          .expect('stdout', /1\) should fail/)
          .expect('stdout', /1 failing/)
          .expect('stdout', /assert\(1 === 2\)/)
          .expect('code', 1)
          .end(done);
      });
    });
  } else {
    it('should exec test instead of cov in win32', done => {
      mm(process, 'platform', 'win32');
      mm(process.env, 'TESTS', 'test/**/*.test.js');
      coffee.fork(eggBin, [ 'cov' ], { cwd })
        .debug()
        .expect('stdout', /should success/)
        .expect('stdout', /a\.test\.js/)
        .expect('stdout', /b\/b\.test\.js/)
        .notExpect('stdout', /Coverage summary/)
        .notExpect('stdout', /a\.js/)
        .expect('code', 0)
        .end(done);
    });
  }
});


text:
ALTER table feature_set add column `display_label` varchar(80) default NULL;

# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_52_53_h.sql|feature_set.display_label');


text:
package com.mcmod.injection.hooks;

import org.objectweb.asm.tree.MethodNode;

import com.mcmod.injection.McClassNode;
import com.mcmod.injection.McHook;

public class McMathUtil extends McHook {

	public boolean canProcess(McClassNode node) {
		return node.constants.get(10430.378f) != null;
	}

	public void process(McClassNode cn) {
		identifyClass(cn, "MathUtil");

		for (MethodNode mn : cn.staticMethods) {
			if (!cn.constants.get(10430.378f).contains(mn)) {
				continue;
			}

			if (cn.constants.get(16384.0f).contains(mn)) {
				identifyMethod("cos", cn, mn);
			} else {
				identifyMethod("sin", cn, mn);
			}
		}
	}
}


text:
from scrapy.selector import Selector
from scrapy.spider import Spider

from familynames.items import FontFamilyItem

class OptimoSpider(Spider):

    name = 'optimo'
    allowed_domains = ['optimo.ch']
    start_urls = [
        'http://www.optimo.ch/typefaces.html'
    ]

    def parse(self, response):
        sel = Selector(response)
        items = sel.xpath('//h3/a[@title]/text()')
        r = []
        for item in items.extract():
            ffi = FontFamilyItem()
            ffi['title'] = item
            r.append(ffi)
        return r


text:
#ifndef __ISR_H
#define __ISR_H

/*!
 * \file isr.h
 * \brief ISR handlers
 * \author David Delassus
 */

#include <types.h>

/* A few defines to make life a little easier */
#define IRQ0  32
#define IRQ1  33
#define IRQ2  34
#define IRQ3  35
#define IRQ4  36
#define IRQ5  37
#define IRQ6  38
#define IRQ7  39
#define IRQ8  40
#define IRQ9  41
#define IRQ10 42
#define IRQ11 43
#define IRQ12 44
#define IRQ13 45
#define IRQ14 46
#define IRQ15 47

/*!
 * \struct registers_t
 * \brief Structure describing registers used by the ISR handler.
 */
struct registers_t
{
    uint32_t ds;                                        /*!< Data segment selector */
    uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;    /*!< Pushed by pusha */
    uint32_t int_no, err_code;                          /*!< Interrupt number and error code (if applicable) */
    uint32_t eip, cs, eflags, useresp, ss;              /*!< Pushed by the processor automatically */
};

typedef void (*isr_t)(struct registers_t *);
void set_interrupt_handler (uint8_t n, isr_t handler);

#endif /* __ISR_H */


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="Sentir, Responsive admin and dashboard UI kits template">
		<meta name="keywords" content="admin,bootstrap,template,responsive admin,dashboard template,web apps template">
		<meta name="author" content="Ari Rusmanto, Isoh Design Studio, Warung Themes">
		<title>Lock screen | SENTIR - Responsive admin and dashboard UI kits template</title>

		<link href="../assets/css/bootstrap.min.css" rel="stylesheet">

		<link href="../assets/plugins/weather-icon/css/weather-icons.min.css" rel="stylesheet">
		<link href="../assets/plugins/prettify/prettify.min.css" rel="stylesheet">
		<link href="../assets/plugins/magnific-popup/magnific-popup.min.css" rel="stylesheet">
		<link href="../assets/plugins/owl-carousel/owl.carousel.min.css" rel="stylesheet">
		<link href="../assets/plugins/owl-carousel/owl.theme.min.css" rel="stylesheet">
		<link href="../assets/plugins/owl-carousel/owl.transitions.min.css" rel="stylesheet">
		<link href="../assets/plugins/chosen/chosen.min.css" rel="stylesheet">
		<link href="../assets/plugins/icheck/skins/all.css" rel="stylesheet">
		<link href="../assets/plugins/datepicker/datepicker.min.css" rel="stylesheet">
		<link href="../assets/plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet">
		<link href="../assets/plugins/validator/bootstrapValidator.min.css" rel="stylesheet">
		<link href="../assets/plugins/summernote/summernote.min.css" rel="stylesheet">
		<link href="../assets/plugins/markdown/bootstrap-markdown.min.css" rel="stylesheet">
		<link href="../assets/plugins/datatable/css/bootstrap.datatable.min.css" rel="stylesheet">
		<link href="../assets/plugins/morris-chart/morris.min.css" rel="stylesheet">
		<link href="../assets/plugins/c3-chart/c3.min.css" rel="stylesheet">
		<link href="../assets/plugins/slider/slider.min.css" rel="stylesheet">
		<link href="../assets/plugins/salvattore/salvattore.css" rel="stylesheet">
		<link href="../assets/plugins/toastr/toastr.css" rel="stylesheet">
		<link href="../assets/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet">
		<link href="../assets/plugins/fullcalendar/fullcalendar/fullcalendar.print.css" rel="stylesheet" media="print">

		<link href="../assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
		<link href="../assets/css/style.css" rel="stylesheet">
		<link href="../assets/css/style-responsive.css" rel="stylesheet">

			<form role="form" action="index.html">

Paris Hawker

				  <input type="password" class="form-control no-border input-lg rounded" placeholder="Enter password" autofocus>

					<button type="submit" class="btn btn-warning btn-lg btn-perspective btn-block">LOGIN</button>

			</form>

Logout


text:
package org.ggp.base.player.request.grammar;

public abstract class Request
{

	public abstract String process(long receptionTime);

	public abstract String getMatchId();

	@Override
	public abstract String toString();

}


text:
"""
Plot the columns of the output files
"""
import sys
import pylab
from mpl_toolkits.basemap import Basemap

# Set up a projection
bm = Basemap(projection='ortho', lon_0=-80, lat_0=-40,
             resolution='l', area_thresh=10000)

data = pylab.loadtxt(sys.argv[1], unpack=True)
shape = (int(sys.argv[2]), int(sys.argv[3]))
lon = pylab.reshape(data[0], shape)
lat = pylab.reshape(data[1], shape)
glon, glat = bm(lon, lat)

for i, value in enumerate(data[3:]):
    value = pylab.reshape(value, shape)
    pylab.figure(figsize=(4, 3))
    pylab.title("Column %d" % (i + 4))
    bm.drawcoastlines()
    #bm.fillcontinents(color='coral',lake_color='aqua')
    #bm.drawmapboundary(fill_color='aqua')
    bm.drawmapboundary()
    bm.drawparallels(pylab.arange(-90.,120.,30.))
    bm.drawmeridians(pylab.arange(0.,420.,60.))
    #bm.bluemarble()
    bm.pcolor(glon, glat, value)
    pylab.colorbar()
    #bm.contour(glon, glat, value, 12, linewidth=3)
    pylab.savefig('column%d.png' % (i + 4))


text:
using Microsoft.AzureStack.Management.StorageAdmin.Models;
using System;
using System.Collections.Generic;

namespace Microsoft.AzureStack.Commands.StorageAdmin
{
    internal class NodeResponse : ResponseBase
    {
        public NodeResponse(NodeModel resource) : base(resource)
        {
        }

        public string CodeVersion { get; set; }

        public string ConfigVersion { get; set; }

        public Uri FaultDomain { get; set; }

        public HealthStatus HealthState { get; set; }

        public string IpAddressOrFqdn { get; set; }

        public bool IsSeedNode { get; set; }

        public string NodeId { get; set; }

        public string NodeName { get; set; }

        public NodeStatus NodeStatus { get; set; }

        public string NodeType { get; set; }

        public TimeSpan NodeUpTime { get; set; }

        public string UpgradeDomain { get; set; }

        public IEnumerable<string> RunningInstanceUris { get; set; }
    }
}


text:
using Umbraco.Web.Mvc;

namespace Umbraco.Tests.CodeFirst.Mvc
{
    public abstract class UmbracoTemplatePage<T> : UmbracoTemplatePage where T : class
    {
        protected override void InitializePage()
        {
            base.InitializePage();

            //set the model to the current node if it is not set, this is generally not the case
			if (Model != null)
			{
			    //Map CurrentContent here
			}
        }

        /// <summary>
        /// Returns the a strongly typed model
        /// </summary>
        public T CurrentContent { get; private set; }
    }
}


text:
from pony.orm import *

db = Database()

class Profile(db.Entity):
    username = PrimaryKey(str, 16)
    status = Required(str, 10)
    firstName = Optional(unicode, 160)
    lastName = Optional(unicode, 160)
    mean = Optional(float)
    requirements = Optional(Json)
    classrooms = Set('Classroom')
    topicmeans = Set('TopicMean')
    nodemeans = Set('NodeMean')
    sentEnvelopes = Set('Envelope', reverse='sender')
    receivedEnvelopes = Set('Envelope', reverse='receiver')

class Classroom(db.Entity):
    ref = PrimaryKey(unicode, 40)
    profiles = Set(Profile)
    topics = Set('Topic')

class Content(db.Entity):
    serial = PrimaryKey(str, 8)
    name = Optional(unicode, 160)
    notes = Optional(LongUnicode)
    text = Optional(LongUnicode)

class Topic(Content):
    nodes = Set('Node')
    classrooms = Set(Classroom)
    topicmeans = Set('TopicMean')

class Node(Content):
    bloom = Optional(str, 10)
    mobile = Optional(bool)
    questions = Set('Question')
    topics = Set(Topic)
    antes = Set('Node', reverse='posts')
    posts = Set('Node', reverse='antes')
    nodemeans = Set('NodeMean')

class Question(Content):
    kind = Optional(str, 10)
    options = Optional(Json)
    node = Optional(Node)

class TopicMean(db.Entity):
    profile = Required(Profile)
    topic = Required(Topic)
    value = Required(float)
    PrimaryKey(profile, topic)

class NodeMean(db.Entity):
    profile = Required(Profile)
    node = Required(Node)
    history = Required(str, 4)
    value = Required(float)
    PrimaryKey(profile, node)

class Envelope(Content):
    sender = Required(Profile, reverse='sentEnvelopes')
    receiver = Required(Profile, reverse='receivedEnvelopes')

db.bind("sqlite", "olddb.sqlite", create_db=True)
db.generate_mapping(create_tables=True)


text:
<meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My Title</title>
  <link href='http://fonts.googleapis.com/css?family=Libre+Baskerville:400,700|Dancing+Script:700' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/main.css">
  <link rel="stylesheet" href="vendor/foundation.css">
  <link rel="stylesheet" href="vendor/normalize.css">

Doggie Date

Search other Users!

      <button class="logout button round">Logout</button>
      <button class="to_profile button round">Back to my Profile</button>


text:
@interface YUCIImageOpenGLRenderer : NSObject <YUCIImageRenderer>

@property (nonatomic,strong,readonly) NSOpenGLView *view;

- (instancetype)initWithOpenGLContext:(NSOpenGLContext *)openGLContext NS_DESIGNATED_INITIALIZER;

@end

#endif


text:
module ApplicationHelper
  # Returns the full title on a per-page basis.
  def full_title(page_title)
    base_title = "#{@city.abbreviation}72"
    if page_title.empty?
      base_title
    else
      "#{base_title} - #{page_title}"
    end
  end

  def city_residents
    @city.moniker.blank? ? "#{@city.name} residents" : @city.moniker
  end

end


text:
export DISPLAY=:0
while [ true ];
do
	xterm
	sleep 1
done


text:
import React from 'react';
import { graphql } from 'gatsby';

import Layout from '../components/list-layout';
import SEO from '../components/seo';
import { ListItems, PostListItem } from '../components/list';
import { Paginate } from '../components/pagination.js';

export default function Template({ pageContext, data}) {
  const {limit, skip, numPages, currentPage} = pageContext;
  const {edges} = data.allMarkdownRemark;
  const slug = `/blog/${currentPage}`;

  let featuredIndex = edges.findIndex(({node}, index) => {
    if (node.frontmatter.featured === true) return index;
  });

  let featured;

  // see if we got a featured post.
  if (featuredIndex >= 0) {
    featured = edges[featuredIndex].node;
  } else {
    // just get the first one
    featured = edges[0].node;
    // and set the featuredIndex to 0
    featuredIndex = 0;
  }

  const items = edges.filter((item, index) => {
    if (index !== featuredIndex) return item;
  });

  const seo = {
    title: `Article archive - page ${currentPage}`,
    description: `Article archive page ${currentPage} from ajfisher.me`
  };

  return (
    <Layout slug={slug} featured={featured}>
      <SEO
        title={seo.title}
        description={seo.description}
        type="list"
      />

Article archive - page {currentPage}

      <ListItems>
        {items.map(({node}) => {
          const { slug, title, date,
            listimage, listimage_position } = node.frontmatter;
          const readingTime = {
            minutes: node.timeToRead,
            words: node.wordCount.words
          }

          const excerpt = node.frontmatter.excerpt || node.excerpt || null;

          return (
            <PostListItem
              key={slug}
              title={title}
              date={date}
              excerpt={excerpt}
              slug={slug}
              readingtime={readingTime.minutes}
              wordcount={readingTime.words}
              image={listimage}
              position={listimage_position}
            />
          );
        })}
      </ListItems>
      <Paginate
        basepath="/blog"
        currentpage={currentPage}
        numpages={numPages}
      />
    </Layout>
  );
};

export const pageQuery = graphql`
  query($skip: Int!, $limit: Int!) {
    allMarkdownRemark(
      sort: {order: DESC, fields: frontmatter___date},
      filter: {frontmatter: {layout: {regex: "/^post/"}}},
      limit: $limit,
      skip: $skip
    ) {
      edges {
        node {
          id
          frontmatter {
            slug
            title
            listimage
            listimage_position
            date(formatString: "YYYY-MM-DD")
            excerpt
            featured
            featureimage
            featureimage_position
            small_title
            large_title
          }
          excerpt(pruneLength: 220)
          wordCount {
            words
          }
          timeToRead
        }
      }
    }
  }
`;


text:
<?xml version="1.0" encoding="windows-1250"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:tx="http://www.springframework.org/schema/tx"

       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
">

    <mvc:annotation-driven />
    <!--tx:annotation-driven transaction-manager="core.txManager" /-->

    <context:property-placeholder location="classpath:system.properties"/>

    <context:component-scan base-package="pl.com.softproject.sample.oauth.controller"/>

    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <!--property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property-->
        <property name="prefix" value="/WEB-INF/jsp/"></property>
        <property name="suffix" value=".jsp"></property>
    </bean>

    <bean id="messageSource"
          class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename" value="messages" />
    </bean>

</beans>


text:
require 'protor'

describe Protor do
  subject{ described_class.new }

  context 'normal usage' do
    subject{ described_class.new }

    it do
      expect(subject.registry).to receive(:reset)
      expect do
        subject.histogram('aaa', 1)
        subject.counter('bbb', 1)
        subject.gauge('ccc', 1)

        subject.publish
      end.not_to raise_error
    end
  end

  context 'error' do
    subject do
      described_class.new do |conf|
        conf[:packet_size] = 10
      end
    end

    it do
      expect do
        subject.histogram('aaa', 1)
        subject.counter('bbb', 1)
        subject.gauge('ccc', 1)

        subject.publish
      end.to raise_error(Errno::ECONNREFUSED)
    end
  end

  context 'silent error' do
    subject do
      described_class.new do |conf|
        conf[:packet_size] = 10
        conf[:silent] = true
      end
    end

    it do
      expect do
        subject.histogram('aaa', 1)
        subject.counter('bbb', 1)
        subject.gauge('ccc', 1)

        subject.publish
      end.not_to raise_error
    end
  end

  context 'can use logger too' do
    subject do
      described_class.new do |conf|
        conf[:client] = :logger
        conf[:logger] = fake_logger
      end
    end
    let(:fake_logger) do
      Class.new do
        def initialize; @count = 0; end;
        def debug(*); @count += 1; end;
        def info(*); @count += 1; end;
        def count; @count; end;
      end.new
    end

    it do
      expect do
        subject.histogram('aaa', 1)
        subject.counter('bbb', 1)
        subject.gauge('ccc', 1)

        subject.publish
      end.not_to raise_error
    end
  end
end


text:
#import <Foundation/Foundation.h>
#import "AWSMobileAnalyticsOptions.h"
#import "AWSMobileAnalyticsEventClient.h"

#import "AWSCore.h"
#import "AWSMobileAnalyticsConfiguration.h"

@class AWSMobileAnalytics;
@class AWSServiceConfiguration;
@class AWSMobileAnalyticsConfiguration;

typedef void(^AWSInitializationCompletionBlock)(AWSMobileAnalytics *);

@interface AWSMobileAnalytics : NSObject

/**
 * Returns the `AWSMobileAnalyticsEventClient`.
 * @returns the `AWSMobileAnalyticsEventClient` to create, record, and submit events.
 */
@property (nonatomic, strong, readonly) id<AWSMobileAnalyticsEventClient> eventClient;

/**
 * Creates an `AWSMobileAnalytics` instance with the specified `appId` using the default `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `configuration` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
 *
 * @param appId AppId from Amazon Mobile Analytics Management Console.
 * @returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
 */
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId;

/**
 * Creates an `AWSMobileAnalytics` instance with the specified `appId` using provided `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `configuration` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
 *
 * @param appId AppId from Amazon Mobile Analytics Management Console.
 * @param configuration A configuraiton object. By default, it uses [AWSServiceManager defaultServiceManager].defaultServiceConfiguration to access the service.
 * @param completionBlock A AWSInitializationCompletionBlock that allows developers to handle custom logic after initialization but before the session begins.
 * @returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
 */
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId
                          configuration:(AWSMobileAnalyticsConfiguration *)configuration
                        completionBlock:(AWSInitializationCompletionBlock)completionBlock;

/**
 * Creates an `AWSMobileAnalytics` instance with the specified `appId` using the default `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `configuration` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
 *
 * @param appId AppId from Amazon Mobile Analytics Management Console.
 * @param insightsPrivateKey Private Key from the Amazon Insights SDK. Pass Private Key to migrate from the Insights SDK.
 * @returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
 */
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId
                     insightsPrivateKey:(NSString *)insightsPrivateKey __attribute__((deprecated));

/**
 * Creates an `AWSMobileAnalytics` instance with the specified `appId` using provided `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `configuration` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
 *
 * @param appId AppId from Amazon Mobile Analytics Management Console.
 * @param insightsPrivateKey Private Key from the Amazon Insights SDK. Pass Private Key to migrate from the Insights SDK.
 * @param configuration A configuraiton object. By default, it uses [AWSServiceManager defaultServiceManager].defaultServiceConfiguration to access the service.
 * @param completionBlock A AWSInitializationCompletionBlock that allows developers to handle custom logic after initialization but before the session begins.
 * @returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
 */
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId
                     insightsPrivateKey:(NSString *)insightsPrivateKey
                          configuration:(AWSMobileAnalyticsConfiguration *)configuration
                        completionBlock:(AWSInitializationCompletionBlock)completionBlock __attribute__((deprecated));

@end


text:
require 'set'

module Nightwatch
  class Exclude
    def initialize(opts = {})
      classes = opts[:class] || []
      classes = [classes] if classes.is_a? Class

      modules = opts[:module] || []
      modules = [modules] if modules.is_a? Module

      filters = opts[:filter] || []
      @filters = filters.is_a?(Proc) ? [filters] : filters

      @classes = Set.new(classes)
      @modules = Set.new(modules)
    end

    def exception(exception, record)
      klass = exception.class

      if @classes.include?(klass)
        return nil
      end

      if !@modules.empty? && @modules.include?(class_module(klass))
        return nil
      end

      @filters.each do |filter|
        if filter.call(exception)
          return nil
        end
      end

      return exception, record
    end

    private

    def class_module(klass)
      name = klass.name
      separator = name.rindex('::')
      if !separator
        nil
      else
        module_name = name[0...separator]
        Kernel.const_get module_name
      end
    end
  end
end


text:
//
//  toBeSellerViewController.m
//  TYDPB2B
//
//  Created by 张俊松 on 2017/9/20.
//  Copyright © 2017年 泰洋冻品. All rights reserved.
//

#import "toBeSellerViewController.h"
#import "tobeSeller_enterTableViewCell.h"
#import "tobeSeller_subBtnTableViewCell.h"
#import "tobeSeller_addressTableViewCell.h"
#import "tobeSeller_fiveSelectTableViewCell.h"
#import "tobeSeller_bannerImageTableViewCell.h"
#import "signTextViewTableViewCell.h"
#import "TYDP_SelectAddressController.h"
@interface toBeSellerViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,UITextViewDelegate,fstffBtnClickDelegate,tobeSeller_subBtnClickDelegate>
{
MBProgressHUD *_MBHUD;
}
@property (weak, nonatomic) IBOutlet UITableView *myTableView;
@property(nonatomic, strong)UIView *navigationBarView;
@property(nonatomic, strong)NSMutableDictionary *pubDic;
@property(nonatomic, strong)NSMutableArray *selectArr;
@property(nonatomic, strong)NSString * addressString;
@end

@implementation toBeSellerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _pubDic=[NSMutableDictionary new];
    _selectArr=[[NSMutableArray alloc] initWithObjects:@"0",@"0",@"0",@"0",@"0", nil];

    [self setUpNavigationBar ];
    // Do any additional setup after loading the view.
}

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

#pragma mark UITextFieldDelegateMethod
- (void)textFieldDidEndEditing:(UITextField *)textField;
{
    switch (textField.tag) {
        case 2:
            _pubDic[@"shop_name"]=textField.text;
            break;
        case 3:
            _pubDic[@"real_name"]=textField.text;
            break;
        case 4:
            _pubDic[@"email"]=textField.text;
            break;
        case 5:
            _pubDic[@"address"]=textField.text;
            break;
        default:
            break;
    }
}

- (void)textViewDidEndEditing:(UITextView *)textView
{
    _pubDic[@"shop_info"]=textView.text;

}
- (void) fstffClick:(NSInteger)sender
{
    [_selectArr replaceObjectAtIndex:sender withObject:[[_selectArr objectAtIndex:sender] isEqualToString:@"0"]?@"1":@"0"];
    [_myTableView reloadData];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0) {
        return self.view.frame.size.width*222/375;
    }
    else if (indexPath.row<8) {
        if (indexPath.row==6) {
            return 70;
        }
        return 50;
    }
    else if (indexPath.row==8) {
        return 80;
    }
    else
    {
    return 60;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0)
    {
        static NSString * const cellID = @"tobeSeller_bannerImageCell";
        tobeSeller_bannerImageTableViewCell *cell=(tobeSeller_bannerImageTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        cell.bannerImage.image=[UIImage imageNamed:NSLocalizedString(@"bg_enter_en", nil)];
        return cell;
    }
    else if (indexPath.row<6)
    {
        static NSString * const cellID = @"tobeSeller_enterCell";
        tobeSeller_enterTableViewCell *cell=(tobeSeller_enterTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
        switch (indexPath.row) {
            case 1:
                cell.inputTextField.userInteractionEnabled=NO;
                cell.inputTextField.text=_TYDP_UserInfoMD.user_name;
                break;
            case 2:
                cell.inputTextField.userInteractionEnabled=YES;
                cell.inputTextField.placeholder=NSLocalizedString(@"Stall name", nil);
            break;
            case 3:
                cell.inputTextField.userInteractionEnabled=YES;
                cell.inputTextField.placeholder=NSLocalizedString(@"Legal name", nil);
                break;
            case 4:
                cell.inputTextField.userInteractionEnabled=YES;
                cell.inputTextField.placeholder=NSLocalizedString(@"Email", nil);
                break;
            case 5:
                cell.inputTextField.userInteractionEnabled=YES;
                cell.inputTextField.placeholder=NSLocalizedString(@"Company address", nil);
                break;
            default:
                break;
        }
        cell.inputTextField.tag=indexPath.row;
        cell.inputTextField.delegate=self;
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        return cell;
    }

    else if (indexPath.row==6)
    {
        static NSString * const cellID = @"tobeSeller_fiveSelectCell";
        tobeSeller_fiveSelectTableViewCell *cell=(tobeSeller_fiveSelectTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
        cell.delegate=self;
        if ([[_selectArr objectAtIndex:0] isEqualToString:@"0"]) {
            cell.firstImage.image=[UIImage imageNamed:@"no_select"];
        }
        else
        {
        cell.firstImage.image=[UIImage imageNamed:@"yes_select"];
        }

        if ([[_selectArr objectAtIndex:1] isEqualToString:@"0"]) {
            cell.secondImage.image=[UIImage imageNamed:@"no_select"];
        }
        else
        {
            cell.secondImage.image=[UIImage imageNamed:@"yes_select"];
        }

        if ([[_selectArr objectAtIndex:2] isEqualToString:@"0"]) {
            cell.thirdImage.image=[UIImage imageNamed:@"no_select"];
        }
        else
        {
            cell.thirdImage.image=[UIImage imageNamed:@"yes_select"];
        }

        if ([[_selectArr objectAtIndex:3] isEqualToString:@"0"]) {
            cell.forthImage.image=[UIImage imageNamed:@"no_select"];
        }
        else
        {
            cell.forthImage.image=[UIImage imageNamed:@"yes_select"];
        }

        if ([[_selectArr objectAtIndex:4] isEqualToString:@"0"]) {
            cell.fifthImage.image=[UIImage imageNamed:@"no_select"];
        }
        else
        {
            cell.fifthImage.image=[UIImage imageNamed:@"yes_select"];
        }
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        return cell;
    }
    else if (indexPath.row==7)
    {
        static NSString * const cellID = @"tobeSeller_addressCell";
        tobeSeller_addressTableViewCell *cell=(tobeSeller_addressTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
        cell.addressLable.userInteractionEnabled=YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapMethod:)];
        [cell.addressLable addGestureRecognizer:tap];
        cell.addressLable.text=_addressString?_addressString:@"";
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        return cell;
    }
    else if (indexPath.row==8)
    {
        static NSString * const cellID = @"signTextViewCell";
        signTextViewTableViewCell *cell=(signTextViewTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
        cell.signTextView.placeholder=NSLocalizedString(@"About the stall", nil);
        cell.signTextView.text =_pubDic[@"shop_info"];
        cell.signTextView.delegate=self;
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        return cell;
    }
    else
    {
        static NSString * const cellID = @"tobeSeller_subBtnCell";
        tobeSeller_subBtnTableViewCell *cell=(tobeSeller_subBtnTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
        cell.delegate=self;
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        return cell;
    }
}

-(void)tapMethod:(UITapGestureRecognizer *)tap
{
    TYDP_SelectAddressController *selectAddressVC = [TYDP_SelectAddressController new];
    [self addChildViewController:selectAddressVC];
    [selectAddressVC retTextBlock:^(NSString *addressName, NSString *privinceId, NSString *cityId) {
        UILabel *lab = (UILabel *)[self.view viewWithTag:105];
        lab.text = addressName;
        _pubDic[@"province"] = privinceId;
        _pubDic[@"city"] = cityId;
        _addressString=[NSString stringWithFormat:@"%@",addressName];
        [_myTableView reloadData];
        //            NSLog(@"addressName:%@---privinceId:%@---cityId:%@",addressName,privinceId,cityId);
    }];
    selectAddressVC.provinceId = @"2";
    selectAddressVC.cityId = @"52";
    [self.view addSubview:selectAddressVC.view];
    [CurrentWindow addSubview:selectAddressVC.view];
}

- (void) tobeSeller_subBtnClick:(NSInteger)sender
{
    [self creatHUD];
    BOOL isSelect=NO;
    debugLog(@"_selectArr_selectArr:%@",_selectArr);
    _pubDic[@"product"]=@"";
    for (int i =0 ; i<_selectArr.count; i++) {
        NSString * str=[_selectArr objectAtIndex:i];
        if ([str isEqualToString:@"1"]) {
            isSelect=YES;
            switch (i) {
                case 0:
                   _pubDic[@"product"]=[_pubDic[@"product"] isEqualToString:@""]?[NSString stringWithFormat:@"猪"]:[NSString stringWithFormat:@"%@ %@",_pubDic[@"product"],@"猪"];
                    break;
                case 1:
                    _pubDic[@"product"]=[_pubDic[@"product"] isEqualToString:@""]?[NSString stringWithFormat:@"牛"]:[NSString stringWithFormat:@"%@ %@",_pubDic[@"product"],@"牛"];
                    break;
                case 2:
                    _pubDic[@"product"]=[_pubDic[@"product"] isEqualToString:@""]?[NSString stringWithFormat:@"羊"]:[NSString stringWithFormat:@"%@ %@",_pubDic[@"product"],@"羊"];
                    break;
                case 3:
                     _pubDic[@"product"]=[_pubDic[@"product"] isEqualToString:@""]?[NSString stringWithFormat:@"禽类"]:[NSString stringWithFormat:@"%@ %@",_pubDic[@"product"],@"禽类"];
                    break;
                case 4:
                    _pubDic[@"product"]=[_pubDic[@"product"] isEqualToString:@""]?[NSString stringWithFormat:@"水产"]:[NSString stringWithFormat:@"%@ %@",_pubDic[@"product"],@"水产"];
                    break;
                default:
                    break;
            }
        }
        else
        {

        }
    }
//    UITextField *tf1 = (UITextField*)[self.view viewWithTag:1];
//    UITextField *tf2 = (UITextField*)[self.view viewWithTag:2];
//    UITextField *tf3 = (UITextField*)[self.view viewWithTag:3];
//    UITextField *tf4 = (UITextField*)[self.view viewWithTag:4];

    if (_pubDic[@"real_name"]&&_pubDic[@"address"]&&_pubDic[@"shop_name"]&&isSelect&&_pubDic[@"province"]&&_pubDic[@"city"]&&![_pubDic[@"real_name"] isEqualToString:@""]&&![_pubDic[@"address"] isEqualToString:@""]&&![_pubDic[@"shop_name"] isEqualToString:@""]&&![_pubDic[@"province"] isEqualToString:@""]&&![_pubDic[@"city"] isEqualToString:@""]) {

    }
    else
    {
        [self.view Message:NSLocalizedString(@"Please complete required information", nil) HiddenAfterDelay:1.5];
        return;
    }
    NSUserDefaults *userdefaul = [NSUserDefaults standardUserDefaults];
    NSMutableDictionary * params=[[NSMutableDictionary alloc] init];
    NSDictionary *paramDic = @{@"model":@"seller",@"action":@"ruzhu",@"sign":[TYDPManager md5:[NSString stringWithFormat:@"sellerruzhu%@",ConfigNetAppKey]],@"user_id":[userdefaul objectForKey:@"user_id"] };
    [params setValuesForKeysWithDictionary:paramDic];
    [params setValuesForKeysWithDictionary:_pubDic];
    debugLog(@"sendParamas:%@",params);
    [TYDPManager tydp_basePostReqWithUrlStr:PHPURL params:params success:^(id data) {
         debugLog(@"shenqingData:%@",data);
        if ([data[@"error"]isEqualToString:@"0"]) {
            [_MBHUD hide:YES];
            UIWindow *window = [UIApplication sharedApplication].keyWindow;
            [window Message:NSLocalizedString(@"Application under review", nil) HiddenAfterDelay:1.5];
             [self leftItemClicked:nil];

        }else{
            [_MBHUD setLabelText:data[@"message"]];
            [_MBHUD hide:YES afterDelay:1];
            NSLog(@"%@",data[@"message"]);
        }
    } failure:^(TYDPError *error) {
        [_MBHUD setLabelText:[NSString stringWithFormat:@"%@",error]];
        [_MBHUD hide:YES afterDelay:1];
        NSLog(@"error:%@",error);
    }];
}

- (void)creatHUD{
    if (!_MBHUD) {
        _MBHUD = [[MBProgressHUD alloc] init];
        [self.view addSubview:_MBHUD];
    }
    [_MBHUD setLabelText:[NSString stringWithFormat:@"%@",NSLocalizedString(@"Wait a moment",nil)]];
    [_MBHUD setAnimationType:MBProgressHUDAnimationFade];
    [_MBHUD setMode:MBProgressHUDModeText];
    [_MBHUD show:YES];
}

#pragma mark 设置导航栏
- (void)setUpNavigationBar {
    _navigationBarView = [UIView new];
    _navigationBarView.backgroundColor=mainColor;
    _navigationBarView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    [self.view addSubview:_navigationBarView];

    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_navigationBarView addSubview:backButton];
    UIImage *backButtonImage = [UIImage imageNamed:@"product_icon_return"];
    [backButton setImage:backButtonImage forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(leftItemClicked:) forControlEvents:UIControlEventTouchUpInside];
    [backButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_navigationBarView);
        make.centerY.equalTo(_navigationBarView).with.offset(Gap);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(30*(backButtonImage.size.height/backButtonImage.size.width));
    }];

    UILabel *titleLable = [UILabel new];
    [_navigationBarView addSubview:titleLable];
    [titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(_navigationBarView);
        make.centerY.equalTo(_navigationBarView).with.offset(Gap);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(20);
    }];

    [titleLable setText:NSLocalizedString(@"Apply for seller account", nil)];

    titleLable.textColor=[UIColor whiteColor];
    [titleLable setFont:ThemeFont(16)];
    [titleLable setTextAlignment:NSTextAlignmentCenter];

}
- (void)leftItemClicked:(UIBarButtonItem *)item{
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
- (void)viewWillAppear:(BOOL)animated {
    self.navigationController.navigationBarHidden = YES;
    [MobClick beginLogPageView:@"入驻商家界面"];
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"入驻商家界面"];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
package org.apache.hadoop.hbase.shaded.com.google.protobuf;

public final class DurationProto {
  private DurationProto() {}
  public static void registerAllExtensions(
      org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite) registry);
  }
  static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor
    internal_static_google_protobuf_Duration_descriptor;
  static final
    org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_protobuf_Duration_fieldAccessorTable;

  public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\036google/protobuf/duration.proto\022\017google" +
      ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r" +
      "\n\005nanos\030\002 \001(\005B|\n\023com.google.protobufB\rDu" +
      "rationProtoP\001Z*github.com/golang/protobu" +
      "f/ptypes/duration\370\001\001\242\002\003GPB\252\002\036Google.Prot" +
      "obuf.WellKnownTypesb\006proto3"
    };
    org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistry assignDescriptors(
              org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
    internal_static_google_protobuf_Duration_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_google_protobuf_Duration_fieldAccessorTable = new
      org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_protobuf_Duration_descriptor,
        new java.lang.String[] { "Seconds", "Nanos", });
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
package com.jeasonfire.galaxies.desktop;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.jeasonfire.galaxies.Galaxies;

public class DesktopLauncher {
	public static void main (String[] arg) {
		LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
		config.width = 640;
		config.height = 360;
		new LwjglApplication(new Galaxies(), config);
	}
}


text:
package org.unitime.timetable.gwt.client;

import org.unitime.timetable.gwt.client.admin.PasswordPage;
import org.unitime.timetable.gwt.client.admin.ScriptPage;
import org.unitime.timetable.gwt.client.admin.SimpleEditPage;
import org.unitime.timetable.gwt.client.curricula.CurriculaPage;
import org.unitime.timetable.gwt.client.curricula.CurriculumProjectionRulesPage;
import org.unitime.timetable.gwt.client.events.EventResourceTimetable;
import org.unitime.timetable.gwt.client.events.EventRoomAvailability;
import org.unitime.timetable.gwt.client.hql.SavedHQLPage;
import org.unitime.timetable.gwt.client.reservations.ReservationEdit;
import org.unitime.timetable.gwt.client.reservations.ReservationsPage;
import org.unitime.timetable.gwt.client.rooms.RoomFeaturesPage;
import org.unitime.timetable.gwt.client.rooms.RoomGroupsPage;
import org.unitime.timetable.gwt.client.rooms.RoomPicturesPage;
import org.unitime.timetable.gwt.client.rooms.RoomSharingPage;
import org.unitime.timetable.gwt.client.rooms.RoomsPage;
import org.unitime.timetable.gwt.client.rooms.TravelTimes;
import org.unitime.timetable.gwt.client.sectioning.SectioningReports;
import org.unitime.timetable.gwt.client.sectioning.SectioningStatusPage;
import org.unitime.timetable.gwt.client.sectioning.StudentSectioningPage;
import org.unitime.timetable.gwt.client.test.OnlineSectioningTest;
import org.unitime.timetable.gwt.resources.GwtMessages;

import com.google.gwt.user.client.ui.Widget;

/**
 * Register GWT pages here.
 * @author Tomas Muller
 *
 */
public enum Pages {
	curricula(new PageFactory() {
		public Widget create() { return new CurriculaPage(); }
		public String name(GwtMessages messages) { return messages.pageCurricula(); }
		}),
	curprojrules(new PageFactory() {
		public Widget create() { return new CurriculumProjectionRulesPage(); }
		public String name(GwtMessages messages) { return messages.pageCurriculumProjectionRules(); }
		}),
	sectioning(new PageFactory() {
		public Widget create() { return new StudentSectioningPage(StudentSectioningPage.Mode.SECTIONING); }
		public String name(GwtMessages messages) { return messages.pageStudentSchedulingAssistant(); }
		}),
	requests(new PageFactory() {
		public Widget create() { return new StudentSectioningPage(StudentSectioningPage.Mode.REQUESTS); }
		public String name(GwtMessages messages) { return messages.pageStudentCourseRequests(); }
		}),
	admin(new PageFactory() {
		public Widget create() { return new SimpleEditPage(); }
		public String name(GwtMessages messages) { return messages.pageAdministration(); }
		}),
	events(new PageFactory() {
		public Widget create() { return new EventResourceTimetable(EventResourceTimetable.PageType.Events); }
		public String name(GwtMessages messages) { return messages.pageEvents(); }
		}),
	timetable(new PageFactory() {
		public Widget create() {return new EventResourceTimetable(EventResourceTimetable.PageType.Timetable); }
		public String name(GwtMessages messages) { return messages.pageEventTimetable(); }
		}),
	roomtable(new PageFactory() {
		public Widget create() { return new EventResourceTimetable(EventResourceTimetable.PageType.RoomTimetable); }
		public String name(GwtMessages messages) { return messages.pageRoomTimetable(); }
		}),
	reservation(new PageFactory() {
		public Widget create() { return new ReservationEdit(true); }
		public String name(GwtMessages messages) { return messages.pageEditReservation(); }
		}),
	reservations(new PageFactory() {
		public Widget create() { return new ReservationsPage(); }
		public String name(GwtMessages messages) { return messages.pageReservations(); }
		}),
	sectioningtest(new PageFactory() {
		public Widget create() { return new OnlineSectioningTest(); }
		public String name(GwtMessages messages) { return messages.pageOnlineStudentSectioningTest(); }
		}),
	hql(new PageFactory() {
		public Widget create() { return new SavedHQLPage(); }
		public String name(GwtMessages messages) { return messages.pageCourseReports(); }
		}),
	onlinesctdash(new PageFactory() {
		public Widget create() { return new SectioningStatusPage(true); }
		public String name(GwtMessages messages) { return messages.pageOnlineStudentSchedulingDashboard(); }
		}),
	batchsctdash(new PageFactory() {
		public Widget create() { return new SectioningStatusPage(false); }
		public String name(GwtMessages messages) { return messages.pageStudentSectioningDashboard(); }
		}),
	traveltimes(new PageFactory() {
		public Widget create() { return new TravelTimes(); }
		public String name(GwtMessages messages) { return messages.pageTravelTimes(); }
		}),
	classes(new PageFactory() {
		public Widget create() { return new EventResourceTimetable(EventResourceTimetable.PageType.Classes); }
		public String name(GwtMessages messages) { return messages.pageClasses(); }
		}),
	exams(new PageFactory() {
		public Widget create() { return new EventResourceTimetable(EventResourceTimetable.PageType.Exams); }
		public String name(GwtMessages messages) { return messages.pageExaminations(); }
		}),
	personal(new PageFactory() {
		public Widget create() { return new EventResourceTimetable(EventResourceTimetable.PageType.Personal); }
		public String name(GwtMessages messages) { return messages.pagePersonalTimetable(); }
		}),
	roomavailability(new PageFactory() {
		public Widget create() { return new RoomSharingPage(); }
		public String name(GwtMessages messages) { return messages.pageEditRoomAvailability(); }
		}),
	scripts(new PageFactory() {
		public Widget create() { return new ScriptPage(); }
		public String name(GwtMessages messages) { return messages.pageScripts(); }
		}),
	availability(new PageFactory() {
		public Widget create() { return new EventRoomAvailability(); }
		public String name(GwtMessages messages) { return messages.pageEventRoomAvailability(); }
		}),
	password(new PageFactory() {
		public Widget create() { return new PasswordPage(); }
		public String name(GwtMessages messages) { return messages.pageChangePassword(); }
		}),
	sctreport(new PageFactory() {
		public Widget create() { return new SectioningReports(false); }
		public String name(GwtMessages messages) { return messages.pageBatchSectioningReports(); }
		}),
	onlinereport(new PageFactory() {
		public Widget create() { return new SectioningReports(true); }
		public String name(GwtMessages messages) { return messages.pageOnlineSectioningReports(); }
		}),
	roompictures(new PageFactory() {
		public Widget create() { return new RoomPicturesPage(); }
		public String name(GwtMessages messages) { return messages.pageRoomPictures(); }
		}),
	rooms(new PageFactory() {
		public Widget create() { return new RoomsPage(); }
		public String name(GwtMessages messages) { return messages.pageRooms(); }
		}),
	roomgroups(new PageFactory() {
		public Widget create() { return new RoomGroupsPage(); }
		public String name(GwtMessages messages) { return messages.pageRoomGroups(); }
		}),
	roomfeatures(new PageFactory() {
		public Widget create() { return new RoomFeaturesPage(); }
		public String name(GwtMessages messages) { return messages.pageRoomFeatures(); }
		}),
	;

	private PageFactory iFactory;

	Pages(String oldTitle, PageFactory factory) { iFactory = factory; }
	Pages(PageFactory factory) { iFactory = factory; }
	public String name(GwtMessages messages) { return iFactory.name(messages); }
	public Widget widget() { return iFactory.create(); }

	public interface PageFactory {
		Widget create();
		String name(GwtMessages messages);
	}
}


text:
<?php

namespace Coduo\PHPMatcher\Matcher;

use LSS\XML2Array;

class XmlMatcher extends Matcher
{
    /**
     * @var
     */
    private $matcher;

    /**
     * @param ValueMatcher $matcher
     */
    public function __construct(ValueMatcher $matcher)
    {
        $this->matcher = $matcher;
    }

    /**
     * {@inheritDoc}
     */
    public function match($value, $pattern)
    {
        if (!is_string($value) || !$this->isValidXml($value) || !$this->isValidXml($pattern)) {
            return false;
        }

        $arrayValue = XML2Array::createArray($value);
        $arrayPattern = XML2Array::createArray($pattern);

        $match = $this->matcher->match($arrayValue, $arrayPattern);
        if (!$match) {
            $this->error = $this->matcher->getError();
            return false;
        }

        return true;
    }

    /**
     * {@inheritDoc}
     */
    public function canMatch($pattern)
    {
        if (!is_string($pattern)) {
            return false;
        }

        return $this->isValidXml($pattern);
    }

    private function isValidXml($string)
    {
        $xml = @simplexml_load_string($string);

        if (!$xml instanceof \SimpleXMLElement) {

            return false;
        }

        return true;
    }
}


text:
package woofworks.repository;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.internal.CriteriaImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * Created by Tim on 11-Nov-16.
 */
@Repository(value = "baseRepository")
@Transactional
public class BaseRepository {
    protected transient Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private SessionFactory sessionFactory;

    protected Session getSession() {
        return sessionFactory.getCurrentSession();
    }

    /**
     * Populates the parameter values into the query
     *
     * @param query
     * @param parameterValues contains the HQL keyword as the key, the paramter value as the map value
     */
    protected void populateParameterValues(Query query, Map<String, Object> parameterValues) {
        if (parameterValues.isEmpty() == false) {
            for (String key : parameterValues.keySet()) {
                Object value = parameterValues.get(key);

                if (Collection.class.isAssignableFrom(value.getClass())) {
                    Collection<?> collection = (Collection<?>) value;
                    query.setParameterList(key, collection.toArray());
                } else {
                    query.setParameter(key, value);
                }
            }
        }
    }

    /**
     * Creates a hibernate query based on the HQL string
     *
     * @param hql
     * @return
     */
    protected Query createQuery(String hql) {
        return getSession().createQuery(hql);
    }

    /**
     * Saves the specified entity
     *
     * @param t
     */
    public <T> void save(T t) {
        getSession().save(t);
    }

    /**
     * Saves the updates entity
     *
     * @param t
     */
    public <T> void update(T t) {
        getSession().update(t);
    }

    /**
     * Deletes the specified entity
     *
     * @param t
     */
    public <T> void delete(T t) {
        getSession().delete(t);
    }

    /**
     * Retrieves the object with the specified id
     *
     * @param cls
     * @param id
     * @return
     */
    public <T> T get(Class<T> cls, Serializable id) {
        return getSession().get(cls, id);
    }

    @SuppressWarnings("unchecked")
    public <T extends Object> List<T> listByDetachedCriteria(DetachedCriteria detachedCriteria) {
        String test = ((CriteriaImpl) detachedCriteria.getExecutableCriteria(getSession()))
                .getEntityOrClassName();
        try {
            List<T> results = detachedCriteria.getExecutableCriteria(getSession()).list();

            logger.debug("List by detached criteria for " + test + ", result size: "
                    + results.size());
            return results;
        } catch (Exception re) {
            logger.error("List by detached criteria failed", re);
            throw new RuntimeException(re);
        }
    }

    public <T> Collection<T> getAll(Class<T> c) {
        DetachedCriteria criteria = DetachedCriteria.forClass(c);
        return listByDetachedCriteria(criteria);
    }
}


text:
var container = element(by.css('.custom-comparator'));
var names = container.all(by.repeater('friends').column('friend.name'));

it('should sort friends by favorite letter (in correct alphabetical order)', function() {
  expect(names.get(0).getText()).toBe('John');
  expect(names.get(1).getText()).toBe('Adam');
  expect(names.get(2).getText()).toBe('Mike');
  expect(names.get(3).getText()).toBe('Mary');
  expect(names.get(4).getText()).toBe('Julie');
});


text:
package com.hazelcast.cp.internal.session;

import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import static com.hazelcast.test.Accessors.getNodeEngineImpl;
import static org.mockito.Mockito.spy;

@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelJVMTest.class})
public class SessionManagerServiceTest extends AbstractProxySessionManagerTest {

    @Override
    protected ProxySessionManagerService getSessionManager() {
        ProxySessionManagerService service = getNodeEngineImpl(members[0]).getService(ProxySessionManagerService.SERVICE_NAME);
        return spy(service);
    }
}


text:
#include "Basic/UtilMath.h"
#include "Basic/UtilTime.h"
#include "Basic/WeatherStation.h"
#include "Simulation/WeatherGeneratorKernel.h"

using namespace WBSF::WEATHER;
using namespace WBSF::NORMALS_DATA;
using namespace WBSF::HOURLY_DATA;
using namespace std;

namespace WBSF
{

	//////////////////////////////////////////////////////////////////////
	// Construction/Destruction
	//////////////////////////////////////////////////////////////////////
	CWeatherGeneratorKernel::CWeatherGeneratorKernel(CWVariables variables)
	{
		m_variables = variables;

		ResetDeltaEpsilon();
	}

	CWeatherGeneratorKernel::~CWeatherGeneratorKernel()
	{

	}

	//****************************************************************************
	// Summary:		ResetDeltaEpsilon
	//
	// Description: Set Delta[3] and Epsilon[3] to zero
	//
	// Input:
	//
	// Output:
	//
	// Note:		When DeltaEpsilon Is reset, these members will be init the next
	//				time the "Generate" method will be call
	//****************************************************************************
	void CWeatherGeneratorKernel::ResetDeltaEpsilon()
	{
		for (int i = 0; i < 3; i++)
		{
			m_delta[i] = 0;
			m_epsilon[i] = 0;
		}
	}

	//****************************************************************************
	// Summary:		Set the normal to the Kernel.
	//
	// Description: Set and adjust normal
	//
	// Input:		CNormalsData: the normals
	//
	// Output:
	//
	// Note:		We adjust monthly temperature to have better linear interpolation
	//****************************************************************************
	void CWeatherGeneratorKernel::SetNormals(const CNormalsData& normals)
	{
		m_normals = normals;
		m_normals.AdjustMonthlyMeans();
	}

	//****************************************************************************
	// Summary:		Generate
	//
	// Description: simulate daily weather for one year
	//
	// Input:
	//
	// Output:		CDailyData& dailyData: daily output
	//
	// Note:		We used the normals to simulate daily
	//****************************************************************************
	void CWeatherGeneratorKernel::Generate(CWeatherYear& dailyData)
	{

		//Daily Generator Loop
		//randomization for temperature
		m_rand.Randomize(m_seed[H_TAIR]);

		//temperature part
		if (m_variables[H_TMIN] || m_variables[H_TAIR] || m_variables[H_TMAX])
		{
			ASSERT(m_normals.GetVariables()[H_TMIN]);
			ASSERT(m_normals.GetVariables()[H_TMAX]);

			//If delta and epsilon isn't init, we init it
			if (!IsDeltaEpsilonInit())
				InitDeltaEpsilon();

			for (size_t m = 0; m < 12; m++) //loop over 12 months
			{
				double e_min[31] = { 0 };
				double e_max[31] = { 0 };

				//generate daily fluctuation for Tmin and Tmax
				GetRandomTraces(e_min, e_max, m);

				for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
				{
					//Get today's temperature
					double tmin = m_normals.Interpole(m, d, TMIN_MN) + e_min[d];
					double tmax = m_normals.Interpole(m, d, TMAX_MN) + e_max[d];
					ASSERT(tmin>-99 && tmin<99);
					ASSERT(tmax>-99 && tmax<99);

					if (tmin > tmax)
						Switch(tmin, tmax);

					_ASSERTE(tmin < tmax);
					dailyData[m][d][H_TMIN] = tmin;
					dailyData[m][d][H_TAIR] = (tmin + tmax) / 2;
					dailyData[m][d][H_TMAX] = tmax;
				} // for all days in the month
			}//for all months
		}

		//randomization for precipitation
		m_rand.Randomize(m_seed[H_PRCP]);
		//precipitation part
		if (m_variables[H_PRCP])
		{
			ASSERT(m_normals.GetVariables()[H_PRCP]);
			//copy normals and make random adjustment for precipitation
			CNormalsData normalTmp = m_normals;
			RandomizeNormals(normalTmp);

			for (int m = 0; m < 12; m++)
			{
				//distribute month's precipitation
				DailyPrecipitation(m, normalTmp, dailyData);
			}
		}

		//randomization for humidity
		m_rand.Randomize(m_seed[H_RELH]);

		//relative humidity part
		if (m_variables[H_TDEW] || m_variables[H_RELH])
		{
			//if there is no humidity from database, they will be complete later in the process
			if (m_normals.GetVariables()[H_RELH])
			{

				for (size_t m = 0; m < 12; m++)
				{
					double mean = m_normals[m][RELH_MN] / 100;
					double variance = Square(m_normals[m][RELH_SD] / 100);

					double alpha = mean * ((mean*(1 - mean) / variance) - 1);
					double beta = (1 - mean)*((mean*(1 - mean) / variance) - 1);

					for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
					{
						_ASSERTE(dailyData[m][d][H_TMIN].IsInit());
						_ASSERTE(dailyData[m][d][H_TMAX].IsInit());

						//NOTE: old beta distribution have a bias of 1%, the new don't, RSA 28/07/2012
						double Hr = m_rand.RandBeta(alpha, beta) * 100;
						ASSERT(Hr >= 0 && Hr <= 100);
						double Tmean = (dailyData[m][d][H_TMIN][MEAN] + dailyData[m][d][H_TMAX][MEAN]) / 2;

						dailyData[m][d][H_RELH] = Hr;
						dailyData[m][d][H_TDEW] = Hr2Td(Tmean, Hr);
					}
				}
			}
		}

		//randomization for wind speed
		m_rand.Randomize(m_seed[H_WNDS]);
		int sw1 = 0;
		int sw2 = 0;
		//wind speed part
		if (m_variables[H_WNDS] || m_variables[H_WND2])
		{
			ASSERT(m_normals.GetVariables()[H_WNDS]);

			for (int m = 0; m < 12; m++)
			{
				//WARNING : the mean and maximum of wind speed have been replaced, RSA 26/07/2012
				//calibrate on 140 station with wind speed (missing less then 20 days) in Canada from 1981-2010
				double windSpeedMean = m_normals[m][WNDS_MN];
				double windSpeedSD = m_normals[m][WNDS_SD];
				double dailyPpt = max(0.1f, m_normals[m][PRCP_TT]) / GetNbDayPerMonth(m);
				double WSMax = exp(1.43319 + 0.74865*windSpeedMean + 0.71983*windSpeedSD);//*1.25;

				for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
				{
					ASSERT(dailyData[m][d][H_PRCP][SUM] > MISSING);

					double Rp = dailyData[m][d][H_PRCP][SUM] / dailyPpt;

					static const double A = 0.9597;
					static const double B = 0.1371;
					static const double C = 0.8853;

					double WS = m_rand.RandUnbiasedLogNormal(windSpeedMean, windSpeedSD)*(A + B*log(Rp + C));

					if (WS > WSMax)
					{
						while (WS<exp(windSpeedMean) || WS > WSMax)
							WS = m_rand.RandUnbiasedLogNormal(windSpeedMean, windSpeedSD)*(A + B*log(Rp + C));
					}

					if (WS < 0.1)
						WS = 0;

					if (m_variables[H_WNDS])
						dailyData[m][d][H_WNDS] = WS;

					//Wnd2 from WndS
					if (m_variables[H_WND2])
						dailyData[m][d][H_WND2] = WS*4.87 / log(67.8 * 10 - 5.42);//wind speed at 2 meters
				}
			}
		}

		//set the day 365 for leap year : by RSA
		if (dailyData.GetTRef().IsLeap())
			dailyData[FEBRUARY][DAY_29] = dailyData[FEBRUARY][DAY_28];
	}

	//****************************************************************************
	// Summary:		RandomizeNormals
	//
	// Description: Randomize only precipitation in normals to have year variation
	//
	// Input:		CNormalsData& normalTmp: the normal to randomize
	//
	// Output:		CNormalsData& normalTmp: randomized normals
	//
	// Note:
	//****************************************************************************
	void CWeatherGeneratorKernel::RandomizeNormals(CNormalsData& normalTmp)
	{

		for (int i = 0; i < 12; i++)
		{
			// Total monthly precipitation
			//Weibull Nu and Lambda, in p = 1-exp(-((Weibull/Lambda)^Nu)) Régnière (2007) Eq. [11]
			//which inverted gives
			//Weibull = Lambda*(-ln((1-p)^(1/Nu))...

			double Weibull = 1;
			//new equations and parameters for high sp values (29/10/2006)
			double Nu = 0.9277 / normalTmp[i][PRCP_SD] + 0.0752 / (normalTmp[i][PRCP_SD] * normalTmp[i][PRCP_SD]); //Régnière (2007) Eq. [12]
			double Lambda = 1.1174* pow(1 - exp(-4.4107*Nu), 7.5088); //Régnière (2007) Eq. [13]

			//Random number in [0,1[
			double p_rand = m_rand.Randv();
			//Compute a Weibull-distributed variate.
			Weibull = min(25.0, max(0.0, (pow(-log(1.0 - p_rand), 1.0 / Nu)*Lambda)));

			normalTmp[i][PRCP_TT] *= float(Weibull);
		}
	}

	//****************************************************************************
	// Summary:		InitDeltaEpsilon
	//
	// Description: Initialize delta and epsilon to have a starting point of temperature variation
	//
	// Input:
	//
	// Output:
	//
	// Note:		m_delta[3] and m_epsilon[3] are init
	//****************************************************************************
	void CWeatherGeneratorKernel::InitDeltaEpsilon()
	{
		ResetDeltaEpsilon();

		size_t month = DECEMBER;
		const double sigma_delta = m_normals[month][DEL_STD];
		const double sigma_epsilon = m_normals[month][EPS_STD];
		const double A1 = m_normals[month][TACF_A1];
		const double A2 = m_normals[month][TACF_A2];
		const double B1 = m_normals[month][TACF_B1];
		const double B2 = m_normals[month][TACF_B2];

		double sigma_gamma = 0;
		double sigma_zeta = 0;
		double P = m_normals[month].GetP(sigma_gamma, sigma_zeta);
		ASSERT(!_isnan(sigma_gamma));
		ASSERT(!_isnan(sigma_zeta));
		//Régnière (2007) Eq [3] in standard 2nd order autoregressive process formulation
		//Initialize time series
		for (size_t i = 0; i < 50; i++)
		{
			double gamma = m_rand.RandNormal(0, sigma_gamma);
			double zeta = m_rand.RandNormal(0, sigma_zeta);

			m_delta[2] = A1*m_delta[1] + A2*m_delta[0] + gamma;
			m_epsilon[2] = (B1*m_epsilon[1] + B2*m_epsilon[0] + sigma_epsilon / sigma_delta * (P*gamma + (1 - abs(P))*zeta));

			//Shift time series
			m_delta[0] = m_delta[1];
			m_delta[1] = m_delta[2];
			m_epsilon[0] = m_epsilon[1];
			m_epsilon[1] = m_epsilon[2];
		}

	}

	//****************************************************************************
	// Summary:		GetRandomTraces
	//
	// Description: Get a random minimum and maximum series of temperature for a month
	//
	// Input:		int month
	//
	// Output:		double e_min[31], double e_max[31]
	//
	// Note:		Used normal
	//****************************************************************************
	void CWeatherGeneratorKernel::GetRandomTraces(double e_min[31], double e_max[31], size_t month)
	{
		const double sigma_delta = m_normals[month][DEL_STD];
		const double sigma_epsilon = m_normals[month][EPS_STD];
		const double A1 = m_normals[month][TACF_A1];
		const double A2 = m_normals[month][TACF_A2];
		const double B1 = m_normals[month][TACF_B1];
		const double B2 = m_normals[month][TACF_B2];

		double sigma_gamma = 0;
		double sigma_zeta = 0;
		double P = m_normals[month].GetP(sigma_gamma, sigma_zeta);
		ASSERT(!_isnan(sigma_zeta));
		//Régnière (2007) Eq [3] in standard 2nd order autoregressive process formulation
		//Initialize time series

		double LimitTmin = 3.9*sigma_delta;
		double LimitTmax = 3.9*sigma_epsilon;
		for (size_t j = 0; j < GetNbDayPerMonth(month); j++)
		{
			double gamma = m_rand.RandNormal(0, sigma_gamma);
			double zeta = m_rand.RandNormal(0, sigma_zeta);

			//Régnière (2007) Eq [3] in standard 2nd order autoregressive process formulation
			m_delta[2] = A1*m_delta[1] + A2*m_delta[0] + gamma;
			m_epsilon[2] = (B1*m_epsilon[1] + B2*m_epsilon[0] + sigma_epsilon / sigma_delta * (P*gamma + (1 - abs(P))*zeta));

			//store deviations
			e_min[j] = min(LimitTmin, max(-LimitTmin, m_delta[2]));
			e_max[j] = min(LimitTmax, max(-LimitTmax, m_epsilon[2]));

			//Shift time series
			m_delta[0] = m_delta[1];
			m_delta[1] = m_delta[2];
			m_epsilon[0] = m_epsilon[1];
			m_epsilon[1] = m_epsilon[2];
		}

		//now we can limit more
		LimitTmin = 2.33*sigma_delta;
		LimitTmax = 1.96*sigma_epsilon;
		for (size_t j = 0; j < GetNbDayPerMonth(month); j++)
		{
			e_min[j] = min(LimitTmin, max(-LimitTmin, e_min[j]));
			e_max[j] = min(LimitTmax, max(-LimitTmax, e_max[j]));
		}

	}

	//****************************************************************************
	// Summary:		DailyPrecipitation
	//
	// Description: Get a random series of precipitation for a month
	//
	// Input:		int month, CNormalsData& normalTmp,
	//
	// Output:		CDailyData& dailyData
	//
	// Note:		We used normalTmp to generate precipitation
	//****************************************************************************
	void CWeatherGeneratorKernel::DailyPrecipitation(int m, const CNormalsData& normalTmp, CWeatherYear& dailyData)
	{
		//JR JAN 2001 Obtain the month's random numbers, and make sure temperature traces add-up to 0
		double p_test[31] = { 0 };
		double epsilon_prec[31] = { 0 };
		InitRandomNumber(m, p_test, epsilon_prec);

		//		Zero-initialize daily precipitation for the month
		for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
			dailyData[m][d][H_PRCP] = 0;

		//Only in months with non-trace rainfall
		if (normalTmp[m][PRCP_TT] > 0.1)
		{
			//	determine Sp
			double Sp = normalTmp[m][PRCP_SD];

			// variable to know the day when the probability is maximum
			double maxPprecip = 0;
			size_t dayMaxPprecip = 0;

			// vector of weights of probability
			double Sum_x = 0;
			std::vector<double> weightOfPpt;
			weightOfPpt.resize(GetNbDayPerMonth(m));

			for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
			{
				ASSERT(dailyData[m][d][H_TMIN].IsInit());
				ASSERT(dailyData[m][d][H_TMAX].IsInit());

				//		Get daily prob of precipitation given min, max, tot_precip of the month and the Sp
				double Pprecip = m_AP.GetPprecip(dailyData[m][d][H_TMIN][MEAN], dailyData[m][d][H_TMAX][MEAN], normalTmp[m][PRCP_TT], Sp);

				//Find the day when the probability of rain is the highest
				if (Pprecip > maxPprecip)
				{
					maxPprecip = Pprecip;
					dayMaxPprecip = d;
				}

				//test to know if there is precipitation
				//p_test is a [0,1] U-random number
				if (p_test[d] > Pprecip)
				{
					Pprecip = 0;
				}

				//if they is a probability of precipitation,
				//transform probability of precipitation to a weight of precipitation.
				//epsilon_prec[j] is a [0, 1] U-random number
				if (Pprecip > 0)
				{
					weightOfPpt[d] = m_AP.XfromP(Sp, epsilon_prec[d]);
					Sum_x += weightOfPpt[d];
				}
			}

			//if we have rain
			if (Sum_x > 0)
			{
				//compute precipitation
				for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
				{
					//int date = d0 + j;

					dailyData[m][d][H_PRCP] = float(weightOfPpt[d] / Sum_x * normalTmp[m][PRCP_TT]);

					//eliminate trace
					if (dailyData[m][d][H_PRCP][SUM] < 0.1f)
						dailyData[m][d][H_PRCP] = 0.0f;
				}
			}
			else
			{
				//if they is no precipitation (Sum_x=0), we force precipitation on day of max likelihood
				dailyData[m][dayMaxPprecip][H_PRCP] = normalTmp[m][PRCP_TT];
			}
		}
	}

	// JR JAN 2001 Set new variables, especially: store month's random trace
	void CWeatherGeneratorKernel::InitRandomNumber(int m, double p_test[31], double epsilon_prec[31])
	{
		for (size_t d = 0; d < GetNbDayPerMonth(m); d++)
		{
			p_test[d] = m_rand.Randu();
			epsilon_prec[d] = m_rand.Randu();
		}
	}

}


text:
from __future__ import absolute_import
from django.utils import unittest
from ..options import *
from collections import OrderedDict

class RGBColorTestCase(unittest.TestCase):

    def test_rgbcolor(self):
        self.assertEqual("%s" % RGBColor(255, 0, 255), '{rgb 1.0 0.0 1.0}')
        self.assertEqual("%s" % RGBColor(100, 100, 100), '{rgb 0.392156862745 0.392156862745 0.392156862745}')

class MultipleOptionsTestCase(unittest.TestCase):

    def test_list(self):
        d = OrderedDict()
        d['position'] = 'center'
        d['fillcolor'] = RGBColor(255, 0, 255)

        self.assertEqual(
            "%s" % MultipleOptions([d, d]),
            '{{position=center fillcolor={rgb 1.0 0.0 1.0}} {position=center fillcolor={rgb 1.0 0.0 1.0}}}'
        )

class FitTextlineTestCase(unittest.TestCase):

    def test_fittextline(self):
        d = OrderedDict()
        d['position'] = 'center'
        d['fillcolor'] = '#414141'

        self.assertEqual(
            "%s" % FitTextline(d),
            '{position=center fillcolor=#414141}'
        )

        d = OrderedDict()
        d['position'] = 'center'
        d['fillcolor'] = RGBColor(255, 0, 255)

        self.assertEqual(
            "%s" % FitTextline(d),
            '{position=center fillcolor={rgb 1.0 0.0 1.0}}'
        )


text:
AMELIAS

Do NFTs have the power to right a historical wrong? The Amelia Pelaez Foundation is about to find out.

"Amelias" is an NFT project that aims to use the power of NFTs to liberate, in more ways than one, the art of Amelia Pelaez from the Cuban government. The drop will happen December 1, 2021 at 6pm EST. The NFT collection will feature 20 Amelias that will each be 1 of 50 for a total collection of 1,000.

countdown to Amelias NFT drop

                      00

days

                      00

hours

                      00

minutes

                      00

seconds


text:
namespace VinylC.Web.MVC
{
    using System.Web.Mvc;
    using System.Web.Optimization;
    using System.Web.Routing;
    using Common.Constants;

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            ViewEnginesConfig.RegisterViewEngines();
            AutoMapperConfig.RegisterMappings(Assemblies.MVCProject);
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DatabaseConfig.Initialize();
        }

        protected void Application_EndRequest()
        {
        }
    }
}


text:
#include "system_wrappers/include/atomic32.h"

#include <assert.h>

#include "common_types.h"  // NOLINT(build/include)

namespace webrtc {

Atomic32::Atomic32(int32_t initial_value) : value_(initial_value) {}

Atomic32::~Atomic32() {}

int32_t Atomic32::operator++() {
  return ++value_;
}

int32_t Atomic32::operator--() {
  return --value_;
}

int32_t Atomic32::operator+=(int32_t value) {
  return value_ += value;
}

int32_t Atomic32::operator-=(int32_t value) {
  return value_ -= value;
}

bool Atomic32::CompareExchange(int32_t new_value, int32_t compare_value) {
  return value_.compare_exchange_strong(compare_value, new_value);
}

int32_t Atomic32::Value() const {
  return value_.load();
}

}  // namespace webrtc