text:
package com.example.anzhimaketdemo;
/*Beta2.0*/
import java.io.IOException;
import java.util.ArrayList;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public abstract class WebpageAnalyzer {

	protected Document doc = null;

	protected WebpageAnalyzer(String url)
	{
		try {
			doc = Jsoup.connect(url).get();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	//delete <>
	protected String deleteSimpleBrackets(String str)
	{
		int leftbracket = -1;
		int rightbracket = -1;

		while( (leftbracket = str.indexOf('<') ) != -1 && ( rightbracket = str.indexOf('>') ) != -1 )
		{
			str = str.replace(str.substring(leftbracket, rightbracket+1), "");
		}
		return str;
	}

	//<div class = "name"> </div>
	protected Elements getElementsByClass(String classname)
	{
		Elements elements = doc.getElementsByClass(classname);
		return elements;
	}

	//<a > </a>
	protected Elements getElementsByTag(String tag)
	{
		Elements elements = doc.select(tag);
		return elements;
	}

	protected Element getElementById(String id)
	{
		Element element = doc.getElementById(id);
		return element;
	}

	// return all links
	protected Elements getAllLinks()
	{
		// get all links
		Elements links = doc.select("a[href]");
		return links;
	}

	//return certain link
	protected ArrayList<String> getLinksByText(String text)
	{
		Elements links = getAllLinks();
		ArrayList<String> arrayList = new ArrayList<>();

		for (Element element : links) {
			if (element.text().equals(text)) {
				arrayList.add(element.attr("href"));
			}
		}

		return arrayList;
	}

	// return all pics
	protected Elements getAllImages()
	{
		// get all pic links
		Elements images = doc.select("img[src~=(?i)\\.(png|jpe?g|gif)]");
		return images;
	}

	//return certain Image
	protected ArrayList<String> getImagesByText(String text)
	{
		Elements links = getAllImages();
		ArrayList<String> arrayList = new ArrayList<>();

		for (Element element : links) {
			if (element.attr("alt").equals(text)) {
				arrayList.add(element.attr("src"));
			}
		}

		return arrayList;
	}

	//get Simple MetaContent
	protected String getMetaContent(String text)
	{
		// get all pic links
		String query = "meta[name=" + text + "]";
		String content = doc.select(query).first().attr("content");

		return content;
	}

	//find the nthOccurrence in a String
	protected int nthOccurrence(String str, char c, int n) {
	    int pos = str.indexOf(c, 0);
	    while (--n > 0 && pos != -1)
	        pos = str.indexOf(c, pos+1);
	    return pos;
	}

	protected int nthOccurrence(String str, String c, int n) {
	    int pos = str.indexOf(c, 0);
	    while (--n > 0 && pos != -1)
	        pos = str.indexOf(c, pos+1);
	    return pos;
	}

}

redpajama_set_name: RedPajamaGithub


text:
using System;

using Internal.TypeSystem;

using Debug = System.Diagnostics.Debug;

namespace Internal.IL.Stubs
{
    /// <summary>
    /// Provides method bodies for generic System.Runtime.CompilerServices.Unsafe intrinsics.
    /// </summary>
    public static class UnsafeIntrinsics
    {
        public static MethodIL EmitIL(MethodDesc method)
        {
            Debug.Assert(((MetadataType)method.OwningType).Name == "Unsafe");

            switch (method.Name)
            {
                case "AsPointer":
                    return new ILStubMethodIL(method, new byte[] { (byte)ILOpcode.ldarg_0, (byte)ILOpcode.conv_u, (byte)ILOpcode.ret }, Array.Empty<LocalVariableDefinition>(), null);
                case "SizeOf":
                    return EmitSizeOf(method);
                case "As":
                    return new ILStubMethodIL(method, new byte[] { (byte)ILOpcode.ldarg_0, (byte)ILOpcode.ret }, Array.Empty<LocalVariableDefinition>(), null);
                case "AddByteOffset":
                    return new ILStubMethodIL(method, new byte[] { (byte)ILOpcode.ldarg_0, (byte)ILOpcode.ldarg_1, (byte)ILOpcode.add, (byte)ILOpcode.ret }, Array.Empty<LocalVariableDefinition>(), null);
                case "InitBlockUnaligned":
                    return new ILStubMethodIL(method, new byte[] {
                        (byte)ILOpcode.ldarg_0, (byte)ILOpcode.ldarg_1, (byte)ILOpcode.ldarg_2,
                        (byte)ILOpcode.prefix1, unchecked((byte)ILOpcode.unaligned), 0x01,
                        (byte)ILOpcode.prefix1, unchecked((byte)ILOpcode.initblk),
                        (byte)ILOpcode.ret }, Array.Empty<LocalVariableDefinition>(), null);
                case "Read":
                    return EmitReadWrite(method, write: false);
                case "Write":
                    return EmitReadWrite(method, write: true);
                case "ReadUnaligned":
                    return EmitReadWrite(method, write: false, unaligned: true);
                case "WriteUnaligned":
                    return EmitReadWrite(method, write: true, unaligned: true);
            }

            return null;
        }

        private static MethodIL EmitSizeOf(MethodDesc method)
        {
            Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 0);

            TypeSystemContext context = method.Context;

            ILEmitter emit = new ILEmitter();
            ILCodeStream codeStream = emit.NewCodeStream();
            codeStream.Emit(ILOpcode.sizeof_, emit.NewToken(context.GetSignatureVariable(0, method: true)));
            codeStream.Emit(ILOpcode.ret);
            return emit.Link(method);
        }

        private static MethodIL EmitReadWrite(MethodDesc method, bool write, bool unaligned = false)
        {
            Debug.Assert(method.Signature.IsStatic && method.Signature.Length == (write ? 2 : 1));

            TypeSystemContext context = method.Context;

            ILEmitter emit = new ILEmitter();
            ILCodeStream codeStream = emit.NewCodeStream();

            codeStream.EmitLdArg(0);
            if (write) codeStream.EmitLdArg(1);
            if (unaligned) codeStream.EmitUnaligned();
            codeStream.Emit(write ? ILOpcode.stobj : ILOpcode.ldobj,
                emit.NewToken(context.GetSignatureVariable(0, method: true)));
            codeStream.Emit(ILOpcode.ret);
            return emit.Link(method);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/temples/nashville-tennessee#nashville-temple-lds-1063720" xml:lang="eng" locale="eng" status="publish" xmlns:its="http://www.w3.org/2005/11/its">
  <search-meta>
      <uri-title its:translate="no">nashville-temple-lds-1063720</uri-title>
      <source>nashville-temple-lds-1063720</source>
      <publication-type its:translate="no">image</publication-type>
      <media-type its:translate="no">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2012-12-14">2012-12-14</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no">global-search</collection>
          <collection its:translate="no">media</collection>
          <collection its:translate="no">images</collection>
      </collections>
      <subjects>
          <subject>nashville tennessee temple</subject>
          <subject>temples</subject>
          <subject>exteriors</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/temples/nashville-tennessee/nashville-temple-lds-1063720-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/temples/nashville-tennessee/nashville-temple-lds-1063720-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>150 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/temples/nashville-tennessee/nashville-temple-lds-1063720-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>167 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/temples/nashville-tennessee/nashville-temple-lds-1063720-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>353 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/temples/nashville-tennessee/nashville-temple-lds-1063720-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>701 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/temples/nashville-tennessee/nashville-temple-lds-1063720-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
</ldswebml>


text:
package org.prussia.play.cloud.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication().withUser("configUser").password("configPassword").roles("SYSTEM");
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests().anyRequest().hasRole("SYSTEM").and().httpBasic().and().csrf().disable();
    }
}


text:
// Copyright 2019 The Bazel Authors. All rights reserved.
//
// 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.

package com.google.devtools.build.lib.bazel.rules.ninja.parser;

import com.google.devtools.build.lib.bazel.rules.ninja.file.DeclarationConsumer;
import com.google.devtools.build.lib.bazel.rules.ninja.file.FileFragment;
import com.google.devtools.build.lib.bazel.rules.ninja.file.GenericParsingException;
import com.google.devtools.build.lib.bazel.rules.ninja.lexer.NinjaLexer;
import com.google.devtools.build.lib.bazel.rules.ninja.lexer.NinjaToken;
import com.google.devtools.build.lib.bazel.rules.ninja.parser.NinjaFileParseResult.NinjaPromise;
import com.google.devtools.build.lib.bazel.rules.ninja.pipeline.NinjaPipeline;
import com.google.devtools.build.lib.util.Pair;
import java.io.IOException;

/**
 * Ninja parser: an instance will be created per a fragment of Ninja file, to avoid synchronization
 * while parsing independent values.
 *
 * <p>Populates the {@link NinjaFileParseResult} with variables and rules.
 */
public class NinjaParser implements DeclarationConsumer {
  private final NinjaPipeline pipeline;
  private final NinjaFileParseResult parseResult;
  private final String ninjaFileName;

  private static final String UNSUPPORTED_TOKEN_MESSAGE =
      " is an unsupported type of Ninja lexeme for the parser at this state. "
          + "These are unexpected lexemes at this state for the parser, and running into a "
          + "token of this lexeme hints that the parser did not progress the lexer to a "
          + "valid state during a previous parsing step.";

  public NinjaParser(
      NinjaPipeline pipeline, NinjaFileParseResult parseResult, String ninjaFileName) {
    this.pipeline = pipeline;
    this.parseResult = parseResult;
    this.ninjaFileName = ninjaFileName;
  }

  @Override
  public void declaration(FileFragment fragment) throws GenericParsingException, IOException {
    long offset = fragment.getFragmentOffset();

    NinjaLexer lexer = new NinjaLexer(fragment);
    if (!lexer.hasNextToken()) {
      throw new IllegalStateException("Empty fragment passed as declaration.");
    }
    NinjaToken token = lexer.nextToken();
    // Skip possible leading newlines in the fragment for parsing.
    while (lexer.hasNextToken() && NinjaToken.NEWLINE.equals(token)) {
      token = lexer.nextToken();
    }
    if (!lexer.hasNextToken()) {
      // If fragment contained only newlines.
      return;
    }
    long declarationStart = offset + lexer.getLastStart();
    lexer.undo();
    NinjaParserStep parser =
        new NinjaParserStep(lexer, pipeline.getPathFragmentInterner(), pipeline.getNameInterner());

    switch (token) {
      case IDENTIFIER:
        Pair<String, NinjaVariableValue> variable = parser.parseVariable();
        parseResult.addVariable(variable.getFirst(), declarationStart, variable.getSecond());
        break;
      case RULE:
        NinjaRule rule = parser.parseNinjaRule();
        parseResult.addRule(declarationStart, rule);
        break;
      case POOL:
        parseResult.addPool(declarationStart, parser.parseNinjaPool());
        break;
      case INCLUDE:
        NinjaVariableValue includeStatement = parser.parseIncludeStatement();
        NinjaPromise<NinjaFileParseResult> includeFuture =
            pipeline.createChildFileParsingPromise(
                includeStatement, declarationStart, ninjaFileName);
        parseResult.addIncludeScope(declarationStart, includeFuture);
        break;
      case SUBNINJA:
        NinjaVariableValue subNinjaStatement = parser.parseSubNinjaStatement();
        NinjaPromise<NinjaFileParseResult> subNinjaFuture =
            pipeline.createChildFileParsingPromise(
                subNinjaStatement, declarationStart, ninjaFileName);
        parseResult.addSubNinjaScope(declarationStart, subNinjaFuture);
        break;
      case BUILD:
        FileFragment targetFragment;
        if (declarationStart == offset) {
          targetFragment = fragment;
        } else {
          // Method subFragment accepts only the offset *inside fragment*.
          // So we should subtract the offset of fragment's buffer in file
          // (fragment.getFileOffset()),
          // and start of fragment inside buffer (fragment.getStartIncl()).
          long fragmentStart =
              declarationStart - fragment.getFileOffset() - fragment.getStartIncl();

          // While the absolute offset is typed as long (because of larger ninja files), the
          // fragments are only at most Integer.MAX_VALUE long, so fragmentStart cannot be
          // larger than that. Sanity check this here.
          if (fragmentStart > Integer.MAX_VALUE) {
            throw new GenericParsingException(
                String.format(
                    "The fragmentStart value %s is not expected to be larger than max-int, "
                        + "since each fragment is at most max-int long.",
                    fragmentStart));
          }
          targetFragment = fragment.subFragment((int) fragmentStart, fragment.length());
        }
        parseResult.addTarget(targetFragment);
        break;
      case DEFAULT:
        // Do nothing.
        break;
      case ZERO:
      case EOF:
        return;
      case COLON:
      case EQUALS:
      case ESCAPED_TEXT:
      case INDENT:
      case NEWLINE:
      case PIPE:
      case PIPE2:
      case TEXT:
      case VARIABLE:
        throw new UnsupportedOperationException(token.name() + UNSUPPORTED_TOKEN_MESSAGE);
      case ERROR:
        throw new GenericParsingException(lexer.getError());
        // Omit default case on purpose. Explicitly specify *all* NinjaToken enum cases above or the
        // compilation will fail.
    }
  }
}


text:
<?php

namespace app\models;

use Yii;
use yii\helpers\ArrayHelper;

/**
 * This is the model class for table "parametroempresa".
 *
 * @property integer $ParametroID
 * @property string $ParametroNombre
 * @property string $ParametroValor
 * @property string $ParametroFechaReg
 * @property integer $EmpresaID
 * @property integer $Departamento_DepartamentoID
 *
 * @property Departamento $departamentoDepartamento
 * @property Empresa $empresa
 */
class Parametroempresa extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'parametroempresa';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['ParametroNombre'], 'required'],
            [['ParametroID', 'EmpresaID', 'Departamento_DepartamentoID'], 'integer'],
            [['ParametroFechaReg'], 'safe'],
            [['ParametroNombre'], 'string', 'max' => 20],
            [['ParametroValor'], 'string', 'max' => 1000],
            [['Departamento_DepartamentoID'], 'exist', 'skipOnError' => true, 'targetClass' => Departamento::className(), 'targetAttribute' => ['Departamento_DepartamentoID' => 'DepartamentoID']],
            [['EmpresaID'], 'exist', 'skipOnError' => true, 'targetClass' => Empresa::className(), 'targetAttribute' => ['EmpresaID' => 'EmpresaID']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ParametroID' => 'Parametro ID',
            'ParametroNombre' => 'Parametro Nombre',
            'ParametroValor' => 'Parametro Valor',
            'ParametroFechaReg' => 'Parametro Fecha Reg',
            'EmpresaID' => 'Empresa ID',
            'Departamento_DepartamentoID' => 'Departamento  Departamento ID',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getDepartamentoDepartamento()
    {
        return $this->hasOne(Departamento::className(), ['DepartamentoID' => 'Departamento_DepartamentoID']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getEmpresa()
    {
        return $this->hasOne(Empresa::className(), ['EmpresaID' => 'EmpresaID']);
    }

    public static function getListaEmpresas(){
        $opciones = Empresa::find()->asArray()->all();
        return ArrayHelper::map($opciones, 'EmpresaID', 'EmpresaNombre');
    }

    public static function getListaDepartamentos(){
        $opciones = Departamento::find()->asArray()->all();
        return ArrayHelper::map($opciones, 'DepartamentoID', 'DepartamentoNombre');
    }
}


text:
var test = function() {
    QUnit.test.apply(QUnit.test, arguments);
}

var ok = function() {
    QUnit.assert.ok.apply(QUnit.assert, arguments);
}

//-------------------------------------

test("Test - Single Expression", function() {

    var text = "Die Deadline ist jetzt";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 8, 9, 10, 11));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'jetzt', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 8, 'Test Result - (Hour) ' + JSON.stringify(result.start) );
        ok(result.start.get('minute') == 9, 'Test Result - (Minute) ' + JSON.stringify(result.start) );
        ok(result.start.get('second') == 10, 'Test Result - (Second) ' + JSON.stringify(result.start) );
        ok(result.start.get('millisecond') == 11, 'Test Result - (Millisecond) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 8, 9, 10, 11);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline ist heute";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'heute', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline ist morgen";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'morgen', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 11, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 11, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    // Say.."Tomorrow" in the late night (1 AM)
    var text = "Die Deadline ist morgen";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 1));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline war gestern";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'gestern', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 9, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 9, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline war letzte Nacht ";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'letzte Nacht', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 9, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 0, 'Test Result - (hour) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 9, 0);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline war gestern Nacht ";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'gestern Nacht', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 9, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 0, 'Test Result - (hour) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 9, 0);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline war heute Morgen ";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'heute Morgen', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 6, 'Test Result - (hour) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 6);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline war heute Nachmittag ";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'heute Nachmittag', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 15, 'Test Result - (hour) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 15);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline war heute Abend ";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'heute Abend', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 18, 'Test Result - (hour) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 18);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }
});

test("Test - Combined Expression", function() {

    var text = "Die Deadline ist heute 17 Uhr";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'heute 17 Uhr', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 17, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 17);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Die Deadline ist heute um 17 Uhr";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 17, 'Wrong index');
        ok(result.text == 'heute um 17 Uhr', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 17, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 17);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }
});

test("Test - Casual date range", function() {

    var text = "Der Event ist heute - nächsten Freitag";
    var results = chrono.de.parse(text, new Date(2012, 7, 4, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 14, 'Wrong index');
        ok(result.text == 'heute - nächsten Freitag', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 4, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 12, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 4, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)

        ok(result.end, JSON.stringify(result.start) );
        ok(result.end.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.end.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.end.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.end.get('hour') == 12, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.end.date();
        var expectDate = new Date(2012, 7, 10, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }

    var text = "Der Event ist heute - nächsten Freitag";
    var results = chrono.de.parse(text, new Date(2012, 7, 10, 12));
    ok(results.length == 1, JSON.stringify( results ) );

    var result = results[0];
    if(result){
        ok(result.index == 14, 'Wrong index');
        ok(result.text == 'heute - nächsten Freitag', result.text );

        ok(result.start, JSON.stringify(result.start) );
        ok(result.start.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.start.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.start.get('day') == 10, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.start.get('hour') == 12, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.start.date();
        var expectDate = new Date(2012, 7, 10, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)

        ok(result.end, JSON.stringify(result.start) );
        ok(result.end.get('year') == 2012, 'Test Result - (Year) ' + JSON.stringify(result.start) );
        ok(result.end.get('month') == 8, 'Test Result - (Month) ' + JSON.stringify(result.start) );
        ok(result.end.get('day') == 17, 'Test Result - (Day) ' + JSON.stringify(result.start) );
        ok(result.end.get('hour') == 12, 'Test Result - (Day) ' + JSON.stringify(result.start) );

        var resultDate = result.end.date();
        var expectDate = new Date(2012, 7, 17, 12);
        ok(Math.abs(expectDate.getTime() - resultDate.getTime()) < 100000, 'Test result.startDate ' + resultDate +'/' +expectDate)
    }
});

test('Test - Random text', function() {

    var text = "heute Nacht";
    var result = chrono.de.parse(text, new Date(2012, 1-1, 1, 12))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('year') == 2012, JSON.stringify(result.start));
    ok(result.start.get('month') == 1, JSON.stringify(result.start));
    ok(result.start.get('day') == 1, JSON.stringify(result.start));
    ok(result.start.get('hour') == 22, JSON.stringify(result.start));
    ok(result.start.get('meridiem')  == 1, JSON.stringify(result.start));

    var text = "heute Nacht um 20 Uhr";
    var result = chrono.de.parse(text, new Date(2012, 1-1, 1, 12))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('hour')  == 20, JSON.stringify(result.start));
    ok(result.start.get('year')  == 2012, JSON.stringify(result.start));
    ok(result.start.get('month') == 1, JSON.stringify(result.start));
    ok(result.start.get('day')   == 1, JSON.stringify(result.start));
    ok(result.start.get('meridiem')  == 1, JSON.stringify(result.start));

    var text = "heute Abend um 8";
    var result = chrono.de.parse(text, new Date(2012, 1-1, 1, 12))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('hour')  == 20, JSON.stringify(result.start));
    ok(result.start.get('year')  == 2012, JSON.stringify(result.start));
    ok(result.start.get('month') == 1, JSON.stringify(result.start));
    ok(result.start.get('day')   == 1, JSON.stringify(result.start));
    ok(result.start.get('meridiem')  == 1, JSON.stringify(result.start));

    var text = "8 Uhr abends";
    var result = chrono.de.parse(text, new Date(2012, 1-1, 1, 12))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('hour')  == 20, JSON.stringify(result.start));
    ok(result.start.get('year')  == 2012, JSON.stringify(result.start));
    ok(result.start.get('month') == 1, JSON.stringify(result.start));
    ok(result.start.get('day')   == 1, JSON.stringify(result.start));
    ok(result.start.get('meridiem')  == 1, JSON.stringify(result.start));

    var text = "Do";
    var result = chrono.de.parse(text)[0];
    ok(result.text == text, result.text);
    ok(result.start.get('weekday') == 4, result.text);

    var text = "Donnerstag";
    var result = chrono.de.parse(text)[0];
    ok(result.text == text, result.text);
    ok(result.start.get('weekday') == 4, result.text);

    var text = "gestern Nachmittag";
    var result = chrono.de.parse(text, new Date(2016, 10-1, 1))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('year') == 2016, JSON.stringify(result.start));
    ok(result.start.get('month') == 9, JSON.stringify(result.start));
    ok(result.start.get('day') == 30, JSON.stringify(result.start));
    ok(result.start.get('hour') == 15, JSON.stringify(result.start));

    var text = "morgen Morgen";
    var result = chrono.de.parse(text, new Date(2016, 10-1, 1, 8))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('year') == 2016, JSON.stringify(result.start));
    ok(result.start.get('month') == 10, JSON.stringify(result.start));
    ok(result.start.get('day') == 2, JSON.stringify(result.start));
    ok(result.start.get('hour') == 6, JSON.stringify(result.start));

    var text = "uebermorgen Abend";
    var result = chrono.de.parse(text, new Date(2016, 10-1, 1, 8))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('year') == 2016, JSON.stringify(result.start));
    ok(result.start.get('month') == 10, JSON.stringify(result.start));
    ok(result.start.get('day') == 3, JSON.stringify(result.start));
    ok(result.start.get('hour') == 18, JSON.stringify(result.start));

    var text = "vorgestern Vormittag";
    var result = chrono.de.parse(text, new Date(2016, 10-1, 1))[0];
    ok(result.text == text, result.text);
    ok(result.start.get('year') == 2016, JSON.stringify(result.start));
    ok(result.start.get('month') == 9, JSON.stringify(result.start));
    ok(result.start.get('day') == 29, JSON.stringify(result.start));
    ok(result.start.get('hour') == 9, JSON.stringify(result.start));
});

test('Test - Random negative text', function() {

    var text = "nicheute";
    var results = chrono.de.parse(text);
    ok(results.length == 0, JSON.stringify(results) );

    var text = "heutenicht";
    var results = chrono.de.parse(text);
    ok(results.length == 0, JSON.stringify(results) );

    var text = "angestern";
    var results = chrono.de.parse(text);
    ok(results.length == 0, JSON.stringify(results) );

    var text = "jetztig";
    var results = chrono.de.parse(text);
    ok(results.length == 0, JSON.stringify(results) );

    var text = "ljetztlich";
    var results = chrono.de.parse(text);
    ok(results.length == 0, JSON.stringify(results) )

});


text:
class SearchController < ApplicationController
  def index
    if params[:search].blank?
      @all_count = 0
      return
    end

    clean_search = params[:search].to_s.squish.downcase
    @search = clean_search.split(/[^\w]/).reject(&:blank?).uniq.join(" & ")
    scope = PgSearch.multisearch(params[:search])

    @all_count = scope.count
    @forum_count = scope.where(searchable_type: ["Topic", "Reply"]).count
    @blog_count = scope.where(searchable_type: "Broadcast").count
    @variables_count = scope.where(searchable_type: "Variable").count
    @datasets_count = scope.where(searchable_type: "DatasetPage").count

    case params[:from]
    when "forum"
      scope = scope.where(searchable_type: ["Topic", "Reply"])
    when "blog"
      scope = scope.where(searchable_type: "Broadcast")
    when "variables"
      scope = scope.where(searchable_type: "Variable")
    when "datasets"
      scope = scope.where(searchable_type: "DatasetPage")
    end

    @search_documents = scope.page(params[:page]).per(25)
    if clean_search.present? && params[:page].blank?
      search = Search.where(search: clean_search).first_or_create
      search.update results_count: @search_documents.total_count
      search.increment! :search_count
    end

    viewable_datasets = if current_user
                          current_user.all_viewable_datasets
                        else
                          Dataset.released
                        end
    @dataset = viewable_datasets.where("datasets.name = ? or datasets.slug = ?", clean_search, clean_search).first
  end
end


text:
<?php

namespace RectorPrefix20210615;

return ['TYPO3\\CMS\\Version\\Hook\\PreviewHook' => 'TYPO3\\CMS\\Workspaces\\Hook\\PreviewHook', 'TYPO3\\CMS\\Version\\Task\\AutoPublishTask' => 'TYPO3\\CMS\\Workspaces\\Task\\AutoPublishTask', 'TYPO3\\CMS\\Version\\Utility\\WorkspacesUtility' => 'TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService'];


text:
<?php

namespace Ndewez\WebHome\CommonBundle\Model;

/**
 * Class MenuItem.
 */
abstract class MenuItem
{
    /** @var string */
    private $title;

    /** @var string */
    private $route;

    /** @var array */
    private $parametersRoute;

    /** @var string */
    private $href;

    /** @var bool */
    private $active;

    /** @var MenuItem[] */
    private $items;

    public function __construct()
    {
        $this->parametersRoute = [];
        $this->items = [];
    }

    /**
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param string $title
     *
     * @return MenuItem
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * @return string
     */
    public function getHref()
    {
        return $this->href;
    }

    /**
     * @param string $href
     *
     * @return MenuItem
     */
    public function setHref($href)
    {
        $this->href = $href;

        return $this;
    }

    /**
     * @return string
     */
    public function getRoute()
    {
        return $this->route;
    }

    /**
     * @param string $route
     *
     * @return MenuItem
     */
    public function setRoute($route)
    {
        $this->route = $route;

        return $this;
    }

    /**
     * @return array
     */
    public function getParametersRoute()
    {
        return $this->parametersRoute;
    }

    /**
     * @param array $parametersRoute
     *
     * @return MenuItem
     */
    public function setParametersRoute($parametersRoute)
    {
        $this->parametersRoute = $parametersRoute;

        return $this;
    }

    /**
     * @return bool
     */
    public function isActive()
    {
        return $this->active;
    }

    /**
     * @param bool $active
     *
     * @return MenuItem
     */
    public function setActive($active)
    {
        $this->active = $active;

        return $this;
    }

    /**
     * @return MenuItem[]
     */
    public function getItems()
    {
        return $this->items;
    }

    /**
     * @param MenuItem[] $items
     *
     * @return MenuItem
     */
    public function setItems(array $items)
    {
        $this->items = $items;

        return $this;
    }

    /**
     * @param MenuItem $item
     *
     * @return $this
     */
    public function addItem(MenuItem $item)
    {
        $this->items[] = $item;

        return $this;
    }

    /**
     * @return bool
     */
    public function hasItem()
    {
        return count($this->items) > 0;
    }

    /**
     * @return bool
     */
    abstract public function isDivider();
}


text:
<template name="reactTour">
	{{#contentFor "headerButtonLeft"}}
		{{>ionNavBackButton path="index"}}
	{{/contentFor}}
	{{#contentFor "headerTitle"}}

ReactTour Com

	{{/contentFor}}

	{{#ionView}}
		{{#ionContent}}
			{{> React component=ReactTourCom }}
		{{/ionContent}}
	{{/ionView}}
</template>


text:
package org.dmfs.httpessentials.converters;

import org.dmfs.httpessentials.typedentity.EntityConverter;

/**
 * {@link EntityConverter} decorator that quotes/unquotes values. {@link #value(String)} also accepts unquoted strings, but {@link #valueString(Object)} always
 * returns quoted strings.
 *
 * @author Marten Gajda
 */
public final class OptionallyQuoted<E> implements EntityConverter<E>
{
    private final EntityConverter<E> mDelegate;

    public OptionallyQuoted(EntityConverter<E> delegate)
    {
        mDelegate = delegate;
    }

    @Override
    public E value(String quotedString)
    {
        String trimmed = quotedString.trim();
        if (trimmed.length() > 1 && trimmed.charAt(0) == '"' && trimmed.charAt(trimmed.length() - 1) == '"')
        {
            return mDelegate.value(trimmed.substring(1, trimmed.length() - 1).replace("\\\\", "\\").replace("\\\"", "\""));
        }
        return mDelegate.value(trimmed);
    }

    @Override
    public String valueString(E value)
    {
        return "\"" + mDelegate.valueString(value).replace("\\", "\\\\").replace("\"", "\\\"") + "\"";
    }

}


text:
<!DOCTYPE html>

	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
	<title>Fancytree - Multi-Select</title>

	<link href="../src/skin-win8/ui.fancytree.css" rel="stylesheet">

	<link href="../lib/prettify.css" rel="stylesheet">

	<link href="sample.css" rel="stylesheet">

Example: 'multi' extension

			Select node ranges using mouse and keyboard and
			Ctrl, Command, Shift modifiers.

			Edit the node titles with `[Shift] + click` '[Shift] + [Down]', ....

			Status: experimental.
			Details:
			ext-multi.

		Skin: <select id="skinswitcher"></select>

		Mode:
		<select id="lbMode">
			<option value="">Unrestricted</option>
			<option value="sameParent">Same parent</option>
			<option value="sameLevel">Same level</option>
		</select>
		<input id="cbCheckboxes" type="checkbox" checked>
		Show checkboxes
		<input id="cbCheckboxAutoHide" type="checkbox">
		Auto-hide checkboxes

Active: -

		Fancytree project home
		Link to this page
		Example Browser
		View source code


text:
package com.github.t3t5u.common.util;

import static com.github.t3t5u.common.util.EncodingUtils.*;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import org.junit.Test;

public class EncodingUtilsTest {
	@Test
	public void パーセントエンコーディングでencodeしてdecodeする() {
		assertThat(decodeUrl(encodeUrl(null)), is(""));
		assertThat(decodeUrl(encodeUrl(12345)), is("12345"));
		assertThat(decodeUrl(encodeUrl("a b c d e")), is("a b c d e"));
		assertThat(decodeUrl(encodeUrl("あ い う え お")), is("あ い う え お"));
	}

	@Test
	public void 文字列をBase64の文字列にencodeして文字列にdecodeする() {
		assertThat(decodeBase64AsString(encodeBase64AsString((String) null)), is(nullValue()));
		assertThat(decodeBase64AsString(encodeBase64AsString("12345")), is("12345"));
		assertThat(decodeBase64AsString(encodeBase64AsString("a b c d e")), is("a b c d e"));
		assertThat(decodeBase64AsString(encodeBase64AsString("あ い う え お")), is("あ い う え お"));
	}

	@Test
	public void 文字列をBase64の文字列にencodeしてバイト配列にdecodeする() {
		assertThat(getString(decodeBase64(encodeBase64AsString((String) null))), is(nullValue()));
		assertThat(getString(decodeBase64(encodeBase64AsString("12345"))), is("12345"));
		assertThat(getString(decodeBase64(encodeBase64AsString("a b c d e"))), is("a b c d e"));
		assertThat(getString(decodeBase64(encodeBase64AsString("あ い う え お"))), is("あ い う え お"));
	}

	@Test
	public void 文字列をBase64のバイト配列にencodeして文字列にdecodeする() {
		assertThat(decodeBase64AsString(encodeBase64((String) null)), is(nullValue()));
		assertThat(decodeBase64AsString(encodeBase64("12345")), is("12345"));
		assertThat(decodeBase64AsString(encodeBase64("a b c d e")), is("a b c d e"));
		assertThat(decodeBase64AsString(encodeBase64("あ い う え お")), is("あ い う え お"));
	}

	@Test
	public void 文字列をBase64のバイト配列にencodeしてバイト配列にdecodeする() {
		assertThat(getString(decodeBase64(encodeBase64((String) null))), is(nullValue()));
		assertThat(getString(decodeBase64(encodeBase64("12345"))), is("12345"));
		assertThat(getString(decodeBase64(encodeBase64("a b c d e"))), is("a b c d e"));
		assertThat(getString(decodeBase64(encodeBase64("あ い う え お"))), is("あ い う え お"));
	}

	@Test
	public void バイト配列をBase64の文字列にencodeして文字列にdecodeする() {
		assertThat(decodeBase64AsString(encodeBase64AsString(getBytes(null))), is(nullValue()));
		assertThat(decodeBase64AsString(encodeBase64AsString(getBytes("12345"))), is("12345"));
		assertThat(decodeBase64AsString(encodeBase64AsString(getBytes("a b c d e"))), is("a b c d e"));
		assertThat(decodeBase64AsString(encodeBase64AsString(getBytes("あ い う え お"))), is("あ い う え お"));
	}

	@Test
	public void バイト配列をBase64の文字列にencodeしてバイト配列にdecodeする() {
		assertThat(getString(decodeBase64(encodeBase64AsString(getBytes(null)))), is(nullValue()));
		assertThat(getString(decodeBase64(encodeBase64AsString(getBytes("12345")))), is("12345"));
		assertThat(getString(decodeBase64(encodeBase64AsString(getBytes("a b c d e")))), is("a b c d e"));
		assertThat(getString(decodeBase64(encodeBase64AsString(getBytes("あ い う え お")))), is("あ い う え お"));
	}

	@Test
	public void バイト配列をBase64のバイト配列にencodeして文字列にdecodeする() {
		assertThat(decodeBase64AsString(encodeBase64(getBytes(null))), is(nullValue()));
		assertThat(decodeBase64AsString(encodeBase64(getBytes("12345"))), is("12345"));
		assertThat(decodeBase64AsString(encodeBase64(getBytes("a b c d e"))), is("a b c d e"));
		assertThat(decodeBase64AsString(encodeBase64(getBytes("あ い う え お"))), is("あ い う え お"));
	}

	@Test
	public void バイト配列をBase64のバイト配列にencodeしてバイト配列にdecodeする() {
		assertThat(getString(decodeBase64(encodeBase64(getBytes(null)))), is(nullValue()));
		assertThat(getString(decodeBase64(encodeBase64(getBytes("12345")))), is("12345"));
		assertThat(getString(decodeBase64(encodeBase64(getBytes("a b c d e")))), is("a b c d e"));
		assertThat(getString(decodeBase64(encodeBase64(getBytes("あ い う え お")))), is("あ い う え お"));
	}

	@Test
	public void 十六進エンコーディングでencodeしてdecodeする() {
		assertThat(getString(decodeHex(encodeHex(getBytes(null)))), is(nullValue()));
		assertThat(getString(decodeHex(encodeHex(getBytes("12345")))), is("12345"));
		assertThat(getString(decodeHex(encodeHex(getBytes("a b c d e")))), is("a b c d e"));
		assertThat(getString(decodeHex(encodeHex(getBytes("あ い う え お")))), is("あ い う え お"));
	}
}


text:
// Copyright (c) 2019 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "qt/pivx/settings/settingswalletrepairwidget.h"
#include "qt/pivx/settings/forms/ui_settingswalletrepairwidget.h"
#include "qt/pivx/qtutils.h"
#include "util.h"
#include "walletmodel.h"
#include <startoptionsmain.h>
#include "askpassphrasedialog.h"

SettingsWalletRepairWidget::SettingsWalletRepairWidget(MARTEXGUI* _window, QWidget *parent) :
    PWidget(_window, parent),
    ui(new Ui::SettingsWalletRepairWidget)
{
    ui->setupUi(this);
    this->setStyleSheet(parent->styleSheet());

    // Containers
    ui->left->setProperty("cssClass", "container");
    ui->left->setContentsMargins(10,10,10,10);
    ui->scrollStack->setProperty("cssClass", "container");

    // Title
    ui->labelTitle->setText(tr("Wallet Repair"));
    ui->labelTitle->setProperty("cssClass", "text-title-screen");

    // Subtitle
    ui->labelSubtitle1->setText(tr("The buttons below will restart the wallet with command-line options to repair this wallet, fix issues with corrupt blockchain files or missing/obsolete transactions."));
    ui->labelSubtitle1->setProperty("cssClass", "text-subtitle");

    // Labels
    ui->labelMessageSalvage->setText(tr("Attempt to recover private keys from a corrupt wallet.dat."));
    ui->labelMessageSalvage->setProperty("cssClass", "text-main-settings");

    ui->labelMessageRescan->setText(tr("Rescan the blockchain for missing wallet transactions."));
    ui->labelMessageRescan->setProperty("cssClass", "text-main-settings");

    ui->labelMessageRecover1->setText(tr("Recover transactions from blockchain (keep-meta-data, e.g. account owner)."));
    ui->labelMessageRecover1->setProperty("cssClass", "text-main-settings");

    ui->labelMessageRecover2->setText(tr("Recover transactions from blockchain (drop meta-data)."));
    ui->labelMessageRecover2->setProperty("cssClass", "text-main-settings");

    ui->labelMessageUpgrade->setText(tr("Upgrade wallet to latest format on startup. (Note: this is NOT an update of the wallet itself)"));
    ui->labelMessageUpgrade->setProperty("cssClass", "text-main-settings");

    ui->labelMessageRebuild->setText(tr("Rebuild blockchain index from current blk000???.dat files."));
    ui->labelMessageRebuild->setProperty("cssClass", "text-main-settings");

    ui->labelMessageDelete->setText(tr("Deletes all local blockchain folders so the wallet synchronizes from scratch."));
    ui->labelMessageDelete->setProperty("cssClass", "text-main-settings");

    ui->labelMessageUpgradeToHD->setText(tr("Upgrade non-hd wallet to hd. You will no longer be able to cold-stake with HD as it isn't supported yet."));
    ui->labelMessageUpgradeToHD->setProperty("cssClass", "text-main-settings");

    // Buttons
    ui->pushButtonSalvage->setText(tr("Salvage wallet"));
    setCssBtnPrimary(ui->pushButtonSalvage);

    ui->pushButtonRescan->setText(tr("Rescan blockchain file"));
    setCssBtnPrimary(ui->pushButtonRescan);

    ui->pushButtonRecover1->setText(tr("Recover transactions 1"));
    setCssBtnPrimary(ui->pushButtonRecover1);

    ui->pushButtonRecover2->setText(tr("Recover transactions 2"));
    setCssBtnPrimary(ui->pushButtonRecover2);

    ui->pushButtonUpgrade->setText(tr("Upgrade wallet format"));
    setCssBtnPrimary(ui->pushButtonUpgrade);

    ui->pushButtonRebuild->setText(tr("Rebuild index"));
    setCssBtnPrimary(ui->pushButtonRebuild);

    ui->pushButtonDelete->setText(tr("Delete local blockchain "));
    setCssBtnPrimary(ui->pushButtonDelete);

    ui->pushButtonUpgradeToHd->setText(tr("Upgrade non-HD Wallet to HD"));
    setCssBtnPrimary(ui->pushButtonUpgradeToHd);

    // Wallet Repair Buttons
    connect(ui->pushButtonSalvage, SIGNAL(clicked()), this, SLOT(walletSalvage()));
    connect(ui->pushButtonRescan, SIGNAL(clicked()), this, SLOT(walletRescan()));
    connect(ui->pushButtonRecover1, SIGNAL(clicked()), this, SLOT(walletZaptxes1()));
    connect(ui->pushButtonRecover2, SIGNAL(clicked()), this, SLOT(walletZaptxes2()));
    connect(ui->pushButtonUpgrade, SIGNAL(clicked()), this, SLOT(walletUpgrade()));
    connect(ui->pushButtonRebuild, SIGNAL(clicked()), this, SLOT(walletReindex()));
    connect(ui->pushButtonDelete, SIGNAL(clicked()), this, SLOT(walletResync()));
    connect(ui->pushButtonUpgradeToHd, SIGNAL(clicked()), this, SLOT(walletUpgradeToHd()));
}

/** Restart wallet with "-salvagewallet" */
void SettingsWalletRepairWidget::walletSalvage()
{
    buildParameterlist(SALVAGEWALLET);
}

/** Restart wallet with "-rescan" */
void SettingsWalletRepairWidget::walletRescan()
{
    buildParameterlist(RESCAN);
}

/** Restart wallet with "-zapwallettxes=1" */
void SettingsWalletRepairWidget::walletZaptxes1()
{
    buildParameterlist(ZAPTXES1);
}

/** Restart wallet with "-zapwallettxes=2" */
void SettingsWalletRepairWidget::walletZaptxes2()
{
    buildParameterlist(ZAPTXES2);
}

/** Restart wallet with "-upgradewallet" */
void SettingsWalletRepairWidget::walletUpgrade()
{
    buildParameterlist(UPGRADEWALLET);
}

/** Restart wallet with "-reindex" */
void SettingsWalletRepairWidget::walletReindex()
{
    buildParameterlist(REINDEX);
}

/** Restart wallet with "-resync" */
void SettingsWalletRepairWidget::walletResync()
{
    QString resyncWarning = tr("This will delete your local blockchain folders and the wallet will synchronize the complete Blockchain from scratch.

");
    resyncWarning +=   tr("This needs quite some time and downloads a lot of data.

");
    resyncWarning +=   tr("Your transactions and funds will be visible again after the download has completed.

");
    resyncWarning +=   tr("Do you want to continue?.
");
    QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm resync Blockchain"),
                                                               resyncWarning,
                                                               QMessageBox::Yes | QMessageBox::Cancel,
                                                               QMessageBox::Cancel);

    if (retval != QMessageBox::Yes) {
        // Resync canceled
        return;
    }

    // Restart and resync
    buildParameterlist(RESYNC);
}

/** Restart wallet with "-resync" and upgrade to a HD wallet*/
void SettingsWalletRepairWidget::walletUpgradeToHd()
{
    QString upgradeWarning = tr("This will convert you non-HD wallet to a HD wallet

");
    upgradeWarning +=   tr("Make sure to make a backup of your wallet ahead of time

");
    upgradeWarning +=   tr("You shouldn't force close the wallet while this is running

");
    upgradeWarning +=   tr("Do you want to continue?.
");
    QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm upgrade to HD wallet"),
                                                               upgradeWarning,
                                                               QMessageBox::Yes | QMessageBox::Cancel,
                                                               QMessageBox::Cancel);

    if (retval != QMessageBox::Yes) {
        // Resync canceled
        return;
    }

    if (IsInitialBlockDownload()) {
        LogPrintf("Cannot set a new HD seed while still in Initial Block Download");
    }

    LOCK2(cs_main, pwalletMain->cs_wallet);

    // Do not do anything to HD wallets
    if (pwalletMain->IsHDEnabled()) {
        LogPrintf("Cannot upgrade a wallet to hd if It is already upgraded to hd.");
    }

    std::vector<std::string> words;
    SecureString strWalletPass;
    strWalletPass.reserve(100);

    int prev_version = pwalletMain->GetVersion();

    int nMaxVersion = GetArg("-upgradewallet", 0);
    if (nMaxVersion == 0) // the -upgradewallet without argument case
    {
        LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
        nMaxVersion = CLIENT_VERSION;
        pwalletMain->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately
    } else
        LogPrintf("Allowing wallet upgrade up to %i\n", nMaxVersion);
    if (nMaxVersion < pwalletMain->GetVersion()) {
        LogPrintf("Cannot downgrade wallet");
    }

    pwalletMain->SetMaxVersion(nMaxVersion);

    // Do not upgrade versions to any version between HD_SPLIT and FEATURE_PRE_SPLIT_KEYPOOL unless already supporting HD_SPLIT
    int max_version = pwalletMain->GetVersion();
    if (!pwalletMain->CanSupportFeature(FEATURE_HD) && max_version >=FEATURE_HD && max_version < FEATURE_PRE_SPLIT_KEYPOOL) {
        LogPrintf("Cannot upgrade a non HD split wallet without upgrading to support pre split keypool. Please use -upgradewallet=169900 or -upgradewallet with no version specified.");
    }

    bool hd_upgrade = false;
    bool split_upgrade = false;
    if (pwalletMain->CanSupportFeature(FEATURE_HD) && !pwalletMain->IsHDEnabled()) {
        LogPrintf("Upgrading wallet to HD\n");
        pwalletMain->SetMinVersion(FEATURE_HD);

        if (walletModel->getEncryptionStatus() == WalletModel::Locked || walletModel->getEncryptionStatus() == WalletModel::UnlockedForStaking) {
            AskPassphraseDialog dlg(AskPassphraseDialog::Mode::Unlock, this, walletModel, AskPassphraseDialog::Context::ToggleLock);
            dlg.exec();
            strWalletPass = dlg.getPassword();
        } else {
            strWalletPass = std::string().c_str();
        }

        StartOptionsMain dlg(nullptr);
        dlg.exec();
        words = dlg.getWords();

        pwalletMain->GenerateNewHDChain(words, strWalletPass);

        hd_upgrade = true;
    }

    // Upgrade to HD chain split if necessary
    if (pwalletMain->CanSupportFeature(FEATURE_HD)) {
        LogPrintf("Upgrading wallet to use HD chain split\n");
        pwalletMain->SetMinVersion(FEATURE_PRE_SPLIT_KEYPOOL);
        split_upgrade = FEATURE_HD > prev_version;
    }

    // Mark all keys currently in the keypool as pre-split
    if (split_upgrade) {
        pwalletMain->MarkPreSplitKeys();
    }

    // Regenerate the keypool if upgraded to HD
    if (hd_upgrade) {
        if (!pwalletMain->TopUpKeyPool()) {
            LogPrintf("Unable to generate keys\n");
        }
    }

    buildParameterlist(RESCAN);

}

/** Build command-line parameter list for restart */
void SettingsWalletRepairWidget::buildParameterlist(QString arg)
{
    // Get command-line arguments and remove the application name
    QStringList args = QApplication::arguments();
    args.removeFirst();

    // Remove existing repair-options
    args.removeAll(SALVAGEWALLET);
    args.removeAll(RESCAN);
    args.removeAll(ZAPTXES1);
    args.removeAll(ZAPTXES2);
    args.removeAll(UPGRADEWALLET);
    args.removeAll(REINDEX);

    // Append repair parameter to command line.
    args.append(arg);

    // Send command-line arguments to MARTEXGUI::handleRestart()
    Q_EMIT handleRestart(args);
}

SettingsWalletRepairWidget::~SettingsWalletRepairWidget()
{
    delete ui;
}


text:
package com.speedment.tool.core;

import com.speedment.common.injector.InjectBundle;
import com.speedment.runtime.application.RuntimeBundle;
import com.speedment.tool.core.internal.component.UserInterfaceComponentImpl;

import java.util.stream.Stream;

/**
 * @author Emil Forslund
 * @since  3.2.5
 */
public class TestBundle implements InjectBundle {

    @Override
    public Stream<Class<?>> injectables() {
        return Stream.concat(
            new RuntimeBundle().injectables(),
            Stream.of(
                UserInterfaceComponentImpl.class
            )
        );
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

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

    <link href="css/clean-blog.min.css" rel="stylesheet">
    <link href="css/new_entry.css" rel="stylesheet">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Burier

                                     Home

                                     New Entry

                                     Messages

Message1

Message2

                                     Maddie

My Entry

Following List

Setting

                    Text Diary
                       Photo Diary

                    <input type="file" id="myProfile" accept="image;
            if (!file.type.match(imageType)) {
                continue;
            }
            var img=document.getElementById("profile");
            img.file = file;
            var reader = new FileReader();
            reader.onload = (function(aImg) {
                return function(e) {
                    aImg.src = e.target.result;
                };
            })(img);
            reader.readAsDataURL(file);
            }
        }
</script>


text:
namespace blink {

class WebPresentationConnectionClient;
class WebString;
enum class WebPresentationConnectionCloseReason;
enum class WebPresentationConnectionState;

// The delegate Blink provides to WebPresentationClient in order to get updates.
class BLINK_PLATFORM_EXPORT WebPresentationController {
public:
    virtual ~WebPresentationController() { }

    // Called when the presentation session is started by the embedder using
    // the default presentation URL and id.
    virtual void didStartDefaultSession(WebPresentationConnectionClient*) = 0;

    // Called when the state of a session changes.
    virtual void didChangeSessionState(WebPresentationConnectionClient*, WebPresentationConnectionState) = 0;

    // Called when a connection closes.
    virtual void didCloseConnection(WebPresentationConnectionClient*, WebPresentationConnectionCloseReason, const WebString& message) = 0;

    // Called when a text message of a session is received.
    virtual void didReceiveSessionTextMessage(WebPresentationConnectionClient*, const WebString& message) = 0;

    // Called when a binary message of a session is received.
    virtual void didReceiveSessionBinaryMessage(WebPresentationConnectionClient*, const uint8_t* data, size_t length) = 0;
};

} // namespace blink

#endif // WebPresentationController_h


text:
<?php

namespace TypiCMS\Modules\Combinations\Shells\Http\Controllers;

use TypiCMS\Modules\Combinations\Http\Controllers\PublicController as BaseClass;

class PublicController extends BaseClass
{

}


text:
{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}

module Value.Data (
  DataValue,
    fromInt,
    getAll,
    show
) where

import SudokuAbstract
import GHC.Generics (Generic)
import Control.DeepSeq

data DataValue = One | Two | Three | Four | Five | Six | Seven | Eight | Nine
                 deriving (Eq, Generic, NFData)

instance Show DataValue where
  show One = "1"
  show Two = "2"
  show Three = "3"
  show Four = "4"
  show Five = "5"
  show Six = "6"
  show Seven = "7"
  show Eight = "8"
  show Nine = "9"

instance SudokuValue DataValue where
  fromInt 1 = One
  fromInt 2 = Two
  fromInt 3 = Three
  fromInt 4 = Four
  fromInt 5 = Five
  fromInt 6 = Six
  fromInt 7 = Seven
  fromInt 8 = Eight
  fromInt 9 = Nine
  getAll = [One, Two, Three, Four, Five, Six, Seven, Eight, Nine]


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

<title>KJViewPager.OnViewChangeListener</title>
<meta name="date" content="2014-12-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

跳过导航链接

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法

org.kymjs.kjframe.widget

接口 KJViewPager.OnViewChangeListener

封闭类:

KJViewPager

public static interface KJViewPager.OnViewChangeListener

屏幕切换监听器

方法概要

All Methods Instance Methods Abstract Methods

限定符和类型
方法和说明

void
OnViewChange(int view)

方法详细资料

OnViewChange

void OnViewChange(int view)

跳过导航链接

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法


text:
export default {
    searchFields: null
};


text:
<?php
/**
 * Created            16/02/2017 23:08
 * @author            Jakub Dubec <jakub.dubec@gmail.com>
 */

namespace phpGPX\Parsers;

use phpGPX\Models\Person;

/**
 * Class PersonParser
 * @package phpGPX\Parsers
 */
abstract class PersonParser
{
	public static $tagName = 'author';

	/**
	 * @param \SimpleXMLElement $node
	 * @return Person
	 */
	public static function parse(\SimpleXMLElement $node)
	{
		$person = new Person();

		$person->name = isset($node->name) ? ((string) $node->name) : null;
		$person->email = isset($node->email) ? EmailParser::parse($node->email) : null;
		$person->links = isset($node->link) ? LinkParser::parse($node->link) : null;

		return $person;
	}

	public static function toXML(Person $person, \DOMDocument &$document)
	{
		$node =  $document->createElement(self::$tagName);

		if (!empty($person->name)) {
			$child = $document->createElement('name', $person->name);
			$node->appendChild($child);
		}

		if (!empty($person->email)) {
			$child = EmailParser::toXML($person->email, $document);
			$node->appendChild($child);
		}

		# TODO: is_iterable
		if (!is_null($person->links)) {
			foreach ($person->links as $link) {
				$child = LinkParser::toXML($link, $document);
				$node->appendChild($child);
			}
		}

		return $node;
	}
}


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

<title>CellTest</title>
<meta name="date" content="2016-01-31">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

fr.eseo.game.test.model

Class CellTest

java.lang.Object

fr.eseo.game.test.model.CellTest

public class CellTest
extends java.lang.Object

Test for cell class.

Field Summary

Fields

Modifier and Type
Field and Description

protected Cell
cell

Cell on which the pirate is.

protected Character
character

Character of the cell.

protected Element
element

Element of the cell.

protected Island
island

Island of the pirate.

Constructor Summary

Constructors

Constructor and Description

CellTest()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
setUp()

setUp what is needed before the test.

void
testCanAccess_earth()

Test to know if we can access to a earth cell.

void
testCanAccess_water()

Test cannot access to a water cell.

void
testGetCharacter()

Test getCharacter.

void
testGetColumn()

Test getColumn.

void
testGetElement()

Test getElement.

void
testGetIsland()

Test getIsland.

void
testGetRow()

Test getRow.

void
testGetType()

Test getType.

void
testSetCharacter()

Test setCharacter.

void
testSetColumn()

Test setColumn.

void
testSetElement()

Test setElement.

void
testSetIsland()

Test setIsland.

void
testSetRow()

Test setRow.

void
testSetType()

Test setType.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

island

protected Island island

Island of the pirate.

cell

protected Cell cell

Cell on which the pirate is.

element

protected Element element

Element of the cell.

character

protected Character character

Character of the cell.

Constructor Detail

CellTest

public CellTest()

Method Detail

setUp

public void setUp()
           throws java.lang.Exception

setUp what is needed before the test.

Throws:

java.lang.Exception - toute exception.

testCanAccess_earth

public void testCanAccess_earth()
                         throws java.lang.Exception

Test to know if we can access to a earth cell.

Throws:

java.lang.Exception - toute exception.

testCanAccess_water

public void testCanAccess_water()
                         throws java.lang.Exception

Test cannot access to a water cell.

Throws:

java.lang.Exception - toute exception.

testGetRow

public void testGetRow()
                throws java.lang.Exception

Test getRow.

Throws:

java.lang.Exception - toute exception.

testSetRow

public void testSetRow()
                throws java.lang.Exception

Test setRow.

Throws:

java.lang.Exception - toute exception.

testGetColumn

public void testGetColumn()
                   throws java.lang.Exception

Test getColumn.

Throws:

java.lang.Exception - toute exception.

testSetColumn

public void testSetColumn()
                   throws java.lang.Exception

Test setColumn.

Throws:

java.lang.Exception - toute exception.

testGetType

public void testGetType()
                 throws java.lang.Exception

Test getType.

Throws:

java.lang.Exception - toute exception.

testSetType

public void testSetType()
                 throws java.lang.Exception

Test setType.

Throws:

java.lang.Exception - toute exception.

testGetCharacter

public void testGetCharacter()
                      throws java.lang.Exception

Test getCharacter.

Throws:

java.lang.Exception - toute exception.

testSetCharacter

public void testSetCharacter()
                      throws java.lang.Exception

Test setCharacter.

Throws:

java.lang.Exception - toute exception.

testGetElement

public void testGetElement()
                    throws java.lang.Exception

Test getElement.

Throws:

java.lang.Exception - toute exception.

testSetElement

public void testSetElement()
                    throws java.lang.Exception

Test setElement.

Throws:

java.lang.Exception - toute exception.

testGetIsland

public void testGetIsland()
                   throws java.lang.Exception

Test getIsland.

Throws:

java.lang.Exception - toute exception.

testSetIsland

public void testSetIsland()
                   throws java.lang.Exception

Test setIsland.

Throws:

java.lang.Exception - toute exception.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
title: Tara Phillips
headshot: 2t662qx
course:
  - Film and Television Studies
gender: female
submitted: false
---


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}" >

    <Button
        android:id="@+id/btn_scan"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:text="@string/scan" />

    <Button
        android:id="@+id/btn_link_host"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn_scan"
        android:text="@string/link_host" />

    <Button
        android:id="@+id/btn_write_host"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn_link_host"
        android:text="@string/write_host" />

    <Button
        android:id="@+id/btn_copy_host"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn_write_host"
        android:text="@string/copy_host" />

</RelativeLayout>


text:
namespace mx
{
    namespace core
    {
        SoundAttributes::SoundAttributes()
        :tempo()
        ,dynamics()
        ,dacapo( YesNo::no )
        ,segno()
        ,dalsegno()
        ,coda()
        ,tocoda()
        ,divisions()
        ,forwardRepeat( YesNo::no )
        ,fine()
        ,timeOnly()
        ,pizzicato( YesNo::no )
        ,pan()
        ,elevation()
        ,damperPedal()
        ,softPedal()
        ,sostenutoPedal()
        ,hasTempo( false )
        ,hasDynamics( false )
        ,hasDacapo( false )
        ,hasSegno( false )
        ,hasDalsegno( false )
        ,hasCoda( false )
        ,hasTocoda( false )
        ,hasDivisions( false )
        ,hasForwardRepeat( false )
        ,hasFine( false )
        ,hasTimeOnly( false )
        ,hasPizzicato( false )
        ,hasPan( false )
        ,hasElevation( false )
        ,hasDamperPedal( false )
        ,hasSoftPedal( false )
        ,hasSostenutoPedal( false )
        {}

        bool SoundAttributes::hasValues() const
        {
            return hasTempo ||
            hasDynamics ||
            hasDacapo ||
            hasSegno ||
            hasDalsegno ||
            hasCoda ||
            hasTocoda ||
            hasDivisions ||
            hasForwardRepeat ||
            hasFine ||
            hasTimeOnly ||
            hasPizzicato ||
            hasPan ||
            hasElevation ||
            hasDamperPedal ||
            hasSoftPedal ||
            hasSostenutoPedal;
        }

        std::ostream& SoundAttributes::toStream( std::ostream& os ) const
        {
            if ( hasValues() )
            {
                streamAttribute( os, tempo, "tempo", hasTempo );
                streamAttribute( os, dynamics, "dynamics", hasDynamics );
                streamAttribute( os, dacapo, "dacapo", hasDacapo );
                streamAttribute( os, segno, "segno", hasSegno );
                streamAttribute( os, dalsegno, "dalsegno", hasDalsegno );
                streamAttribute( os, coda, "coda", hasCoda );
                streamAttribute( os, tocoda, "tocoda", hasTocoda );
                streamAttribute( os, divisions, "divisions", hasDivisions );
                streamAttribute( os, forwardRepeat, "forward-repeat", hasForwardRepeat );
                streamAttribute( os, fine, "fine", hasFine );
                streamAttribute( os, timeOnly, "time-only", hasTimeOnly );
                streamAttribute( os, pizzicato, "pizzicato", hasPizzicato );
                streamAttribute( os, pan, "pan", hasPan );
                streamAttribute( os, elevation, "elevation", hasElevation );
                streamAttribute( os, damperPedal, "damper-pedal", hasDamperPedal );
                streamAttribute( os, softPedal, "soft-pedal", hasSoftPedal );
                streamAttribute( os, sostenutoPedal, "sostenuto-pedal", hasSostenutoPedal );
            }
            return os;
        }

        bool SoundAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement )
        {
            const char* const className = "SoundAttributes";
            bool isSuccess = true;

            auto it = xelement.attributesBegin();
            auto endIter = xelement.attributesEnd();

            for( ; it != endIter; ++it )
            {
                if( parseAttribute( message, it, className, isSuccess, tempo, hasTempo, "tempo" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, dynamics, hasDynamics, "dynamics" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, dacapo, hasDacapo, "dacapo", &parseYesNo ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, segno, hasSegno, "segno" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, dalsegno, hasDalsegno, "dalsegno" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, coda, hasCoda, "coda" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, tocoda, hasTocoda, "tocoda" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, divisions, hasDivisions, "divisions" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, forwardRepeat, hasForwardRepeat, "forward-repeat", &parseYesNo ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, fine, hasFine, "fine" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, timeOnly, hasTimeOnly, "time-only" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, pizzicato, hasPizzicato, "pizzicato", &parseYesNo ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, pan, hasPan, "pan" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, elevation, hasElevation, "elevation" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, damperPedal, hasDamperPedal, "damper-pedal" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, softPedal, hasSoftPedal, "soft-pedal" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, sostenutoPedal, hasSostenutoPedal, "sostenuto-pedal" ) ) { continue; }
            }

            MX_RETURN_IS_SUCCESS;
        }

    }
}


text:
from __future__ import unicode_literals
from copy import deepcopy

from django.views.generic import ListView, FormView
from django.core.urlresolvers import reverse
from django.http import Http404

from framework.auth.core import get_user
from website.conferences.model import Conference, DEFAULT_FIELD_NAMES
from website.conferences.exceptions import ConferenceError

from admin.base.utils import OSFAdmin
from admin.meetings.forms import MeetingForm
from admin.meetings.serializers import serialize_meeting

class MeetingListView(OSFAdmin, ListView):
    template_name = 'meetings/list.html'
    paginate_by = 10
    paginate_orphans = 1
    context_object_name = 'meeting'

    def get_queryset(self):
        return Conference.find()

    def get_context_data(self, **kwargs):
        queryset = kwargs.pop('object_list', self.object_list)
        page_size = self.get_paginate_by(queryset)
        paginator, page, queryset, is_paginated = self.paginate_queryset(
            queryset, page_size
        )
        kwargs.setdefault('meetings', map(serialize_meeting, queryset))
        kwargs.setdefault('page', page)
        return super(MeetingListView, self).get_context_data(**kwargs)

class MeetingFormView(OSFAdmin, FormView):
    template_name = 'meetings/detail.html'
    form_class = MeetingForm

    def dispatch(self, request, *args, **kwargs):
        endpoint = self.kwargs.get('endpoint')
        try:
            self.conf = Conference.get_by_endpoint(endpoint, active=False)
        except ConferenceError:
            raise Http404('Meeting with endpoint "{}" not found'.format(
                endpoint
            ))
        return super(MeetingFormView, self).dispatch(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        kwargs.setdefault('endpoint', self.kwargs.get('endpoint'))
        return super(MeetingFormView, self).get_context_data(**kwargs)

    def get_initial(self):
        self.initial = serialize_meeting(self.conf)
        self.initial.setdefault('edit', True)
        return super(MeetingFormView, self).get_initial()

    def form_valid(self, form):
        custom_fields, data = get_custom_fields(form.cleaned_data)
        if 'admins' in form.changed_data:
            admin_users = get_admin_users(data.get('admins'))
            self.conf.admins = admin_users
        self.conf.name = data.get('name')
        self.conf.info_url = data.get('info_url')
        self.conf.logo_url = data.get('logo_url')
        self.conf.active = data.get('active')
        self.conf.public_projects = data.get('public_projects')
        self.conf.poster = data.get('poster')
        self.conf.talk = data.get('talk')
        self.conf.field_names.update(custom_fields)
        self.conf.save()
        return super(MeetingFormView, self).form_valid(form)

    @property
    def success_url(self):
        return reverse('meetings:detail',
                       kwargs={'endpoint': self.kwargs.get('endpoint')})

class MeetingCreateFormView(OSFAdmin, FormView):
    template_name = 'meetings/create.html'
    form_class = MeetingForm

    def get_initial(self):
        self.initial.update(DEFAULT_FIELD_NAMES)
        self.initial.setdefault('edit', False)
        return super(MeetingCreateFormView, self).get_initial()

    def form_valid(self, form):
        custom_fields, data = get_custom_fields(form.cleaned_data)
        endpoint = data.pop('endpoint')
        self.kwargs.setdefault('endpoint', endpoint)
        # Form validation already checks emails for existence
        admin_users = get_admin_users(data.pop('admins'))
        # Form validation already catches if a conference endpoint exists
        new_conf = Conference(
            endpoint=endpoint,
            admins=admin_users,
            **data
        )
        new_conf.field_names.update(custom_fields)
        new_conf.save()
        return super(MeetingCreateFormView, self).form_valid(form)

    def get_success_url(self):
        return reverse('meetings:detail',
                       kwargs={'endpoint': self.kwargs.get('endpoint')})

def get_custom_fields(data):
    """Return two dicts, one of field_names and the other regular fields."""
    data_copy = deepcopy(data)
    field_names = {}
    for key, value in data.iteritems():
        if key in DEFAULT_FIELD_NAMES:
            field_names[key] = data_copy.pop(key)
    return field_names, data_copy

def get_admin_users(admins):
    """Returns a list of user objects

    If used in conjunction with MeetingForm it will already have checked for
    emails that don't match OSF users.
    """
    return [get_user(email=e) for e in admins]


text:
date: 2020-11-17T08:06:30-04:00
description: "Physical activity meant to improve and maintain physical health"
tags: []
title: "Exercise Resources"
---

# Exercise Resources

* [CDC Physical Activity Basics](https://www.cdc.gov/physicalactivity/basics/)


text:
// Copyright 2021 Google LLC
//
// 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
//
//     https://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.

#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_OPTIONS_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_OPTIONS_H

/**
 * @file
 *
 * This file defines options to be used with instances of
 * `google::cloud::Options`. By convention options are named with an "Option"
 * suffix. As the name would imply, all options are optional, and leaving them
 * unset will result in a reasonable default being chosen.
 *
 * Not all options are meaningful to all functions that accept a
 * `google::cloud::Options` instance. Each function that accepts a
 * `google::cloud::Options` should document which options it expects. This is
 * typically done by indicating lists of options using "OptionList" aliases.
 * For example, a function may indicate that users may set any option in
 * `SpannerPolicyOptionList`.
 *
 * @note Unrecognized options are allowed and will be ignored. To debug issues
 *     with options set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment
 *     and unexpected options will be logged.
 *
 * @see `google::cloud::CommonOptionList`
 * @see `google::cloud::GrpcOptionList`
 */

#include "google/cloud/spanner/backoff_policy.h"
#include "google/cloud/spanner/internal/session.h"
#include "google/cloud/spanner/polling_policy.h"
#include "google/cloud/spanner/request_priority.h"
#include "google/cloud/spanner/retry_policy.h"
#include "google/cloud/spanner/version.h"
#include "google/cloud/options.h"
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>

namespace google {
namespace cloud {
namespace spanner {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/**
 * Option for `google::cloud::Options` to set a `spanner::RetryPolicy`.
 *
 * @ingroup spanner-options
 */
struct SpannerRetryPolicyOption {
  using Type = std::shared_ptr<spanner::RetryPolicy>;
};

/**
 * Option for `google::cloud::Options` to set a `spanner::BackoffPolicy`.
 *
 * @ingroup spanner-options
 */
struct SpannerBackoffPolicyOption {
  using Type = std::shared_ptr<spanner::BackoffPolicy>;
};

/**
 * Option for `google::cloud::Options` to set a `spanner::PollingPolicy`.
 *
 * @ingroup spanner-options
 */
struct SpannerPollingPolicyOption {
  using Type = std::shared_ptr<spanner::PollingPolicy>;
};

/**
 * List of all "policy" options.
 */
using SpannerPolicyOptionList =
    OptionList<spanner::SpannerRetryPolicyOption, SpannerBackoffPolicyOption,
               SpannerPollingPolicyOption>;

/**
 * Option for `google::cloud::Options` to set the database role used for
 * session creation.
 *
 * @ingroup spanner-options
 */
struct SessionCreatorRoleOption {
  using Type = std::string;
};

/**
 * Option for `google::cloud::Options` to set the minimum number of sessions to
 * keep in the pool.
 *
 * Values <= 0 are treated as 0.
 * This value will effectively be reduced if it exceeds the overall limit on
 * the number of sessions (`max_sessions_per_channel` * number of channels).
 *
 * @ingroup spanner-options
 */
struct SessionPoolMinSessionsOption {
  using Type = int;
};

/**
 * Option for `google::cloud::Options` to set the maximum number of sessions to
 * create on each channel.
 *
 * Values <= 1 are treated as 1.
 *
 * @ingroup spanner-options
 */
struct SessionPoolMaxSessionsPerChannelOption {
  using Type = int;
};

/**
 * Option for `google::cloud::Options` to set the maximum number of sessions to
 * keep in the pool in an idle state.
 *
 * Values <= 0 are treated as 0.
 *
 * @ingroup spanner-options
 */
struct SessionPoolMaxIdleSessionsOption {
  using Type = int;
};

/// Action to take when the session pool is exhausted.
enum class ActionOnExhaustion { kBlock, kFail };
/**
 * Option for `google::cloud::Options` to set the action to take when
 * attempting to allocate a session when the pool is exhausted.
 *
 * @ingroup spanner-options
 */
struct SessionPoolActionOnExhaustionOption {
  using Type = spanner::ActionOnExhaustion;
};

/**
 * Option for `google::cloud::Options` to set the interval at which we refresh
 * sessions so they don't get collected by the backend GC.
 *
 * The GC collects objects older than 60 minutes, so any duration
 * below that (less some slack to allow the calls to be made to refresh the
 * sessions) should suffice.
 *
 * @ingroup spanner-options
 */
struct SessionPoolKeepAliveIntervalOption {
  using Type = std::chrono::seconds;
};

/**
 * Option for `google::cloud::Options` to set the labels used when creating
 * sessions within the pool.
 *
 *  * Label keys must match `[a-z]([-a-z0-9]{0,61}[a-z0-9])?`.
 *  * Label values must match `([a-z]([-a-z0-9]{0,61}[a-z0-9])?)?`.
 *  * The maximum number of labels is 64.
 *
 * @ingroup spanner-options
 */
struct SessionPoolLabelsOption {
  using Type = std::map<std::string, std::string>;
};

/**
 * List of all SessionPool options. Pass to `spanner::MakeConnection()`.
 */
using SessionPoolOptionList =
    OptionList<SessionCreatorRoleOption, SessionPoolMinSessionsOption,
               SessionPoolMaxSessionsPerChannelOption,
               SessionPoolMaxIdleSessionsOption,
               SessionPoolActionOnExhaustionOption,
               SessionPoolKeepAliveIntervalOption, SessionPoolLabelsOption>;

/**
 * Option for `google::cloud::Options` to set the optimizer version used in an
 * SQL query.
 *
 * @ingroup spanner-options
 */
struct QueryOptimizerVersionOption {
  using Type = std::string;
};

/**
 * Option for `google::cloud::Options` to set the optimizer statistics package
 * used in an SQL query.
 *
 * @ingroup spanner-options
 */
struct QueryOptimizerStatisticsPackageOption {
  using Type = std::string;
};

/**
 * Option for `google::cloud::Options` to set a `spanner::RequestPriority`.
 *
 * @ingroup spanner-options
 */
struct RequestPriorityOption {
  using Type = spanner::RequestPriority;
};

/**
 * Option for `google::cloud::Options` to set a per-request tag.
 *
 * @ingroup spanner-options
 */
struct RequestTagOption {
  using Type = std::string;
};

/**
 * Option for `google::cloud::Options` to set the name of an index on a
 * database table. This index is used instead of the table primary key when
 * interpreting the `KeySet` and sorting result rows.
 *
 * @ingroup spanner-options
 */
struct ReadIndexNameOption {
  using Type = std::string;
};

/**
 * Option for `google::cloud::Options` to set a limit on the number of rows
 * to yield from `Client::Read()`. There is no limit when the option is unset,
 * or when it is set to 0.
 *
 * @ingroup spanner-options
 */
struct ReadRowLimitOption {
  using Type = std::int64_t;
};

/**
 * Option for `google::cloud::Options` to set a limit on how much data will
 * be buffered to guarantee resumability of a streaming read or SQL query.
 * If the limit is exceeded, and the stream is subsequently interrupted before
 * a new resumption point can be established, the read/query will fail.
 *
 * @ingroup spanner-options
 */
struct StreamingResumabilityBufferSizeOption {
  using Type = std::size_t;
};

/**
 * Option for `google::cloud::Options` to set the desired partition size to
 * be generated by `Client::PartitionRead()` or `PartitionQuery()`.
 *
 * The default for this option is currently 1 GiB. This is only a hint. The
 * actual size of each partition may be smaller or larger than this request.
 *
 * @ingroup spanner-options
 */
struct PartitionSizeOption {
  using Type = std::int64_t;
};

/**
 * Option for `google::cloud::Options` to set the desired maximum number of
 * partitions to return from `Client::PartitionRead()` or `PartitionQuery()`.
 *
 * For example, this may be set to the number of workers available. The
 * default for this option is currently 10,000. The maximum value is
 * currently 200,000. This is only a hint. The actual number of partitions
 * returned may be smaller or larger than this request.
 *
 * @ingroup spanner-options
 */
struct PartitionsMaximumOption {
  using Type = std::int64_t;
};

/**
 * Option for `google::cloud::Options` to set a per-transaction tag.
 *
 * @ingroup spanner-options
 */
struct TransactionTagOption {
  using Type = std::string;
};

/**
 * Option for `google::cloud::Options` to return additional statistics
 * about the committed transaction in a `spanner::CommitResult`.
 *
 * @ingroup spanner-options
 */
struct CommitReturnStatsOption {
  using Type = bool;
};

/**
 * List of Request options for `client::ExecuteBatchDml()`.
 */
using RequestOptionList = OptionList<RequestPriorityOption, RequestTagOption>;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace spanner
}  // namespace cloud
}  // namespace google

#endif  // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_OPTIONS_H