text:
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
using System.Runtime;
using System.Threading.Tasks;
using Xunit;

namespace System.Tests
{
    public class GCExtendedTests : RemoteExecutorTestBase
    {
        private const int TimeoutMilliseconds = 10 * 30 * 1000; //if full GC is triggered it may take a while

        [Fact]
        [OuterLoop]
        public static void GetGeneration_WeakReference()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
                {

                    Func<WeakReference> getweakref = delegate ()
                    {
                        Version myobj = new Version();
                        var wkref = new WeakReference(myobj);

                        Assert.True(GC.TryStartNoGCRegion(1024));
                        Assert.True(GC.GetGeneration(wkref) >= 0);
                        Assert.Equal(GC.GetGeneration(wkref), GC.GetGeneration(myobj));
                        GC.EndNoGCRegion();

                        myobj = null;
                        return wkref;
                    };

                    WeakReference weakref = getweakref();
                    Assert.True(weakref != null);
#if !DEBUG
                    GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true);
                    Assert.Throws<ArgumentNullException>(() => GC.GetGeneration(weakref));
#endif
                    return SuccessExitCode;
                }, options).Dispose();

        }

        [Fact]
        public static void GCNotificationNegTests()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(-1, -1));
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(100, -1));
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(-1, 100));

            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(10, -1));
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(-1, 10));
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(100, 10));
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.RegisterForFullGCNotification(10, 100));

            Assert.Throws<ArgumentOutOfRangeException>(() => GC.WaitForFullGCApproach(-2));
            Assert.Throws<ArgumentOutOfRangeException>(() => GC.WaitForFullGCComplete(-2));
        }

        [Theory]
        [InlineData(true, -1)]
        [InlineData(false, -1)]
        [InlineData(true, 0)]
        [InlineData(false, 0)]
        [InlineData(true, 100)]
        [InlineData(false, 100)]
        [InlineData(true, int.MaxValue)]
        [InlineData(false, int.MaxValue)]
        [OuterLoop]
        public static void GCNotificationTests(bool approach, int timeout)
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
                {
                    TestWait(approach, timeout);
                    return SuccessExitCode;
                }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_EndNoGCRegion_ThrowsInvalidOperationException()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
                {
                    Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
                    return SuccessExitCode;
                }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_StartWhileInNoGCRegion()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024));
                Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(1024));

                Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());

                return SuccessExitCode;
            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_StartWhileInNoGCRegion_BlockingCollection()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, true));
                Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(1024, true));

                Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());

                return SuccessExitCode;
            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_StartWhileInNoGCRegion_LargeObjectHeapSize()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, 1024));
                Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(1024, 1024));

                Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());

                return SuccessExitCode;
            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_StartWhileInNoGCRegion_BlockingCollectionAndLOH()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, 1024, true));
                Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(1024, 1024, true));

                Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());

                return SuccessExitCode;
            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_SettingLatencyMode_ThrowsInvalidOperationException()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, true));
                Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
                Assert.Throws<InvalidOperationException>(() => GCSettings.LatencyMode = GCLatencyMode.LowLatency);

                GC.EndNoGCRegion();

                return SuccessExitCode;
            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_SOHSize()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
                {

                    Assert.True(GC.TryStartNoGCRegion(1024));
                    Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
                    GC.EndNoGCRegion();

                    return SuccessExitCode;

                }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_SOHSize_BlockingCollection()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, true));
                Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
                GC.EndNoGCRegion();

                return SuccessExitCode;

            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_SOHSize_LOHSize()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, 1024));
                Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
                GC.EndNoGCRegion();

                return SuccessExitCode;

            }, options).Dispose();
        }

        [Fact]
        [OuterLoop]
        public static void TryStartNoGCRegion_SOHSize_LOHSize_BlockingCollection()
        {
            RemoteInvokeOptions options = new RemoteInvokeOptions();
            options.TimeOut = TimeoutMilliseconds;
            RemoteInvoke(() =>
            {
                Assert.True(GC.TryStartNoGCRegion(1024, 1024, true));
                Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
                GC.EndNoGCRegion();

                return SuccessExitCode;

            }, options).Dispose();
        }

        public static void TestWait(bool approach, int timeout)
        {
            GCNotificationStatus result = GCNotificationStatus.Failed;
            Thread cancelProc = null;

            // Since we need to test an infinite (or very large) wait but the API won't return, spawn off a thread which
            // will cancel the wait after a few seconds
            //
            bool cancelTimeout = (timeout == -1) || (timeout > 10000);

            GC.RegisterForFullGCNotification(20, 20);

            try
            {
                if (cancelTimeout)
                {
                    cancelProc = new Thread(new ThreadStart(CancelProc));
                    cancelProc.Start();
                }

                if (approach)
                    result = GC.WaitForFullGCApproach(timeout);
                else
                    result = GC.WaitForFullGCComplete(timeout);
            }
            catch (Exception e)
            {
                Assert.True(false, $"({approach}, {timeout}) Error - Unexpected exception received: {e.ToString()}");
            }
            finally
            {
                if (cancelProc != null)
                    cancelProc.Join();
            }

            if (cancelTimeout)
            {
                Assert.True(result == GCNotificationStatus.Canceled, $"({approach}, {timeout}) Error - WaitForFullGCApproach result not Cancelled");
            }
            else
            {
                Assert.True(result == GCNotificationStatus.Timeout, $"({approach}, {timeout}) Error - WaitForFullGCApproach result not Timeout");
            }
        }

        public static void CancelProc()
        {
            Thread.Sleep(500);
            GC.CancelFullGCNotification();
        }
    }
}


text:
package main

import (
	_ "regexp" //makes things work with go -race
	"testing"

	"fmt"
	"net/http"

	_ "net/http/pprof"

	log "github.com/Sirupsen/logrus"
	"github.com/bmizerany/assert"
)

func init() {
	initLog(log.DebugLevel)
}

func TestSerialize(t *testing.T) {
	for i := 1; i < 100000; i++ {
		read, err := readSequence(writeSequence(int64(i)))
		assert.T(t, err == nil, err)
		assert.T(t, read == int64(i))
	}
}

func TestEncodeDecodeEvent(t *testing.T) {
	event := &Event{Channel: "test123", Body: []byte("test123")}
	encoded, err := encodeEvent(event)
	assert.T(t, err == nil, err)
	decoded, err := decodeEvent(encoded)
	assert.T(t, err == nil, err)
	assert.T(t, event.Channel == decoded.Channel, fmt.Sprintf("%v+ %v+", event, decoded))
	assert.T(t, string(event.Body) == string(decoded.Body), fmt.Sprintf("%v+ %v+", event, decoded))
}

func TestOpenCloseStore(t *testing.T) {

	go func() {
		log.Debugf("Error creating http server %v\n", http.ListenAndServe("localhost:6060", nil))
	}()
	for i := 0; i < 100; i++ {
		store, err := OpenStore("test.db")
		assert.T(t, err == nil, err)
		init := store.getWritePointer()
		acks := make(chan bool)
		for i := 0; i < 100; i++ {
			store.eventsInChannel() <- &EventIn{event: &Event{Channel: "test", Body: []byte("BODY-TestOpenCloseStore")}, saved: acks}
			<-acks
		}
		curr := store.getWritePointer()
		assert.Equal(t, init+100, curr)
		store.Close()

		store, err = OpenStore("test.db")
		assert.T(t, err == nil, err)
		init = store.getWritePointer()
		assert.Equal(t, init, curr)
		store.Close()
	}
}

func BenchmarkStoreEventsInBolt(b *testing.B) {
	store, _ := OpenStore("test.db")
	acks := make(chan bool)
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		store.eventsInChannel() <- &EventIn{event: &Event{Channel: "test", Body: []byte("BODY-BenchmarkStoreEventsInBolt")}, saved: acks}
		<-acks
	}
	b.StopTimer()
	store.Close()
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hoangphan.staffapp.fu.domain;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author hoangpt
 */
public class TeacherTest {

  Teacher teacher;

  @Before
  public void setUp() {
    teacher = new Teacher();

    teacher.name = "Hoang";
    teacher.salaryRatio = 1;
    teacher.degree = 0;
    teacher.teaching_time = 10;

  }

  @After
  public void tearDown() {
    //destructor
    System.out.println("Destroy teacher");
  }

  /**
   * TDD Test of getFalcuty method, of class Teacher.
   */
  @Test
  public void testcalculateSalaryOK() {

    double expResult = 1480; //tester require
    double result = 0;
    try {
      result = teacher.calculateSalary();
    } catch (Exception ex) {
      Logger.getLogger(TeacherTest.class.getName()).log(Level.SEVERE, null, ex);
    }

    assertEquals(expResult, result, 0.01);
  }

  @Test
  public void testcalculateSalaryNotOK() {
    teacher.salaryRatio = -1;

    double expResult = 0; //tester require
    double result = 0;
    try {
      result = teacher.calculateSalary();
    } catch (Exception ex) {
      Logger.getLogger(TeacherTest.class.getName()).log(Level.SEVERE, null, ex);
    }

    assertEquals(expResult, result, 0.01);
  }

  /**
   * Automation test
   */
  @Test
  public void testHoho() {

    String expResult = teacher.hoho();

    //fail("Hoho la cai me gi");
    assertEquals(expResult, teacher.name);
  }

  @Test
  public void testLoginSuccess() {
    //username and password match
    fail("Hehe");
  }

  @Test
  public void testLoginFailDuetoEmptyInput() {
    //username or password empty
    //check popup
    fail("Hehe");
  }

  @Test
  public void testLoginFailDuetoNotMatch() {
    //username and password
    //check popup
    fail("Hehe");
  }

  @Test
  public void testLoginFailDuetoShitWord() {
    //username @#@$alert("Hehe")
    //check popup
    fail("Hehe");
  }

  @Test
  public void testLoginFailDuetoUserNameSmallerThan6() {
    //username @#@$alert("Hehe")
    //check popup
    fail("Hehe");
  }

  @Test
  public void testLoginFailDuetoPasswordNotContainSpecialLetter() {
    //password @#@$alert("Hehe")
    //check popup
    fail("Hehe");
  }

}


text: exports.FitParser = require('./lib/fitparser').FitParser;


text:
@setlocal
@rem Install missing python packages.
@rem State tracking is irrelevant for Python packages as they can easily be added via Pypi if missing.
@rem Meson is the exception because its a Python 3 only package and as a result it can be missing.

@set pypack=0
@set firstpyinstall=1
@set pywin32com=n

:pypackmissing
@rem Check for Python packages availability.
@IF NOT EXIST %pythonloc:~0,-11%Lib\site-packages\markupsafe\" (
@set pypack=MarkupSafe
@GOTO pypackinstall
)
@IF NOT EXIST %pythonloc:~0,-11%Lib\site-packages\mako\" (
@set pypack=Mako
@GOTO pypackinstall
)

@set mesonstate=2
@CMD /C EXIT 0
@where /q meson.exe
@if NOT "%ERRORLEVEL%"=="0" set mesonstate=1
@IF NOT EXIST %pythonloc:~0,-11%Scripts\meson.py" IF NOT EXIST %pythonloc:~0,-11%Scripts\meson.exe" (
@set pypack=meson
@GOTO pypackinstall
)
@GOTO pyupdate

:pypackinstall
@rem Found a missing package. Install it.
@IF %firstpyinstall%==1 IF NOT %pypack%==0 if EXIST "%LOCALAPPDATA%\pip" RD /S /Q "%LOCALAPPDATA%\pip"
@IF %firstpyinstall%==1 IF NOT %pypack%==0 (
@%pythonloc% -W ignore -m pip install -U pip
@echo.
@%pythonloc% -W ignore -m pip install -U setuptools
@echo.
)
@set firstpyinstall=0
@IF NOT %pypack%==0 %pythonloc% -W ignore -m pip install -U %pypack%
@IF NOT %pypack%==0 echo.
@IF %pypack%==pywin32 set /p pywin32com=Do you want to install COM and services support - y/n. You'll be asked for admin privileges:
@IF %pypack%==pywin32 echo.
@IF %pypack%==pywin32 IF /I "%pywin32com%"=="y" powershell -Command Start-Process "%devroot%\%projectname%\buildscript\modules\pywin32.cmd" -Args "%pythonloc%" -Verb runAs 2>nul
@set pypack=0
@GOTO pypackmissing

:pyupdate
@rem Check for python packages updates.
@set pyupd=n
@set /p pyupd=Update python packages (y/n):
@echo.
@if /I NOT "%pyupd%"=="y" GOTO endpython
@set pywinsetup=2
@for /f tokens^=1-2^ delims^=.^ eol^= %%a IN ("%pythonver%") DO @set spyver=%%a%%b
@IF NOT EXIST %pythonloc:~0,-11%Removepywin32.exe" set pywinsetup=1
@IF NOT EXIST "%windir%\system32\pythoncom%spyver%.dll" IF NOT EXIST "%windir%\syswow64\pythoncom%spyver%.dll" set pywinsetup=0
@if EXIST "%LOCALAPPDATA%\pip" RD /S /Q "%LOCALAPPDATA%\pip"
@for /F skip^=2^ eol^= %%a in ('%pythonloc% -W ignore -m pip list -o --disable-pip-version-check') do @(
IF NOT "%%a"=="pywin32" (
%pythonloc% -W ignore -m pip install -U "%%a"
echo.
)
IF "%%a"=="pywin32" IF %pywinsetup% LSS 2 (
%pythonloc% -W ignore -m pip install -U "%%a"
echo.
)
IF "%%a"=="pywin32" IF %pywinsetup% EQU 1 powershell -Command Start-Process "%devroot%\%projectname%\buildscript\modules\pywin32.cmd" -Args "%pythonloc%" -Verb runAs 2>nul
IF "%%a"=="pywin32" IF %pywinsetup% EQU 2 (
echo New version of pywin32 is available.
echo Visit https://github.com/mhammond/pywin32/releases to download it.
echo.
)
)

:endpython
@endlocal&set mesonstate=%mesonstate%


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

<title>A-Index</title>
<meta name="date" content="2014-01-25">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G I M N P R S T U V

A

Address - Class in com.createtank.payments.coinbase.models

Address(String, String, String, String) - Constructor for class com.createtank.payments.coinbase.models.Address

allowSecure() - Method in class com.createtank.payments.coinbase.CoinbaseApi

allowSecure(boolean) - Method in class com.createtank.payments.coinbase.CoinbaseApi

Amount - Class in com.createtank.payments.coinbase.models

Amount() - Constructor for class com.createtank.payments.coinbase.models.Amount

amount - Variable in class com.createtank.payments.coinbase.models.Amount

authenticate(String) - Method in class com.createtank.payments.coinbase.CoinbaseApi

Authenticates the client useing OAuth 2.0.

A B C D E F G I M N P R S T U V

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
<?php

namespace app\modules\pa\models\search;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\modules\pa\models\EmailType;

/**
 * EmailTypeSearch represents the model behind the search form about `app\modules\pa\models\EmailType`.
 */
class EmailTypeSearch extends EmailType
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'parent_id'], 'integer'],
            [['name', 'description', 'date_created', 'timestamp'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = EmailType::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'parent_id' => $this->parent_id,
            'date_created' => $this->date_created,
            'timestamp' => $this->timestamp,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'description', $this->description]);

        return $dataProvider;
    }
}


text:
FROM python:3.5
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN apt-get update
RUN apt-get install gettext -y
RUN pip3 install -r requirements.txt
ADD . /code/


text:
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Elm WebGL Game</title>

    <link rel="stylesheet" href="css/main.css">

    <script src="ports/pointer.js"></script>
    <script src="main.js"></script>
  </head>
  <body>
    <script type="text/javascript">
      let app = Elm.Main.fullscreen();

      window.pointerModulePort(app);
    </script>
  </body>
</html>


text:
e{% extends path1+"/_layout.html" %}

{% block left_content %}

Booked

{{customer.appointmentDate | formatDate("dddd D MMMM YYYY")}}

{{customer.appointmentTime}}

          Rearrange appointment

{% endblock %}

{% block citizen_content %}
 {# macro #}
  {{ nav2.case_tabs("bobby_timeline",1,path1) }}

Appointment booked

04 February 2018

Referred for appointment

30 January 2018

GP statement received (ESA113)

29 January 2018

Request for GP statement sent (ESA113)

19 January 2018

ESA50 form received at CHDA

4 January 2018

ESA50 form sent out to Tomas

12 December 2018

FIT note (MED3) received

19 November 2017

Entitlement letter sent to Tomas

5 November 2017

ESA application completed on the phone

1 November 2017

{% endblock %}

{% block footer_top %}
{{ super() }}
{# {% include path1+"/footer_links.html" %} #}
{% endblock %}
_


text:
import {AnimationEvent} from '@angular/animations';
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';

import {RendererType2, ViewEncapsulation} from '../../src/core';
import {defineComponent, detectChanges} from '../../src/render3/index';
import {bind, directiveRefresh, elementEnd, elementProperty, elementStart, listener, text, tick} from '../../src/render3/instructions';
import {createRendererType2} from '../../src/view/index';

import {getAnimationRendererFactory2, getRendererFactory2} from './imported_renderer2';
import {containerEl, document, renderComponent, renderToHtml, toHtml} from './render_util';

describe('renderer factory lifecycle', () => {
  let logs: string[] = [];
  let rendererFactory = getRendererFactory2(document);
  const createRender = rendererFactory.createRenderer;
  rendererFactory.createRenderer = (hostElement: any, type: RendererType2 | null) => {
    logs.push('create');
    return createRender.apply(rendererFactory, [hostElement, type]);
  };
  rendererFactory.begin = () => logs.push('begin');
  rendererFactory.end = () => logs.push('end');

  class SomeComponent {
    static ngComponentDef = defineComponent({
      type: SomeComponent,
      tag: 'some-component',
      template: function(ctx: SomeComponent, cm: boolean) {
        logs.push('component');
        if (cm) {
          text(0, 'foo');
        }
      },
      factory: () => new SomeComponent
    });
  }

  class SomeComponentWhichThrows {
    static ngComponentDef = defineComponent({
      type: SomeComponentWhichThrows,
      tag: 'some-component-with-Error',
      template: function(ctx: SomeComponentWhichThrows, cm: boolean) {
        throw(new Error('SomeComponentWhichThrows threw'));
      },
      factory: () => new SomeComponentWhichThrows
    });
  }

  function Template(ctx: any, cm: boolean) {
    logs.push('function');
    if (cm) {
      text(0, 'bar');
    }
  }

  function TemplateWithComponent(ctx: any, cm: boolean) {
    logs.push('function_with_component');
    if (cm) {
      text(0, 'bar');
      elementStart(1, SomeComponent);
      elementEnd();
    }
    SomeComponent.ngComponentDef.h(2, 1);
    directiveRefresh(2, 1);
  }

  beforeEach(() => { logs = []; });

  it('should work with a component', () => {
    const component = renderComponent(SomeComponent, {rendererFactory});
    expect(logs).toEqual(['create', 'create', 'begin', 'component', 'end']);

    logs = [];
    tick(component);
    expect(logs).toEqual(['begin', 'component', 'end']);
  });

  it('should work with a component which throws', () => {
    expect(() => renderComponent(SomeComponentWhichThrows, {rendererFactory})).toThrow();
    expect(logs).toEqual(['create', 'create', 'begin', 'end']);
  });

  it('should work with a template', () => {
    renderToHtml(Template, {}, rendererFactory);
    expect(logs).toEqual(['create', 'begin', 'function', 'end']);

    logs = [];
    renderToHtml(Template, {});
    expect(logs).toEqual(['begin', 'function', 'end']);
  });

  it('should work with a template which contains a component', () => {
    renderToHtml(TemplateWithComponent, {}, rendererFactory);
    expect(logs).toEqual(
        ['create', 'begin', 'function_with_component', 'create', 'component', 'end']);

    logs = [];
    renderToHtml(TemplateWithComponent, {});
    expect(logs).toEqual(['begin', 'function_with_component', 'component', 'end']);
  });

});

describe('animation renderer factory', () => {
  let eventLogs: string[] = [];
  function getLog(): MockAnimationPlayer[] {
    return MockAnimationDriver.log as MockAnimationPlayer[];
  }

  function resetLog() { MockAnimationDriver.log = []; }

  beforeEach(() => {
    eventLogs = [];
    resetLog();
  });

  class SomeComponent {
    static ngComponentDef = defineComponent({
      type: SomeComponent,
      tag: 'some-component',
      template: function(ctx: SomeComponent, cm: boolean) {
        if (cm) {
          text(0, 'foo');
        }
      },
      factory: () => new SomeComponent
    });
  }

  class SomeComponentWithAnimation {
    exp: string;
    callback(event: AnimationEvent) {
      eventLogs.push(`${event.fromState ? event.fromState : event.toState} - ${event.phaseName}`);
    }
    static ngComponentDef = defineComponent({
      type: SomeComponentWithAnimation,
      tag: 'some-component',
      template: function(ctx: SomeComponentWithAnimation, cm: boolean) {
        if (cm) {
          elementStart(0, 'div');
          {
            listener('@myAnimation.start', ctx.callback.bind(ctx));
            listener('@myAnimation.done', ctx.callback.bind(ctx));
            text(1, 'foo');
          }
          elementEnd();
        }
        elementProperty(0, '@myAnimation', bind(ctx.exp));
      },
      factory: () => new SomeComponentWithAnimation,
      rendererType: createRendererType2({
        encapsulation: ViewEncapsulation.None,
        styles: [],
        data: {
          animation: [{
            type: 7,
            name: 'myAnimation',
            definitions: [{
              type: 1,
              expr: '* => on',
              animation:
                  [{type: 4, styles: {type: 6, styles: {opacity: 1}, offset: null}, timings: 10}],
              options: null
            }],
            options: {}
          }]
        }
      }),
    });
  }

  it('should work with components without animations', () => {
    renderComponent(SomeComponent, {rendererFactory: getAnimationRendererFactory2(document)});
    expect(toHtml(containerEl)).toEqual('foo');
  });

  isBrowser && it('should work with animated components', (done) => {
    const rendererFactory = getAnimationRendererFactory2(document);
    const component = renderComponent(SomeComponentWithAnimation, {rendererFactory});
    expect(toHtml(containerEl))
        .toMatch(/<div class="ng-tns-c\d+-0 ng-trigger ng-trigger-myAnimation">foo<\/div>/);

    component.exp = 'on';
    tick(component);

    const [player] = getLog();
    expect(player.keyframes).toEqual([
      {opacity: '*', offset: 0},
      {opacity: 1, offset: 1},
    ]);
    player.finish();

    rendererFactory.whenRenderingDone !().then(() => {
      expect(eventLogs).toEqual(['void - start', 'void - done', 'on - start', 'on - done']);
      done();
    });
  });
});


text:
package lila.team

import org.joda.time.DateTime
import scala.util.chaining._

import lila.user.User
import org.joda.time.Days

case class Team(
    _id: Team.ID, // also the url slug
    name: String,
    password: Option[String],
    description: String,
    descPrivate: Option[String],
    nbMembers: Int,
    enabled: Boolean,
    open: Boolean,
    createdAt: DateTime,
    createdBy: User.ID,
    leaders: Set[User.ID],
    chat: Team.Access,
    forum: Team.Access,
    hideMembers: Option[Boolean]
) {

  def id = _id

  def slug = id

  def disabled = !enabled

  def isChatFor(f: Team.Access.type => Team.Access) =
    chat == f(Team.Access)

  def isForumFor(f: Team.Access.type => Team.Access) =
    forum == f(Team.Access)

  def publicMembers: Boolean = !hideMembers.has(true)

  def passwordMatches(pw: String) =
    password.forall(teamPw =>
      teamPw.size == pw.size && teamPw.zip(pw).foldLeft(0) { case (acc, (a, b)) =>
        acc | (a ^ b) // constant time
      } == 0
    )
}

object Team {

  case class Mini(id: Team.ID, name: String)

  val maxJoinCeiling = 50

  def maxJoin(u: User) =
    if (u.isVerified) maxJoinCeiling * 2
    else {
      15 + Days.daysBetween(u.createdAt, DateTime.now).getDays / 7
    } atMost maxJoinCeiling

  type ID = String

  type Access = Int
  object Access {
    val NONE    = 0
    val LEADERS = 10
    val MEMBERS = 20
    val all     = List(NONE, LEADERS, MEMBERS)
  }

  case class IdsStr(value: String) extends AnyVal {

    import IdsStr.separator

    def contains(teamId: ID) =
      value == teamId ||
        value.startsWith(s"$teamId$separator") ||
        value.endsWith(s"$separator$teamId") ||
        value.contains(s"$separator$teamId$separator")

    def toArray: Array[String] = value split IdsStr.separator
    def toList                 = value.nonEmpty ?? toArray.toList
  }

  object IdsStr {

    private val separator = ' '

    val empty = IdsStr("")

    def apply(ids: Iterable[ID]): IdsStr = IdsStr(ids mkString separator.toString)
  }

  def make(
      id: String,
      name: String,
      password: Option[String],
      description: String,
      descPrivate: Option[String],
      open: Boolean,
      createdBy: User
  ): Team =
    new Team(
      _id = id,
      name = name,
      password = password,
      description = description,
      descPrivate = descPrivate,
      nbMembers = 1,
      enabled = true,
      open = open,
      createdAt = DateTime.now,
      createdBy = createdBy.id,
      leaders = Set(createdBy.id),
      chat = Access.MEMBERS,
      forum = Access.MEMBERS,
      hideMembers = none
    )

  def nameToId(name: String) =
    (lila.common.String slugify name) pipe { slug =>
      // if most chars are not latin, go for random slug
      if (slug.lengthIs > (name.lengthIs / 2)) slug else randomId()
    }

  private[team] def randomId() = lila.common.ThreadLocalRandom nextString 8
}


text:
package org.apache.camel.maven.packaging.srcgen;

import java.lang.reflect.Array;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("rawtypes")
public class GenericType {

    private static final GenericType ALL = new GenericType(Object.class);

    private static final GenericType[] EMPTY = new GenericType[0];

    private static final Map<String, Class> PRIMITIVE_CLASSES = new HashMap<>();

    enum BoundType {
        Exact, Extends, Super
    }

    private final Class clazz;
    private GenericType[] parameters;
    private BoundType boundType;

    static {
        PRIMITIVE_CLASSES.put("int", int.class);
        PRIMITIVE_CLASSES.put("short", short.class);
        PRIMITIVE_CLASSES.put("long", long.class);
        PRIMITIVE_CLASSES.put("byte", byte.class);
        PRIMITIVE_CLASSES.put("char", char.class);
        PRIMITIVE_CLASSES.put("float", float.class);
        PRIMITIVE_CLASSES.put("double", double.class);
        PRIMITIVE_CLASSES.put("boolean", boolean.class);
        PRIMITIVE_CLASSES.put("void", void.class);
    }

    public GenericType(Type type) {
        this(getConcreteClass(type), parametersOf(type));
    }

    public GenericType(Class clazz, GenericType... parameters) {
        this(clazz, BoundType.Exact, parameters);
    }

    public GenericType(Class clazz, BoundType boundType, GenericType... parameters) {
        this.clazz = clazz;
        this.parameters = parameters;
        this.boundType = boundType;
    }

    public static GenericType parse(String type, ClassLoader loader) throws ClassNotFoundException, IllegalArgumentException {
        type = type.trim();
        // Check if this is an array
        if (type.endsWith("[]")) {
            GenericType t = parse(type.substring(0, type.length() - 2), loader);
            return new GenericType(Array.newInstance(t.getRawClass(), 0).getClass(), t);
        }
        // Check if this is a generic
        int genericIndex = type.indexOf('<');
        if (genericIndex > 0) {
            if (!type.endsWith(">")) {
                throw new IllegalArgumentException("Can not load type: " + type);
            }
            GenericType base = parse(type.substring(0, genericIndex), loader);
            String[] params = type.substring(genericIndex + 1, type.length() - 1).split(",");
            GenericType[] types = new GenericType[params.length];
            for (int i = 0; i < params.length; i++) {
                types[i] = parse(params[i], loader);
            }
            return new GenericType(base.getRawClass(), types);
        }
        // Primitive
        if (isPrimitive(type)) {
            return new GenericType(PRIMITIVE_CLASSES.get(type));
        }
        // Extends
        if (type.startsWith("? extends ")) {
            String raw = type.substring("? extends ".length());
            return new GenericType(loadClass(loader, raw), BoundType.Extends);
        }
        // Super
        if (type.startsWith("? super ")) {
            String raw = type.substring("? extends ".length());
            return new GenericType(loadClass(loader, raw), BoundType.Super);
        }
        // Wildcard
        if (type.equals("?")) {
            return new GenericType(Object.class, BoundType.Extends);
        }
        // Class
        if (loader != null) {
            return new GenericType(loadClass(loader, type));
        } else {
            throw new IllegalArgumentException("Unsupported loader: " + loader);
        }
    }

    static boolean isPrimitive(String type) {
        return PRIMITIVE_CLASSES.containsKey(type);
    }

    private static Class<?> loadClass(ClassLoader loader, String loadClassName) throws ClassNotFoundException {
        Class<?> optionClass;
        String org = loadClassName;
        while (true) {
            try {
                optionClass = loader.loadClass(loadClassName);
                break;
            } catch (ClassNotFoundException e) {
                int dotIndex = loadClassName.lastIndexOf('.');
                if (dotIndex == -1) {
                    throw new ClassNotFoundException(org);
                } else {
                    loadClassName = loadClassName.substring(0, dotIndex) + "$" + loadClassName.substring(dotIndex + 1);
                }
            }
        }
        return optionClass;
    }

    public Class<?> getRawClass() {
        return clazz;
    }

    public GenericType getActualTypeArgument(int i) {
        if (parameters.length == 0) {
            return ALL;
        }
        return parameters[i];
    }

    public int size() {
        return parameters.length;
    }

    @Override
    public String toString() {
        if (parameters.length == 0 && boundType == BoundType.Extends && clazz == Object.class) {
            return "?";
        }
        StringBuilder sb = new StringBuilder();
        if (boundType == BoundType.Extends) {
            sb.append("? extends ");
        } else if (boundType == BoundType.Super) {
            sb.append("? super ");
        }
        Class cl = getRawClass();
        if (cl.isArray()) {
            if (parameters.length > 0) {
                return parameters[0].toString() + "[]";
            } else {
                return cl.getComponentType().getName() + "[]";
            }
        }
        sb.append(cl.getName());
        if (parameters.length > 0) {
            sb.append("<");
            for (int i = 0; i < parameters.length; i++) {
                if (i > 0) {
                    sb.append(", ");
                }
                sb.append(parameters[i].toString());
            }
            sb.append(">");
        }
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((boundType == null) ? 0 : boundType.hashCode());
        result = prime * result + ((clazz == null) ? 0 : clazz.hashCode());
        result = prime * result + Arrays.hashCode(parameters);
        return result;
    }

    public boolean equals(Object object) {
        if (!(object instanceof GenericType)) {
            return false;
        }
        GenericType other = (GenericType)object;
        if (getRawClass() != other.getRawClass()) {
            return false;
        }
        if (boundType != other.boundType) {
            return false;
        }
        if (parameters == null) {
            return other.parameters == null;
        } else {
            if (other.parameters == null) {
                return false;
            }
            if (parameters.length != other.parameters.length) {
                return false;
            }
            for (int i = 0; i < parameters.length; i++) {
                if (!parameters[i].equals(other.parameters[i])) {
                    return false;
                }
            }
            return true;
        }
    }

    static GenericType bound(GenericType type) {
        if (type.boundType != BoundType.Exact) {
            return new GenericType(type.getRawClass(), BoundType.Exact, type.parameters);
        }
        return type;
    }

    static BoundType boundType(GenericType type) {
        return type.boundType;
    }

    static BoundType boundType(Type type) {
        if (type instanceof WildcardType) {
            WildcardType wct = (WildcardType)type;
            return wct.getLowerBounds().length == 0 ? BoundType.Extends : BoundType.Super;
        }
        return BoundType.Exact;
    }

    static GenericType[] parametersOf(Type type) {
        if (type instanceof Class) {
            Class clazz = (Class)type;
            if (clazz.isArray()) {
                GenericType t = new GenericType(clazz.getComponentType());
                if (t.size() > 0) {
                    return new GenericType[] {t};
                } else {
                    return EMPTY;
                }
            } else {
                return EMPTY;
            }
        }
        if (type instanceof ParameterizedType) {
            ParameterizedType pt = (ParameterizedType)type;
            Type[] parameters = pt.getActualTypeArguments();
            GenericType[] gts = new GenericType[parameters.length];
            for (int i = 0; i < gts.length; i++) {
                gts[i] = new GenericType(parameters[i]);
            }
            return gts;
        }
        if (type instanceof GenericArrayType) {
            return new GenericType[] {new GenericType(((GenericArrayType)type).getGenericComponentType())};
        }
        if (type instanceof WildcardType) {
            return EMPTY;
        }
        throw new IllegalStateException();
    }

    static Class<?> getConcreteClass(Type type) {
        Type ntype = collapse(type);
        if (ntype instanceof Class) {
            return (Class<?>)ntype;
        }
        if (ntype instanceof ParameterizedType) {
            return getConcreteClass(collapse(((ParameterizedType)ntype).getRawType()));
        }
        throw new RuntimeException("Unknown type " + type);
    }

    static Type collapse(Type target) {
        if (target instanceof Class || target instanceof ParameterizedType) {
            return target;
        } else if (target instanceof TypeVariable) {
            return collapse(((TypeVariable<?>)target).getBounds()[0]);
        } else if (target instanceof GenericArrayType) {
            Type t = collapse(((GenericArrayType)target).getGenericComponentType());
            while (t instanceof ParameterizedType) {
                t = collapse(((ParameterizedType)t).getRawType());
            }
            return Array.newInstance((Class<?>)t, 0).getClass();
        } else if (target instanceof WildcardType) {
            WildcardType wct = (WildcardType)target;
            if (wct.getLowerBounds().length == 0) {
                return collapse(wct.getUpperBounds()[0]);
            } else {
                return collapse(wct.getLowerBounds()[0]);
            }
        }
        throw new RuntimeException("Huh? " + target);
    }

}


text:
_DEBUG=0

if [ "`which brew`" = "" ] ; then
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

function debug_list_before() {
  if [ "$_DEBUG" -eq 1 ] ; then
    echo ""
    echo "Before installations via $@..."
    echo ""
    $@ list
    echo ""
  fi
}

function debug_list_after() {
  if [ "$_DEBUG" -eq 1 ] ; then
    echo ""
    echo "After installations via $@..."
    echo ""
    $@ list
    echo ""
  fi
}

function brew_install() {
  brew_list=`brew list`

  for package in $@ ; do
    set +e
    echo "$brew_list" | grep $package > /dev/null
    local grep_exit_code=$?
    set -e

    if [ $grep_exit_code = 1 ] ; then
      # If grep returns 1, the package wasn't found in our list of installed packages...
      brew install $package
    fi
  done
}

function brew_cask_install() {
  brew_cask_list=`brew cask list`

  for package in $@ ; do
    set +e
    echo "$brew_cask_list" | grep $package > /dev/null
    local grep_exit_code=$?
    set -e

    if [ $grep_exit_code = 1 ] ; then
      # If grep returns 1, the package wasn't found in our list of installed packages...
      brew cask install $package
    fi
  done
}

debug_list_before brew cask

brew tap caskroom/cask
brew tap caskroom/drivers
brew tap caskroom/versions
brew tap AdoptOpenJDK/openjdk

brew_cask_install \
  1password \
  cleanmymac \
  docker \
  dropbox \
  evernote \
  google-chrome \
  harvest \
  jetbrains-toolbox \
  logitech-options \
  microsoft-office \
  adoptopenjdk8 \
  paperspace \
  slack \
  sublime-text \
  viscosity \
  zoomus

set +e
brew cask doctor
set -e
brew cask upgrade
brew cleanup

debug_list_after brew cask

debug_list_before brew

brew_install \
  bash-completion \
  dos2unix \
  git \
  httpie \
  jq \
  neofetch \
  node \
  rename \
  tree \
  wget \
  zlib

set +e
brew doctor
set -e
brew update
brew upgrade
brew cleanup

debug_list_after brew

# You may need to run this in some cases:
#
# xcode-select --install
# sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /


text:
import pkg_resources

__version__ = pkg_resources.get_distribution("pinax-documents").version


text:
require "luosimao/version"
require "luosimao/message"

module Luosimao
  class << self
    attr_accessor :username, :key, :brand
  end
end


text:
title: Configuration
permalink: /docs/en/configuration
key: docs-configuration
---

Jekyll allows you to concoct your sites in any way you can dream up, and it's thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a *_config.yml* file placed in your site's root directory, or can be specified as flags for the jekyll executable in the terminal.

For technical reasons, *_config.yml* is **NOT** reloaded automatically when you use `jekyll serve`. If you change this file, please restart the server process.
{:.warning}

<!--more-->

## Site Settings

### Theme

If you're using the Ruby gem version of the theme you'll need this line to activate it:

```yaml
theme: jekyll-text-theme
```

### Skin

You can choose these 6 built-in skins below:

| `default` | `dark` | `forest` |
| --- |  --- | --- |
| ![Default](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/skins_default.png) | ![Dark](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/skins_dark.png) | ![Forest](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/skins_forest.png) |

| `ocean` | `chocolate` | `orange` |
| --- |  --- | --- |
| ![Ocean](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/skins_ocean.png) | ![Chocolate](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/skins_chocolate.png) | ![Orange](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/skins_orange.png) |

```yaml
text_skin: default # "default" (default), "dark", "forest", "ocean", "chocolate", "orange"
```

### Highlight Theme

TeXt use [Tomorrow](https://github.com/chriskempson/tomorrow-theme) as the highlight theme.

| `tomorrow` | `tomorrow-night` | `tomorrow-night-eighties` | `tomorrow-night-blue` | `tomorrow-night-bright` |
| --- |  --- | --- | --- |  --- |
| ![Tomorrow](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/highlight_tomorrow.png) | ![Tomorrow Night](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/highlight_tomorrow-night.png) | ![Tomorrow Night Eighties](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/highlight_tomorrow-night-eighties.png) | ![Tomorrow Night Blue](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/highlight_tomorrow-night-blue.png) | ![Tomorrow Night Bright](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/highlight_tomorrow-night-bright.png) |

Every skin has a default highlight theme, but you can overwrite it by `highlight_theme` variable.

```yaml
highlight_theme: default # "default" (default), "tomorrow", "tomorrow-night", "tomorrow-night-eighties", "tomorrow-night-blue", "tomorrow-night-bright"
```

### URL

The base hostname and protocol for your site. if you are hosting the site on Github Pages this will be set as the GitHub Pages domain (cname or user domain)[^gitHub_metadata]. For example, https://kitian616.github.io or https://tianqi.name if there is cname file.

Jekyll 3.3 overrides this value with url: http://localhost:4000 when running `jekyll serve` in a development environment[^jekyll_site_variables]. You can specifying Jekyll environment[^jekyll_specifying_environment] to production environment by `JEKYLL_ENV=production` to avoid this behavior.
{:.warning}

[^gitHub_metadata]: [GitHub Metadata, a.k.a. site.github](https://github.com/jekyll/github-metadata#what-it-does)

[^jekyll_site_variables]: [Variables#Site Variables](https://jekyllrb.com/docs/variables/#site-variables)

[^jekyll_specifying_environment]: [Configuration#Specifying a Jekyll environment at build timePermalink](https://jekyllrb.com/docs/configuration/#specifying-a-jekyll-environment-at-build-time)

### Base URL

The base URL for your site, default to '/'. If you are hosting the site on Github Pages this will be set as the project name for project pages if none is set[^gitHub_metadata].

### Title

The name of your site.

```yaml
title: "My Awesome Website"
```

### Description

Use some words to describe your site.

```yaml
description: > # this means to ignore newlines until "nav_lists:"
  A website with awesome stories.
```

## Language and Timezone

### Language

The language of your site, you can override it with different ones on specific posts, pages by YAML Front Matter[^font_matter].

| Name | Language |
| --- | --- |
| **en** | English(default) |
| **zh** | Simplified Chinese, 简体中文 |
| **zh-Hans** | Simplified Chinese, 简体中文 |
| **zh-Hant** | Traditional Chinese, 繁體中文 |

```yaml
lang: en
```

[^font_matter]: [Front Matter](https://jekyllrb.com/docs/frontmatter/)

### Timezone

Set the time zone for site generation. This sets the TZ environment variable, which Ruby uses to handle time and date creation and manipulation. A list of all available values can be found [HERE](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

When serving on a local machine, the default time zone is set by your operating system. But when served on a remote host/server, the default time zone depends on the server's setting or location.[^jekyll_global_configuration]

[^jekyll_global_configuration]: [Configuration#Global Configuration](https://jekyllrb.com/docs/configuration/#global-configuration)

```yaml
timezone: Asia/Shanghai
```

## Author and Social

Information of the site author (a person, a team or an organization).

### Type

Type of the site author, a person or an organization, used by [schema.org](https://schema.org/) markup, default as "person".

### Name

Used to assign a site author.

### Avatar

Photo or Logo for site author

### Bio

Short introduction for site author

### Social

Username or id of site author's social networks.

Now we supports Email, Facebook, Twitter, Google Plus, Github, Linkedin, Weibo(微博) and Douban(豆瓣), more to be added.

Depending on your settings, the social network buttons would show on every pages' footer.

## GitHub repository

Setting for [GitHub Metadata](https://github.com/jekyll/github-metadata) plugin, you can refer to [HERE](https://github.com/jekyll/github-metadata/blob/master/docs/configuration.md#configuration) for more info.

In order for jekyll-github-metadata to know what metadata to fetch it must be able to determine the repository NWO to ask GitHub about.

"NWO" stands for "name with owner." It is GitHub lingo for the username of the owner of the repository plus a forward slash plus the name of the repository, e.g. 'kitian616/jekyll-TeXt-theme', where 'kitian616' is the owner and 'jekyll-TeXt-theme' is the repository name.

```yaml
repository: user_name/repo_name
```

## Post

### Excerpt

Each post automatically takes the first block of text, from the beginning of the content to the first occurrence of `excerpt_separator`, and sets it as the post's excerpt.

The post's excerpt is show in the articles list in the home layout. There are two excerpt types, text type and html type.

| Type Name | Description |
| --- | --- |
| **text** | the excerpt are plain text that filters out all non-text elements (such as title, link, list, table, picture, etc.) and only show 350 characters most. |
| **html** | the excerpt are HTML document just like the content of the article, This will show all the content by default, except adding `<!--more-->` in the article Markdown file, You can find more info [HERE](https://jekyllrb.com/docs/posts/#post-excerpts).  |

```yaml
excerpt_separator: <!--more-->
excerpt_type: text # text (default), html
```

### License

| Name          | License | Image |
| CC-BY-4.0     | [Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) | ![CC-BY-4.0](https://i.creativecommons.org/l/by/4.0/88x31.png) |
| CC-BY-SA-4.0  | [Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/) | ![CC-BY-SA-4.0](https://i.creativecommons.org/l/by-sa/4.0/88x31.png) |
| CC-BY-NC-4.0  | [Attribution-NonCommercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/) | ![CC-BY-NC-4.0](https://i.creativecommons.org/l/by-nc/4.0/88x31.png) |
| CC-BY-ND-4.0  | [Attribution-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nd/4.0/) | ![CC-BY-ND-4.0](https://i.creativecommons.org/l/by-nd/4.0/88x31.png) |

```yaml
license: CC-BY-NC-4.0
```

### TOC

Elements to use as headings.

```yaml
toc:
  selectors: "h1,h2,h3"
```

### Markdown Enhancements

To improve the user experience for both reading and writing posts, TeXt made some enhancements for markdown. By default, all the enhancements for markdown is enabled. you need set the settings to true to enable them:

```yaml
# Mathjax
mathjax: true
mathjax_autoNumber: true

# Mermaid
mermaid: true

# Chart
chart: true
```

And also you can override it with different ones on specific posts, pages by YAML Front Matter[^font_matter].

Check [Writing Posts](/) for detail usage.

## Paginate

Settings for [Jekyll Paginate](https://github.com/jekyll/jekyll-paginate) plugin. to enable pagination for posts on your blog, add a line to the *_config.yml* file that specifies how many items should be displayed per page:

```yaml
paginate: 8
```

The number should be the maximum number of Posts you'd like to be displayed per-page in the generated site.

You may also specify the destination of the pagination pages:

```yaml
paginate_path: /page:num # don't change this unless for special need
```

## Sources

TeXt use CDN[^cdn] for speed improvements, You can choose [BootCDN](http://www.bootcdn.cn/)(default) or [unpkg](https://unpkg.com/) as your site's CDN provider, both of them are open source and free.

If your website is mainly for Chinese, just use BootCDN.

```yaml
sources: bootcdn # bootcdn (default), unpkg
```

[^cdn]: [Content delivery network](https://en.wikipedia.org/wiki/Content_delivery_network)

## Comments

| Name | Comments Provider |
| --- | --- |
| **disqus** | [Disqus](https://disqus.com/) |
| **gitalk** | [Gitalk](https://github.com/gitalk/gitalk/) |

### Disqus

To use Disqus you'll need to create an account and [shortname](https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname-). Once you have both update *_config.yml* to:

```yaml
comments:
  provider: disqus
  disqus:
    shortname: "your-disqus-shortname"
```

### Gitalk

To use gitalk you need a GitHub application, if you don't have one, [Click here to register](https://github.com/settings/applications/new) a new one. and then update *_config.yml* to:

```yaml
comments:
  provider: gitalk
  gitalk:
    clientID    : "github-application-client-id"
    clientSecret: "github-application-client-secret"
    repository  : "github-repo"
    owner       : "github-repo-owner"
    admin: # Github repo owner and collaborators, only these guys can initialize github issues, IT IS A LIST.
      - "your-github-id"
      - "the-other-admin-github-id"
```

For all the above comments systems, you NEED set `key` variable in the page's YAML Front Matter to enable comments on this page, you can find more information [HRER](https://tianqi.name/jekyll-TeXt-theme/docs/en/layouts#page-layout).
{:.warning}

## Pageview

| Name | Pageview Provider |
| --- | --- |
| **leancloud** | [Disqus](https://leancloud.cn/) |

## LeanCloud

This use [LeanCloud](https://leancloud.cn/) as back-end service. You need create a app on the dashboard, and config the app's id, key and class name.

The detail guide of LeanCloud will find in [Chinese document](https://tianqi.name/jekyll-TeXt-theme/docs/zh/configuration#%E6%96%87%E7%AB%A0%E7%82%B9%E5%87%BB%E9%87%8F) since LeanCloud haven't provide an English-language edition.
{:.info}

```yaml
pageview:
  provider: leancloud
  leancloud:
    app_id    : "your-leanCloud-app-id"
    app_key   : "your-leanCloud-app-key"
    app_class : "your-leanCloud-app-class"
```

For all the above pageview statistics, you **NEED** set `key` variable in the page's YAML Front Matter to enable statistics on this page, you can find more information [HRER](https://tianqi.name/jekyll-TeXt-theme/docs/en/layouts#page-layout).
{:.warning}

## Analytics

| Name | Analytics Provider |
| --- | --- |
| **google** | [Google Analytics](https://analytics.google.com/) |

### Google Analytics

In order to use Google Analytics, set `tracking_id` to your Google Analytics tracking code. You can also set `anonymize_ip` to `true` to anonymize IP tracking for analytic.

```yaml
analytics:
  provider: google
  google:
    tracking_id: "your-google-analytics-tracking-code"
    anonymize_ip: true
```


text:
	<title>Alun Michael's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Alun Michael's panel show appearances

Alun Michael (born 1943-08-22[ref]) has appeared in 4 episodes between 1998-2005.  Alun Michael on Wikipedia.

1998

1999

2000

2001

2002

2003

2004

2005

2005-02-23 / Question Time

2002-04-25 / Question Time

1999-05-27 / Question Time

1998-03-05 / Question Time


text: __all__ = ['ttypes', 'constants', 'Nimbus', 'DistributedRPC', 'DistributedRPCInvocations']


text:
package org.assertj.core.error;

import java.util.Set;

/**
 * Creates an error message indicating that an assertion that verifies that a class have field.
 *
 * @author William Delanoue
 * @author Joel Costigliola
 */
public class ShouldHaveFields extends BasicErrorMessageFactory {

  /**
   * Creates a new {@link org.assertj.core.error.ShouldHaveFields}.
   *
   * @param actual the actual value in the failed assertion.
   * @param expected expected fields for this class
   * @param missing missing fields for this class
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldHaveFields(Class<?> actual, Set<String> expected, Set<String> missing) {
    return new ShouldHaveFields(actual, expected, missing, false);
  }

  /**
   * Creates a new {@link org.assertj.core.error.ShouldHaveFields}.
   *
   * @param actual the actual value in the failed assertion.
   * @param expected expected fields for this class
   * @param missing missing fields for this class
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldHaveDeclaredFields(Class<?> actual, Set<String> expected,
                                                             Set<String> missing) {
    return new ShouldHaveFields(actual, expected, missing, true);
  }

  private ShouldHaveFields(Class<?> actual, Set<String> expected, Set<String> missing, boolean declared) {
    super("%nExpecting%n" +
          "  %s%n" +
          "to have the following " + (declared ? "declared" : "public accessible") + " fields:%n" +
          "  %s%n" +
          "but it doesn't have:%n" +
          "  %s", actual, expected, missing);
  }
}


text:
<!DOCTYPE html>

	<title>Element Testing Page</title>

		<input type="button" id="button1" value="Click Me 1"/>
		<button id="button2">Click Me 2</button>

		  <input type="checkbox" id="checkbox-without-label"/>

      <input type="checkbox" id="checkbox-with-label"/>label text 2

      <input type="checkbox" id="checkbox-inside-label"/>label text 3

      <input type="radio" id="radio-without-group">

      <input type="radio" name="radio-group1" value="1">

      <input type="radio" name="radio-group1" value="2"> radio text 2

      <input type="radio" name="radio-group1" id="r1_v3" value="3">radio text 3

      <input type="radio" name="radio-group1" id="r1_v4" value="4">radio text 4

		<input type="text" id="text-input"/>
		<textarea id="text-area"></textarea>

		<select id="select-simple">
			<option value="v1">t1</option>
			<option value="v2">t2</option>
		</select>

		<select id="select-complex" multiple="multiple">

			<optgroup label="g1">
				<option value="v1">t1</option>
				<option value="v2">t2 t11</option>
			</optgroup>

			<option value="v3">t3</option>
		</select>

  <form id="test-form">
    <button id="generate-btn">generate element</button>
  </form>


text:
define( [ "store/TwitchSerializer" ], function( TwitchSerializer ) {

	return TwitchSerializer.extend({
		primaryKey: "regex",

		modelNameFromPayloadKey: function() {
			return "twitchProductEmoticon";
		}
	});

});


text:
package utils;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;

import org.apache.log4j.Logger;

import com.google.common.base.Predicate;

/**
 * @author oshai
 */
public class TextFileUtils
{
	transient private static Logger log = Logger.getLogger(TextFileUtils.class);

	/**
	 * Fetch the entire contents of a text file, and return it in a String. This style of implementation does not throw
	 * Exceptions to the caller.
	 *
	 * @param aFile
	 *            is a file which already exists and can be read.
	 */
	public static String getContents(File aFile)
	{
		StringBuilder contents = new StringBuilder();
		try
		{
			FileReader input = new FileReader(aFile);
			try
			{
				int line;
				char[] buf = new char[1024];
				while ((line = input.read(buf)) != -1)
				{
					contents.append(buf, 0, line);
				}
			} finally
			{
				input.close();
			}
		}
		catch (IOException ex)
		{
			log.error("Error reading file " + aFile.getPath(), ex);
		}

		return contents.toString();
	}

	/**
	 * Change the contents of text file in its entirety, overwriting any existing text.
	 *
	 * This style of implementation throws all exceptions to the caller.
	 *
	 * @param aFile
	 *            is an existing file which can be written to.
	 * @throws IllegalArgumentException
	 *             if param does not comply.
	 * @throws FileNotFoundException
	 *             if the file does not exist.
	 * @throws IOException
	 *             if problem encountered during write.
	 */
	public static void setContents(String aFile, String aContents)
	{
		setContents(new File(aFile), aContents, false);
	}

	public static void setContents(File aFile, String aContents)
	{
		setContents(aFile, aContents, false);
	}

	public static void setContents(File aFile, String aContents, boolean append)
	{
		if (aFile == null)
		{
			throw new IllegalArgumentException("File should not be null.");
		}
		if (!aFile.exists())
		{
			throw ExceptionUtils.asUnchecked(new FileNotFoundException("File does not exist: " + aFile));
		}
		if (!aFile.isFile())
		{
			throw new IllegalArgumentException("Should not be a directory: " + aFile);
		}
		if (!aFile.canWrite())
		{
			throw new IllegalArgumentException("File cannot be written: " + aFile);
		}
		try
		{
			// use buffering
			Writer output = getWriter(aFile, append);
			try
			{
				// FileWriter always assumes default encoding is OK!
				output.write(aContents);
			} finally
			{
				output.close();
			}
		}
		catch (Exception ex)
		{
			throw ExceptionUtils.asUnchecked(ex);
		}
	}

	/**
	 * make sure to close writer after use!!!
	 */
	public static Writer getWriter(File aFile, boolean append)
	{
		try
		{
			Writer output = new BufferedWriter(new FileWriter(aFile, append));
			return output;
		}
		catch (Exception ex)
		{
			throw ExceptionUtils.asUnchecked(ex);
		}
	}

	public static void getContentByLines(String file, Predicate<String> linePredicate)
	{
		DataInputStream in = null;
		try
		{
			FileInputStream fstream = new FileInputStream(file);
			in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String strLine;
			// Read File Line By Line
			while ((strLine = br.readLine()) != null && linePredicate.apply(strLine))
			{
			}
			// Close the input stream
		}
		catch (Exception ex)
		{
			throw ExceptionUtils.asUnchecked(ex);
		} finally
		{
			if (null != in)
			{
				try
				{
					in.close();
				}
				catch (IOException ex)
				{
					log.debug("getContentByLines() - ", ex);
				}
			}
		}
	}

}


text:
package net.ceedubs.ficus.readers

import net.ceedubs.ficus.util.ReflectionUtils
import com.typesafe.config.Config
import scala.language.experimental.macros
import scala.reflect.internal.{StdNames, SymbolTable, Definitions}

trait ArbitraryTypeReader {
  implicit def arbitraryTypeValueReader[T]: ValueReader[T] = macro ArbitraryTypeReaderMacros.arbitraryTypeValueReader[T]
}

object ArbitraryTypeReader extends ArbitraryTypeReader

object ArbitraryTypeReaderMacros {
  import scala.reflect.macros.blackbox.Context

  def arbitraryTypeValueReader[T : c.WeakTypeTag](c: Context): c.Expr[ValueReader[T]] = {
    import c.universe._

    reify {
      new ValueReader[T] {
        def read(config: Config, path: String): T = instantiateFromConfig[T](c)(
          config = c.Expr[Config](Ident(TermName("config"))),
          path = c.Expr[String](Ident(TermName("path")))).splice
      }
    }
  }

  def instantiateFromConfig[T : c.WeakTypeTag](c: Context)(config: c.Expr[Config], path: c.Expr[String]): c.Expr[T] = {
    import c.universe._

    val returnType = c.weakTypeOf[T]

    def fail(reason: String) = c.abort(c.enclosingPosition, s"Cannot generate a config value reader for type $returnType, because $reason")

    val companionSymbol = returnType.typeSymbol.companion match {
      case NoSymbol => None
      case x => Some(x)
    }

    val instantiationMethod = ReflectionUtils.instantiationMethod[T](c, fail)

    val instantiationArgs = extractMethodArgsFromConfig[T](c)(method = instantiationMethod,
      companionObjectMaybe = companionSymbol, config = config, path = path, fail = fail)
    val instantiationObject = companionSymbol.filterNot(_ =>
      instantiationMethod.isConstructor
    ).map(Ident(_)).getOrElse(New(Ident(returnType.typeSymbol)))
    val instantiationCall = Select(instantiationObject, instantiationMethod.name)
    c.Expr[T](Apply(instantiationCall, instantiationArgs))
  }

  def extractMethodArgsFromConfig[T : c.WeakTypeTag](c: Context)(method: c.universe.MethodSymbol, companionObjectMaybe: Option[c.Symbol],
                                              config: c.Expr[Config], path: c.Expr[String], fail: String => Nothing): List[c.Tree] = {
    import c.universe._

    val decodedMethodName = method.name.decodedName.toString

    if (!method.isPublic) fail(s"'$decodedMethodName' method is not public")

    method.paramLists.head.zipWithIndex map { case (param, index) =>
      val name = param.name.decodedName.toString
      val key = q"""$path + "." + $name"""
      val returnType: Type = param.typeSignatureIn(c.weakTypeOf[T])

      companionObjectMaybe.filter(_ => param.asTerm.isParamWithDefault) map { companionObject =>
        val optionType = appliedType(weakTypeOf[Option[_]].typeConstructor, List(returnType))
        val optionReaderType = appliedType(weakTypeOf[ValueReader[_]].typeConstructor, List(optionType))
        val optionReader = c.inferImplicitValue(optionReaderType, silent = true) match {
          case EmptyTree => fail(s"an implicit value reader of type $optionReaderType must be in scope to read parameter '$name' on '$decodedMethodName' method since '$name' has a default value")
          case x => x
        }
        val argValueMaybe = q"$optionReader.read($config, $key)"
        Apply(Select(argValueMaybe, TermName("getOrElse")), List({
          // fall back to default value for param
          val u = c.universe.asInstanceOf[Definitions with SymbolTable with StdNames]
          val getter = u.nme.defaultGetterName(u.TermName(decodedMethodName), index + 1)
          Select(Ident(companionObject), TermName(getter.encoded))
        }))
      } getOrElse {
        val readerType = appliedType(weakTypeOf[ValueReader[_]].typeConstructor, List(returnType))
        val reader = c.inferImplicitValue(readerType, silent = true) match {
          case EmptyTree => fail(s"an implicit value reader of type $readerType must be in scope to read parameter '$name' on '$decodedMethodName' method")
          case x => x
        }
        q"$reader.read($config, $key)"
      }
    }
  }
}


text:
import cx from 'classnames'
import React, { PropTypes } from 'react'

import {
  customPropTypes,
  getElementType,
  getUnhandledProps,
  META,
} from '../../lib'

function CommentActions(props) {
  const { className, children } = props
  const classes = cx('actions', className)
  const rest = getUnhandledProps(CommentActions, props)
  const ElementType = getElementType(CommentActions, props)

  return <ElementType {...rest} className={classes}>{children}</ElementType>
}

CommentActions._meta = {
  name: 'CommentActions',
  parent: 'Comment',
  type: META.TYPES.VIEW,
}

CommentActions.propTypes = {
  /** An element type to render as (string or function). */
  as: customPropTypes.as,

  /** Primary content. */
  children: PropTypes.node,

  /** Additional classes. */
  className: PropTypes.string,
}

export default CommentActions


text:
@*
 * Copyright 2021 HM Revenue & Customs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *@

@this(
    ihtMainTemplateApplication: iht_main_template_application
)

@(title: String, heading: String,message: String)(implicit request : Request[_], messages: Messages)

@ihtMainTemplateApplication(title = heading,  browserTitle = Some(title)) {
    <p>@message</p>
    }


text:
import * as import0 from '../../app/app.component';
import * as import1 from '@angular/core/src/linker/view';
import * as import2 from '@angular/core/src/render/api';
import * as import3 from '@angular/core/src/linker/view_utils';
import * as import4 from '@angular/core/src/metadata/view';
import * as import5 from '../../app/timetable-item/timetable-item.service';
import * as import6 from '../../app/timetable-wish/timetable-wish.service';
import * as import7 from '../../app/timetable-tip/timetable-tip.service';
import * as import8 from '../../app/timetable-auth/timetable-auth.service';
import * as import9 from '@angular/core/src/linker/view_type';
import * as import10 from '@angular/core/src/change_detection/constants';
import * as import11 from '@angular/http/src/http';
import * as import12 from '@angular/router/src/router';
import * as import13 from '@angular/core/src/linker/component_factory';
import * as import14 from '../../app/timetable-header/timetable-header.component';
import * as import15 from './timetable-header/timetable-header.component.ngfactory';
import * as import16 from '@angular/core/src/linker/view_container';
import * as import17 from '../node_modules/@angular/router/src/directives/router_outlet.ngfactory';
import * as import18 from '@angular/router/src/router_outlet_map';
import * as import19 from '@angular/core/src/linker/component_factory_resolver';
import * as import20 from '@angular/router/src/directives/router_outlet';
export class Wrapper_AppComponent {
  /*private*/ _eventHandler:Function;
  context:import0.AppComponent;
  /*private*/ _changed:boolean;
  constructor() {
    this._changed = false;
    this.context = new import0.AppComponent();
  }
  ngOnDetach(view:import1.AppView<any>,componentView:import1.AppView<any>,el:any):void {
  }
  ngOnDestroy():void {
  }
  ngDoCheck(view:import1.AppView<any>,el:any,throwOnChange:boolean):boolean {
    var changed:any = this._changed;
    this._changed = false;
    return changed;
  }
  checkHost(view:import1.AppView<any>,componentView:import1.AppView<any>,el:any,throwOnChange:boolean):void {
  }
  handleEvent(eventName:string,$event:any):boolean {
    var result:boolean = true;
    return result;
  }
  subscribe(view:import1.AppView<any>,_eventHandler:any):void {
    this._eventHandler = _eventHandler;
  }
}
var renderType_AppComponent_Host:import2.RenderComponentType = import3.createRenderComponentType('',0,import4.ViewEncapsulation.None,([] as any[]),{});
class View_AppComponent_Host0 extends import1.AppView<any> {
  _el_0:any;
  compView_0:import1.AppView<import0.AppComponent>;
  _AppComponent_0_3:Wrapper_AppComponent;
  __TimetableItemService_0_4:import5.TimetableItemService;
  __TimetableWishService_0_5:import6.TimetableWishService;
  __TimetableTipService_0_6:import7.TimetableTipService;
  __TimetableAuthService_0_7:import8.TimetableAuthService;
  constructor(viewUtils:import3.ViewUtils,parentView:import1.AppView<any>,parentIndex:number,parentElement:any) {
    super(View_AppComponent_Host0,renderType_AppComponent_Host,import9.ViewType.HOST,viewUtils,parentView,parentIndex,parentElement,import10.ChangeDetectorStatus.CheckAlways);
  }
  get _TimetableItemService_0_4():import5.TimetableItemService {
    if ((this.__TimetableItemService_0_4 == null)) { (this.__TimetableItemService_0_4 = new import5.TimetableItemService(this.injectorGet(import11.Http,this.parentIndex))); }
    return this.__TimetableItemService_0_4;
  }
  get _TimetableWishService_0_5():import6.TimetableWishService {
    if ((this.__TimetableWishService_0_5 == null)) { (this.__TimetableWishService_0_5 = new import6.TimetableWishService()); }
    return this.__TimetableWishService_0_5;
  }
  get _TimetableTipService_0_6():import7.TimetableTipService {
    if ((this.__TimetableTipService_0_6 == null)) { (this.__TimetableTipService_0_6 = new import7.TimetableTipService()); }
    return this.__TimetableTipService_0_6;
  }
  get _TimetableAuthService_0_7():import8.TimetableAuthService {
    if ((this.__TimetableAuthService_0_7 == null)) { (this.__TimetableAuthService_0_7 = new import8.TimetableAuthService(this.injectorGet(import11.Http,this.parentIndex),this.injectorGet(import12.Router,this.parentIndex))); }
    return this.__TimetableAuthService_0_7;
  }
  createInternal(rootSelector:string):import13.ComponentRef<any> {
    this._el_0 = import3.selectOrCreateRenderHostElement(this.renderer,'my-app',import3.EMPTY_INLINE_ARRAY,rootSelector,(null as any));
    this.compView_0 = new View_AppComponent0(this.viewUtils,this,0,this._el_0);
    this._AppComponent_0_3 = new Wrapper_AppComponent();
    this.compView_0.create(this._AppComponent_0_3.context);
    this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [this._el_0]),(null as any));
    return new import13.ComponentRef_<any>(0,this,this._el_0,this._AppComponent_0_3.context);
  }
  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
    if (((token === import0.AppComponent) && (0 === requestNodeIndex))) { return this._AppComponent_0_3.context; }
    if (((token === import5.TimetableItemService) && (0 === requestNodeIndex))) { return this._TimetableItemService_0_4; }
    if (((token === import6.TimetableWishService) && (0 === requestNodeIndex))) { return this._TimetableWishService_0_5; }
    if (((token === import7.TimetableTipService) && (0 === requestNodeIndex))) { return this._TimetableTipService_0_6; }
    if (((token === import8.TimetableAuthService) && (0 === requestNodeIndex))) { return this._TimetableAuthService_0_7; }
    return notFoundResult;
  }
  detectChangesInternal(throwOnChange:boolean):void {
    this._AppComponent_0_3.ngDoCheck(this,this._el_0,throwOnChange);
    this.compView_0.internalDetectChanges(throwOnChange);
  }
  destroyInternal():void {
    this.compView_0.destroy();
  }
  visitRootNodesInternal(cb:any,ctx:any):void {
    cb(this._el_0,ctx);
  }
}
export const AppComponentNgFactory:import13.ComponentFactory<import0.AppComponent> = new import13.ComponentFactory<import0.AppComponent>('my-app',View_AppComponent_Host0,import0.AppComponent);
const styles_AppComponent:any[] = ([] as any[]);
var renderType_AppComponent:import2.RenderComponentType = import3.createRenderComponentType('',0,import4.ViewEncapsulation.None,styles_AppComponent,{});
export class View_AppComponent0 extends import1.AppView<import0.AppComponent> {
  _el_0:any;
  _text_1:any;
  _el_2:any;
  compView_2:import1.AppView<import14.TimetableHeaderComponent>;
  _TimetableHeaderComponent_2_3:import15.Wrapper_TimetableHeaderComponent;
  _text_3:any;
  _text_4:any;
  _el_5:any;
  /*private*/ _vc_5:import16.ViewContainer;
  _RouterOutlet_5_5:import17.Wrapper_RouterOutlet;
  _text_6:any;
  _text_7:any;
  constructor(viewUtils:import3.ViewUtils,parentView:import1.AppView<any>,parentIndex:number,parentElement:any) {
    super(View_AppComponent0,renderType_AppComponent,import9.ViewType.COMPONENT,viewUtils,parentView,parentIndex,parentElement,import10.ChangeDetectorStatus.CheckAlways);
  }
  createInternal(rootSelector:string):import13.ComponentRef<any> {
    const parentRenderNode:any = this.renderer.createViewRoot(this.parentElement);
    this._el_0 = import3.createRenderElement(this.renderer,parentRenderNode,'div',import3.EMPTY_INLINE_ARRAY,(null as any));
    this._text_1 = this.renderer.createText(this._el_0,'\n    ',(null as any));
    this._el_2 = import3.createRenderElement(this.renderer,this._el_0,'timetable-header',import3.EMPTY_INLINE_ARRAY,(null as any));
    this.compView_2 = new import15.View_TimetableHeaderComponent0(this.viewUtils,this,2,this._el_2);
    this._TimetableHeaderComponent_2_3 = new import15.Wrapper_TimetableHeaderComponent();
    this.compView_2.create(this._TimetableHeaderComponent_2_3.context);
    this._text_3 = this.renderer.createText(this._el_0,'\n    ',(null as any));
    this._text_4 = this.renderer.createText(this._el_0,'\n    ',(null as any));
    this._el_5 = import3.createRenderElement(this.renderer,this._el_0,'router-outlet',import3.EMPTY_INLINE_ARRAY,(null as any));
    this._vc_5 = new import16.ViewContainer(5,0,this,this._el_5);
    this._RouterOutlet_5_5 = new import17.Wrapper_RouterOutlet(this.parentView.injectorGet(import18.RouterOutletMap,this.parentIndex),this._vc_5.vcRef,this.parentView.injectorGet(import19.ComponentFactoryResolver,this.parentIndex),(null as any));
    this._text_6 = this.renderer.createText(this._el_0,'\n',(null as any));
    this._text_7 = this.renderer.createText(parentRenderNode,'\n',(null as any));
    this.init((null as any),((<any>this.renderer).directRenderer? (null as any): [
      this._el_0,
      this._text_1,
      this._el_2,
      this._text_3,
      this._text_4,
      this._el_5,
      this._text_6,
      this._text_7
    ]
    ),(null as any));
    return (null as any);
  }
  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
    if (((token === import14.TimetableHeaderComponent) && (2 === requestNodeIndex))) { return this._TimetableHeaderComponent_2_3.context; }
    if (((token === import20.RouterOutlet) && (5 === requestNodeIndex))) { return this._RouterOutlet_5_5.context; }
    return notFoundResult;
  }
  detectChangesInternal(throwOnChange:boolean):void {
    this._TimetableHeaderComponent_2_3.ngDoCheck(this,this._el_2,throwOnChange);
    this._RouterOutlet_5_5.ngDoCheck(this,this._el_5,throwOnChange);
    this._vc_5.detectChangesInNestedViews(throwOnChange);
    this.compView_2.internalDetectChanges(throwOnChange);
  }
  destroyInternal():void {
    this._vc_5.destroyNestedViews();
    this.compView_2.destroy();
    this._RouterOutlet_5_5.ngOnDestroy();
  }
}


text:
#pragma once

#include "envoy/api/api.h"
#include "envoy/event/dispatcher.h"
#include "envoy/http/conn_pool.h"
#include "envoy/network/address.h"
#include "envoy/runtime/runtime.h"
#include "envoy/stats/scope.h"
#include "envoy/stats/store.h"
#include "envoy/upstream/upstream.h"

#include "nighthawk/client/benchmark_client.h"
#include "nighthawk/common/request_source.h"
#include "nighthawk/common/sequencer.h"
#include "nighthawk/common/statistic.h"
#include "nighthawk/user_defined_output/user_defined_output_plugin.h"

#include "external/envoy/source/common/common/logger.h"
#include "external/envoy/source/common/common/random_generator.h"
#include "external/envoy/source/common/http/http1/conn_pool.h"
#include "external/envoy/source/common/http/http2/conn_pool.h"
#include "external/envoy/source/common/runtime/runtime_impl.h"

#include "api/client/options.pb.h"

#include "source/client/stream_decoder.h"
#include "source/common/statistic_impl.h"

namespace Nighthawk {
namespace Client {

using namespace std::chrono_literals;

#define ALL_BENCHMARK_CLIENT_COUNTERS(COUNTER)                                                     \
  COUNTER(stream_resets)                                                                           \
  COUNTER(http_1xx)                                                                                \
  COUNTER(http_2xx)                                                                                \
  COUNTER(http_3xx)                                                                                \
  COUNTER(http_4xx)                                                                                \
  COUNTER(http_5xx)                                                                                \
  COUNTER(http_xxx)                                                                                \
  COUNTER(pool_overflow)                                                                           \
  COUNTER(pool_connection_failure)                                                                 \
  COUNTER(user_defined_plugin_handle_headers_failure)                                              \
  COUNTER(user_defined_plugin_handle_data_failure)                                                 \
  COUNTER(user_defined_plugin_per_worker_output_failure)

// For counter metrics, Nighthawk use Envoy Counter directly. For histogram metrics, Nighthawk uses
// its own Statistic instead of Envoy Histogram. Here BenchmarkClientCounters contains only counters
// while BenchmarkClientStatistic contains only histograms.
struct BenchmarkClientCounters {
  ALL_BENCHMARK_CLIENT_COUNTERS(GENERATE_COUNTER_STRUCT)
};

// BenchmarkClientStatistic contains only histogram metrics.
struct BenchmarkClientStatistic {
  BenchmarkClientStatistic(BenchmarkClientStatistic&& statistic) noexcept;
  BenchmarkClientStatistic(StatisticPtr&& connect_stat, StatisticPtr&& response_stat,
                           StatisticPtr&& response_header_size_stat,
                           StatisticPtr&& response_body_size_stat, StatisticPtr&& latency_1xx_stat,
                           StatisticPtr&& latency_2xx_stat, StatisticPtr&& latency_3xx_stat,
                           StatisticPtr&& latency_4xx_stat, StatisticPtr&& latency_5xx_stat,
                           StatisticPtr&& latency_xxx_stat,
                           StatisticPtr&& origin_latency_statistic);

  // These are declared order dependent. Changing ordering may trigger on assert upon
  // destruction when tls has been involved during usage.
  StatisticPtr connect_statistic;
  StatisticPtr response_statistic;
  StatisticPtr response_header_size_statistic;
  StatisticPtr response_body_size_statistic;
  StatisticPtr latency_1xx_statistic;
  StatisticPtr latency_2xx_statistic;
  StatisticPtr latency_3xx_statistic;
  StatisticPtr latency_4xx_statistic;
  StatisticPtr latency_5xx_statistic;
  StatisticPtr latency_xxx_statistic;
  StatisticPtr origin_latency_statistic;
};

class Http1PoolImpl : public Envoy::Http::FixedHttpConnPoolImpl {
public:
  enum class ConnectionReuseStrategy {
    MRU,
    LRU,
  };
  using Envoy::Http::FixedHttpConnPoolImpl::FixedHttpConnPoolImpl;
  Envoy::Http::ConnectionPool::Cancellable*
  newStream(Envoy::Http::ResponseDecoder& response_decoder,
            Envoy::Http::ConnectionPool::Callbacks& callbacks,
            const Instance::StreamOptions& options) override;
  void setConnectionReuseStrategy(const ConnectionReuseStrategy connection_reuse_strategy) {
    connection_reuse_strategy_ = connection_reuse_strategy;
  }
  void setPrefetchConnections(const bool prefetch_connections) {
    prefetch_connections_ = prefetch_connections;
  }

private:
  ConnectionReuseStrategy connection_reuse_strategy_{};
  bool prefetch_connections_{};
};

class BenchmarkClientHttpImpl : public BenchmarkClient,
                                public StreamDecoderCompletionCallback,
                                public Envoy::Logger::Loggable<Envoy::Logger::Id::main> {
public:
  BenchmarkClientHttpImpl(Envoy::Api::Api& api, Envoy::Event::Dispatcher& dispatcher,
                          Envoy::Stats::Scope& scope, BenchmarkClientStatistic& statistic,
                          Envoy::Http::Protocol protocol,
                          Envoy::Upstream::ClusterManagerPtr& cluster_manager,
                          Envoy::Tracing::HttpTracerSharedPtr& http_tracer,
                          absl::string_view cluster_name, RequestGenerator request_generator,
                          const bool provide_resource_backpressure,
                          absl::string_view latency_response_header_name,
                          std::vector<UserDefinedOutputNamePluginPair> user_defined_output_plugins);
  void setConnectionLimit(uint32_t connection_limit) { connection_limit_ = connection_limit; }
  void setMaxPendingRequests(uint32_t max_pending_requests) {
    max_pending_requests_ = max_pending_requests;
  }
  void setMaxActiveRequests(uint32_t max_active_requests) {
    max_active_requests_ = max_active_requests;
  }
  void setMaxRequestsPerConnection(uint32_t max_requests_per_connection) {
    max_requests_per_connection_ = max_requests_per_connection;
  }

  // BenchmarkClient
  void terminate() override;
  StatisticPtrMap statistics() const override;
  bool shouldMeasureLatencies() const override { return measure_latencies_; }
  void setShouldMeasureLatencies(bool measure_latencies) override {
    measure_latencies_ = measure_latencies;
  }
  bool tryStartRequest(CompletionCallback caller_completion_callback) override;
  Envoy::Stats::Scope& scope() const override { return *scope_; }

  /**
   * Returns additional output from any specified User Defined Output plugins.
   */
  std::vector<nighthawk::client::UserDefinedOutput> getUserDefinedOutputResults() const override;

  // StreamDecoderCompletionCallback
  void onComplete(bool success, const Envoy::Http::ResponseHeaderMap& headers) override;
  void onPoolFailure(Envoy::Http::ConnectionPool::PoolFailureReason reason) override;
  void exportLatency(const uint32_t response_code, const uint64_t latency_ns) override;
  void handleResponseData(const Envoy::Buffer::Instance& response_data) override;

  // Helpers
  absl::optional<::Envoy::Upstream::HttpPoolData> pool() {
    const auto thread_local_cluster = cluster_manager_->getThreadLocalCluster(cluster_name_);
    return thread_local_cluster->httpConnPool(Envoy::Upstream::ResourcePriority::Default, protocol_,
                                              nullptr);
  }

private:
  Envoy::Api::Api& api_;
  Envoy::Event::Dispatcher& dispatcher_;
  Envoy::Stats::ScopeSharedPtr scope_;
  BenchmarkClientStatistic statistic_;
  const Envoy::Http::Protocol protocol_;
  std::chrono::seconds timeout_{5s};
  uint32_t connection_limit_{1};
  uint32_t max_pending_requests_{1};
  uint32_t max_active_requests_{UINT32_MAX};
  uint32_t max_requests_per_connection_{UINT32_MAX};
  Envoy::Event::TimerPtr timer_;
  Envoy::Random::RandomGeneratorImpl generator_;
  uint64_t requests_completed_{};
  uint64_t requests_initiated_{};
  bool measure_latencies_{};
  BenchmarkClientCounters benchmark_client_counters_;
  Envoy::Upstream::ClusterManagerPtr& cluster_manager_;
  Envoy::Tracing::HttpTracerSharedPtr& http_tracer_;
  std::string cluster_name_;
  const RequestGenerator request_generator_;
  const bool provide_resource_backpressure_;
  const std::string latency_response_header_name_;
  Envoy::Event::TimerPtr drain_timer_;
  std::vector<UserDefinedOutputNamePluginPair> user_defined_output_plugins_;
};

} // namespace Client
} // namespace Nighthawk


text:
set timezone 'Asia/Shanghai';
drop table if exists t;
create table t(i int auto_increment,j datetime with time zone) partition by range(minute(j))
(
partition p0 values less than (20),
partition p1 values less than (30),
partition p2 values less than maxvalue
);
insert into t values (null,datetimetz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetimeltz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetime'2010-1-1 06:53:45');
insert into t values (null,datetimeltz '2010-1-1 06:53:45 +2:50');
insert into t values (null,datetimetz '2010-1-1 06:53:45 +2:50');
select * from t__p__p0 order by 1;
select * from t__p__p1 order by 1;
select * from t__p__p2 order by 1;

drop table if exists t;
create table t(i int auto_increment,j datetime with local time zone) partition by range(minute(j))
(
partition p0 values less than (20),
partition p1 values less than (30),
partition p2 values less than maxvalue
);
insert into t values (null,datetimetz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetimeltz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetime'2010-1-1 06:53:45');
insert into t values (null,datetimeltz '2010-1-1 06:53:45 +2:50');
insert into t values (null,datetimetz '2010-1-1 06:53:45 +2:50');
select * from t__p__p0 order by 1;
select * from t__p__p1 order by 1;
select * from t__p__p2 order by 1;

drop table if exists t;
create table t(i int auto_increment,j timestamp with time zone) partition by range(minute(j))
(
partition p0 values less than (20),
partition p1 values less than (30),
partition p2 values less than maxvalue
);
insert into t values (null,datetimetz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetimeltz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetime'2010-1-1 06:53:45');
insert into t values (null,datetimeltz '2010-1-1 06:53:45 +2:50');
insert into t values (null,datetimetz '2010-1-1 06:53:45 +2:50');
select * from t__p__p0 order by 1;
select * from t__p__p1 order by 1;
select * from t__p__p2 order by 1;

drop table if exists t;
create table t(i int auto_increment,j timestamp with local time zone) partition by range(minute(j))
(
partition p0 values less than (20),
partition p1 values less than (30),
partition p2 values less than maxvalue
);
insert into t values (null,datetimetz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetimeltz'2010-1-1 06:53:45 +8:30:30');
insert into t values (null,datetime'2010-1-1 06:53:45');
insert into t values (null,datetimeltz '2010-1-1 06:53:45 +2:50');
insert into t values (null,datetimetz '2010-1-1 06:53:45 +2:50');
select * from t__p__p0 order by 1;
select * from t__p__p1 order by 1;
select * from t__p__p2 order by 1;
drop table if exists t;
set timezone 'Asia/Seoul';


text:
namespace cobalt {
namespace speech {

class SpeechSynthesisUtterance;

// The speech synthesis event interface is the scripted web API for defining a
// speech synthesis event.
//   https://dvcs.w3.org/hg/speech-api/raw-file/9a0075d25326/speechapi.html#speechsynthesisevent
class SpeechSynthesisEvent : public web::Event {
 public:
  SpeechSynthesisEvent(
      base::Token event_name,
      const scoped_refptr<SpeechSynthesisUtterance>& utterance);

  ~SpeechSynthesisEvent();

  // Readonly Attributes.
  const scoped_refptr<SpeechSynthesisUtterance>& utterance() const {
    return utterance_;
  }
  const base::Optional<unsigned int> char_index() const { return char_index_; }
  const base::Optional<float> elapsed_time() const { return elapsed_time_; }
  const base::Optional<std::string>& name() const { return name_; }

  DEFINE_WRAPPABLE_TYPE(SpeechSynthesisEvent);
  void TraceMembers(script::Tracer* tracer) override;

 private:
  const scoped_refptr<SpeechSynthesisUtterance> utterance_;
  const base::Optional<unsigned int> char_index_;
  const base::Optional<float> elapsed_time_;
  const base::Optional<std::string> name_;

  DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisEvent);
};

}  // namespace speech
}  // namespace cobalt

#endif  // COBALT_SPEECH_SPEECH_SYNTHESIS_EVENT_H_


text:
using System;
using System.Text;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;

using Vernacular.Tool;

namespace Vernacular.Parsers
{
    public sealed class AndroidResourceParser : Parser
    {
        private List<string> xml_paths = new List<string> ();

        public override IEnumerable<string> SupportedFileExtensions {
            get {
                yield return ".xml";
                yield return ".axml";
            }
        }

        public override void Add (string path)
        {
            xml_paths.Add (path);
        }

        private static string DecodeElement (XElement element)
        {
            StringBuilder builder = null;

            foreach (var node in element.Nodes ()) {
                if (builder == null) {
                    builder = new StringBuilder (node.ToString ());
                } else {
                    builder.Append (node.ToString ());
                }
            }

            var value = builder.ToString ();

            return Regex.Replace (value
                .Replace ("\n", " ")
                .Replace ("\r", " ")
                .Replace ("\t", " ")
                .Replace ("\\'", "'")
                .Replace ("\\\"", "\"")
                .Escape (decode: true),
                @"[ ]+", " ", RegexOptions.Multiline).Trim ();
        }

        public override IEnumerable<LocalizedString> Parse ()
        {
            return from xml_path in xml_paths
                   from resource in XDocument.Load (xml_path, LoadOptions.SetLineInfo).Elements ("resources")
                   from @string in resource.Elements ("string")
                   select new LocalizedString {
                       Name = @string.Attribute ("name").Value,
                       References = new [] {
                           String.Format ("{0}:{1}", xml_path, ((IXmlLineInfo)@string).LineNumber)
                       },
                       UntranslatedSingularValue = DecodeElement (@string)
                   };
        }
    }
}


text:
package com.example.fw;

import java.util.List;
import java.util.ArrayList;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import com.example.tests.GroupData;
import com.example.tests.TestBase;
import com.example.utils.SortedListOf;

public class GroupHelper extends WebDriverHelperBase {

	public GroupHelper(ApplicationManager manager) {
		super(manager);
	}

	/*private SortedListOf<GroupData> cachedGroups;

	public SortedListOf<GroupData> getGroups() {
		if (cachedGroups == null){
			rebuildCache();
		}
		return cachedGroups;
	}*/

	public  SortedListOf<GroupData> getUiGroups() {
		SortedListOf<GroupData> groups = new SortedListOf<GroupData>();
		manager.navigateTo().groupsPage();
		List<WebElement> checkboxes = driver.findElements(By.name("selected[]"));
		for (WebElement checkbox : checkboxes) {
			String title = checkbox.getAttribute("title");
			//group.name = title.substring("Select (".length(), title.length() - ")".length());
			String name = title.substring(title.indexOf("(")+1, title.indexOf(")"));
			groups.add(new GroupData().withName(name));
		}
		return groups;
	}

	public GroupHelper createGroup(GroupData group) {

    	initGroupCreation();
    	fillGroupForm(group);
    	submitGroupForm();
    	returntoGroupPage();
    	//manager.getModel().addGroup(group);
    	return this;
	}

	public GroupHelper deleteGroup(int index) {
		manager.navigateTo().groupsPage();
		selectGroupByIndex(index);
		submitGroupDeletion();
 		returntoGroupPage();
 		//manager.getModel().removeGroup(index);
		return this;
	}

	public GroupHelper modifyGroup(int index, GroupData group) {
		manager.navigateTo().groupsPage();
		initGroupModification(index);
		fillGroupForm(group);
		submitGroupModification();
	    returntoGroupPage();
	   // manager.getModel().removeGroup(index).addGroup(group);
		return this;
	}

	//===================================================================================

	public GroupHelper initGroupCreation() {
		manager.navigateTo().groupsPage();
		click(By.name("new"));
		return this;
	}

	public GroupHelper fillGroupForm(GroupData group) {
		type(By.name("group_name"), group.getName());
		type(By.name("group_header"), group.getHeader());
		type(By.name("group_footer"), group.getFooter());
		return this;
	}

	public GroupHelper submitGroupForm() {
		click(By.name("submit"));
		return this;
	}

	public GroupHelper returntoGroupPage() {
	    click(By.linkText("group page"));
		return this;
	}

	public GroupHelper deleteFewGroups(int[] index) {
		for (int i=0; i<index.length; i++){
			selectGroupByIndex(index[i]);
		}
		submitGroupDeletion();
		return this;
	}

	private GroupHelper selectGroupByIndex(int index) {
		click(By.xpath("//input[@name='selected[]'][" + (index+1) + "]"));
		return this;
	}

	public GroupHelper initGroupModification(int index) {
		selectGroupByIndex(index);
		click(By.name("edit"));
		return this;
	}

	public GroupHelper submitGroupModification() {
		click(By.name("update"));
		return this;

	}
	private void submitGroupDeletion() {
		click(By.name("delete"));
	}

}