text:
.class public Landroid/net/wifi/WpsResult;
.super Ljava/lang/Object;
.source "WpsResult.java"

# interfaces
.implements Landroid/os/Parcelable;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/net/wifi/WpsResult$Status;,
        Landroid/net/wifi/WpsResult$1;
    }
.end annotation

# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator",
            "<",
            "Landroid/net/wifi/WpsResult;",
            ">;"
        }
    .end annotation
.end field

# instance fields
.field public pin:Ljava/lang/String;

.field public status:Landroid/net/wifi/WpsResult$Status;

# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 78
    new-instance v0, Landroid/net/wifi/WpsResult$1;

    invoke-direct {v0}, Landroid/net/wifi/WpsResult$1;-><init>()V

    .line 77
    sput-object v0, Landroid/net/wifi/WpsResult;->CREATOR:Landroid/os/Parcelable$Creator;

    .line 26
    return-void
.end method

.method public constructor <init>()V
    .registers 2

    .prologue
    .line 38
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 39
    sget-object v0, Landroid/net/wifi/WpsResult$Status;->FAILURE:Landroid/net/wifi/WpsResult$Status;

    iput-object v0, p0, Landroid/net/wifi/WpsResult;->status:Landroid/net/wifi/WpsResult$Status;

    .line 40
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/net/wifi/WpsResult;->pin:Ljava/lang/String;

    .line 38
    return-void
.end method

.method public constructor <init>(Landroid/net/wifi/WpsResult$Status;)V
    .registers 3
    .param p1, "s"    # Landroid/net/wifi/WpsResult$Status;

    .prologue
    .line 43
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 44
    iput-object p1, p0, Landroid/net/wifi/WpsResult;->status:Landroid/net/wifi/WpsResult$Status;

    .line 45
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/net/wifi/WpsResult;->pin:Ljava/lang/String;

    .line 43
    return-void
.end method

.method public constructor <init>(Landroid/net/wifi/WpsResult;)V
    .registers 3
    .param p1, "source"    # Landroid/net/wifi/WpsResult;

    .prologue
    .line 63
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 64
    if-eqz p1, :cond_d

    .line 65
    iget-object v0, p1, Landroid/net/wifi/WpsResult;->status:Landroid/net/wifi/WpsResult$Status;

    iput-object v0, p0, Landroid/net/wifi/WpsResult;->status:Landroid/net/wifi/WpsResult$Status;

    .line 66
    iget-object v0, p1, Landroid/net/wifi/WpsResult;->pin:Ljava/lang/String;

    iput-object v0, p0, Landroid/net/wifi/WpsResult;->pin:Ljava/lang/String;

    .line 63
    :cond_d
    return-void
.end method

# virtual methods
.method public describeContents()I
    .registers 2

    .prologue
    .line 59
    const/4 v0, 0x0

    return v0
.end method

.method public toString()Ljava/lang/String;
    .registers 4

    .prologue
    .line 49
    new-instance v0, Ljava/lang/StringBuffer;

    invoke-direct {v0}, Ljava/lang/StringBuffer;-><init>()V

    .line 50
    .local v0, "sbuf":Ljava/lang/StringBuffer;
    const-string/jumbo v1, " status: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Landroid/net/wifi/WpsResult;->status:Landroid/net/wifi/WpsResult$Status;

    invoke-virtual {v2}, Landroid/net/wifi/WpsResult$Status;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 51
    const/16 v1, 0xa

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 52
    const-string/jumbo v1, " pin: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    iget-object v2, p0, Landroid/net/wifi/WpsResult;->pin:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 53
    const-string/jumbo v1, "\n"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 54
    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .registers 4
    .param p1, "dest"    # Landroid/os/Parcel;
    .param p2, "flags"    # I

    .prologue
    .line 72
    iget-object v0, p0, Landroid/net/wifi/WpsResult;->status:Landroid/net/wifi/WpsResult$Status;

    invoke-virtual {v0}, Landroid/net/wifi/WpsResult$Status;->name()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 73
    iget-object v0, p0, Landroid/net/wifi/WpsResult;->pin:Ljava/lang/String;

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 71
    return-void
.end method


text:
<!doctype html>
content
<!doctype html>

redpajama_set_name: RedPajamaGithub


text:
package compile

import (
	"bytes"
	"runtime"
	"strings"

	"github.com/jimmyfrasche/etlite/internal/ast"
	"github.com/jimmyfrasche/etlite/internal/internal/errint"
	"github.com/jimmyfrasche/etlite/internal/internal/errusr"
	"github.com/jimmyfrasche/etlite/internal/internal/savepoint"
	"github.com/jimmyfrasche/etlite/internal/token"
	"github.com/jimmyfrasche/etlite/internal/virt"
)

type compiler struct {
	usedStdin, hadDevice bool

	dname, frname string
	used          map[string]bool
	hdr           []string

	inst []virt.Instruction

	//caches for query rewriting
	buf *bytes.Buffer
	r   *ast.SQL

	//track savepoints to ensure no invalid programs
	stack *savepoint.Stack
}

func (c *compiler) push(is ...virt.Instruction) {
	c.inst = append(c.inst, is...)
}

func (c *compiler) bufStr() string {
	s := c.buf.String()
	c.buf.Reset()
	return s
}

func (c *compiler) rec(name string) {
	c.used[strings.ToLower(name)] = true
}

func (c *compiler) nameUsed(nm string) bool {
	return c.used[strings.ToLower(nm)]
}

//Nodes collects and compiles the nodes on from into instructions for our VM.
func Nodes(from <-chan ast.Node, usedStdin bool) (db string, to []virt.Instruction, err error) {
	c := &compiler{
		inst:      make([]virt.Instruction, 0, 128),
		usedStdin: usedStdin,
		used:      map[string]bool{},
		buf:       &bytes.Buffer{},
		r:         &ast.SQL{Kind: ast.Query},
		stack:     savepoint.New(),
	}

	if !usedStdin {
		c.dname = "-"
	}

	defer func() {
		if x := recover(); x != nil {
			e, ok := x.(error)
			if ok {
				if _, ok := e.(runtime.Error); ok {
					panic(x)
				}
			} else {
				panic(x)
			}
			err = e
		}
	}()

	firstStatement := true
	for n := range from {
		switch n := n.(type) {
		default:
			return "", nil, errint.Newf("internal error: unknown node type %T", n)

		case *ast.Error:
			return "", nil, n

		case *ast.Use:
			if !firstStatement {
				return "", nil, errusr.New(n, "USE must be first statement")
			}
			db = n.DB

		case *ast.Assert:
			c.compileAssert(n)

		case *ast.Display:
			c.compileDisplay(n)

		case *ast.Import:
			c.compileImport(n)

		case *ast.SQL:
			c.compileSQL(n)
		}

		firstStatement = false
	}

	if c.stack.Open() {
		c.push(virt.ErrPos(token.Position{
			Name: "<implicitly generated>",
			Line: -1,
		}))
	}
	if c.stack.InTransaction() {
		c.push(virt.Exec("END TRANSACTION;"))
	} else if c.stack.HasSavepoints() {
		c.push(virt.Exec("RELEASE " + c.stack.Top() + ";"))
	}

	return db, c.inst, nil
}


text:
<?php echo $titulo;?>

	        Pedido
	        Data
	        Status

     	  <?php if(count($model)): ?>
			<?php foreach($model as $m): ?>

			        <?php echo $m->id?>
			        <?php echo $m->dt_cadastro?>
			        <?php echo $m->getStatus()?>
			        <a href="<?php echo \Uri::base()."conta/pedidos/detalhes/{$m->id}"?>" class="btn_detalhes" title="Detalhes do Pedido">Exibir Detalhes

			 <?php endforeach;?>
			 <?php else:?>

					Nenhum pedido realizado

		 <?php endif;?>

					 <?php echo $pagination;?>


text:
import {
  Convert as GencodeConvert,
  DebugTrace,
  Function as FunctionInfo,
  Slot as SlotInfo
} from './generate/debug-trace-quicktype';

export { DebugTrace, FunctionInfo, SlotInfo };

export class Convert extends GencodeConvert {
  public static toDebugTrace(json: string): DebugTrace {
    // Use the quicktype library to parse and check the validity of the passed-in JSON.
    const out = GencodeConvert.toDebugTrace(json);

    // Confirm the version of the JSON trace data.
    const expectedVersion: string = '20220209';
    if (out.version != expectedVersion) {
      throw Error(
        `Version mismatch. Trace version is '${out.version}', expected version ` +
        `is '${expectedVersion}'`);
    }

    // The trace data consists of three values--one trace-op and two data fields.
    // https://github.com/google/skia/blob/2ac310266912687a2266d45f5008b942d56fc35e/src/sksl/tracing/SkVMDebugTrace.h#L52-L53
    // Our JSON trace arrays omit trailing zeros from the data to save space. Re-insert them here.
    for (let index = 0; index < out.trace.length; ++index) {
      while (out.trace[index].length < 3) {
        out.trace[index].push(0);
      }
    }

    // If the groupIdx field is missing from a slot, have it mirror `index` (the component index).
    for (let index = 0; index < out.slots.length; ++index) {
      if ((out.slots[index].groupIdx ?? -1) < 0) {
        out.slots[index].groupIdx = out.slots[index].index;
      }
    }

    return out;
  }
}


text:
cadnano\.strand package
=======================

Submodules
----------

.. toctree::

   cadnano.strand.insertioncmd
   cadnano.strand.modscmd
   cadnano.strand.resizecmd
   cadnano.strand.strand

Module contents
---------------

.. automodule:: cadnano.strand
    :members:
    :undoc-members:
    :show-inheritance:


text:
<?php

namespace OSS\Tests;

use OSS\Core\OssException;
use OSS\Model\CorsConfig;
use OSS\Model\CorsRule;
use OSS\Core\OssUtil;
use OSS\OssClient;

require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';

class OssClientBucketCorsTest extends TestOssClientBase
{
    public function testBucket()
    {
        $corsConfig = new CorsConfig();
        $rule = new CorsRule();
        $rule->addAllowedHeader("x-oss-test");
        $rule->addAllowedHeader("x-oss-test2");
        $rule->addAllowedHeader("x-oss-test2");
        $rule->addAllowedHeader("x-oss-test3");
        $rule->addAllowedOrigin("http://www.b.com");
        $rule->addAllowedOrigin("http://www.a.com");
        $rule->addAllowedOrigin("http://www.a.com");
        $rule->addAllowedMethod("GET");
        $rule->addAllowedMethod("PUT");
        $rule->addAllowedMethod("POST");
        $rule->addExposeHeader("x-oss-test1");
        $rule->addExposeHeader("x-oss-test1");
        $rule->addExposeHeader("x-oss-test2");
        $rule->setMaxAgeSeconds(10);
        $corsConfig->addRule($rule);
        $rule = new CorsRule();
        $rule->addAllowedHeader("x-oss-test");
        $rule->addAllowedMethod("GET");
        $rule->addAllowedOrigin("http://www.b.com");
        $rule->addExposeHeader("x-oss-test1");
        $rule->setMaxAgeSeconds(110);
        $corsConfig->addRule($rule);

        try {
            $this->ossClient->putBucketCors($this->bucket, $corsConfig);
        } catch (OssException $e) {
            $this->assertFalse(True);
        }

        try {
            Common::waitMetaSync();
            $object = "cors/test.txt";
            $this->ossClient->putObject($this->bucket, $object, file_get_contents(__FILE__));
            $headers = $this->ossClient->optionsObject($this->bucket, $object, "http://www.a.com", "GET", "", null);
            $this->assertNotEmpty($headers);
        } catch (OssException $e) {
            var_dump($e->getMessage());
        }

        try {
            Common::waitMetaSync();
            $corsConfig2 = $this->ossClient->getBucketCors($this->bucket);
            $this->assertNotNull($corsConfig2);
            $this->assertEquals($corsConfig->serializeToXml(), $corsConfig2->serializeToXml());
        } catch (OssException $e) {
            $this->assertFalse(True);
        }

        try {
            Common::waitMetaSync();
            $this->ossClient->deleteBucketCors($this->bucket);
        } catch (OssException $e) {
            $this->assertFalse(True);
        }

        try {
            Common::waitMetaSync();
            $corsConfig3 = $this->ossClient->getBucketCors($this->bucket);
            $this->assertNotNull($corsConfig3);
            $this->assertNotEquals($corsConfig->serializeToXml(), $corsConfig3->serializeToXml());
        } catch (OssException $e) {
            $this->assertFalse(True);
        }

    }
}


text:
\section {Список по идентификатору}

Вначале идут функции многомерной оптимизации, потом двумерной, далее одномерной. В конце идут функции бинарной оптимизации.

\begin{enumerate}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Ackley]{\textbf{HML\_TestFunction\_Ackley}} --- функция Ackley;
 \item \hyperref[TestFunctions:section:HML_TestFunction_GaussianQuartic]{\textbf{HML\_TestFunction\_GaussianQuartic}} --- функция Gaussian quartic;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Griewangk]{\textbf{HML\_TestFunction\_Griewangk}} --- функция Гриванка;
 \item \hyperref[TestFunctions:section:HML_TestFunction_HyperEllipsoid]{\textbf{HML\_TestFunction\_HyperEllipsoid}} --- гипер-эллипсоид;
 \item \hyperref[TestFunctions:section:HML_TestFunction_ParaboloidOfRevolution]{\textbf{HML\_TestFunction\_ParaboloidOfRevolution}} --- эллиптический параболоид;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Rastrigin]{\textbf{HML\_TestFunction\_Rastrigin}} --- функция Растригина;
 \item \hyperref[TestFunctions:section:HML_TestFunction_RastriginNovgorod]{\textbf{HML\_TestFunction\_RastriginNovgorod}} --- функция Растригина новгородская;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Rosenbrock]{\textbf{HML\_TestFunction\_Rosenbrock}} --- функция Розенброка;
 \item \hyperref[TestFunctions:section:HML_TestFunction_RotatedHyperEllipsoid]{\textbf{HML\_TestFunction\_RotatedHyperEllipsoid}} --- развернутый гипер-эллипсоид;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Schwefel]{\textbf{HML\_TestFunction\_Schwefel}} --- функция Швефеля;
 \item \hyperref[TestFunctions:section:HML_TestFunction_StepFunction]{\textbf{HML\_TestFunction\_StepFunction}} --- функция Step (модифицированная версия De Jong 3);
 \item \hyperref[TestFunctions:section:HML_TestFunction_AdditivePotential]{\textbf{HML\_TestFunction\_AdditivePotential}} --- аддитивная потенциальная функция;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Bosom]{\textbf{HML\_TestFunction\_Bosom}} --- функция Bosom;
 \item \hyperref[TestFunctions:section:HML_TestFunction_EggHolder]{\textbf{HML\_TestFunction\_EggHolder}} --- функция Egg Holder;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Himmelblau]{\textbf{HML\_TestFunction\_Himmelblau}} --- функция Химмельблау;
 \item \hyperref[TestFunctions:section:HML_TestFunction_InvertedRosenbrock]{\textbf{HML\_TestFunction\_InvertedRosenbrock}} --- перевернутая функция Розенброка;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Katnikov]{\textbf{HML\_TestFunction\_Katnikov}} --- функция Катникова;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal3]{\textbf{HML\_TestFunction\_Multiextremal3}} --- функция Multiextremal3;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal4]{\textbf{HML\_TestFunction\_Multiextremal4}} --- функция Multiextremal4;
 \item \hyperref[TestFunctions:section:HML_TestFunction_MultiplicativePotential]{\textbf{HML\_TestFunction\_MultiplicativePotential}} --- мультипликативная потенциальная функция;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Rana]{\textbf{HML\_TestFunction\_Rana}} --- функция Rana;
 \item \hyperref[TestFunctions:section:HML_TestFunction_RastriginWithChange]{\textbf{HML\_TestFunction\_RastriginWithChange}} --- функция Растригина с изменением коэффициентов;
 \item \hyperref[TestFunctions:section:HML_TestFunction_RastriginWithTurning]{\textbf{HML\_TestFunction\_RastriginWithTurning}} --- функция Растригина овражная с поворотом осей;
 \item \hyperref[TestFunctions:section:HML_TestFunction_ReverseGriewank]{\textbf{HML\_TestFunction\_ReverseGriewank}} --- функция ReverseGriewank;
 \item \hyperref[TestFunctions:section:HML_TestFunction_ShekelsFoxholes]{\textbf{HML\_TestFunction\_ShekelsFoxholes}} --- функция "Лисьи норы" Шекеля;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Sombrero]{\textbf{HML\_TestFunction\_Sombrero}} --- функция Сомбреро;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal]{\textbf{HML\_TestFunction\_Multiextremal}} --- функция Multiextremal;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal2]{\textbf{HML\_TestFunction\_Multiextremal2}} --- функция Multiextremal2;
 \item \hyperref[TestFunctions:section:HML_TestFunction_Wave]{\textbf{HML\_TestFunction\_Wave}} --- волна;
 \item \hyperref[TestFunctions:section:HML_TestFunction_SumVector]{\textbf{HML\_TestFunction\_SumVector}} --- сумма всех элементов бинарного вектора.
\end{enumerate}

\section {Список формул}

\begin{enumerate}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Ackley]{\textbf{HML\_TestFunction\_Ackley}} --- функция Ackley:
 \begin{equation}
 f\left( \bar{x}\right) = 20 + e - 20e^{-0.2\sqrt{\frac{1}{n}\sum_{i=1}^{n}\bar{x}_i^2}}-e^{\frac{1}{n}\sum_{i=1}^{n}cos\left( 2\pi\cdot\bar{x}_i\right) }.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_GaussianQuartic]{\textbf{HML\_TestFunction\_GaussianQuartic}} --- функция Gaussian quartic:
 \begin{equation}
 f\left( \bar{x}\right) = \sum_{i=1}^{n}\left( i\cdot\bar{x}_i^4\right) +rnorm\left( 0,1\right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Griewangk]{\textbf{HML\_TestFunction\_Griewangk}} --- функция Гриванка:
\begin{equation}
f\left( \bar{x}\right) = \sum_{i=1}^{n}\dfrac{\bar{x}_i^2}{4000}-\prod_{i=1}^{n}\cos\left( \dfrac{\bar{x}_i}{\sqrt{i}}\right)+1.
\end{equation} \item \hyperref[TestFunctions:section:HML_TestFunction_HyperEllipsoid]{\textbf{HML\_TestFunction\_HyperEllipsoid}} --- гипер-эллипсоид:
\begin{equation}
f\left( \bar{x}\right) = \sum_{i=1}^{n}\left( i\cdot\bar{x}_i\right) ^2.
\end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_ParaboloidOfRevolution]{\textbf{HML\_TestFunction\_ParaboloidOfRevolution}} --- эллиптический параболоид:
 \begin{equation}
 f\left( \bar{x}\right) = \sum_{i=1}^{n}\bar{x}_i^2.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Rastrigin]{\textbf{HML\_TestFunction\_Rastrigin}} --- функция Растригина:
 \begin{equation}
 f\left( \bar{x}\right) = 10n+\sum_{i=1}^{n}\left( \bar{x}_i^2-10\cdot\cos\left( 2\pi\cdot \bar{x}_i\right) \right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_RastriginNovgorod]{\textbf{HML\_TestFunction\_RastriginNovgorod}} --- функция Растригина новгородская:
 \begin{equation}
 f\left( \bar{x}\right) = n+\sum_{i=1}^{n}\left( \bar{x}_i^2-\cos\left(18\cdot \bar{x}_i^2\right) \right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Rosenbrock]{\textbf{HML\_TestFunction\_Rosenbrock}} --- функция Розенброка:
 \begin{equation}
 f\left( \bar{x}\right) = \sum_{i=1}^{n-1} \left( 100{\left( \bar{x}_{i+1}-\bar{x}_i^2\right)}^2+{\left( 1-\bar{x}_i\right) }^2 \right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_RotatedHyperEllipsoid]{\textbf{HML\_TestFunction\_RotatedHyperEllipsoid}} --- развернутый гипер-эллипсоид:
 \begin{equation}
 f\left( \bar{x}\right) = \sum_{i=1}^{n}\left( \sum_{j=1}^{j}\bar{x}_j\right) ^2.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Schwefel]{\textbf{HML\_TestFunction\_Schwefel}} --- функция Швефеля:
 \begin{equation}
 f\left( \bar{x}\right) = 418.9829 n-\sum_{i=1}^{n}\left( \bar{x}_i\sin\left( \sqrt{\left| \bar{x}_i\right|}\right)  \right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_StepFunction]{\textbf{HML\_TestFunction\_StepFunction}} --- функция Step (модифицированная версия De Jong 3):
 \begin{equation}
 f\left( \bar{x}\right) =\left\lbrace \begin{aligned}
 \sum_{i=1}^{n} \left( int\left( \bar{x}_{i}\right)  \right)^2,& \text{ если} \sum_{i=1}^{n} \left| int\left( \bar{x}_{i}\right)\right| \neq 0 ;\\ \left( \sum_{i=1}^{n} \left| \bar{x}_{i}\right|\right) -1 ,& \text{ иначе}.
 \end{aligned}\right.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_AdditivePotential]{\textbf{HML\_TestFunction\_AdditivePotential}} --- аддитивная потенциальная функция:
 \begin{equation}
 f\left( \bar{x}\right) = z\left( \bar{x}_1\right)+ z\left( \bar{x}_2\right), \text{ где}
 \end{equation}
 \begin{equation*}
 z\left( v\right)= -\dfrac{1}{\left( v-1\right)^2+0.2 }-\dfrac{1}{2\left( v-2\right)^2+0.15}-\dfrac{1}{3\left( v-3\right)^2+0.3}.
 \end{equation*}
\item \hyperref[TestFunctions:section:HML_TestFunction_Bosom]{\textbf{HML\_TestFunction\_Bosom}} --- функция Bosom:
\begin{equation}
f\left( \bar{x}\right) = e^{\frac{z_1\left( \bar{x}_1,\bar{x}_2\right)}{1000} } +e^{\frac{z_2\left( \bar{x}_1,\bar{x}_2\right)}{1000} }+ 0.15\cdot e^{z_1\left( \bar{x}_1,\bar{x}_2\right) }+0.15\cdot e^{z_2\left( \bar{x}_1,\bar{x}_2\right) }, \text{ где}
\end{equation}
\begin{equation*}
\label{TestFunctions:eq:HML_Bosom2}
z_1\left( \bar{x}_1,\bar{x}_2\right) = -\left(\left( \bar{x}_1+4\right)^2 +\left( \bar{x}_2+4\right)^2 \right)^2 ,
\end{equation*}
\begin{equation*}
\label{TestFunctions:eq:HML_Bosom3}
z_2\left( \bar{x}_1,\bar{x}_2\right) = -\left(\left( \bar{x}_1-4\right)^2 +\left( \bar{x}_2-4\right)^2 \right)^2 ,
\end{equation*}
 \item \hyperref[TestFunctions:section:HML_TestFunction_EggHolder]{\textbf{HML\_TestFunction\_EggHolder}} --- функция Egg Holder:
 \begin{equation}
 f\left( \bar{x}\right) = -\bar{x}_1\sin\left( \sqrt{\left| \bar{x}_1-47-\bar{x}_2\right| }\right)- (\bar{x}_2+47)\sin\left( \sqrt{\left| \dfrac{\bar{x}_1}{2}+47+\bar{x}_2\right| }\right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Himmelblau]{\textbf{HML\_TestFunction\_Himmelblau}} --- функция Химмельблау:
 \begin{equation}
 f\left( \bar{x}\right) = \left( \bar{x}_1^2+\bar{x}_2-11\right)^2+\left( \bar{x}_1+\bar{x}^2-7\right)^2.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_InvertedRosenbrock]{\textbf{HML\_TestFunction\_InvertedRosenbrock}} --- перевернутая функция Розенброка:
 \begin{equation}
 f\left( \bar{x}\right) =\dfrac{-100}{100\left( \bar{x}_1^2-\bar{x}_2\right) +\left( 1.-\bar{x}_1\right)^2+600}.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Katnikov]{\textbf{HML\_TestFunction\_Katnikov}} --- функция Катникова:
 \begin{equation}
 f\left( \bar{x}\right) = 0.5\left( \bar{x}_1^2+\bar{x}_2^2\right) \left( 2A+A\cos\left( 1.5\bar{x}_1\right)\cos\left( 3.14\bar{x}_2\right)+A\cos\left( \sqrt{5}\bar{x}_1\right)\cos\left( 3.5\bar{x}_2\right)    \right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal3]{\textbf{HML\_TestFunction\_Multiextremal3}} --- функция Multiextremal3:
 \begin{equation}
 f\left( \bar{x}\right) = \bar{x}_1^2\left| \sin\left( 2\bar{x}_1\right) \right| +\bar{x}_2^2\left| \sin\left( 2\bar{x}_2\right) \right| -\dfrac{1}{5\bar{x}_1^2+5\bar{x}_2^2+0.2} + 5.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal4]{\textbf{HML\_TestFunction\_Multiextremal4}} --- функция Multiextremal4:
 \begin{align}
 f\left( \bar{x}\right) =& 0.5\left( \bar{x}_1^2+\bar{x}_1\bar{x}_2 +\bar{x}_2^2\right) \left( 1+0.5\cos\left(1.5\bar{x}_1\right)\cos\left(3.2\bar{x}_1\bar{x}_2\right)\cos\left(3.14\bar{x}_2\right)  +\right. \\
  & \left.+0.5\cos\left(2.2\bar{x}_1\right)\cos\left(4.8\bar{x}_1\bar{x}_2\right)\cos\left(3.5\bar{x}_2\right)\right).\nonumber
 \end{align}
 \item \hyperref[TestFunctions:section:HML_TestFunction_MultiplicativePotential]{\textbf{HML\_TestFunction\_MultiplicativePotential}} --- мультипликативная потенциальная функция:
 \begin{equation}
 f\left( \bar{x}\right) = -z\left( \bar{x}_1\right)\cdot z\left( \bar{x}_2\right), \text{ где}
 \end{equation}
 \begin{equation*}
 z\left( v\right)= -\dfrac{1}{\left( v-1\right)^2+0.2 }-\dfrac{1}{2\left( v-2\right)^2+0.15}-\dfrac{1}{3\left( v-3\right)^2+0.3}.
 \end{equation*}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Rana]{\textbf{HML\_TestFunction\_Rana}} --- функция Rana:
 \begin{align}
 f\left( \bar{x}\right) = & \bar{x}_1\sin\left( \sqrt{\left| \bar{x}_2+1-\bar{x}_1\right| }\right) \cos\left( \sqrt{\left| \bar{x}_2+1+\bar{x}_1\right| }\right)+  \\&+ (\bar{x}_2+1)\cos\left( \sqrt{\left| \bar{x}_2+1-\bar{x}_1\right| }\right) \sin\left( \sqrt{\left| \bar{x}_2+1+x\right| }\right).
 \end{align}
 \item \hyperref[TestFunctions:section:HML_TestFunction_RastriginWithChange]{\textbf{HML\_TestFunction\_RastriginWithChange}} --- функция Растригина с изменением коэффициентов:
 \begin{equation}
 f\left( \bar{x}\right) =0.1\bar{x}_1^2+0.1\bar{x}_2^2-4\cos\left( 0.8\bar{x}_1\right) -4\cos\left( 0.8\bar{x}_2\right) +8.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_RastriginWithTurning]{\textbf{HML\_TestFunction\_RastriginWithTurning}} --- функция Растригина овражная с поворотом осей:
 \begin{align}
 f\left( \bar{x}\right) =&{\left( 0.1 K_{\bar{x}_1}A\left( \bar{x}_1,\bar{x}_2\right) \right) }^2+{\left( 0.1 K_{\bar{x}_2}B\left( \bar{x}_1,\bar{x}_2\right) \right) }^2-
 \\&-4\cos\left( 0.8K_{\bar{x}_1}A\left( \bar{x}_1,\bar{x}_2\right)\right) -4\cos\left( 0.8K_{\bar{x}_2}B\left( \bar{x}_1,\bar{x}_2\right)\right) +8, \text{ где}\nonumber
 \\&A\left( \bar{x}_1,\bar{x}_2\right)= \bar{x}_1\cos\left( \alpha\right) -\bar{x}_2\sin\left( \alpha\right),\nonumber
 \\&B\left( \bar{x}_1,\bar{x}_2\right)= \bar{x}_1\sin\left( \alpha\right) +\bar{x}_2\cos\left( \alpha\right).\nonumber
 \end{align}
 \item \hyperref[TestFunctions:section:HML_TestFunction_ReverseGriewank]{\textbf{HML\_TestFunction\_ReverseGriewank}} --- функция ReverseGriewank:
 \begin{equation}
 f\left( \bar{x}\right) = \dfrac{1}{\dfrac{\bar{x}_1^2+\bar{x}_2^2}{200}-cos\left( \bar{x}_0\right)cos\left( \dfrac{\bar{x}_2}{\sqrt{2}}\right)+2  }, \text{ где}
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_ShekelsFoxholes]{\textbf{HML\_TestFunction\_ShekelsFoxholes}} --- функция "Лисьи норы" Шекеля:
 \begin{equation}
 f\left( \bar{x}\right) = \dfrac{1}{\dfrac{1}{K}+\sum_{j=1}^{25}\dfrac{1}{j+\left( \bar{x}_1-A_{1,j}\right)^6+ \left( \bar{x}_2-A_{2,j}\right)^6}}, \text{ где}
 \end{equation}
 \begin{equation*}
 A =  \bigl(\begin{smallmatrix}
 -32 & -16 & 0 & 16 & 32 & -32 & -16 & 0 & 16 & 32 & -32 & -16 & 0 & 16 & 32 & -32 & -16 & 0 & 16 & 32 & -32 & -16 & 0 & 16 & 32\\
 -32 & -32 & -32 & -32 & -32 & -16 & -16 & -16 & -16 & -16 & 0 & 0 & 0 & 0 & 0 & 16 & 16 & 16 & 16 & 16 & 32 & 32 & 32 & 32 & 32
 \end{smallmatrix}\bigr).
 \end{equation*}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Sombrero]{\textbf{HML\_TestFunction\_Sombrero}} --- функция Сомбреро:
 \begin{equation}
 f\left( \bar{x}\right) =\dfrac{1-{sin\left( \sqrt{\bar{x}_1^2+\bar{x}_2^2}\right)}^2 }{1+0.001\left(\bar{x}_1^2+\bar{x}_2^2 \right) }.
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal]{\textbf{HML\_TestFunction\_Multiextremal}} --- функция Multiextremal:
 \begin{equation}
 f\left( \bar{x}\right) = 0.05\left( x-1\right)^2 + \left( 3-2.9e^{-2.77257x^2}\right)\left( 1-\cos\left(x\left(4-50e^{-2.77257x^2} \right)  \right) \right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Multiextremal2]{\textbf{HML\_TestFunction\_Multiextremal2}} --- функция Multiextremal2:
 \begin{equation}
 f\left( \bar{x}\right) =1-0.5\cos\left( 1.5\left( 10x-0.3\right) \right)\cos\left( 31.4x\right)+0.5\cos\left(\sqrt{5}\cdot10x \right)\cos\left( 35x\right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_Wave]{\textbf{HML\_TestFunction\_Wave}} --- волна:
 \begin{equation}
 f\left( \bar{x}\right) = e^{ -\bar{x}_1^2}+0.01\cos\left( 200\cdot\bar{x}_1\right).
 \end{equation}
 \item \hyperref[TestFunctions:section:HML_TestFunction_SumVector]{\textbf{HML\_TestFunction\_SumVector}} --- сумма всех элементов бинарного вектора:
 \begin{equation}
 f\left( \bar{x}\right) = \sum_{i=1}^{n}\bar{x}_i.
 \end{equation}
 \end{enumerate}


text:
#ifndef __XF_GDI_H
#define __XF_GDI_H

#include <freerdp/gdi/gdi.h>

#include "xf_client.h"
#include "xfreerdp.h"

void xf_gdi_register_update_callbacks(rdpUpdate* update);
BOOL xf_gdi_bitmap_update(rdpContext* context, BITMAP_UPDATE* bitmapUpdate);
UINT32 xf_convert_rdp_order_color(xfContext* xfc, UINT32 color);

#endif /* __XF_GDI_H */


text:
import theano
import theano.tensor as T
from theano.tensor import nnet
from theano.tensor.nnet import conv
from hmmlearn import hmm
import np as np

class ConvPoolLayer(object):

    def __init__(self, rng, input, filter_shape, image_shape, poolsize=(1, 1)):
        """
        Allocate a LeNetConvPoolLayer with shared variable internal parameters.

        :type rng: np.random.RandomState
        :param rng: a random number generator used to initialize weights

        :type input: theano.tensor.dtensor4
        :param input: symbolic image tensor, of shape image_shape

        :type filter_shape: tuple or list of length 4
        :param filter_shape: (number of filters, num input feature maps,
                              filter height,filter width)

        :type image_shape: tuple or list of length 4
        :param image_shape: (batch size, num input feature maps,
                             image height, image width)

        :type poolsize: tuple or list of length 2
        :param poolsize: the downsampling (pooling) factor (#rows,#cols)
        """
        assert image_shape[1] == filter_shape[1]
        self.input = input

        # initialize weight values: the fan-in of each hidden neuron is
        # restricted by the size of the receptive fields.
        fan_in =  np.prod(filter_shape[1:])
        W_values = np%.asarray(rng.uniform(
              low=-np%.sqrt(3./fan_in),
              high=np.sqrt(3./fan_in),
              size=filter_shape), dtype=theano.config.floatX)
        self.W = theano.shared(value=W_values, name='W')

        # the bias is a 1D tensor -- one bias per output feature map
        b_values = np.zeros((filter_shape[0],), dtype=theano.config.floatX)
        self.b = theano.shared(value=b_values, name='b')

        # convolve input feature maps with filters
        conv_out = conv.conv2d(input, self.W,
                filter_shape=filter_shape, image_shape=image_shape)

        # downsample each feature map individually, using maxpooling
        pooled_out = downsample.max_pool_2d(conv_out, poolsize, ignore_border=True)

        # add the bias term. Since the bias is a vector (1D array), we first
        # reshape it to a tensor of shape (1, n_filters, 1, 1). Each bias will thus
        # be broadcasted across mini-batches and feature map width & height
        self.output = T.tanh(pooled_out + self.b.dimshuffle('x', 0, 'x', 'x'))

        # store parameters of this layer
        self.params = [self.W, self.b]

def main():

    #### Data ####

    # fake A/C params
    pi=np.array([0.1,0.9])
    a=np.array([[0.95,0.05],[0.05,0.95]])
    mean=np.array([[0],[1500]])
    cov=np.array([[[ 1.]],[[ 10]]])
    model=hmm.GaussianHMM(pi.size, "full", pi,a)
    model.means_ = mean
    model.covars_ = cov

    # randomly sample one day of data
    length = 4 * 24
    power, state = model.sample(length)

    #### CNN ####
    learning_rate = 0.1
    rng = np.random.RandomState(23455)

    ishape = (length, 1)  # this is the size of our input data
    batch_size = 20  # size of the minibatch

    # allocate symbolic variables for the data
    x = T.matrix('x')  # generated power levels
    y = T.lvector('y')  # generate states

    ##############################
    # BEGIN BUILDING ACTUAL MODEL
    ##############################

    # Reshape matrix of rasterized images of shape (batch_size,length,1)
    # to a 4D tensor, compatible with our ConvPoolLayer
    layer0_input = x.reshape((batch_size,1,length,1))

    # Construct the first convolutional pooling layer:
    # filtering reduces the image size to (96-3+1,1-1+1)=(94,1)
    # maxpooling reduces this further to (94/2,1/1) = (47,1)
    # 4D output tensor is thus of shape (20,20,47,1)
    layer0 = LeNetConvPoolLayer(rng, input=layer0_input,
            image_shape=(batch_size, 1, length, 1),
            filter_shape=(20, 1, 3, 1), poolsize=(3, 1))

    # Construct the second convolutional pooling layer
    # filtering reduces the image size to (12 - 5 + 1, 12 - 5 + 1)=(8, 8)
    # maxpooling reduces this further to (8/2,8/2) = (4, 4)
    # 4D output tensor is thus of shape (20,50,4,4)
    #layer1 = LeNetConvPoolLayer(rng, input=layer0.output,
    #        image_shape=(batch_size, 20, 12, 12),
    #        filter_shape=(50, 20, 5, 5), poolsize=(2, 2))

    # the HiddenLayer being fully-connected, it operates on 2D matrices of
    # shape (batch_size,num_pixels) (i.e matrix of rasterized images).
    # This will generate a matrix of shape (20, 20 * 47 * 1)
    layer2_input = layer0.output.flatten(2)

    # construct a fully-connected sigmoidal layer
    layer2 = HiddenLayer(rng, input=layer2_input,
                         n_in=20*47*1, n_out=50,
                         activation=T.tanh    )

    # classify the values of the fully-connected sigmoidal layer
    layer3 = LogisticRegression(input=layer2.output, n_in=50, n_out=1)

    # the cost we minimize during training is the NLL of the model
    cost = layer3.negative_log_likelihood(y)

    # create a function to compute the mistakes that are made by the model
    test_model = theano.function([x, y], layer3.errors(y))

    # create a list of all model parameters to be fit by gradient descent
    params = layer3.params + layer2.params + layer1.params + layer0.params

    # create a list of gradients for all model parameters
    grads = T.grad(cost, params)

    # train_model is a function that updates the model parameters by SGD
    # Since this model has many parameters, it would be tedious to manually
    # create an update rule for each model parameter. We thus create the updates
    # dictionary by automatically looping over all (params[i],grads[i])  pairs.
    updates = []
    for param_i, grad_i in zip(params, grads):
        updates.append((param_i, param_i - learning_rate * grad_i))
    train_model = theano.function([index], cost, updates = updates,
            givens={
                x: train_set_x[index * batch_size: (index + 1) * batch_size],
                y: train_set_y[index * batch_size: (index + 1) * batch_size]})

if __name__ == "__main__":
    main()


text:
<?php

final class ManiphestProjectNameFulltextEngineExtension
  extends PhabricatorFulltextEngineExtension {

  const EXTENSIONKEY = 'maniphest.project.name';

  public function getExtensionName() {
    return pht('Maniphest Project Name Cache');
  }

  public function shouldIndexFulltextObject($object) {
    return ($object instanceof PhabricatorProject);
  }

  public function indexFulltextObject(
    $object,
    PhabricatorSearchAbstractDocument $document) {

    ManiphestNameIndex::updateIndex(
      $object->getPHID(),
      $object->getName());
  }

}


text:
module Tinycar
{
    export module Session
    {
        interface ISessionData
        {
            [key:string]:any;
        }

        export var sessionData:ISessionData;

        // Clear specified session property
        export function clear(name:string):void
        {
            sessionStorage.removeItem(name);
        }

        // Get specified session property value
        export function get(name:string):Object
        {
            // Get data from storage
            let data = sessionStorage.getItem(name);

            // Invalid data to parse
            if (typeof data !== 'string')
                return {};

            // Try to parse JSON string
            data = JSON.parse(data);

            // Get empty object on failure
            if (!(data instanceof Object))
                return {};

            return data;
        }

        // Check if specified session property exists
        export function has(name:string):boolean
        {
            return (sessionStorage.getItem(name) !== null);
        }

        // Set specified session storage property value
        export function set(name:string, value:Object):void
        {
            sessionStorage.setItem(name, JSON.stringify(value));
        }
    }
}


text:
package tech.crom.client.java.http.internal;

import crom.tech.api.models.CommitIdCollection;
import crom.tech.api.models.CreateVersionRequest;
import crom.tech.api.models.CreateVersionResponse;
import crom.tech.api.models.VersionSearchResponse;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import tech.crom.client.java.RepoDetails;

public interface ConradRetrofitService {

    @GET("/api/v1/project/{projectName}/repo/{repoName}")
    Call<RepoDetails> getRepoDetails(@Path("projectName") String projectName,
                                     @Path("repoName") String repoName);

    @POST("/api/v1/project/{projectName}/repo/{repoName}/search/version")
    Call<VersionSearchResponse> findVersion(@Path("projectName") String projectName,
                                            @Path("repoName") String repoName,
                                            @Body CommitIdCollection commitIdCollection);

    @POST("/api/v1/project/{projectName}/repo/{repoName}/version")
    Call<CreateVersionResponse> claimVersion(@Path("projectName") String projectName,
                                             @Path("repoName") String repoName,
                                             @Body CreateVersionRequest createVersionRequest);
}


text:
require 'spec_helper'

describe 'SymbolTable' do
  it 'should create symbol table' do
    CONFIG.profile.should == 'firefox_profile'
    CONFIG.enable_proxy == false
    CONFIG.grid_url == 'http://localhost:4444'
    CONFIG.proxy_based_url == 'my_proxy:8080'
    CONFIG.secure_ssl == false
    CONFIG.untrust_ssl_cert == false
    CONFIG.test_host_name == 'stage'
    CONFIG.machine_name ==   'localhost'
  end
end


text:
var workspace           = require('../controllers/Workspace.js')
  , helpers             = require('../libs/Helpers.js');

function removeUserFromWorkspace(req, res, next) {
  console.log('removeUserFromWorkspace: ' + req.params.wsId + ' ' + req.params.userId)

  workspace.removeUser(req.params.wsId, req.params.userId, function(err, result) {

    if( err ) {
      err.where = 'removeUserFromWorkspace workspace.removeUser';
      helpers.responseError(res, 400, err)
      return;
    }

    helpers.successResponse(res, {})
  });
}
exports.removeUserFromWorkspace = removeUserFromWorkspace;


text:
<link rel="import" href="vaadin-date-picker-overlay.html">
<link rel="import" href="vaadin-date-picker-overlay-content.html">
<link rel="import" href="vaadin-month-calendar.html">

<link rel="import" href="../../src/vaadin-date-picker-light.html">


text:
#ifndef AnimationTimeline_h
#define AnimationTimeline_h

#include "bindings/core/v8/ScriptWrappable.h"
#include "core/animation/AnimationEffect.h"
#include "core/animation/AnimationPlayer.h"
#include "core/dom/Element.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"

namespace blink {

class Document;
class AnimationNode;

// AnimationTimeline is constructed and owned by Document, and tied to its lifecycle.
class AnimationTimeline : public RefCountedWillBeGarbageCollectedFinalized<AnimationTimeline>, public ScriptWrappable {
    DEFINE_WRAPPERTYPEINFO();
public:
    class PlatformTiming : public NoBaseWillBeGarbageCollectedFinalized<PlatformTiming> {

    public:
        // Calls AnimationTimeline's wake() method after duration seconds.
        virtual void wakeAfter(double duration) = 0;
        virtual void cancelWake() = 0;
        virtual void serviceOnNextFrame() = 0;
        virtual ~PlatformTiming() { }
        virtual void trace(Visitor*) { }
    };

    static PassRefPtrWillBeRawPtr<AnimationTimeline> create(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming> = nullptr);
    ~AnimationTimeline();

    void serviceAnimations(TimingUpdateReason);

    // Creates a player attached to this timeline, but without a start time.
    AnimationPlayer* createAnimationPlayer(AnimationNode*);
    AnimationPlayer* play(AnimationNode*);
    WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> getAnimationPlayers();

#if !ENABLE(OILPAN)
    void playerDestroyed(AnimationPlayer* player)
    {
        ASSERT(m_players.contains(player));
        m_players.remove(player);
    }
#endif

    bool hasPendingUpdates() const { return !m_playersNeedingUpdate.isEmpty(); }
    double zeroTime();
    double currentTime(bool& isNull);
    double currentTime();
    double currentTimeInternal(bool& isNull);
    double currentTimeInternal();
    double effectiveTime();
    void pauseAnimationsForTesting(double);

    void setOutdatedAnimationPlayer(AnimationPlayer*);
    bool hasOutdatedAnimationPlayer() const;

    Document* document() { return m_document.get(); }
#if !ENABLE(OILPAN)
    void detachFromDocument();
#endif
    void wake();

    void trace(Visitor*);

protected:
    AnimationTimeline(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming>);

private:
    RawPtrWillBeMember<Document> m_document;
    double m_zeroTime;
    // AnimationPlayers which will be updated on the next frame
    // i.e. current, in effect, or had timing changed
    WillBeHeapHashSet<RefPtrWillBeMember<AnimationPlayer>> m_playersNeedingUpdate;
    WillBeHeapHashSet<RawPtrWillBeWeakMember<AnimationPlayer>> m_players;

    friend class SMILTimeContainer;
    static const double s_minimumDelay;

    OwnPtrWillBeMember<PlatformTiming> m_timing;

    class AnimationTimelineTiming final : public PlatformTiming {
    public:
        AnimationTimelineTiming(AnimationTimeline* timeline)
            : m_timeline(timeline)
            , m_timer(this, &AnimationTimelineTiming::timerFired)
        {
            ASSERT(m_timeline);
        }

        virtual void wakeAfter(double duration) override;
        virtual void cancelWake() override;
        virtual void serviceOnNextFrame() override;

        void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); }

        virtual void trace(Visitor*) override;

    private:
        RawPtrWillBeMember<AnimationTimeline> m_timeline;
        Timer<AnimationTimelineTiming> m_timer;
    };

    friend class AnimationAnimationTimelineTest;
};

} // namespace blink

#endif


text:
using System.Threading.Tasks;

namespace RedDog.Messenger.Contracts.Handlers
{
    public interface ICommandHandler : IMessageHandler
    {

    }

    public interface ICommandHandler<in TCommand> : ICommandHandler
        where TCommand : class, ICommand
    {
        Task Handle(TCommand command);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace Aleterated
{
    class Word
    {

        /// <summary>
        /// Number of blocks that will be on the screen
        /// </summary>
        int blockNumber;

        /// <summary>
        /// List of every neccessary blocks to complete the word
        /// </summary>
        public List<Block> blockList;

        /// <summary>
        /// Angle between blocks
        /// </summary>
        public float stepAngle;

        /// <summary>
        /// Letter radius
        /// </summary>
        public float radius;

        /// <summary>
        /// speed of the blocks
        /// </summary>
        public float rotationSpeed;

        /// <summary>
        /// String of the word
        /// </summary>
        public string word;

        /// <summary>
        /// Difficulty level of the word
        /// </summary>
        public int level;

        /// <summary>
        /// Initialize class variables
        /// </summary>
        /// <param name="gameWord">The word itself</param>
        /// <param name="lvl">Nivel a la que pertenece</param>
        public void Initialize(string gameWord, int lvl)
        {
            radius = 120;
            rotationSpeed = 36;
            blockList = new List<Block>();

            word = gameWord;
            blockNumber = word.Length;
            stepAngle = 360 / blockNumber;

            level = lvl;
        }

        /// <summary>
        /// Initialize each block individually
        /// </summary>
        /// <returns></returns>
        public char[] InitializeNewWord()
        {
            char[] ArrChar = word.ToCharArray();

            // Adds blocks to the list
            for (int i = 0; i < ArrChar.Length; i++)
            {
                Block b = new Block();
                blockList.Add(b);
            }
            return ArrChar;
        }

        /// <summary>
        /// update
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values</param>
        /// <param name="touchLocation">Position where the screen was touched</param>
        public void Update(GameTime gameTime, Vector2 touchLocation, TouchLocationState TouchState)
        {
            // TODO: Add your update logic here
            // Block update
            foreach (Block b in blockList)
                b.Update((float)gameTime.ElapsedGameTime.TotalSeconds, touchLocation, TouchState);
        }

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public void Draw(SpriteBatch spriteBatch)
        {

            // TODO: Add your drawing code here

            // Block Draw
            foreach (Block b in blockList)
                b.Draw(spriteBatch);

        }
    }
}


text:
package org.mockito.internal.junit;

import org.mockito.mock.MockCreationSettings;

public class NoOpTestListener implements MockitoTestListener {

    public void testFinished(TestFinishedEvent event) {}

    public void onMockCreated(Object mock, MockCreationSettings settings) {}
}


text:
package <%- packageName %>;

import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.service.ServiceRegistry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.alfresco.repo.processor.BaseProcessorExtension;

/**
 * Documentation on creating custom javascript root objects can be found here:
 *
 * http://docs.alfresco.com/5.2/references/dev-extension-points-javascript-root-objects.html
 *
 * The Rhino JavaScript runtime is really clever at being able to call Java from JavaScript.
 * It will automatically handle some type conversions and even allows for javascript functions
 * to be passed to java code if the Java code expects an interface with a single method in it,
 * the javascript function will be made to look like that function. More details can be found in
 *
 * https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java#JavaScript_Functions_as_Java_Interfaces
 *
 */
public class <%- className %> extends BaseProcessorExtension {
  private static Log logger = LogFactory.getLog(<%- className %>.class);

  private ServiceRegistry serviceRegistry;
  private PolicyComponent policyComponent;

  public void setServiceRegistry(ServiceRegistry serviceRegistry) {
    this.serviceRegistry = serviceRegistry;
  }
  public void setPolicyComponent(PolicyComponent policyComponent) {
    this.policyComponent = policyComponent;
  }
  /**
   * This is a sample method that can be called from the javascript root object.
   * Example: <%- rootObjectId %>.callMe();
   */
  public void callMe() {
  	logger.error("<%- className %> the javascript root object works :)");
  }
}


text:
class QuestionSerializer < BaseSerializer
  attributes :id, :title, :body, :created_at, :updated_at, :short_title, :attachments_url, :user_id
  has_many :answers
  has_many :comments

  def short_title
    object.title.truncate(10)
  end
end


text:
import os
import subprocess
import sys
import random
import datetime
import argparse

# Borrowed from Simple-Haskell-Marker

# ARG PARSER ###########################################################
parser = argparse.ArgumentParser()

parser.add_argument('--clean',
                    action='store_true',
                    default=False
                    )

args = parser.parse_args()

# UTILITY FUNCTIONS ####################################################

def datetime_past_seconds(time):
    now = datetime.datetime.now()
    difference = now - time
    return difference.total_seconds()

def clear_directory(target):
    old_threshold = 3600 # Delete files older than 1 hour
    randint = random.randint(0,100) # 1 possibility in 100 of performing a cleaning
    if randint == 0:
        print('Clearing directory {}'.format(target))
        dir_content = os.listdir(target)
        for a_file in dir_content:
            if a_file == 'manifest.txt':
                continue
            timestamp = os.path.getmtime(target + os.sep + a_file)
            time_created = datetime.datetime.fromtimestamp(timestamp)
            time_past = datetime_past_seconds(time_created)
            print('Time past for {} is {}'.format(a_file, time_past))
            if time_past > old_threshold:
                print('Removing {}'.format(target + os.sep + a_file))
                os.remove(target + os.sep + a_file)

# MAIN SCRIPT ##########################################################

# alabno/overlapping-block-marker
exec_dir = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
# alabno/overlapping-block-marker/training
training_dir = os.path.abspath(exec_dir + os.sep + 'training')

# clear old directory entries if necessary
if args.clean:
    clear_directory(training_dir)
    sys.exit(0)

# get list of items in training directory
dir_content = os.listdir(training_dir)

# sort the list
dir_content.sort()

# remove anything that isn't starting with train
new_dir = []
for a_dir in dir_content:
    stem, ext = os.path.splitext(a_dir)
    if stem[:5] == 'train' and ext == '.train':
        new_dir.append(a_dir)

# create the manifest file
manifest_path = exec_dir + os.sep + 'training' + os.sep + 'manifest.txt'
manifest_file = open(manifest_path, 'w')
stem, ext = os.path.splitext(new_dir[len(new_dir) - 1])
manifest_file.write(stem)
manifest_file.close()


text:
module Zonomi
  module API

    SERVER = {
      domain: 'https://zonomi.com',
      prefix: '/app/dns',
      suffix: '.jsp',
      routes: {
        dyndns: '/dyndns',
        zone: {
          add: '/addzone',
          to_slave: '/converttosecondary',
          to_master: '/converttomaster',
        },
        ipchange: '/ipchange',
      }
    }

    require_relative "api/adapter"
    require_relative "api/client"
    require_relative "api/request"
    require_relative "api/action"
    require_relative "api/record"
    require_relative "api/zone"
    require_relative "api/result"

  end
end


text:
package org.onvif.ver10.schema;

import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.cxf.xjc.runtime.JAXBToStringStyle;

/**
 *
Java class for DeviceCapabilities complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="DeviceCapabilities">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="XAddr" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
 *         <element name="Network" type="{http://www.onvif.org/ver10/schema}NetworkCapabilities" minOccurs="0"/>
 *         <element name="System" type="{http://www.onvif.org/ver10/schema}SystemCapabilities" minOccurs="0"/>
 *         <element name="IO" type="{http://www.onvif.org/ver10/schema}IOCapabilities" minOccurs="0"/>
 *         <element name="Security" type="{http://www.onvif.org/ver10/schema}SecurityCapabilities" minOccurs="0"/>
 *         <element name="Extension" type="{http://www.onvif.org/ver10/schema}DeviceCapabilitiesExtension" minOccurs="0"/>
 *       </sequence>
 *       <anyAttribute processContents='lax'/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DeviceCapabilities", propOrder = {
    "xAddr",
    "network",
    "system",
    "io",
    "security",
    "extension"
})
public class DeviceCapabilities {

    @XmlElement(name = "XAddr", required = true)
    @XmlSchemaType(name = "anyURI")
    protected String xAddr;
    @XmlElement(name = "Network")
    protected NetworkCapabilities network;
    @XmlElement(name = "System")
    protected SystemCapabilities system;
    @XmlElement(name = "IO")
    protected IOCapabilities io;
    @XmlElement(name = "Security")
    protected SecurityCapabilities security;
    @XmlElement(name = "Extension")
    protected DeviceCapabilitiesExtension extension;
    @XmlAnyAttribute
    private Map<QName, String> otherAttributes = new HashMap<QName, String>();

    /**
     * Gets the value of the xAddr property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getXAddr() {
        return xAddr;
    }

    /**
     * Sets the value of the xAddr property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setXAddr(String value) {
        this.xAddr = value;
    }

    /**
     * Gets the value of the network property.
     *
     * @return
     *     possible object is
     *     {@link NetworkCapabilities }
     *
     */
    public NetworkCapabilities getNetwork() {
        return network;
    }

    /**
     * Sets the value of the network property.
     *
     * @param value
     *     allowed object is
     *     {@link NetworkCapabilities }
     *
     */
    public void setNetwork(NetworkCapabilities value) {
        this.network = value;
    }

    /**
     * Gets the value of the system property.
     *
     * @return
     *     possible object is
     *     {@link SystemCapabilities }
     *
     */
    public SystemCapabilities getSystem() {
        return system;
    }

    /**
     * Sets the value of the system property.
     *
     * @param value
     *     allowed object is
     *     {@link SystemCapabilities }
     *
     */
    public void setSystem(SystemCapabilities value) {
        this.system = value;
    }

    /**
     * Gets the value of the io property.
     *
     * @return
     *     possible object is
     *     {@link IOCapabilities }
     *
     */
    public IOCapabilities getIO() {
        return io;
    }

    /**
     * Sets the value of the io property.
     *
     * @param value
     *     allowed object is
     *     {@link IOCapabilities }
     *
     */
    public void setIO(IOCapabilities value) {
        this.io = value;
    }

    /**
     * Gets the value of the security property.
     *
     * @return
     *     possible object is
     *     {@link SecurityCapabilities }
     *
     */
    public SecurityCapabilities getSecurity() {
        return security;
    }

    /**
     * Sets the value of the security property.
     *
     * @param value
     *     allowed object is
     *     {@link SecurityCapabilities }
     *
     */
    public void setSecurity(SecurityCapabilities value) {
        this.security = value;
    }

    /**
     * Gets the value of the extension property.
     *
     * @return
     *     possible object is
     *     {@link DeviceCapabilitiesExtension }
     *
     */
    public DeviceCapabilitiesExtension getExtension() {
        return extension;
    }

    /**
     * Sets the value of the extension property.
     *
     * @param value
     *     allowed object is
     *     {@link DeviceCapabilitiesExtension }
     *
     */
    public void setExtension(DeviceCapabilitiesExtension value) {
        this.extension = value;
    }

    /**
     * Gets a map that contains attributes that aren't bound to any typed property on this class.
     *
     *

     * the map is keyed by the name of the attribute and
     * the value is the string value of the attribute.
     *
     * the map returned by this method is live, and you can add new attribute
     * by updating the map directly. Because of this design, there's no setter.
     *
     *
     * @return
     *     always non-null
     */
    public Map<QName, String> getOtherAttributes() {
        return otherAttributes;
    }

    /**
     * Generates a String representation of the contents of this type.
     * This is an extension method, produced by the 'ts' xjc plugin
     *
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE);
    }

}


text:
trait Foo {}

trait Bar<T> {}

trait Iterable {
    type Item;
}

struct Container<T: Iterable<Item = impl Foo>> {
    //~^ ERROR `impl Trait` not allowed
    field: T
}

enum Enum<T: Iterable<Item = impl Foo>> {
    //~^ ERROR `impl Trait` not allowed
    A(T),
}

union Union<T: Iterable<Item = impl Foo> + Copy> {
    //~^ ERROR `impl Trait` not allowed
    x: T,
}

type Type<T: Iterable<Item = impl Foo>> = T;
//~^ ERROR `impl Trait` not allowed

fn main() {
}


text:
package org.elasticsearch.shell;

import org.elasticsearch.shell.console.Console;

import java.io.PrintStream;

/**
 * @author Luca Cavanna
 *
 * Allows to execute an action giving a progressive feedback through the console
 * The action to execute is given through the inner ActionCallback class
 * @param <Result> the object returned as a result of the execution of the action
 */
public class ExecutorWithProgress<Result> {

    final Console<PrintStream> console;
    final ActionCallback<Result> actionCallback;

    /**
     * Creates a new instance of the ExecutorWithProgress class given the console where
     * it needs to print feedback and the action to execute
     * @param console the console
     * @param actionCallback the action to execute
     */
    public ExecutorWithProgress(Console<PrintStream> console, ActionCallback<Result> actionCallback) {
        this.console = console;
        this.actionCallback = actionCallback;
    }

    /**
     * Executes the action and displays a progressive feedback on the console in the meantime,
     * till the execution has been completed
     * @return the result coming from the execution of the action
     */
    public Result execute() {
        ProgressThread progressThread = new ProgressThread();
        progressThread.start();
        try {
            return actionCallback.execute();
        } finally {
            progressThread.end();
            console.println();
        }
    }

    /**
     * Thread that runs concurrently to the action to give progressive feedback
     */
    private class ProgressThread extends Thread {
        private volatile boolean stopped = false;

        public void end() {
            this.stopped = true;
        }

        @Override
        public void run() {
            while(!stopped) {
                console.print(".");
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {

                }
            }
        }
    }

    /**
     * Represents an action to execute
     * @param <Result> the object that the execution returns
     */
    public interface ActionCallback<Result> {
        Result execute();
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace PlexPowerSaver.Properties {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("b94169de-175e-4a1a-bd94-bebe784069a6")]
        public string ClientId {
            get {
                return ((string)(this["ClientId"]));
            }
            set {
                this["ClientId"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("30")]
        public string IdleTimeout {
            get {
                return ((string)(this["IdleTimeout"]));
            }
            set {
                this["IdleTimeout"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3." +
            "org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n  <s" +
            "tring>PlexNewTranscoder</string>\r\n</ArrayOfString>")]
        public global::System.Collections.Specialized.StringCollection BlacklistedProcesses {
            get {
                return ((global::System.Collections.Specialized.StringCollection)(this["BlacklistedProcesses"]));
            }
            set {
                this["BlacklistedProcesses"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("")]
        public string Username {
            get {
                return ((string)(this["Username"]));
            }
            set {
                this["Username"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("")]
        public string Password {
            get {
                return ((string)(this["Password"]));
            }
            set {
                this["Password"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("10")]
        public string PlexIdleTimeout {
            get {
                return ((string)(this["PlexIdleTimeout"]));
            }
            set {
                this["PlexIdleTimeout"] = value;
            }
        }
    }
}


text:
from google.appengine.api import taskqueue
from google.appengine.ext import deferred, testbed

from djangoappengine.db.stubs import stub_manager

import time, base64, logging

queue_cache = {}

def get_queue(queue_name):
    global queue_cache
    try:
        queue = queue_cache[queue_name]
    except KeyError:
        queue = queue_cache[queue_name] = taskqueue.Queue(queue_name)
    return queue

def add_task(name, url, queue_name='background-processing', countdown=0, params={}):
    if not isinstance(name,basestring):
        name = str(name)
    #sys.stderr.write('a'.join([name,' - ',url,'\n']))
    queue = get_queue(queue_name)
    try:
        name = '%s%d'%(name,int(time.time()/2))
        #headers = {'content-type':'multipart/form-data; boundary="-=-=-=-=-=-=-=-=-=-=-"'}
        task = taskqueue.Task(url=url, name=name, method='POST', countdown=countdown, params=params) #, headers=headers)
        queue.add(task)
        #sys.stderr.write('a %s\n'%str(poll_task_queue(queue_name)))
        return True
    except taskqueue.TaskAlreadyExistsError:
        return False
    except taskqueue.TombstonedTaskError:
        taskqueue.add(url=url, method='POST', queue_name=queue_name, countdown=countdown, params=params) #, headers=headers)
        return True

def delete_task(queue_name, task_name):
    queue = get_queue(queue_name)
    queue.delete_tasks_by_name_async(task_name)

def defer_function(func, *args, **kwargs):
    deferred.defer(func,*args,**kwargs)

class QueueStats(object):
    def __init__(self, name, active, waiting):
        self.name = name
        self.active = active if active is not None else 0
        self.waiting = waiting if waiting is not None else 0
        self.idle = self.active==0 and self.waiting==0
    def __str__(self, *args, **kwargs):
        return self.__unicode__()
    def __unicode__(self):
        return u'{"name":%s,"active":%s,"waiting":%d,"idle":%s}'%(self.name,self.active,self.waiting,str(self.idle))

def poll_task_queue(queue_name):
    if stub_manager.testbed and stub_manager.testbed._activated:
        test_task_stub = stub_manager.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
        rv = QueueStats(queue_name,0,0)
        tasks = test_task_stub.GetTasks(queue_name)
        rv.waiting += len(tasks)
        rv.idle = rv.waiting==0
        return rv
    queue = get_queue(queue_name)
    stats = queue.fetch_statistics()
    return QueueStats(queue.name, stats.in_flight, stats.tasks)

def run_test_task_queue(client):
    test_task_stub = stub_manager.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
    #stub = stub_manager.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
    for queue in test_task_stub.GetQueues():
        tasks = test_task_stub.GetTasks(queue['name'])
        for task in tasks:
            #logging.info('queue %s %s %s'%(queue['name'],task['method'],task['url']))
            if task['method'].upper()=='POST':
                content_type = 'multipart/form-data; boundary="-=-=-=-=-=-"'
                data = {}
                for k,v in task['headers']:
                    if k.lower()=='content-type':
                        content_type = v
                if task['body']:
                    data = base64.b64decode(task['body'])
                if task['url']=='/_ah/queue/deferred':
                    #content_type=='application/octet-stream' and queue['name']=='default':
                    deferred.run(data)
                else:
                    #logging.info(' '.join(['post',task['name'],' - ',task['url']]))
                    client.post(task['url'],data=data, content_type=content_type)
            else:
                #logging.info(' '.join(['get',task['name'],' - ',task['url']]))
                client.get(task['url'])
            #logging.info(' '.join(['done',task['name'],' - ',task['url']]))
        test_task_stub.FlushQueue(queue['name'])


text:
package cn.intelvision.rpc.server.handler;

import cn.intelvision.rpc.packet.BinPack;
import cn.intelvision.rpc.packet.DataPack;

/**
 * @author lanhuidong
 * @since 2017-02-08
 */
public interface BusinessHandler {

    DataPack service(DataPack in);

    BinPack service(BinPack in);

}


text:
r"""
Alignments and Sequence collections (:mod:`skbio.alignment`)
============================================================

.. currentmodule:: skbio.alignment

This module provides functionality for working with biological sequence
collections and alignments. These can be composed of generic sequences,
nucelotide sequences, DNA sequences, and RNA sequences. By default, input is
not validated, except that sequence ids must be unique, but all
contructor methods take a validate option which checks different features of
the input based on ``SequenceCollection`` type.

Data Structures
---------------

.. autosummary::
   :toctree: generated/

   SequenceCollection
   Alignment
   TabularMSA

Optimized (i.e., production-ready) Alignment Algorithms
-------------------------------------------------------

.. autosummary::
   :toctree: generated/

   StripedSmithWaterman
   AlignmentStructure
   local_pairwise_align_ssw

Slow (i.e., educational-purposes only) Alignment Algorithms
-----------------------------------------------------------

.. autosummary::
   :toctree: generated/

   global_pairwise_align_nucleotide
   global_pairwise_align_protein
   global_pairwise_align
   local_pairwise_align_nucleotide
   local_pairwise_align_protein
   local_pairwise_align

General functionality
---------------------

.. autosummary::
   :toctree: generated/

    make_identity_substitution_matrix

Exceptions
----------

.. autosummary::
   :toctree: generated/

   SequenceCollectionError
   AlignmentError

Data Structure Examples
-----------------------
>>> from skbio import SequenceCollection, Alignment, DNA
>>> seqs = [DNA("ACC--G-GGTA..", metadata={'id':"seq1"}),
...         DNA("TCC--G-GGCA..", metadata={'id':"seqs2"})]
>>> a1 = Alignment(seqs)
>>> a1
<Alignment: n=2; mean +/- std length=13.00 +/- 0.00>

>>> seqs = [DNA("ACCGGG", metadata={'id':"seq1"}),
...         DNA("TCCGGGCA", metadata={'id':"seq2"})]
>>> s1 = SequenceCollection(seqs)
>>> s1
<SequenceCollection: n=2; mean +/- std length=7.00 +/- 1.00>

>>> fasta_lines = ['>seq1\n',
...                'CGATGTCGATCGATCGATCGATCAG\n',
...                '>seq2\n',
...                'CATCGATCGATCGATGCATGCATGCATG\n']
>>> s1 = SequenceCollection.read(fasta_lines, constructor=DNA)
>>> s1
<SequenceCollection: n=2; mean +/- std length=26.50 +/- 1.50>

Alignment Algorithm Examples
----------------------------

Optimized Alignment Algorithm Examples
--------------------------------------
Using the convenient ``local_pairwise_align_ssw`` function:

>>> from skbio.alignment import local_pairwise_align_ssw
>>> alignment = local_pairwise_align_ssw(
...                 "ACTAAGGCTCTCTACCCCTCTCAGAGA",
...                 "ACTAAGGCTCCTAACCCCCTTTTCTCAGA"
...             )
>>> print(alignment)
>query
ACTAAGGCTCTC-TACCC----CTCTCAGA
>target
ACTAAGGCTC-CTAACCCCCTTTTCTCAGA
<BLANKLINE>

Using the ``StripedSmithWaterman`` object:

>>> from skbio.alignment import StripedSmithWaterman
>>> query = StripedSmithWaterman("ACTAAGGCTCTCTACCCCTCTCAGAGA")
>>> alignment = query("AAAAAACTCTCTAAACTCACTAAGGCTCTCTACCCCTCTTCAGAGAAGTCGA")
>>> print(alignment)
ACTAAGGCTC...
ACTAAGGCTC...
Score: 49
Length: 28

Using the ``StripedSmithWaterman`` object for multiple targets in an efficient
way and finding the aligned sequence representations:

>>> from skbio.alignment import StripedSmithWaterman
>>> alignments = []
>>> target_sequences = [
...     "GCTAACTAGGCTCCCTTCTACCCCTCTCAGAGA",
...     "GCCCAGTAGCTTCCCAATATGAGAGCATCAATTGTAGATCGGGCC",
...     "TCTATAAGATTCCGCATGCGTTACTTATAAGATGTCTCAACGG",
...     "TAGAGATTAATTGCCACTGCCAAAATTCTG"
... ]
>>> query_sequence = "ACTAAGGCTCTCTACCCCTCTCAGAGA"
>>> query = StripedSmithWaterman(query_sequence)
>>> for target_sequence in target_sequences:
...     alignment = query(target_sequence)
...     alignments.append(alignment)
...
>>> print(alignments[0])
ACTAAGGCT-...
ACT-AGGCTC...
Score: 38
Length: 30
>>> print(alignments[0].aligned_query_sequence)
ACTAAGGCT---CTCTACCCCTCTCAGAGA
>>> print(alignments[0].aligned_target_sequence)
ACT-AGGCTCCCTTCTACCCCTCTCAGAGA

Slow Alignment Algorithm Examples
---------------------------------
scikit-bio also provides pure-Python implementations of Smith-Waterman and
Needleman-Wunsch alignment. These are much slower than the methods described
above, but serve as useful educational examples as they're simpler to
experiment with. Functions are provided for local and global alignment of
protein and nucleotide sequences. The ``global*`` and ``local*`` functions
differ in the underlying algorithm that is applied (``global*`` uses Needleman-
Wunsch while ``local*`` uses Smith-Waterman), and ``*protein`` and
``*nucleotide`` differ in their default scoring of matches, mismatches, and
gaps.

Here we locally align a pair of protein sequences using gap open penalty
of 11 and a gap extend penalty of 1 (in other words, it is much more
costly to open a new gap than extend an existing one).

>>> from skbio.alignment import local_pairwise_align_protein
>>> s1 = "HEAGAWGHEE"
>>> s2 = "PAWHEAE"
>>> r = local_pairwise_align_protein(s1, s2, 11, 1)

This returns an ``skbio.Alignment`` object. We can look at the aligned
sequences:

>>> print(str(r[0]))
AWGHE
>>> print(str(r[1]))
AW-HE

We can identify the start and end positions of each aligned sequence
as follows:

>>> r.start_end_positions()
[(4, 8), (1, 4)]

And we can view the score of the alignment using the ``score`` method:

>>> r.score()
25.0

Similarly, we can perform global alignment of nucleotide sequences, and print
the resulting alignment in FASTA format:

>>> from skbio.alignment import global_pairwise_align_nucleotide
>>> s1 = "GCGTGCCTAAGGTATGCAAG"
>>> s2 = "ACGTGCCTAGGTACGCAAG"
>>> r = global_pairwise_align_nucleotide(s1, s2)
>>> print(r)
>0
GCGTGCCTAAGGTATGCAAG
>1
ACGTGCCTA-GGTACGCAAG
<BLANKLINE>

"""

# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------

from __future__ import absolute_import, division, print_function

from skbio.util import TestRunner

from ._tabular_msa import TabularMSA
from ._alignment import Alignment, SequenceCollection
from ._pairwise import (
    local_pairwise_align_nucleotide, local_pairwise_align_protein,
    local_pairwise_align, global_pairwise_align_nucleotide,
    global_pairwise_align_protein, global_pairwise_align,
    make_identity_substitution_matrix, local_pairwise_align_ssw
)
from skbio.alignment._ssw_wrapper import (
    StripedSmithWaterman, AlignmentStructure)
from ._exception import (SequenceCollectionError, AlignmentError)

__all__ = ['TabularMSA', 'Alignment', 'SequenceCollection',
           'StripedSmithWaterman', 'AlignmentStructure',
           'local_pairwise_align_ssw', 'SequenceCollectionError',
           'AlignmentError', 'global_pairwise_align',
           'global_pairwise_align_nucleotide', 'global_pairwise_align_protein',
           'local_pairwise_align', 'local_pairwise_align_nucleotide',
           'local_pairwise_align_protein', 'make_identity_substitution_matrix']

test = TestRunner(__file__).test


text:
EChart-Swift
============

A Swift version of EChart: https://github.com/zhuhuihuihui/EChart


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.diamondq.common</groupId>
    <artifactId>common-parent</artifactId>
    <version>${revision}${sha1}${changelist}</version>
    <relativePath>../../common-parent</relativePath>
  </parent>
  <artifactId>common-storage.hibernate.ogm</artifactId>
  <packaging>jar</packaging>
  <name>DiamondQ Common: Storage: Hibernate OGM</name>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.hibernate.ogm</groupId>
        <artifactId>hibernate-ogm-bom</artifactId>
        <version>5.1.0.Final</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.hibernate.ogm</groupId>
      <artifactId>hibernate-ogm-infinispan</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.transaction</groupId>
      <artifactId>jboss-transaction-api_1.2_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.1-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.diamondq.common.config</groupId>
      <artifactId>config-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>jakarta.enterprise</groupId>
      <artifactId>jakarta.enterprise.cdi-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.immutables</groupId>
      <artifactId>value</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
  </dependencies>
</project>


text:
namespace blink {

class FrameView;
class LayoutObject;
struct PrePaintTreeWalkContext;

// This class walks the whole layout tree, beginning from the root FrameView,
// across frame boundaries. Helper classes are called for each tree node to
// perform actual actions.  It expects to be invoked in InPrePaint phase.
class PrePaintTreeWalk {
 public:
  void walk(FrameView& rootFrame);

 private:
  // Throttled rendering (see: FrameView::shouldThrottleRendering()) can prevent
  // updating a subtree. We return true if the subtree was fully walked/updated,
  // and false if the walk was interrupted by throttling.
  bool walk(FrameView&, const PrePaintTreeWalkContext&);
  bool walk(const LayoutObject&, const PrePaintTreeWalkContext&);

  PaintPropertyTreeBuilder m_propertyTreeBuilder;
  PaintInvalidator m_paintInvalidator;
};

}  // namespace blink

#endif  // PrePaintTreeWalk_h


text:
Team membership:  BT (Captain) & SC (First Mate) & GY (Second Mate)
Team conventions: Allman notation, markdown for changelog
Changelog format: [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)

## *Version 1.3*  - GY (Second Mate)

## New Components

Added images model and cell view

## Updated Components

Updated Gallery and Welcome controllers to utilize database to grab images
Updated Gallery and Welcome views to display images using CodeIgniter's Table library
Removed text from Template view that is intended for Welcome page only
Added text to Welcome view that is intended for Welcome page only

## *Version 1.2*  - BT (Captain)

## New Components

Added base template

## Updated Components

Removed common header, footer, and includes
Modified files to use the new template

## *Version 1.1*  - SC (First Mate)

## New Components

Added Views and Controllers

## *Version 1.0*

Release Date: Sept 21, 2017

## New Components

-   Changelog

## Updated Components


text:
/*
 * 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.github.ipaas.ifw.jdbc.impl;

import com.github.ipaas.ifw.jdbc.DbAccessRequest;

/**
 * 直接数据库访问的请求
 *
 * @author Chenql
 */
public final class FwDbAccessRequest implements DbAccessRequest {

	private String id = "";

	/**
	 * hash
	 */
	private long hash = 0;

	/**
	 * request timeout, 单位: 毫秒
	 */
	private long timeout = 60000; // default 60s;

	/**
	 * SQL语句
	 */
	private String sql = null;

	public String getId() {
		return this.id;
	}

	public void setId(String reqId) {
		this.id = reqId;
	}

	public long getIdentityHashCode() {
		return this.hash;
	}

	public long getRequestTimeout() {
		return timeout;
	}

	public String getSql() {
		return sql;
	}

	public void setIdentityHashCode(long hashCode) {
		this.hash = hashCode;
	}

	public void setRequestTimeout(long timeout) {
		this.timeout = timeout;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}

	@Override
	public String toString() {

		StringBuilder sb = new StringBuilder(256);
		sb.append("\nFwDirectDbAccessRequest{\n");
		sb.append(" id:").append(id).append(",\n");
		sb.append(" hash:").append(hash).append(",\n");
		sb.append(" sql:").append(sql).append(",\n");
		sb.append(" timeout:").append(timeout).append("ms}");
		return sb.toString();
	}
}


text:
package gl

// #include "gl.h"
import "C"

// Object

type Object C.GLuint

func (object Object) IsBuffer() bool { return C.glIsBuffer(C.GLuint(object)) != 0 }

func (object Object) IsProgram() bool { return C.glIsProgram(C.GLuint(object)) != 0 }

func (object Object) IsQuery() bool { return C.glIsQuery(C.GLuint(object)) != 0 }

func (object Object) IsShader() bool { return C.glIsShader(C.GLuint(object)) != 0 }

func (object Object) IsTexture() bool { return C.glIsTexture(C.GLuint(object)) != 0 }

func (object Object) IsTransformFeedback() bool { return C.glIsTransformFeedback(C.GLuint(object)) != 0 }

func (object Object) IsVertexArray() bool { return C.glIsVertexArray(C.GLuint(object)) != 0 }


text:
// oda :: objective data access

#pragma once

#include <unittest/test_suite.hpp>
#include <unittest/test_case.hpp>

namespace unittest
{
    class test_decimal : public test_suite
    {
    public:
        test_decimal();

        void test_create();
    };
}


text:
require 'abstract_unit'
require 'active_support/time'

class TimeZoneTest < Test::Unit::TestCase
  def test_utc_to_local
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    assert_equal Time.utc(1999, 12, 31, 19), zone.utc_to_local(Time.utc(2000, 1)) # standard offset -0500
    assert_equal Time.utc(2000, 6, 30, 20), zone.utc_to_local(Time.utc(2000, 7)) # dst offset -0400
  end

  def test_local_to_utc
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    assert_equal Time.utc(2000, 1, 1, 5), zone.local_to_utc(Time.utc(2000, 1)) # standard offset -0500
    assert_equal Time.utc(2000, 7, 1, 4), zone.local_to_utc(Time.utc(2000, 7)) # dst offset -0400
  end

  def test_period_for_local
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    assert_instance_of TZInfo::TimezonePeriod, zone.period_for_local(Time.utc(2000))
  end

  ActiveSupport::TimeZone::MAPPING.keys.each do |name|
    define_method("test_map_#{name.downcase.gsub(/[^a-z]/, '_')}_to_tzinfo") do
      zone = ActiveSupport::TimeZone[name]
      assert zone.tzinfo.respond_to?(:period_for_local)
    end
  end

  def test_from_integer_to_map
    assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone[-28800] # PST
  end

  def test_from_duration_to_map
    assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone[-480.minutes] # PST
  end

  ActiveSupport::TimeZone.all.each do |zone|
    name = zone.name.downcase.gsub(/[^a-z]/, '_')
    define_method("test_from_#{name}_to_map") do
      assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone[zone.name]
    end

    define_method("test_utc_offset_for_#{name}") do
      period = zone.tzinfo.current_period
      assert_equal period.utc_offset, zone.utc_offset
    end
  end

  def test_now
    with_env_tz 'US/Eastern' do
      Time.stubs(:now).returns(Time.local(2000))
      zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
      assert_instance_of ActiveSupport::TimeWithZone, zone.now
      assert_equal Time.utc(2000,1,1,5), zone.now.utc
      assert_equal Time.utc(2000), zone.now.time
      assert_equal zone, zone.now.time_zone
    end
  end

  def test_now_enforces_spring_dst_rules
    with_env_tz 'US/Eastern' do
      Time.stubs(:now).returns(Time.local(2006,4,2,2)) # 2AM springs forward to 3AM
      zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
      assert_equal Time.utc(2006,4,2,3), zone.now.time
      assert_equal true, zone.now.dst?
    end
  end

  def test_now_enforces_fall_dst_rules
    with_env_tz 'US/Eastern' do
      Time.stubs(:now).returns(Time.at(1162098000)) # equivalent to 1AM DST
      zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
      assert_equal Time.utc(2006,10,29,1), zone.now.time
      assert_equal true, zone.now.dst?
    end
  end

  def test_today
    Time.stubs(:now).returns(Time.utc(2000, 1, 1, 4, 59, 59)) # 1 sec before midnight Jan 1 EST
    assert_equal Date.new(1999, 12, 31), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today
    Time.stubs(:now).returns(Time.utc(2000, 1, 1, 5)) # midnight Jan 1 EST
    assert_equal Date.new(2000, 1, 1), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today
    Time.stubs(:now).returns(Time.utc(2000, 1, 2, 4, 59, 59)) # 1 sec before midnight Jan 2 EST
    assert_equal Date.new(2000, 1, 1), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today
    Time.stubs(:now).returns(Time.utc(2000, 1, 2, 5)) # midnight Jan 2 EST
    assert_equal Date.new(2000, 1, 2), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today
  end

  def test_local
    time = ActiveSupport::TimeZone["Hawaii"].local(2007, 2, 5, 15, 30, 45)
    assert_equal Time.utc(2007, 2, 5, 15, 30, 45), time.time
    assert_equal ActiveSupport::TimeZone["Hawaii"], time.time_zone
  end

  def test_local_with_old_date
    time = ActiveSupport::TimeZone["Hawaii"].local(1850, 2, 5, 15, 30, 45)
    assert_equal [45,30,15,5,2,1850], time.to_a[0,6]
    assert_equal ActiveSupport::TimeZone["Hawaii"], time.time_zone
  end

  def test_local_enforces_spring_dst_rules
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    twz = zone.local(2006,4,2,1,59,59) # 1 second before DST start
    assert_equal Time.utc(2006,4,2,1,59,59), twz.time
    assert_equal Time.utc(2006,4,2,6,59,59), twz.utc
    assert_equal false, twz.dst?
    assert_equal 'EST', twz.zone
    twz2 = zone.local(2006,4,2,2) # 2AM does not exist because at 2AM, time springs forward to 3AM
    assert_equal Time.utc(2006,4,2,3), twz2.time # twz is created for 3AM
    assert_equal Time.utc(2006,4,2,7), twz2.utc
    assert_equal true, twz2.dst?
    assert_equal 'EDT', twz2.zone
    twz3 = zone.local(2006,4,2,2,30) # 2:30AM does not exist because at 2AM, time springs forward to 3AM
    assert_equal Time.utc(2006,4,2,3,30), twz3.time # twz is created for 3:30AM
    assert_equal Time.utc(2006,4,2,7,30), twz3.utc
    assert_equal true, twz3.dst?
    assert_equal 'EDT', twz3.zone
  end

  def test_local_enforces_fall_dst_rules
    # 1AM during fall DST transition is ambiguous, it could be either DST or non-DST 1AM
    # Mirroring Time.local behavior, this method selects the DST time
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    twz = zone.local(2006,10,29,1)
    assert_equal Time.utc(2006,10,29,1), twz.time
    assert_equal Time.utc(2006,10,29,5), twz.utc
    assert_equal true, twz.dst?
    assert_equal 'EDT', twz.zone
  end

  def test_at
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    secs = 946684800.0
    twz = zone.at(secs)
    assert_equal Time.utc(1999,12,31,19), twz.time
    assert_equal Time.utc(2000), twz.utc
    assert_equal zone, twz.time_zone
    assert_equal secs, twz.to_f
  end

  def test_at_with_old_date
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    secs = DateTime.civil(1850).to_f
    twz = zone.at(secs)
    assert_equal [1850, 1, 1, 0], [twz.utc.year, twz.utc.mon, twz.utc.day, twz.utc.hour]
    assert_equal zone, twz.time_zone
    assert_equal secs, twz.to_f
  end

  def test_parse
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    twz = zone.parse('1999-12-31 19:00:00')
    assert_equal Time.utc(1999,12,31,19), twz.time
    assert_equal Time.utc(2000), twz.utc
    assert_equal zone, twz.time_zone
  end

  def test_parse_string_with_timezone
    (-11..13).each do |timezone_offset|
      zone = ActiveSupport::TimeZone[timezone_offset]
      twz = zone.parse('1999-12-31 19:00:00')
      assert_equal twz, zone.parse(twz.to_s)
    end
  end

  def test_parse_with_old_date
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    twz = zone.parse('1850-12-31 19:00:00')
    assert_equal [0,0,19,31,12,1850], twz.to_a[0,6]
    assert_equal zone, twz.time_zone
  end

  def test_parse_far_future_date_with_time_zone_offset_in_string
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    twz = zone.parse('2050-12-31 19:00:00 -10:00') # i.e., 2050-01-01 05:00:00 UTC
    assert_equal [0,0,0,1,1,2051], twz.to_a[0,6]
    assert_equal zone, twz.time_zone
  end

  def test_parse_returns_nil_when_string_without_date_information_is_passed_in
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    assert_nil zone.parse('foobar')
    assert_nil zone.parse('   ')
  end

  def test_parse_with_incomplete_date
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    zone.stubs(:now).returns zone.local(1999,12,31)
    twz = zone.parse('19:00:00')
    assert_equal Time.utc(1999,12,31,19), twz.time
  end

  def test_utc_offset_lazy_loaded_from_tzinfo_when_not_passed_in_to_initialize
    tzinfo = TZInfo::Timezone.get('America/New_York')
    zone = ActiveSupport::TimeZone.create(tzinfo.name, nil, tzinfo)
    assert_equal nil, zone.instance_variable_get('@utc_offset')
    assert_equal(-18_000, zone.utc_offset)
  end

  def test_seconds_to_utc_offset_with_colon
    assert_equal "-06:00", ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600)
    assert_equal "+00:00", ActiveSupport::TimeZone.seconds_to_utc_offset(0)
    assert_equal "+05:00", ActiveSupport::TimeZone.seconds_to_utc_offset(18_000)
  end

  def test_seconds_to_utc_offset_without_colon
    assert_equal "-0600", ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600, false)
    assert_equal "+0000", ActiveSupport::TimeZone.seconds_to_utc_offset(0, false)
    assert_equal "+0500", ActiveSupport::TimeZone.seconds_to_utc_offset(18_000, false)
  end

  def test_formatted_offset_positive
    zone = ActiveSupport::TimeZone['Moscow']
    assert_equal "+03:00", zone.formatted_offset
    assert_equal "+0300", zone.formatted_offset(false)
  end

  def test_formatted_offset_negative
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    assert_equal "-05:00", zone.formatted_offset
    assert_equal "-0500", zone.formatted_offset(false)
  end

  def test_formatted_offset_zero
    zone = ActiveSupport::TimeZone['London']
    assert_equal "+00:00", zone.formatted_offset
    assert_equal "UTC", zone.formatted_offset(true, 'UTC')
  end

  def test_zone_compare
    zone1 = ActiveSupport::TimeZone['Central Time (US & Canada)'] # offset -0600
    zone2 = ActiveSupport::TimeZone['Eastern Time (US & Canada)'] # offset -0500
    assert zone1 < zone2
    assert zone2 > zone1
    assert zone1 == zone1
  end

  def test_zone_match
    zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
    assert zone =~ /Eastern/
    assert zone =~ /New_York/
    assert zone !~ /Nonexistent_Place/
  end

  def test_to_s
    assert_equal "(GMT+03:00) Moscow", ActiveSupport::TimeZone['Moscow'].to_s
  end

  def test_all_sorted
    all = ActiveSupport::TimeZone.all
    1.upto( all.length-1 ) do |i|
      assert all[i-1] < all[i]
    end
  end

  def test_index
    assert_nil ActiveSupport::TimeZone["bogus"]
    assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone["Central Time (US & Canada)"]
    assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone[8]
    assert_raise(ArgumentError) { ActiveSupport::TimeZone[false] }
  end

  def test_new
    assert_equal ActiveSupport::TimeZone["Central Time (US & Canada)"], ActiveSupport::TimeZone.new("Central Time (US & Canada)")
  end

  def test_us_zones
    assert ActiveSupport::TimeZone.us_zones.include?(ActiveSupport::TimeZone["Hawaii"])
    assert !ActiveSupport::TimeZone.us_zones.include?(ActiveSupport::TimeZone["Kuala Lumpur"])
  end

  protected
    def with_env_tz(new_tz = 'US/Eastern')
      old_tz, ENV['TZ'] = ENV['TZ'], new_tz
      yield
    ensure
      old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ')
    end
end


text:
<?php

namespace Symfony\Component\RateLimiter\Policy;

use Symfony\Component\Lock\LockInterface;
use Symfony\Component\RateLimiter\Storage\StorageInterface;

trait ResetLimiterTrait
{
    private LockInterface $lock;
    private StorageInterface $storage;
    private string $id;

    /**
     * {@inheritdoc}
     */
    public function reset(): void
    {
        try {
            $this->lock->acquire(true);

            $this->storage->delete($this->id);
        } finally {
            $this->lock->release();
        }
    }
}


text:
{% extends "base.html" %}
{% load tz %}
{% load flatblock_tags %}

{%  block extra_head_js %}

{%  endblock extra_head_js %}
{% block content %}

{% if request.user == article.site_owner %}
 Edit
{% endif %}

{{ article.title }}

{{ article.authors_text }}

{% for contributor in article.contributors.all %}
  {% if contributor.public_name %}
    {{ contributor.firstname }} {{ contributor.lastname }}
    {% if not forloop.last %}, {% endif %}
  {% endif %}
{% endfor %}

{{ article.description_header }}

{{ article.code_data_abstract }}

{% if article.code_archive_file %}
  <button class="btn btn-default" data-toggle="modal" data-target="#citecode">
   code
  </button>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Download Code

                {%  flatblock "cite_reminder" %}
                {% include "compendia/citation.html" %}

                 code

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

{% endif %}

 {% if article.data_archive_file %}
  <button class="btn btn-default" data-toggle="modal" data-target="#citedata">
   data
  </button>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Download Data

                {%  flatblock "cite_reminder" %}
                {% include "compendia/citation.html" %}

                 data

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

{% endif %}

{% if article.lecture_notes_archive_file %}
 Lectures
{% endif %}
{% if article.homework_archive_file %}
 Assignments
{% endif %}

{% if 'can_change_compendium' in perms %}
{% if article.solution_archive_file %}
 Solutions
{% endif %}
{% endif %}

{% if article.article_file %}
 Article
{% endif %}
{% if article.book_file %}
 Book
{% endif %}
{% if article.image_archive_file %}
 Images
{% endif %}

{% if article.verification_archive_file %}
<button type="button" id="compendia_verification" onclick="verification(event);" data-loading-text="Verifying..."
    class="btn btn-default"> Verify</button>

{% endif %}

{% if article.paper_abstract %}

Paper Abstract

{{ article.paper_abstract }}

{% endif %}

{% include "compendia/citation.html" %}

{% if article.compendium_type %}
Compendium Type: {{ article.get_compendium_type_display }}

{% endif %}
{% if article.primary_research_field %}
Primary Research Field: {{ article.get_primary_research_field_display }}

{% endif %}
{% if article.secondary_research_field %}
Secondary Research Field: {{ article.get_secondary_research_field_display }}

{% endif %}
{% if article.content_license %}
Content License: {{ article.get_content_license_display }}

{% endif %}
{% if article.code_license %}
Code License: {{ article.get_code_license_display }}

{% endif %}

{% if article.admin_notes %}

Administrator Notes

{{ article.admin_notes }}

{% endif %}

{% include "compendia/verification.html" %}

Page Owner

{{ article.site_owner }}
{% localtime on %}

created {{ article.created|date:"SHORT_DATE_FORMAT" }}

modified {{ article.modified|date:"SHORT_DATE_FORMAT" }}

{% endlocaltime %}

{% load disqus_tags %}
{% disqus_show_comments %}

{% if article.legacy_id %}
rmc id
{% endif %}

{% endblock content %}

{% block extrajs %}

{% endblock extrajs %}