text:
  if (mProcessingSettings.trackletConstructorInPipeline < 0) {                         \
    mProcessingSettings.trackletConstructorInPipeline = GPUCA_CONSTRUCTOR_IN_PIPELINE; \
  }                                                                                \
  if (mProcessingSettings.trackletSelectorInPipeline < 0) {                            \
    mProcessingSettings.trackletSelectorInPipeline = GPUCA_SELECTOR_IN_PIPELINE;       \
  }                                                                                \
  if (mProcessingSettings.trackletSelectorSlices < 0) {                                \
    mProcessingSettings.trackletSelectorSlices = GPUCA_TRACKLET_SELECTOR_SLICE_COUNT;  \
  }                                                                                \
  if (mProcessingSettings.alternateBorderSort < 0) {                                   \
    mProcessingSettings.alternateBorderSort = GPUCA_ALTERNATE_BORDER_SORT;             \
  }                                                                                \
  if (mProcessingSettings.mergerSortTracks < 0) {                                      \
    mProcessingSettings.mergerSortTracks = GPUCA_SORT_BEFORE_FIT;                      \
  }                                                                                \
  if (param().rec.loopInterpolationInExtraPass < 0) {                                  \
    param().rec.loopInterpolationInExtraPass = GPUCA_MERGER_SPLIT_LOOP_INTERPOLATION;  \
  }                                                                                \
  if (mProcessingSettings.tpcCompressionGatherModeKernel < 0) {                        \
    mProcessingSettings.tpcCompressionGatherModeKernel = GPUCA_COMP_GATHER_KERNEL;     \
  }                                                                                \
  if (mProcessingSettings.tpcCompressionGatherMode < 0) {                              \
    mProcessingSettings.tpcCompressionGatherMode = GPUCA_COMP_GATHER_MODE;             \
  }

#endif

redpajama_set_name: RedPajamaGithub


text:
import pytest

# noinspection PyUnresolvedReferences
from pytestqt.qt_compat import qt_api

fails_on_pyqt = pytest.mark.xfail(
    qt_api.pytest_qt_api == "pyqt5", reason="fails on PyQt"
)

keysequence = pytest.mark.skipif(
    not hasattr(qt_api.QtTest.QTest, "keySequence"), reason="needs Qt >= 5.10"
)

@pytest.mark.parametrize(
    "expected_method",
    [
        "keyPress",
        "keyClick",
        "keyClicks",
        "keyEvent",
        "keyPress",
        "keyRelease",
        pytest.param("keyToAscii", marks=fails_on_pyqt),
        pytest.param("keySequence", marks=keysequence),
        "mouseClick",
        "mouseDClick",
        "mouseMove",
        "mousePress",
        "mouseRelease",
    ],
)
def test_expected_qtest_proxies(qtbot, expected_method):
    """
    Ensure that we are exporting expected QTest API methods.
    """
    assert hasattr(qtbot, expected_method)
    assert getattr(qtbot, expected_method).__name__ == expected_method


text:
HolidayBundle
=============


text:
package org.gradle.model.dsl.internal.transform;

import com.google.common.collect.Lists;
import org.codehaus.groovy.ast.AnnotationNode;
import org.codehaus.groovy.ast.ClassHelper;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.ast.expr.*;
import org.codehaus.groovy.ast.stmt.BlockStatement;
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.codehaus.groovy.control.SourceUnit;
import org.gradle.api.Nullable;
import org.gradle.groovy.scripts.internal.AstUtils;
import org.gradle.groovy.scripts.internal.RestrictiveCodeVisitor;
import org.gradle.groovy.scripts.internal.ScriptSourceDescriptionTransformer;
import org.gradle.model.internal.core.ModelPath;

import java.util.List;

public class RulesVisitor extends RestrictiveCodeVisitor {

    private static final String AST_NODE_METADATA_KEY = RulesVisitor.class.getName();
    private static final ClassNode ANNOTATION_CLASS_NODE = new ClassNode(RulesBlock.class);

    // TODO - have to do much better here
    public static final String INVALID_STATEMENT = "illegal rule";
    public static final String ARGUMENT_HAS_TO_BE_CLOSURE_LITERAL_MESSAGE = "Rules can only be specified using a closure literal";

    private final SourceUnit sourceUnit;
    private final RuleVisitor ruleVisitor;

    public RulesVisitor(SourceUnit sourceUnit, RuleVisitor ruleVisitor) {
        super(sourceUnit, INVALID_STATEMENT);
        this.sourceUnit = sourceUnit;
        this.ruleVisitor = ruleVisitor;
    }

    public static void visitGeneratedClosure(ClassNode node) {
        MethodNode method = AstUtils.getGeneratedClosureImplMethod(node);
        Boolean isRulesBlock = method.getCode().getNodeMetaData(AST_NODE_METADATA_KEY);
        if (isRulesBlock != null) {
            AnnotationNode markerAnnotation = new AnnotationNode(ANNOTATION_CLASS_NODE);
            node.addAnnotation(markerAnnotation);
        }
    }

    @Override
    public void visitBlockStatement(BlockStatement block) {
        block.setNodeMetaData(AST_NODE_METADATA_KEY, true);

        for (Statement statement : block.getStatements()) {
            statement.visit(this);
        }
    }

    @Override
    public void visitExpressionStatement(ExpressionStatement statement) {
        statement.getExpression().visit(this);
    }

    @Override
    public void visitMethodCallExpression(MethodCallExpression call) {
        ClosureExpression closureExpression = AstUtils.getSingleClosureArg(call);
        if (closureExpression == null) {
            restrict(call, ARGUMENT_HAS_TO_BE_CLOSURE_LITERAL_MESSAGE);
            return;
        }

        String modelPath = extractModelPathFromMethodTarget(call);
        if (modelPath == null) {
            return;
        }

        // Rewrite the method call to match ModelDsl#configure(String, Closure), which is what the delegate will be
        ConstantExpression modelPathArgument = new ConstantExpression(modelPath);
        ArgumentListExpression replacedArgumentList = new ArgumentListExpression(modelPathArgument, closureExpression);
        call.setMethod(new ConstantExpression("configure"));
        call.setArguments(replacedArgumentList);

        // Call directly on the delegate to avoid some dynamic dispatch
        call.setImplicitThis(true);
        call.setObjectExpression(new MethodCallExpression(VariableExpression.THIS_EXPRESSION, "getDelegate", ArgumentListExpression.EMPTY_ARGUMENTS));

        SourceLocation sourceLocation = new SourceLocation(getScriptSourceDescription(), call.getLineNumber(), call.getColumnNumber());
        closureExpression.getCode().setNodeMetaData(RuleVisitor.AST_NODE_METADATA_LOCATION_KEY, sourceLocation);

        closureExpression.visit(ruleVisitor);
    }

    private String getScriptSourceDescription() {
        return sourceUnit.getAST().getNodeMetaData(ScriptSourceDescriptionTransformer.AST_NODE_METADATA_KEY);
    }

    @Nullable // if the target was invalid
    private String extractModelPathFromMethodTarget(MethodCallExpression call) {
        Expression target = call.getMethod();
        List<String> names = Lists.newLinkedList();
        while (true) {
            if (target instanceof ConstantExpression) {
                if (target.getType().equals(ClassHelper.STRING_TYPE)) {
                    String name = target.getText();
                    names.add(0, name);
                    if (call.isImplicitThis()) {
                        break;
                    } else {
                        target = call.getObjectExpression();
                        continue;
                    }
                }
            } else if (target instanceof PropertyExpression) {
                PropertyExpression propertyExpression = (PropertyExpression) target;
                Expression property = propertyExpression.getProperty();
                if (property instanceof ConstantExpression) {
                    ConstantExpression constantProperty = (ConstantExpression) property;
                    if (constantProperty.getType().equals(ClassHelper.STRING_TYPE)) {
                        String name = constantProperty.getText();
                        names.add(0, name);
                        target = propertyExpression.getObjectExpression();
                        continue;
                    }
                }
            } else if (target instanceof VariableExpression) {
                // This will be the left most property
                names.add(0, ((VariableExpression) target).getName());
                break;
            }

            // Invalid paths fall through to here

            restrict(call);
            return null;
        }

        // TODO - validate that it's a valid model path
        return ModelPath.pathString(names);
    }
}


text:
.class final Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Landroid/view/View$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;->ˎ(Lo/ᔿ;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field private synthetic ˊ:Lo/ᔿ;

.field private synthetic ˋ:Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;

# direct methods
.method constructor <init>(Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;Lo/ᔿ;)V
    .locals 0

    .line 173
    iput-object p1, p0, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;->ˋ:Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;

    iput-object p2, p0, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;->ˊ:Lo/ᔿ;

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

    return-void
.end method

# virtual methods
.method public final onClick(Landroid/view/View;)V
    .locals 4

    .line 177
    sget-object v0, Lo/Ꮮ;->ˏ:Lo/Ꮮ;

    invoke-static {v0}, Lo/ᒥ;->ˊ(Lo/Ꮮ;)V

    .line 178
    iget-object p1, p0, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;->ˊ:Lo/ᔿ;

    goto :goto_0

    :catchall_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;

    move-result-object v0

    throw v0

    :goto_0
    :try_start_0
    const-string v0, "o.\u0295"

    invoke-static {v0}, Lo/Ꮀ$Ɩ;->ィ(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    const-string v1, "\u02ca"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v0

    const/4 v1, 0x0

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    new-instance v2, Lo/ⅹ;

    iget-object v0, p1, Lo/ᔿ;->ˈ:Ljava/lang/String;

    invoke-direct {v2, v0}, Lo/ⅹ;-><init>(Ljava/lang/String;)V

    const-string v0, "o.\u0295"

    invoke-static {v0}, Lo/Ꮀ$Ɩ;->ィ(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    const-string v3, "\u02bd"

    invoke-virtual {v0, v3}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v0

    invoke-virtual {v0, v1, v2}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V

    .line 179
    new-instance p1, Landroid/content/Intent;

    iget-object v0, p0, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;->ˋ:Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;

    invoke-static {v0}, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;->'(Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;)Landroid/content/Context;

    move-result-object v0

    const-class v1, Lcom/quizup/core/activities/ChatActivity;

    invoke-direct {p1, v0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 180
    iget-object v0, p0, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;->ˋ:Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;

    invoke-static {v0}, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;->ʽ(Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, p1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 181
    iget-object v0, p0, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge$4;->ˋ:Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;

    invoke-static {v0}, Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;->ͺ(Lcom/quizup/core/widgets/topicButton/challenge/TopicDrawerChallenge;)Landroid/content/Context;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    const v1, 0x7f040005

    const v2, 0x7f040007

    invoke-virtual {v0, v1, v2}, Landroid/app/Activity;->overridePendingTransition(II)V

    .line 182
    return-void
.end method


text:
<!DOCTYPE HTML>

    <title>JavaScript back and Forth</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=792, user-scalable=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <link rel="stylesheet" href="css/screen.css">

JavaScript back and Forth

Aliaksei Chapyzhenka

JavaScript back and Forth

Aliaksei Chapyzhenka drom.io/fday15

            We turn out water into wine

            It's something we do all the time

            It doesn't cost a single dime

            And it's beautiful...

Crash Test Dummies

Forth is everywhere

Forth runs everywhere

from micro-controllers to rockets

"everywhere" is changing over time

JavaScript is everywhere

Can we translate Forth <--> JavaScript?

JavaScipt is new "everywhere"

PC client (browser)

server, cloud (node.js)

mobile phone, tablet, Apps

Embedded. IoT, etc.

Dev boards: tessel.io, espruino.com

Runtimes: kinomajs, iot.js, v7

Some JavaScript facts

Dynamic, do all at runtime

Untyped, everything is var

Interpreted, no explicit compile stage, binary or bytecode

Multi-pardigm, imperative, OO, functional

Async programming with callbacks

Streams, UNIX concept. (stdin/stdout)

originally developed in 10 days in May 1995

JavaScript AST

JavaScript code can be represented in form of Abstract Syntax Tree (AST)

Parser, code generator, traversal utilites, will use it.

            Mozilla-AST and
            Shift-AST
            , are the most popular AST formats

AST can be represented in JSON format

AST used in all following experiments

JavaScript arithmetic

Main numeric value format is float64, tricks to do i32, u32, f32.

x | 0 --> i32

x >>> 0 --> u32

+x --> f64

Math.fround(x) --> f32

            TypedArrays
            can be used to store signed / unsigned {8, 16, 32}, f32, f64

            asm.js and
            WebAssembly
            new ways to be closer to CPU.

case 1: Forth interpreter in JavaScript

Standard Forth interpreter in JavaScript

JavaScript as an Assembler

Forth as a stream, non-blocking IO

embed Forth inside web page or server

Working torwards ANS94 and Forth2012 compliance.

        Repo and
        Demo

Forth in JS -- challenges

Organize vocabulary with JS structures, array, object.

Forth control structures are complex, JS has no branches, has to use break

CREATE DOES> magic

Double and mixed integer arithmetic. i64, u64

case 2: JavaScript to Forth

Proof of concept prototype

Needs serious CFG and SSA pipeline

Migrating to the Sea of Nodes tools

May switch to WebAssembly:
            wast-parser,
            wast-pipeline

Demo

case 3: CodeMirror

CodeMirror is a versatile text editor implemented in JavaScript for the browser

Supports 100+ languages including Forth

Runs lightweight Forth interpreter to do proper coloring

Conclusions

Yes, one can mix JavaScript and Forth

Allows full web-based Forth IDE

A stepping stone in my Stack Processor reserach (Quark).

All free and Open Source


text:
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2011 Benoit Jacob <jacob.benoit.1@gmail.com>
// Copyright (C) 2011-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2011-2012 Jitse Niesen <jitse@maths.leeds.ac.uk>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_ASSIGN_EVALUATOR_H
#define EIGEN_ASSIGN_EVALUATOR_H

namespace Eigen {

// This implementation is based on Assign.h

namespace internal {

/***************************************************************************
* Part 1 : the logic deciding a strategy for traversal and unrolling       *
***************************************************************************/

// copy_using_evaluator_traits is based on assign_traits

template <typename DstEvaluator, typename SrcEvaluator, typename AssignFunc>
struct copy_using_evaluator_traits
{
  typedef typename DstEvaluator::XprType Dst;

  enum {
    DstFlags = DstEvaluator::Flags,
    SrcFlags = SrcEvaluator::Flags
  };

public:
  enum {
    DstIsAligned = DstFlags & AlignedBit,
    DstHasDirectAccess = DstFlags & DirectAccessBit,
    SrcIsAligned = SrcFlags & AlignedBit,
    JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned
  };

private:
  enum {
    InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime)
              : int(DstFlags)&RowMajorBit ? int(Dst::ColsAtCompileTime)
              : int(Dst::RowsAtCompileTime),
    InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime)
              : int(DstFlags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime)
              : int(Dst::MaxRowsAtCompileTime),
    MaxSizeAtCompileTime = Dst::SizeAtCompileTime,
    PacketSize = packet_traits<typename Dst::Scalar>::size
  };

  enum {
    DstIsRowMajor = DstFlags&RowMajorBit,
    SrcIsRowMajor = SrcFlags&RowMajorBit,
    StorageOrdersAgree = (int(DstIsRowMajor) == int(SrcIsRowMajor)),
    MightVectorize = StorageOrdersAgree
                  && (int(DstFlags) & int(SrcFlags) & ActualPacketAccessBit)
                  && (functor_traits<AssignFunc>::PacketAccess),
    MayInnerVectorize  = MightVectorize && int(InnerSize)!=Dynamic && int(InnerSize)%int(PacketSize)==0
                       && int(DstIsAligned) && int(SrcIsAligned),
    MayLinearize = StorageOrdersAgree && (int(DstFlags) & int(SrcFlags) & LinearAccessBit),
    MayLinearVectorize = MightVectorize && MayLinearize && DstHasDirectAccess
                       && (DstIsAligned || MaxSizeAtCompileTime == Dynamic),
      /* If the destination isn't aligned, we have to do runtime checks and we don't unroll,
         so it's only good for large enough sizes. */
    MaySliceVectorize  = MightVectorize && DstHasDirectAccess
                       && (int(InnerMaxSize)==Dynamic || int(InnerMaxSize)>=3*PacketSize)
      /* slice vectorization can be slow, so we only want it if the slices are big, which is
         indicated by InnerMaxSize rather than InnerSize, think of the case of a dynamic block
         in a fixed-size matrix */
  };

public:
  enum {
    Traversal = int(MayInnerVectorize)   ? int(InnerVectorizedTraversal)
              : int(MayLinearVectorize)  ? int(LinearVectorizedTraversal)
              : int(MaySliceVectorize)   ? int(SliceVectorizedTraversal)
              : int(MayLinearize)        ? int(LinearTraversal)
                                         : int(DefaultTraversal),
    Vectorized = int(Traversal) == InnerVectorizedTraversal
              || int(Traversal) == LinearVectorizedTraversal
              || int(Traversal) == SliceVectorizedTraversal
  };

private:
  enum {
    UnrollingLimit      = EIGEN_UNROLLING_LIMIT * (Vectorized ? int(PacketSize) : 1),
    MayUnrollCompletely = int(Dst::SizeAtCompileTime) != Dynamic
                       && int(SrcEvaluator::CoeffReadCost) != Dynamic
                       && int(Dst::SizeAtCompileTime) * int(SrcEvaluator::CoeffReadCost) <= int(UnrollingLimit),
    MayUnrollInner      = int(InnerSize) != Dynamic
                       && int(SrcEvaluator::CoeffReadCost) != Dynamic
                       && int(InnerSize) * int(SrcEvaluator::CoeffReadCost) <= int(UnrollingLimit)
  };

public:
  enum {
    Unrolling = (int(Traversal) == int(InnerVectorizedTraversal) || int(Traversal) == int(DefaultTraversal))
                ? (
                    int(MayUnrollCompletely) ? int(CompleteUnrolling)
                  : int(MayUnrollInner)      ? int(InnerUnrolling)
                                             : int(NoUnrolling)
                  )
              : int(Traversal) == int(LinearVectorizedTraversal)
                ? ( bool(MayUnrollCompletely) && bool(DstIsAligned) ? int(CompleteUnrolling)
                                                                    : int(NoUnrolling) )
              : int(Traversal) == int(LinearTraversal)
                ? ( bool(MayUnrollCompletely) ? int(CompleteUnrolling)
                                              : int(NoUnrolling) )
              : int(NoUnrolling)
  };

#ifdef EIGEN_DEBUG_ASSIGN
  static void debug()
  {
    std::cerr << "DstXpr: " << typeid(typename DstEvaluator::XprType).name() << std::endl;
    std::cerr << "SrcXpr: " << typeid(typename SrcEvaluator::XprType).name() << std::endl;
    std::cerr.setf(std::ios::hex, std::ios::basefield);
    EIGEN_DEBUG_VAR(DstFlags)
    EIGEN_DEBUG_VAR(SrcFlags)
    std::cerr.unsetf(std::ios::hex);
    EIGEN_DEBUG_VAR(DstIsAligned)
    EIGEN_DEBUG_VAR(SrcIsAligned)
    EIGEN_DEBUG_VAR(JointAlignment)
    EIGEN_DEBUG_VAR(InnerSize)
    EIGEN_DEBUG_VAR(InnerMaxSize)
    EIGEN_DEBUG_VAR(PacketSize)
    EIGEN_DEBUG_VAR(StorageOrdersAgree)
    EIGEN_DEBUG_VAR(MightVectorize)
    EIGEN_DEBUG_VAR(MayLinearize)
    EIGEN_DEBUG_VAR(MayInnerVectorize)
    EIGEN_DEBUG_VAR(MayLinearVectorize)
    EIGEN_DEBUG_VAR(MaySliceVectorize)
    EIGEN_DEBUG_VAR(Traversal)
    EIGEN_DEBUG_VAR(UnrollingLimit)
    EIGEN_DEBUG_VAR(MayUnrollCompletely)
    EIGEN_DEBUG_VAR(MayUnrollInner)
    EIGEN_DEBUG_VAR(Unrolling)
    std::cerr << std::endl;
  }
#endif
};

/***************************************************************************
* Part 2 : meta-unrollers
***************************************************************************/

/************************
*** Default traversal ***
************************/

template<typename Kernel, int Index, int Stop>
struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling
{
  // FIXME: this is not very clean, perhaps this information should be provided by the kernel?
  typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
  typedef typename DstEvaluatorType::XprType DstXprType;

  enum {
    outer = Index / DstXprType::InnerSizeAtCompileTime,
    inner = Index % DstXprType::InnerSizeAtCompileTime
  };

  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    kernel.assignCoeffByOuterInner(outer, inner);
    copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, Index+1, Stop>::run(kernel);
  }
};

template<typename Kernel, int Stop>
struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, Stop, Stop>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { }
};

template<typename Kernel, int Index_, int Stop>
struct copy_using_evaluator_DefaultTraversal_InnerUnrolling
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer)
  {
    kernel.assignCoeffByOuterInner(outer, Index_);
    copy_using_evaluator_DefaultTraversal_InnerUnrolling<Kernel, Index_+1, Stop>::run(kernel, outer);
  }
};

template<typename Kernel, int Stop>
struct copy_using_evaluator_DefaultTraversal_InnerUnrolling<Kernel, Stop, Stop>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index) { }
};

/***********************
*** Linear traversal ***
***********************/

template<typename Kernel, int Index, int Stop>
struct copy_using_evaluator_LinearTraversal_CompleteUnrolling
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel& kernel)
  {
    kernel.assignCoeff(Index);
    copy_using_evaluator_LinearTraversal_CompleteUnrolling<Kernel, Index+1, Stop>::run(kernel);
  }
};

template<typename Kernel, int Stop>
struct copy_using_evaluator_LinearTraversal_CompleteUnrolling<Kernel, Stop, Stop>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { }
};

/**************************
*** Inner vectorization ***
**************************/

template<typename Kernel, int Index, int Stop>
struct copy_using_evaluator_innervec_CompleteUnrolling
{
  // FIXME: this is not very clean, perhaps this information should be provided by the kernel?
  typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
  typedef typename DstEvaluatorType::XprType DstXprType;

  enum {
    outer = Index / DstXprType::InnerSizeAtCompileTime,
    inner = Index % DstXprType::InnerSizeAtCompileTime,
    JointAlignment = Kernel::AssignmentTraits::JointAlignment
  };

  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    kernel.template assignPacketByOuterInner<Aligned, JointAlignment>(outer, inner);
    enum { NextIndex = Index + packet_traits<typename DstXprType::Scalar>::size };
    copy_using_evaluator_innervec_CompleteUnrolling<Kernel, NextIndex, Stop>::run(kernel);
  }
};

template<typename Kernel, int Stop>
struct copy_using_evaluator_innervec_CompleteUnrolling<Kernel, Stop, Stop>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { }
};

template<typename Kernel, int Index_, int Stop>
struct copy_using_evaluator_innervec_InnerUnrolling
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer)
  {
    kernel.template assignPacketByOuterInner<Aligned, Aligned>(outer, Index_);
    enum { NextIndex = Index_ + packet_traits<typename Kernel::Scalar>::size };
    copy_using_evaluator_innervec_InnerUnrolling<Kernel, NextIndex, Stop>::run(kernel, outer);
  }
};

template<typename Kernel, int Stop>
struct copy_using_evaluator_innervec_InnerUnrolling<Kernel, Stop, Stop>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &, Index) { }
};

/***************************************************************************
* Part 3 : implementation of all cases
***************************************************************************/

// dense_assignment_loop is based on assign_impl

template<typename Kernel,
         int Traversal = Kernel::AssignmentTraits::Traversal,
         int Unrolling = Kernel::AssignmentTraits::Unrolling>
struct dense_assignment_loop;

/************************
*** Default traversal ***
************************/

template<typename Kernel>
struct dense_assignment_loop<Kernel, DefaultTraversal, NoUnrolling>
{
  EIGEN_DEVICE_FUNC static void run(Kernel &kernel)
  {
    for(Index outer = 0; outer < kernel.outerSize(); ++outer) {
      for(Index inner = 0; inner < kernel.innerSize(); ++inner) {
        kernel.assignCoeffByOuterInner(outer, inner);
      }
    }
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, DefaultTraversal, CompleteUnrolling>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
    copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, 0, DstXprType::SizeAtCompileTime>::run(kernel);
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, DefaultTraversal, InnerUnrolling>
{
  typedef typename Kernel::StorageIndex StorageIndex;
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    typedef typename Kernel::DstEvaluatorType::XprType DstXprType;

    const Index outerSize = kernel.outerSize();
    for(Index outer = 0; outer < outerSize; ++outer)
      copy_using_evaluator_DefaultTraversal_InnerUnrolling<Kernel, 0, DstXprType::InnerSizeAtCompileTime>::run(kernel, outer);
  }
};

/***************************
*** Linear vectorization ***
***************************/

// The goal of unaligned_dense_assignment_loop is simply to factorize the handling
// of the non vectorizable beginning and ending parts

template <bool IsAligned = false>
struct unaligned_dense_assignment_loop
{
  // if IsAligned = true, then do nothing
  template <typename Kernel>
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index, Index) {}
};

template <>
struct unaligned_dense_assignment_loop<false>
{
  // MSVC must not inline this functions. If it does, it fails to optimize the
  // packet access path.
  // FIXME check which version exhibits this issue
#if EIGEN_COMP_MSVC
  template <typename Kernel>
  static EIGEN_DONT_INLINE void run(Kernel &kernel,
                                    Index start,
                                    Index end)
#else
  template <typename Kernel>
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel,
                                      Index start,
                                      Index end)
#endif
  {
    for (Index index = start; index < end; ++index)
      kernel.assignCoeff(index);
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, LinearVectorizedTraversal, NoUnrolling>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    const Index size = kernel.size();
    typedef packet_traits<typename Kernel::Scalar> PacketTraits;
    enum {
      packetSize = PacketTraits::size,
      dstIsAligned = int(Kernel::AssignmentTraits::DstIsAligned),
      dstAlignment = PacketTraits::AlignedOnScalar ? Aligned : dstIsAligned,
      srcAlignment = Kernel::AssignmentTraits::JointAlignment
    };
    const Index alignedStart = dstIsAligned ? 0 : internal::first_aligned(&kernel.dstEvaluator().coeffRef(0), size);
    const Index alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize;

    unaligned_dense_assignment_loop<dstIsAligned!=0>::run(kernel, 0, alignedStart);

    for(Index index = alignedStart; index < alignedEnd; index += packetSize)
      kernel.template assignPacket<dstAlignment, srcAlignment>(index);

    unaligned_dense_assignment_loop<>::run(kernel, alignedEnd, size);
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, LinearVectorizedTraversal, CompleteUnrolling>
{
  typedef typename Kernel::StorageIndex StorageIndex;
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    typedef typename Kernel::DstEvaluatorType::XprType DstXprType;

    enum { size = DstXprType::SizeAtCompileTime,
           packetSize = packet_traits<typename Kernel::Scalar>::size,
           alignedSize = (size/packetSize)*packetSize };

    copy_using_evaluator_innervec_CompleteUnrolling<Kernel, 0, alignedSize>::run(kernel);
    copy_using_evaluator_DefaultTraversal_CompleteUnrolling<Kernel, alignedSize, size>::run(kernel);
  }
};

/**************************
*** Inner vectorization ***
**************************/

template<typename Kernel>
struct dense_assignment_loop<Kernel, InnerVectorizedTraversal, NoUnrolling>
{
  EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel)
  {
    const Index innerSize = kernel.innerSize();
    const Index outerSize = kernel.outerSize();
    const Index packetSize = packet_traits<typename Kernel::Scalar>::size;
    for(Index outer = 0; outer < outerSize; ++outer)
      for(Index inner = 0; inner < innerSize; inner+=packetSize)
        kernel.template assignPacketByOuterInner<Aligned, Aligned>(outer, inner);
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, InnerVectorizedTraversal, CompleteUnrolling>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
    copy_using_evaluator_innervec_CompleteUnrolling<Kernel, 0, DstXprType::SizeAtCompileTime>::run(kernel);
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, InnerVectorizedTraversal, InnerUnrolling>
{
  typedef typename Kernel::StorageIndex StorageIndex;
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
    const Index outerSize = kernel.outerSize();
    for(Index outer = 0; outer < outerSize; ++outer)
      copy_using_evaluator_innervec_InnerUnrolling<Kernel, 0, DstXprType::InnerSizeAtCompileTime>::run(kernel, outer);
  }
};

/***********************
*** Linear traversal ***
***********************/

template<typename Kernel>
struct dense_assignment_loop<Kernel, LinearTraversal, NoUnrolling>
{
  EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel)
  {
    const Index size = kernel.size();
    for(Index i = 0; i < size; ++i)
      kernel.assignCoeff(i);
  }
};

template<typename Kernel>
struct dense_assignment_loop<Kernel, LinearTraversal, CompleteUnrolling>
{
  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
  {
    typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
    copy_using_evaluator_LinearTraversal_CompleteUnrolling<Kernel, 0, DstXprType::SizeAtCompileTime>::run(kernel);
  }
};

/**************************
*** Slice vectorization ***
***************************/

template<typename Kernel>
struct dense_assignment_loop<Kernel, SliceVectorizedTraversal, NoUnrolling>
{
  EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel)
  {
    typedef packet_traits<typename Kernel::Scalar> PacketTraits;
    enum {
      packetSize = PacketTraits::size,
      alignable = PacketTraits::AlignedOnScalar,
      dstAlignment = alignable ? Aligned : int(Kernel::AssignmentTraits::DstIsAligned)
    };
    const Index packetAlignedMask = packetSize - 1;
    const Index innerSize = kernel.innerSize();
    const Index outerSize = kernel.outerSize();
    const Index alignedStep = alignable ? (packetSize - kernel.outerStride() % packetSize) & packetAlignedMask : 0;
    Index alignedStart = ((!alignable) || Kernel::AssignmentTraits::DstIsAligned) ? 0
                       : internal::first_aligned(&kernel.dstEvaluator().coeffRef(0,0), innerSize);

    for(Index outer = 0; outer < outerSize; ++outer)
    {
      const Index alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask);
      // do the non-vectorizable part of the assignment
      for(Index inner = 0; inner<alignedStart ; ++inner)
        kernel.assignCoeffByOuterInner(outer, inner);

      // do the vectorizable part of the assignment
      for(Index inner = alignedStart; inner<alignedEnd; inner+=packetSize)
        kernel.template assignPacketByOuterInner<dstAlignment, Unaligned>(outer, inner);

      // do the non-vectorizable part of the assignment
      for(Index inner = alignedEnd; inner<innerSize ; ++inner)
        kernel.assignCoeffByOuterInner(outer, inner);

      alignedStart = std::min<Index>((alignedStart+alignedStep)%packetSize, innerSize);
    }
  }
};

/***************************************************************************
* Part 4 : Generic dense assignment kernel
***************************************************************************/

// This class generalize the assignment of a coefficient (or packet) from one dense evaluator
// to another dense writable evaluator.
// It is parametrized by the two evaluators, and the actual assignment functor.
// This abstraction level permits to keep the evaluation loops as simple and as generic as possible.
// One can customize the assignment using this generic dense_assignment_kernel with different
// functors, or by completely overloading it, by-passing a functor.
template<typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT, typename Functor, int Version = Specialized>
class generic_dense_assignment_kernel
{
protected:
  typedef typename DstEvaluatorTypeT::XprType DstXprType;
  typedef typename SrcEvaluatorTypeT::XprType SrcXprType;
public:

  typedef DstEvaluatorTypeT DstEvaluatorType;
  typedef SrcEvaluatorTypeT SrcEvaluatorType;
  typedef typename DstEvaluatorType::Scalar Scalar;
  typedef typename DstEvaluatorType::StorageIndex StorageIndex;
  typedef copy_using_evaluator_traits<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor> AssignmentTraits;

  EIGEN_DEVICE_FUNC generic_dense_assignment_kernel(DstEvaluatorType &dst, const SrcEvaluatorType &src, const Functor &func, DstXprType& dstExpr)
    : m_dst(dst), m_src(src), m_functor(func), m_dstExpr(dstExpr)
  {
    #ifdef EIGEN_DEBUG_ASSIGN
    AssignmentTraits::debug();
    #endif
  }

  EIGEN_DEVICE_FUNC Index size() const        { return m_dstExpr.size(); }
  EIGEN_DEVICE_FUNC Index innerSize() const   { return m_dstExpr.innerSize(); }
  EIGEN_DEVICE_FUNC Index outerSize() const   { return m_dstExpr.outerSize(); }
  EIGEN_DEVICE_FUNC Index rows() const        { return m_dstExpr.rows(); }
  EIGEN_DEVICE_FUNC Index cols() const        { return m_dstExpr.cols(); }
  EIGEN_DEVICE_FUNC Index outerStride() const { return m_dstExpr.outerStride(); }

  // TODO get rid of this one:
  EIGEN_DEVICE_FUNC DstXprType& dstExpression() const { return m_dstExpr; }

  EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() { return m_dst; }
  EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const { return m_src; }

  /// Assign src(row,col) to dst(row,col) through the assignment functor.
  EIGEN_DEVICE_FUNC void assignCoeff(Index row, Index col)
  {
    m_functor.assignCoeff(m_dst.coeffRef(row,col), m_src.coeff(row,col));
  }

  /// \sa assignCoeff(Index,Index)
  EIGEN_DEVICE_FUNC void assignCoeff(Index index)
  {
    m_functor.assignCoeff(m_dst.coeffRef(index), m_src.coeff(index));
  }

  /// \sa assignCoeff(Index,Index)
  EIGEN_DEVICE_FUNC void assignCoeffByOuterInner(Index outer, Index inner)
  {
    Index row = rowIndexByOuterInner(outer, inner);
    Index col = colIndexByOuterInner(outer, inner);
    assignCoeff(row, col);
  }

  template<int StoreMode, int LoadMode>
  EIGEN_DEVICE_FUNC void assignPacket(Index row, Index col)
  {
    m_functor.template assignPacket<StoreMode>(&m_dst.coeffRef(row,col), m_src.template packet<LoadMode>(row,col));
  }

  template<int StoreMode, int LoadMode>
  EIGEN_DEVICE_FUNC void assignPacket(Index index)
  {
    m_functor.template assignPacket<StoreMode>(&m_dst.coeffRef(index), m_src.template packet<LoadMode>(index));
  }

  template<int StoreMode, int LoadMode>
  EIGEN_DEVICE_FUNC void assignPacketByOuterInner(Index outer, Index inner)
  {
    Index row = rowIndexByOuterInner(outer, inner);
    Index col = colIndexByOuterInner(outer, inner);
    assignPacket<StoreMode,LoadMode>(row, col);
  }

  EIGEN_DEVICE_FUNC static Index rowIndexByOuterInner(Index outer, Index inner)
  {
    typedef typename DstEvaluatorType::ExpressionTraits Traits;
    return int(Traits::RowsAtCompileTime) == 1 ? 0
      : int(Traits::ColsAtCompileTime) == 1 ? inner
      : int(DstEvaluatorType::Flags)&RowMajorBit ? outer
      : inner;
  }

  EIGEN_DEVICE_FUNC static Index colIndexByOuterInner(Index outer, Index inner)
  {
    typedef typename DstEvaluatorType::ExpressionTraits Traits;
    return int(Traits::ColsAtCompileTime) == 1 ? 0
      : int(Traits::RowsAtCompileTime) == 1 ? inner
      : int(DstEvaluatorType::Flags)&RowMajorBit ? inner
      : outer;
  }

protected:
  DstEvaluatorType& m_dst;
  const SrcEvaluatorType& m_src;
  const Functor &m_functor;
  // TODO find a way to avoid the needs of the original expression
  DstXprType& m_dstExpr;
};

/***************************************************************************
* Part 5 : Entry point for dense rectangular assignment
***************************************************************************/

template<typename DstXprType, typename SrcXprType, typename Functor>
EIGEN_DEVICE_FUNC void call_dense_assignment_loop(const DstXprType& dst, const SrcXprType& src, const Functor &func)
{
  eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());

  typedef typename evaluator<DstXprType>::type DstEvaluatorType;
  typedef typename evaluator<SrcXprType>::type SrcEvaluatorType;

  DstEvaluatorType dstEvaluator(dst);
  SrcEvaluatorType srcEvaluator(src);

  typedef generic_dense_assignment_kernel<DstEvaluatorType,SrcEvaluatorType,Functor> Kernel;
  Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived());

  dense_assignment_loop<Kernel>::run(kernel);
}

template<typename DstXprType, typename SrcXprType>
EIGEN_DEVICE_FUNC void call_dense_assignment_loop(const DstXprType& dst, const SrcXprType& src)
{
  call_dense_assignment_loop(dst, src, internal::assign_op<typename DstXprType::Scalar>());
}

/***************************************************************************
* Part 6 : Generic assignment
***************************************************************************/

// Based on the respective shapes of the destination and source,
// the class AssignmentKind determine the kind of assignment mechanism.
// AssignmentKind must define a Kind typedef.
template<typename DstShape, typename SrcShape> struct AssignmentKind;

// Assignement kind defined in this file:
struct Dense2Dense {};
struct EigenBase2EigenBase {};

template<typename,typename> struct AssignmentKind { typedef EigenBase2EigenBase Kind; };
template<> struct AssignmentKind<DenseShape,DenseShape> { typedef Dense2Dense Kind; };

// This is the main assignment class
template< typename DstXprType, typename SrcXprType, typename Functor,
          typename Kind = typename AssignmentKind< typename evaluator_traits<DstXprType>::Shape , typename evaluator_traits<SrcXprType>::Shape >::Kind,
          typename Scalar = typename DstXprType::Scalar>
struct Assignment;

// The only purpose of this call_assignment() function is to deal with noalias() / AssumeAliasing and automatic transposition.
// Indeed, I (Gael) think that this concept of AssumeAliasing was a mistake, and it makes thing quite complicated.
// So this intermediate function removes everything related to AssumeAliasing such that Assignment
// does not has to bother about these annoying details.

template<typename Dst, typename Src>
EIGEN_DEVICE_FUNC void call_assignment(Dst& dst, const Src& src)
{
  call_assignment(dst, src, internal::assign_op<typename Dst::Scalar>());
}
template<typename Dst, typename Src>
EIGEN_DEVICE_FUNC void call_assignment(const Dst& dst, const Src& src)
{
  call_assignment(dst, src, internal::assign_op<typename Dst::Scalar>());
}

// Deal with AssumeAliasing
template<typename Dst, typename Src, typename Func>
EIGEN_DEVICE_FUNC void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable_if<evaluator_traits<Src>::AssumeAliasing==1, void*>::type = 0)
{
  typename plain_matrix_type<Src>::type tmp(src);
  call_assignment_no_alias(dst, tmp, func);
}

template<typename Dst, typename Src, typename Func>
EIGEN_DEVICE_FUNC void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable_if<evaluator_traits<Src>::AssumeAliasing==0, void*>::type = 0)
{
  call_assignment_no_alias(dst, src, func);
}

// by-pass AssumeAliasing
// FIXME the const version should probably not be needed
// When there is no aliasing, we require that 'dst' has been properly resized
template<typename Dst, template <typename> class StorageBase, typename Src, typename Func>
EIGEN_DEVICE_FUNC void call_assignment(const NoAlias<Dst,StorageBase>& dst, const Src& src, const Func& func)
{
  call_assignment_no_alias(dst.expression(), src, func);
}
template<typename Dst, template <typename> class StorageBase, typename Src, typename Func>
EIGEN_DEVICE_FUNC void call_assignment(NoAlias<Dst,StorageBase>& dst, const Src& src, const Func& func)
{
  call_assignment_no_alias(dst.expression(), src, func);
}

template<typename Dst, typename Src, typename Func>
EIGEN_DEVICE_FUNC void call_assignment_no_alias(Dst& dst, const Src& src, const Func& func)
{
  enum {
    NeedToTranspose = (  (int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1)
                        |   // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&".
                                // revert to || as soon as not needed anymore.
                         (int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1))
                     && int(Dst::SizeAtCompileTime) != 1
  };

  Index dstRows = NeedToTranspose ? src.cols() : src.rows();
  Index dstCols = NeedToTranspose ? src.rows() : src.cols();
  if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
    dst.resize(dstRows, dstCols);

  typedef typename internal::conditional<NeedToTranspose, Transpose<Dst>, Dst>::type ActualDstTypeCleaned;
  typedef typename internal::conditional<NeedToTranspose, Transpose<Dst>, Dst&>::type ActualDstType;
  ActualDstType actualDst(dst);

  // TODO check whether this is the right place to perform these checks:
  EIGEN_STATIC_ASSERT_LVALUE(Dst)
  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src)

  // TODO this line is commented to allow matrix = permutation
  // Actually, the "Scalar" type for a permutation matrix does not really make sense,
  // perhaps it could be void, and EIGEN_CHECK_BINARY_COMPATIBILIY could allow micing void with anything...?
//   EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);

  Assignment<ActualDstTypeCleaned,Src,Func>::run(actualDst, src, func);
}
template<typename Dst, typename Src>
EIGEN_DEVICE_FUNC void call_assignment_no_alias(Dst& dst, const Src& src)
{
  call_assignment_no_alias(dst, src, internal::assign_op<typename Dst::Scalar>());
}

// forward declaration
template<typename Dst, typename Src> void check_for_aliasing(const Dst &dst, const Src &src);

// Generic Dense to Dense assignment
template< typename DstXprType, typename SrcXprType, typename Functor, typename Scalar>
struct Assignment<DstXprType, SrcXprType, Functor, Dense2Dense, Scalar>
{
  EIGEN_DEVICE_FUNC static void run(DstXprType &dst, const SrcXprType &src, const Functor &func)
  {
    eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());

#ifndef EIGEN_NO_DEBUG
    internal::check_for_aliasing(dst, src);
#endif

    call_dense_assignment_loop(dst, src, func);
  }
};

// Generic assignment through evalTo.
// TODO: not sure we have to keep that one, but it helps porting current code to new evaluator mechanism.
template< typename DstXprType, typename SrcXprType, typename Functor, typename Scalar>
struct Assignment<DstXprType, SrcXprType, Functor, EigenBase2EigenBase, Scalar>
{
  EIGEN_DEVICE_FUNC static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar> &/*func*/)
  {
    eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());

    src.evalTo(dst);
  }
};

} // namespace internal

} // end namespace Eigen

#endif // EIGEN_ASSIGN_EVALUATOR_H


text:
//
//  APIMockRequest.h
//
//  Created by Joseph Lorich on 3/19/14.
//  Copyright (c) 2014 Joseph Lorich.
//  Contributions by Cloudspace (http://www.cloudspace.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

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

/**
 * A mock API Request object.  Used to look up mock API Responses
 */
@interface APIMockRequest : NSObject

/// The request path
@property (nonatomic, retain) NSString *path;

/// The request method
@property (nonatomic, retain) NSString *method;

/// The request headers
@property (nonatomic, retain) NSDictionary *headers;

/// The request parameters
@property (nonatomic, retain) NSDictionary *parameters;

/// The response for this request
@property (nonatomic, retain) APIMockResponse *response;

@end


text:
package simx.profiler.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Stephan Rehfeld
 */
public class ProfilingData {

    static ProfilingData profilingData;

    public static ProfilingData getLoadedProfilingData() {
        return ProfilingData.profilingData;
    }

    private final Map< String, ActorType > actorTypes;
    private final Map< String, MessageType > messageTypes;
    private final Map< String, ActorInstance > idToInstance;

    private long firstEventTimestamp;
    private long lastEventTimestamp;
    private int processedMessagesCount;

    private final ActorInstance unknownActorInstance;

    private final List< ParallelismEvent > parallelismEvents;
    private long overallProcessingTime;
    private int messagesSentCount;
    private int messagesProcessedCount;

    private int averageTimeInMailboxCounter;
    private double averageTimeInMailbox;

    public ProfilingData() {
        this.actorTypes = new HashMap<>();
        this.messageTypes = new HashMap<>();
        this.idToInstance = new HashMap<>();

        this.firstEventTimestamp = Long.MAX_VALUE;
        this.lastEventTimestamp = Long.MIN_VALUE;

        this.processedMessagesCount = 0;

        ActorType unknownActorType = this.getOrRegisterActorType( "Unknown Type" );
        this.unknownActorInstance = unknownActorType.registerInstance( "Unknown Instance" );
        this.parallelismEvents = new ArrayList<>();
    }

    final ActorType getOrRegisterActorType( final String typeName ) {
        ActorType actorType;
        if( this.actorTypes.containsKey( typeName ) ) {
            actorType = this.actorTypes.get( typeName );
        } else {
            actorType = new ActorType( this, typeName );
            this.actorTypes.put( typeName, actorType );
        }
        return actorType;
    }

    public void registerSending( final long sendTime, final String senderString, final String receiverString, final String type, final int messageID ) {

        if( sendTime < this.firstEventTimestamp ) this.firstEventTimestamp = sendTime;
        if( sendTime > this.lastEventTimestamp ) this.lastEventTimestamp = sendTime;
        this.messagesSentCount++;
        final MessageType messageType = this.getOrRegisterMessageType( type );
        final MessageInstance messageInstance = messageType.getOrRegisterInstance( messageID );

        final ActorInstance sender = this.getActorInstance( senderString );
        final ActorInstance receiver = this.getActorInstance( receiverString );

        messageInstance.registerSentEvent( sender, receiver, sendTime );

    }

    public MessageType getOrRegisterMessageType( final String type ) {
       MessageType messageType;
        if( this.messageTypes.containsKey( type ) ) {
            messageType = this.messageTypes.get( type );
        } else {
            messageType = new MessageType( type, this );
            this.messageTypes.put( type, messageType );
        }
        return messageType;
    }

    ActorInstance getActorInstance( final String id ) {
        if( this.idToInstance.containsKey( id ) ) {
            return this.idToInstance.get( id );
        }
        return this.unknownActorInstance;
    }

    void registerInstance( final String id, final ActorInstance actorInstance ) {
        this.idToInstance.put( id, actorInstance );
    }

    public long applicationRunTime() {
        return this.lastEventTimestamp - this.firstEventTimestamp;
    }

    public long applicationStart() {
        return this.firstEventTimestamp;
    }

    public List< ActorInstance > getActorInstances() {
        final List< ActorInstance > actorInstances = new ArrayList<>();
        this.getActorTypes().stream().forEach((actorType) -> {
            actorInstances.addAll( actorType.getInstances() );
        });
        return actorInstances;
    }

    public void registerProcessingEvent( final long start, final long end, final String messageTypeString, final int messageID, final String senderString, final String receiverString) {
        if( start < this.firstEventTimestamp ) this.firstEventTimestamp = start;
        if( start > this.lastEventTimestamp ) this.lastEventTimestamp = start;

        if( end < this.firstEventTimestamp ) this.firstEventTimestamp = end;
        if( end > this.lastEventTimestamp ) this.lastEventTimestamp = end;

        this.overallProcessingTime += end - start;
        this.messagesProcessedCount++;
        this.parallelismEvents.add( new ParallelismEvent( start, ParallelismEvent.ParallelimEventTypes.PROCESSING_START ) );
        this.parallelismEvents.add( new ParallelismEvent( end, ParallelismEvent.ParallelimEventTypes.PROCESSING_END ) );

        final MessageType messageType = this.getOrRegisterMessageType( messageTypeString );
        final MessageInstance messageInstance = messageType.getOrRegisterInstance( messageID );

        final ActorInstance sender = this.getActorInstance( senderString );
        final ActorInstance receiver = this.getActorInstance( receiverString );

        final MessageProcessingEvent messageProcessingEvent = new MessageProcessingEvent( sender, receiver, start, end, messageInstance );

        messageInstance.registerProcessingEvent( messageProcessingEvent );
        receiver.registerMessageProcessingEvent( messageProcessingEvent );

        if( messageInstance.getMessageSentEvents().size() == 1 ) {
            this.averageTimeInMailbox = (this.averageTimeInMailbox * this.averageTimeInMailboxCounter / (this.averageTimeInMailbox+1) ) + ((messageInstance.getMessageSentEvents().get( 0 ).timestamp - start) / (this.averageTimeInMailbox+1) );
            this.averageTimeInMailboxCounter++;
        }
        this.processedMessagesCount++;
    }

    public List<ActorType> getActorTypes() {
        return new ArrayList<>(this.actorTypes.values());
    }

    void registerActorCreationTimeStamp( final long created ) {
        if( created < this.firstEventTimestamp ) this.firstEventTimestamp = created;
        if( created > this.lastEventTimestamp ) this.lastEventTimestamp = created;
    }

    public List< MessageType > getMessageTypes() {
        return new ArrayList<>( this.messageTypes.values() );
    }

    public int getProcessedMessagesCount() {
        return this.processedMessagesCount;
    }

    ActorInstance getUnknownActorInstance() {
        return this.unknownActorInstance;
    }

    public ActorInstance registerActorInstance( final String typeName, final String id, final long creationTime, final String supervisor ) {
        final ActorType type = this.getOrRegisterActorType( typeName );
        return type.registerInstance( id, creationTime, supervisor );
    }

    public List< ParallelismEvent > getParallelismEvents() {
        return this.parallelismEvents;
    };

    public long getOverallProcessingTime() {
        return this.overallProcessingTime;
    }

    public int getMessagesSentCount() {
        return this.messagesSentCount;
    }

    public int getMessagesProcessedCount() {
        return this.messagesProcessedCount;
    }

    public double getAverageTimeInMailbox() {
        return this.averageTimeInMailbox;
    }
}


text:
  Baissey est
       un village
       situé dans le département de Haute-Marne en Champagne-Ardenne. On dénombrait 204 habitants en 2008.

À proximité de Baissey sont situées les communes de
Villiers-lès-Aprey à 3 km, 35 habitants,
Aprey située à 2 km, 190 habitants,
Verseilles-le-Bas située à 3 km, 103 habitants,
Verseilles-le-Haut à 3 km, 43 habitants,
Longeau-Percey située à 4 km, 695 habitants,
Leuchey à 3 km, 57 habitants,
 entre autres. De plus, Baissey est située à seulement treize km de Langres.

Si vous envisagez de venir habiter à Baissey, vous pourrez facilement trouver une maison à vendre.

Le parc d'habitations, à Baissey, se décomposait en 2011 en un appartements et 105 maisons soit
 un marché plutôt équilibré.


text:
'use strict'

var rule = require('../../lib/rules/no-describe-selectors')
var RuleTester = require('eslint').RuleTester
var eslintTester = new RuleTester()

eslintTester.run('no-describe-selectors', rule, {
  valid: [
    'var PageObject = function () { this.getDOMElement = function () { return element(by.css(".some-element")); }; }',
    'module.exports = { getDOMElement: function () { return element(by.css(".some-element")); } };'
  ],

  invalid: [
    {
      code: 'describe(function () { element(by.addLocator("newLocator", function () { } )); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () {element(by.binding("something.binding")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.model("something.model")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.buttonText("buttonText")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.partialButtonText("partialButtonText")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.repeater("something in repeater")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.cssContainingText(".css", "Contained text")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.options("o for o in options")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.deepCss(".deepCss")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.className("className")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },

    {
      code: 'describe(function () { element(by.css(".css")); })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.id("id")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.linkText("linkText")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.js("js")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.name("name")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.partialLinkText("partialLinkText")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.tagName("tagName")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    },
    {
      code: 'describe(function () { element(by.xpath("//xpath")) })',
      errors: [{
        message: 'Unexpected selector in describe block'
      }]
    }
  ]
})


text:
from ._matcher_function import MatcherFunction
from ._registry import Registry
from ._resolver import Resolver
from ._reversed_resolver import ReversedResolver

__all__ = ("MatcherFunction", "Registry", "Resolver", "ReversedResolver",)


text:
<!DOCTYPE html>

	<title>The Purest Cacophony</title>
	<meta name="description" content="The Purest Cacophony is a folk / americana / alt-country band from Worcester, MA.">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW" />
	<meta name="keywords" content="The Purest Cacophony, I Will Not Fall, folk, americana, alt-country" />
	<meta name="language" content="English" />
	<meta name="charset" content="utf-8" />
	<link href="stylesheets/screen.css" rel="stylesheet" type="text/css">
	<link href="stylesheets/ie.css" rel="stylesheet" type="text/css">
	<link href='http://fonts.googleapis.com/css?family=Alef|Habibi' rel='stylesheet' type='text/css'>

	<link rel="icon" href="../favicon.gif" type="image/gif" />
	<link rel="apple-touch-icon" href="../apple-touch-icon.png" />

The Purest Cacophony

			 Listen
			 Bandcamp
			 About
			 Lyrics
			 Shows
			 Booking
			 Support

I Will Not Fall

is released!

What's Next?

			After half a year of writing, recording, mixing and mastering, The Purest Cacophony's debut
			EP is released. Special thanks to my friends Theo Van Dyke, Jonathan Dana, Mike Tierney
			& Paul Puiia for all their help.

Upcoming Album

Want To Help?

			I'm excited to announce that I've begun work on a full-length album. I feel that
			my last release lacked dirt. So for the album I've broken out the fertilizer,
			and started to compost. Check back here to learn more.

Support The Purest Cacophony

Back To Top   |   Questions or Comments?  |  Website Handmade by  Jasper


text:
'use strict';

// Declare app level module which depends on filters, and services
angular.module('airQualityApp', [
    'ngRoute',
    'airQualityApp.filters',
    'airQualityApp.services',
    'airQualityApp.directives',
    'airQualityApp.controllers',
    'ngResource',
    'ngSanitize',
    'ngTable',
    'n3-line-chart',
    'angularSpinner',
    'ui.bootstrap'
]).
config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/main', {templateUrl: 'partials/main.html', controller: 'TweetCtrl'});
  $routeProvider.otherwise({redirectTo: '/main'});
}]);


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.like.common.view.banner.BannerViewPager
        android:id="@+id/vp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <LinearLayout
        android:id="@+id/indicatorContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@id/vp"
        android:gravity="center"
        android:orientation="horizontal"
        android:paddingBottom="10dp"
        android:paddingTop="10dp" />

</RelativeLayout>


text:
package co.edu.uniandes.csw.artwork.persistence;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import co.edu.uniandes.csw.artwork.entities.CategoryEntity;
import co.edu.uniandes.csw.crud.spi.persistence.CrudPersistence;

/**
 * @generated
 */
@Stateless
public class CategoryPersistence extends CrudPersistence<CategoryEntity> {

    @PersistenceContext(unitName="ArtworkPU")
    protected EntityManager em;

    /**
     * @generated
     */
    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    /**
     * @generated
     */
    @Override
    protected Class<CategoryEntity> getEntityClass() {
        return CategoryEntity.class;
    }

}


text:
package com.pme.exe.res.vi;

import com.pme.exe.Bin;
import com.pme.util.OffsetTrackingInputStream;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.RandomAccessFile;

public class VersionInfoBin extends Bin.Structure {
  private String myExpectedName;
  private VersionInfoFactory myChildFactory;

  public VersionInfoBin(String name) {
    super(name);
    Word length = new Word("wLength");
    addMember(length);
    addSizeHolder(length);
    addMember(new Word("wValueLength"));
    addMember(new Word("wType"));
    addMember(new WChar("szKey"));
    addMember(new Padding(4));
  }

  public VersionInfoBin(String versionInfo, String expectedName) {
    this(versionInfo);
    myExpectedName = expectedName;
  }

  public VersionInfoBin(String versionInfo, String expectedName, VersionInfoFactory childFactory) {
    this(versionInfo, expectedName);
    myChildFactory = childFactory;
  }

  @Override
  public void read(DataInput stream) throws IOException {
    OffsetTrackingInputStream inputStream = (OffsetTrackingInputStream) stream;
    long startOffset = inputStream.getOffset();
    assert startOffset % 4 == 0;
    super.read(stream);
    if (myExpectedName != null) {
      String signature = ((WChar) getMember("szKey")).getValue();
      assert signature.equals(myExpectedName): "Expected signature " + myExpectedName + ", found '" + signature + "'";
    }
    if (myChildFactory != null) {
      long length = getValue("wLength");
      int i = 0;
      while(inputStream.getOffset() < startOffset + length) {
        VersionInfoBin child = myChildFactory.createChild(i++);
        child.read(inputStream);
        addMember(child);
      }
    }
  }

  @Override
  public void write(DataOutput stream) throws IOException {
    long startOffset = -1;
    if (stream instanceof RandomAccessFile) {
      startOffset = ((RandomAccessFile) stream).getFilePointer();
      assert startOffset % 4 == 0;
    }
    super.write(stream);
    if (stream instanceof RandomAccessFile) {
      long offset = ((RandomAccessFile) stream).getFilePointer();
      long realLength = offset - startOffset;
      long expectedLength = getValue("wLength");
      assert realLength == expectedLength: "Actual length does not match calculated length for " + getName() +
          ": expected " + expectedLength + ", actual " + realLength + ", sizeInBytes() " + sizeInBytes();
    }
  }
}


text:
package org.ovirt.engine.core.vdsbroker.vdsbroker;

import java.util.Map;

@SuppressWarnings("unchecked")
public final class OneVmReturnForXmlRpc {

    private static final String STATUS = "status";
    private static final String VM_LIST = "vmList";

    public StatusForXmlRpc status;
    public Map<String, Object> vm;

    public OneVmReturnForXmlRpc(Map<String, Object> innerMap) {
        status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS));
        vm = (Map<String, Object>) innerMap.get(VM_LIST);
    }
}


text:
using sessions_helper::AwaitCheckForeignSessionsAgainst;
using sessions_helper::CheckInitialState;
using sessions_helper::OpenTabAndGetLocalWindows;
using sessions_helper::ScopedWindowMap;
using sessions_helper::SessionWindowMap;
using sessions_helper::SyncedSessionVector;

class MultipleClientSessionsSyncTest : public SyncTest {
 public:
  MultipleClientSessionsSyncTest() : SyncTest(MULTIPLE_CLIENT) {}
  ~MultipleClientSessionsSyncTest() override {}

 private:
  DISALLOW_COPY_AND_ASSIGN(MultipleClientSessionsSyncTest);
};

// Timeout on Windows, see http://crbug.com/99819
#if defined(OS_WIN)
#define MAYBE_E2ETest_AllChanged DISABLED_E2ETest_AllChanged
#define MAYBE_EncryptedAndChanged DISABLED_EncryptedAndChanged
#else
#define MAYBE_E2ETest_AllChanged E2ETest_AllChanged
#define MAYBE_EncryptedAndChanged EncryptedAndChanged
#endif

IN_PROC_BROWSER_TEST_F(MultipleClientSessionsSyncTest,
                       MAYBE_E2ETest_AllChanged) {
  ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";

  // Open tabs on all clients and retain window information.
  std::vector<ScopedWindowMap> client_windows(num_clients());
  for (int i = 0; i < num_clients(); ++i) {
    SessionWindowMap windows;
    std::string url = base::StringPrintf("http://127.0.0.1/bubba%s",
        base::GenerateGUID().c_str());
    ASSERT_TRUE(OpenTabAndGetLocalWindows(i, GURL(url), &windows));
    client_windows[i].Reset(&windows);
  }

  // Get foreign session data from all clients and check it against all
  // client_windows.
  for (int i = 0; i < num_clients(); ++i) {
    ASSERT_TRUE(AwaitCheckForeignSessionsAgainst(i, client_windows));
  }
}

IN_PROC_BROWSER_TEST_F(MultipleClientSessionsSyncTest,
                       MAYBE_EncryptedAndChanged) {
  ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
  std::vector<ScopedWindowMap> client_windows(num_clients());

  for (int i = 0; i < num_clients(); ++i) {
    ASSERT_TRUE(CheckInitialState(i));
  }

  // Enable encryption on client 0, should propagate to all other clients.
  ASSERT_TRUE(EnableEncryption(0));

  // Wait for sync.
  // TODO(zea): Fix sync completion detection so we don't need this. For now,
  // the profile sync service harness detects completion before all encryption
  // changes are propagated.
  ASSERT_TRUE(GetClient(0)->AwaitGroupSyncCycleCompletion(clients()));

  // Open tabs on all clients and retain window information.
  for (int i = 0; i < num_clients(); ++i) {
    SessionWindowMap windows;
    ASSERT_TRUE(OpenTabAndGetLocalWindows(
        i, GURL(base::StringPrintf("http://127.0.0.1/bubba%i", i)), &windows));
    client_windows[i].Reset(&windows);
  }

  // Get foreign session data from all clients and check it against all
  // client_windows.
  for (int i = 0; i < num_clients(); ++i) {
    ASSERT_TRUE(AwaitCheckForeignSessionsAgainst(i, client_windows));
    ASSERT_TRUE(IsEncryptionComplete(i));
  }
}


text:
package org.avantssar.aslanpp;

//import java.util.ArrayList;
//import java.util.List;
import junit.framework.TestCase;
import org.avantssar.aslanpp.model.ASLanPPSpecification;
import org.avantssar.aslanpp.model.ConstantSymbol;
import org.avantssar.aslanpp.model.Entity;
import org.avantssar.aslanpp.model.EntityManager;
import org.avantssar.aslanpp.model.ExpressionContext;
import org.avantssar.aslanpp.model.FunctionSymbol;
import org.avantssar.aslanpp.model.ITerm;
import org.avantssar.aslanpp.model.IType;
import org.avantssar.aslanpp.model.Prelude;
import org.avantssar.aslanpp.model.SymbolsState;
import org.avantssar.aslanpp.model.VariableSymbol;
import org.avantssar.aslanpp.model.VariableTerm;
import org.avantssar.commons.ChannelModel;

public class TermReductionTest extends TestCase {

	private SymbolsState symState;
	private ExpressionContext ctx;
	private ASLanPPSpecification spec;
	private Entity ent;

	private IType tMessage;
	private IType tFact;

	private EntityManager manager;

	public TermReductionTest(String testName) {
		super(testName);
	}

	@Override
	public void setUp() {
		symState = new SymbolsState();
		manager = new EntityManager();
		spec = new ASLanPPSpecification(manager, "spec", ChannelModel.CCM);
		ent = spec.entity("Environment");

		tMessage = spec.findType(Prelude.MESSAGE);
		tFact = spec.findType(Prelude.FACT);
	}

	public void xtestOne() {
		ConstantSymbol a = ent.constants(tMessage, "a");
		ConstantSymbol b = ent.constants(tMessage, "b");
		ConstantSymbol c = ent.constants(tMessage, "c");
	//	List<IType> argTypes = new ArrayList<IType>();
		VariableSymbol varA = ent.addVariable("A", tMessage);
		VariableSymbol varB = ent.addVariable("B", tMessage);
		VariableSymbol varC = ent.addVariable("C", tMessage);
		FunctionSymbol fncMyFact = ent.addFunction("myfact", tFact, tMessage, tMessage, tMessage);
		ITerm original = fncMyFact.term(new ITerm[] { varA.term(), varB.term(), varC.term() });
		System.out.println("original: " + original.getRepresentation());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varA, a.term());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varB, b.term());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varC, c.term());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varA, varB.term());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varB, varC.term());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varC, varA.term());
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varA, original);
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
		symState.assign(varA, original);
		System.out.println(symState);
		System.out.println("reduced: " + original.reduce(symState).getRepresentation());
	}

	public void xtestTwo() {
		VariableSymbol varA = ent.addVariable("A", tMessage);
		VariableSymbol varB = ent.addVariable("B", tMessage);
		VariableSymbol varC = ent.addVariable("C", tMessage);
		VariableSymbol varD = ent.addVariable("D", tMessage);
		VariableTerm termBMatched = varB.matchedTerm();
		VariableTerm termCMatched = varC.matchedTerm();
		FunctionSymbol fncMyFact = ent.addFunction("my_fact", tFact, tMessage, tMessage, tMessage, tMessage);
		FunctionSymbol fncPrevFact = ent.addFunction("prev_fact", tFact, tMessage, tMessage, tMessage, tMessage);
		ITerm prevTerm = fncPrevFact.term(new ITerm[] { varA.term(), varB.term(), varC.term(), varD.term() });
		ITerm myTerm = fncMyFact.term(new ITerm[] { varA.term(), termBMatched, termCMatched, varD.term() });
		System.out.println("prev: " + prevTerm.getRepresentation());
		System.out.println("my: " + myTerm.getRepresentation());
		System.out.println(symState);
		myTerm.useContext(ctx, symState);
		System.out.println("contributed");
		System.out.println(symState);
		System.out.println("prev reduced: " + prevTerm.reduce(symState).getRepresentation());
		System.out.println("my reduced: " + myTerm.reduce(symState).getRepresentation());
		symState.assign(varD, varB.term());
		System.out.println(symState);
		System.out.println("prev reduced: " + prevTerm.reduce(symState).getRepresentation());
		System.out.println("my reduced: " + myTerm.reduce(symState).getRepresentation());
		symState.clear();
		System.out.println(symState);
		System.out.println("prev reduced: " + prevTerm.reduce(symState).getRepresentation());
		System.out.println("my reduced: " + myTerm.reduce(symState).getRepresentation());
	}

	public void testPushPop() {
		VariableSymbol varA = ent.addVariable("A", tMessage);
		VariableSymbol varB = ent.addVariable("B", tMessage);
		System.out.println(symState);
		symState.push();
		symState.assign(varA, varA.term());
		System.out.println(symState);
		symState.push();
		symState.assign(varB, varB.term());
		System.out.println(symState);
		symState.pop();
		System.out.println(symState);
		symState.pop();
		System.out.println(symState);
	}
}


text:
<?php

if (file_exists($autoload = realpath(__DIR__ . "/../../../vendor/autoload.php"))) {
	require_once $autoload;
} else {
	print_r("Autoload not found or on path $autoload");
}

use Gerencianet\Exception\GerencianetException;
use Gerencianet\Gerencianet;

if (file_exists($options = realpath(__DIR__ . "/../../credentials/options.php"))) {
	require_once $options;
}

$params = [
	"codBarras" => "36400000000000000000000000000000000000000000000"
];

$body = [
	"valor" => 500,
	"dataPagamento" => "2024-12-10",
	"descricao" => "Payment of the test billet"
];

try {
	$api = Gerencianet::getInstance($options);
	$response = $api->payRequestBarCode($params, $body);

	print_r("
" . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "
");
} catch (GerencianetException $e) {
	print_r($e->code);
	print_r($e->error);
	print_r($e->errorDescription);
} catch (Exception $e) {
	print_r($e->getMessage());
}


text:
kick.sh
=======

Requirements
------------
- **Root permission**
- aircrack-ng
- arp-scan

Kicks a host from a wireless network by sending de-authenticating packet.

Note: If you have a mac, uncomment the mac line


text:
<?php
namespace HBase\View\Helper;
use Zend\ServiceManager\ServiceLocatorAwareTrait;

class Cdn extends \Zend\View\Helper\AbstractHelper implements \Zend\ServiceManager\ServiceLocatorAwareInterface
{
    use ServiceLocatorAwareTrait;
    protected $types=array(
        "qiniu"=>"cdn.qiniu.com",
        "google"=>"google.code.com",
    );
    protected static $defaultType="google";

    public function __invoke($type=null){
        if($type!=null){
            if(array_key_exists($type, $this->types)){
                return $this->types[$type];
            }
        }
       $serviceLocator=  $this->serviceLocator->getServiceLocator();
       $config=$serviceLocator->get("config");

           if(isset($config["view_manager"])&&isset($config["view_manager"]["base_path"])){
               return $config["view_manager"]["base_path"];
           }
        return $this->types[static::$defaultType];

    }
}


text:
function [Tr, leafIdx, Score] = OnlineThinning(Tr, leafIdx, Xt, obsIdx, method, eps, gamma, alpha)
% Perform Online Thinning algorithm
% Inputs:
%   Tr - Tree of nodes. Each node relates to some subset of the data.
%   leafIdx - indexes of the leaf nodes (parents of the shadow nodes)
%   Xt - input observations (p x N_t)
%   obsIdx - observed indices of each column of Xt (Boolean p x 1)
%   method - petrels_batch or petrels_fo. petrels_batch is the default
%     method, which process data in mini-batches. if petrels_fo is chosen,
%     the data will be processed sequentially.
%   eps - Error bound, scaled by the number of leafIdx's
%   gamma - amount virtual leaves must improve error by, to be used, scaled
%     by the number of leafIdx's
%   alpha - forgetting factor for history, higher value means to consider node
%     history more strongly, scaled by the number of leafIdx's
% Outputs:
%   Tr - updated tree of nodes, for all of the data.
%   leafIdx - updated indexes of the leaf nodes
%   Score - for each column of Xt, the weighted negative log likelihood
%     that it is from any of the leaf nodes

% assign each data point to a leaf node and its ancestors
% update each node with the data assigned
% calculate the Score
[Tr, updatedLeaf, Score] = MiniBatchAssign(Tr, leafIdx, Xt, obsIdx, method, alpha);

% split the tree
splitLeaf = [];
newLeaf = [];

for n = updatedLeaf
    leafErr = Tr(n).error;
    leftVir = Tr(n).left;
    rightVir = Tr(n).right;
    % weighted average of cumulated likelihood at the vitual children level
    virErr = (Tr(leftVir).error * Tr(leftVir).weight + Tr(rightVir).error * Tr(rightVir).weight) ...
        / (Tr(leftVir).weight + Tr(rightVir).weight);

    if (leafErr > eps) && (leafErr > virErr + gamma)
        leafIdx = setdiff(leafIdx, n);
        leafIdx = [leafIdx, leftVir, rightVir];

		splitLeaf = [splitLeaf, n];
		newLeaf = [newLeaf, leftVir, rightVir];

        Tr(end+1) = Tr(leftVir);
        [maxLen, maxIdx] = max(Tr(leftVir).spread);
        majorAxis = Tr(leftVir).basis(:, maxIdx);
        Tr(end).center = Tr(leftVir).center + sqrt(maxLen)/2*majorAxis;
        Tr(end).spread(maxIdx) = maxLen/4;
        Tr(end).left = -inf;
        Tr(end).right = -inf;
        Tr(end).father = leftVir;
        Tr(end).weight = Tr(leftVir).weight/2;
        Tr(leftVir).left = length(Tr);

        Tr(end+1) = Tr(leftVir);
        Tr(end).center = Tr(leftVir).center - sqrt(maxLen)/2*majorAxis;
        Tr(end).spread(maxIdx) = maxLen/4;
        Tr(end).left = -inf;
        Tr(end).right = -inf;
        Tr(end).father = leftVir;
        Tr(end).weight = Tr(leftVir).weight/2;
        Tr(leftVir).right = length(Tr);

        Tr(end+1) = Tr(rightVir);
        [maxLen, maxIdx] = max(Tr(rightVir).spread);
        majorAxis = Tr(rightVir).basis(:, maxIdx);
        Tr(end).center = Tr(rightVir).center + sqrt(maxLen)/2*majorAxis;
        Tr(end).spread(maxIdx) = maxLen/4;
        Tr(end).left = -inf;
        Tr(end).right = -inf;
        Tr(end).father = rightVir;
        Tr(end).weight = Tr(rightVir).weight/2;
        Tr(rightVir).left = length(Tr);

        Tr(end+1) = Tr(rightVir);
        Tr(end).center = Tr(rightVir).center - sqrt(maxLen)/2*majorAxis;
        Tr(end).spread(maxIdx) = maxIdx/4;
        Tr(end).left = -inf;
        Tr(end).right = -inf;
        Tr(end).father = rightVir;
        Tr(end).weight = Tr(rightVir).weight/2;
        Tr(rightVir).right = length(Tr);
    end
end

% merge the tree
[~, nPatches] = size(Xt);
abandonedLeaf = []; % leaves that aren't used any more
for i = leafIdx
    % delete obsolete nodes (weights too small)
    if (Tr(i).weight < (1/nPatches) * alpha^3)
        abandonedLeaf = [abandonedLeaf, i];
    end
end

updatedLeaf = [updatedLeaf, abandonedLeaf];

mergedLeaf = [];
removedVirtLeaf = [];
newLeaf = [];

% merge the tree
while ~isempty(updatedLeaf)
    n = updatedLeaf(1);
    updatedLeaf = updatedLeaf(2:end);

    if n ~= 1
        myFather = Tr(n).father;
        fatherErr = Tr(myFather).error;

        if Tr(myFather).left == n
            sib = Tr(myFather).right;
        else
            sib = Tr(myFather).left;
        end

        if (ismember(n, leafIdx)) && (ismember(sib, leafIdx))
            % weighted average of accumulative likelihood of the leaf node
            % and its sibling
            leafErr = (Tr(n).error * Tr(n).weight + Tr(sib).error * Tr(sib).weight) ...
                / (Tr(n).weight + Tr(sib).weight);

            if ((leafErr < eps) && (leafErr > fatherErr - gamma)) || ...
                    (ismember(n, abandonedLeaf) && ismember(sib, abandonedLeaf))
                leafIdx = setdiff(leafIdx, [n,sib]);
                leafIdx = [leafIdx, myFather];

                %Tr(myFather).weight = Tr(n).weight + Tr(sib).weight;
                updatedLeaf = setdiff(updatedLeaf, sib);
                abandonedLeaf = setdiff(abandonedLeaf, [n sib]);
				mergedLeaf = [mergedLeaf, [n, sib]];
				newLeaf = [newLeaf, myFather];

                del1 = Tr(n).left;
                del2 = Tr(n).right;
                del3 = Tr(sib).left;
                del4 = Tr(sib).right;
                del = [del1, del2, del3, del4];

				removedVirtLeaf = [removedVirtLeaf, del];

                for i = setdiff(1:length(Tr), del)
                    if ismember(Tr(i).left, del)
                        Tr(i).left = -inf;
                    else
                        Tr(i).left = Tr(i).left - sum(Tr(i).left > del);
                    end

                    if ismember(Tr(i).right, del)
                        Tr(i).right = -inf;
                    else
                        Tr(i).right = Tr(i).right - sum(Tr(i).right > del);
                    end

                    Tr(i).father = Tr(i).father - sum(Tr(i).father > del);
                end

                for i = 1:length(leafIdx)
                    leafIdx(i) = leafIdx(i) - sum(leafIdx(i) > del);
                end

                for i = 1:length(updatedLeaf)
                    updatedLeaf(i) = updatedLeaf(i) - sum(updatedLeaf(i) > del);
                end

                for i = 1:length(abandonedLeaf)
                    abandonedLeaf(i) = abandonedLeaf(i) - sum(abandonedLeaf(i) > del);
                end

                Tr(del) = [];
            end
        end
    end
end


text:
$(document).ready(function() {
    $("#eval-btn").click(function() {
        execute();
    });
    $('#templateAndModelForm textarea, #templateAndModelForm select').keydown(function (e) {
        if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) {
            execute();
        }
    });
    $.blockUI.defaults.fadeIn = 1000;
    $.blockUI.defaults.fadeOut = 0;
});

var hasPendingExecuteAjaxCall = false;

function execute() {
    if (hasPendingExecuteAjaxCall || !checkFormSendable()) {
        return;
    }

    var request = {
        "template": $("#template").val(),
        "dataModel": $("#dataModel").val(),
        "outputFormat": $("#outputFormat").val(),
        "locale": $("#locale").val(),
        "timeZone": $("#timeZone").val()
    }

    $.ajax({
        method: "POST",
        url: "/api/execute",
        data: JSON.stringify(request),
        headers: { "Content-Type":"application/json" },
        beforeSend: function (jqXHR, options) {
            hasPendingExecuteAjaxCall = true;
            $.blockUI({ message: null });
            $("#error").hide();
            return true;
        }
    })
    .done(function (data) {
        if (data.problems && data.problems.length != 0) {
            showResult(data.problems[0].message, true);
        } else {
            showResult(data.result, false);
        }
    })
    .fail(function (data) {
        if (data.responseJSON) {
            showResult(data.responseJSON.errorCode + ": " + data.responseJSON.errorDescription, true);
        } else {
            showResult("The service was unavailable or had returned an invalid response.", true);
        }
    })
    .always(function (data) {
        hasPendingExecuteAjaxCall = false;
        $.unblockUI();
    });
}

function checkFormSendable() {
    if($.trim($("#template").val()) === "" ) {
        showResult("Template was empty; nothing to do.", true);
        return false;
    }
    return true;
}

function showResult(result, isError) {
    if (isError) {
        $("#result").addClass("error");
    } else {
        $("#result").removeClass("error");
    }
    $("#result").val(result);
    $(".resultContainer").show();
    autosize.update($("#result"));
}


text:
from .development import *

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'tester_cbh_chembl', # Or path to database file if using sqlite3.
        'USER': 'chembl', # Not used with sqlite3.
        'PASSWORD': 'chembl', # Not used witis oracle
        'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
        'TEST_NAME' : 'tester_cbh_chembl'
    },
}

ES_PREFIX = "test"


text:
import { md, sample } from '../markdown';

export default function notes(exampleForm) {
    return md`# Component sets

The easiest way to create cohesive forms is to globally set a set of components to use. Individual elements only choose
the component kind (textbox, dropdown, etc) and the actual element being rendered will come from the configured set.

## Setting up template registry

--- js
import Registry from '@lit-any/lit-any/forms;
import * as paperElements from '@lit-any/components-paper-elements';

Registry.default.useComponents(paperElements);
---

Switching the **component set** knob let's you quickly change the appearance of the entire form below. Individual fields
do not "know" if the will be with a paper element of with a vaadin component.

${sample(exampleForm)}

## Individual fields

Individual field templates are configured slightly different, using a \`renderComponent\` method instead of \`render\`.
It accepts an \`{ type, options }\` object where the \`type\` is a string which must match the component name from the set
and the \`options\` will be passed to the actual builder of the chosen component.

For common component those objects do not have to be constructed manually. Instead they can be imported from
\`lit-any/components\` to reduce boilerplate.

Here's how the form above is configured to render a dropdown menu for a \`languages\` property.

--- js
import { dropdown } from '@lit-any/lit-any/components';
import Registry from '@lit-any/lit-any/forms;

Registry.when
    .fieldMatches(f => f.type === 'language')
    .rendersComponent(dropdown({
        items: [
            { value: 'en', label: 'English' },
            { value: 'de', label: 'German' },
            { value: 'pl', label: 'Polish' },
        ],
    }));
--- `;
}


text:
"""

Created on Fri Mar 30 18:27:25 2012
Author: Josef Perktold
"""

from statsmodels.sandbox.stats.multicomp import tukeyhsd, MultiComparison

def pairwise_tukeyhsd(endog, groups, alpha=0.05):
    '''calculate all pairwise comparisons with TukeyHSD confidence intervals

    this is just a wrapper around tukeyhsd method of MultiComparison

    Parameters
    ----------
    endog : ndarray, float, 1d
        response variable
    groups : ndarray, 1d
        array with groups, can be string or integers
    alpha : float
        significance level for the test

    Returns
    -------
    table : SimpleTable instance
        table for printing
    tukeyhsd_res : list
        contains detailed results from tukeyhsd function
        [(idx1, idx2), reject, meandiffs, std_pairs, confint, q_crit,
           df_total, reject2]

    See Also
    --------
    MultiComparison
    tukeyhsd

    '''

    return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>CasPHP</title>

<meta name="description" content="Clear and Straight forward PHP Web Framework" />

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="true"/>
<meta name="MobileOptimized" content="320"/>

Not Found

<?php echo $__reason; ?>