text:
<!DOCTYPE html>

  <meta charSet="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <title>Redux Form - Examples</title>
  <link href="/6.0.0-alpha.4/bundle.css" media="screen, projection" rel="stylesheet" type="text/css" />
  <link href="https://fonts.googleapis.com/css?family=Lato:400,300,700" rel="stylesheet" type="text/css">
  <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" media="screen, projection" rel="stylesheet"
    type="text/css" />
  <meta itemprop="name" content="Redux Form" />
  <meta property="og:type" content="website" />
  <meta property="og:title" content="Redux Form" />
  <meta property="og:site_name" content="Redux Form" />
  <meta property="og:description" content="The best way to manage your form state in Redux." />
  <meta property="og:image" content="logo.png" />
  <meta property="twitter:site" content="@erikras" />
  <meta property="twitter:creator" content="@erikras" />

<button type="button"></button>

      Redux FormGetting Startedv6 Migration Guide
        APIreduxForm()
          propsField
            reducerreducer.syncValidation()
              SubmissionErrorAction Creators
                FAQExamplesSimple FormSync ValidationSubmit ValidationAsync ValidationInitializing from StateImmutable JSOlder Versions

Redux Form

Examples

Examples

Below are a list of examples that demonstrate the capabilities of redux-form for testing and learning
              purposes.

Each example is its own standalone web app with hot reloading. To run them locally, clone the
              redux-form repository, cd into an example folder, and run npm install              and npm start. Then open localhost:3030 in your
              browser.

Simple Form

The simplest form. Demonstrates how to attach standard inputs to Redux.

Synchronous Validation

How to add synchronous client-side validation to your form.

Submit Validation

How to return server-side validation errors back from your submit function.

Aynchronous Blur Validation

How to run asynchronous server-side validation on your form when certain fields lose focus.

Initializing From State

How to initialize your form data from any slice of the Redux state.

Immutable JS

How to use Immutable JS for redux-form state storage.

Created by Erik Rasmussen

Got questions? Ask for help:

Follow @erikras
          Follow @ReduxForm


text:
/**
 *	kbaseEditHistory.js
 *
 *  @author nconrad <nconrad@anl.gov>
 *
 *  Object for managing edit history on client.
 *  - Keeps a history of operations that can be fetched with EditHistory.getHistory()
 *  - Keeps a master set of added, removed, and edited that can be fetched with EditHistory.getMaster()
 *  - The master copy is based on IDs.  Ids are assumed to be unique.
 *  - Works on the operations "add", "rm", and "edit", where unique ids are provided
 *
 *  To add an operation, use EditHistory.add(operation), where
 *  - "add" op is of form:
 *    	{op: 'add', ids: ['unique_id', ... ], data: [Object object]}
 *  - "rm" op is of form:
 *    	{op: 'rm', ids: ['unique_id', ... ], data: [Object object]}
 *  - "edit" op is of the following form:
 *      {
 *          op: 'edit',
 *          id: ['unique_id',..]
 *          kind: 'kind_of_edit',
 *          before: 'data before',
 *          after: 'data after',
 *      }
 *
 */

define([], () => {
    function EditHistory() {
        let ops = [];

        // master copy
        const added = {};
        const removed = {};
        const edits = {}; // has form {<id>: {<kind>: {before: <before>, after: <after>}}}

        this.add = function (newOp) {
            ops.push(newOp);

            if (newOp.op === 'add') {
                newOp.ids.forEach((id, i) => {
                    added[id] = newOp.data[i];

                    // remove any removed ids in master
                    if (id in removed) delete removed[id];
                });
            } else if (newOp.op === 'rm') {
                newOp.ids.forEach((id, i) => {
                    removed[id] = newOp.data[i];

                    // remove any edited ids or added ids from master
                    if (id in edits) delete edits[id];
                    if (id in added) delete added[id];
                });
            } else if (newOp.op === 'edit') {
                // for all ids in edit, if edit already exists,
                // replace with latest edit.  if not, add edit.
                newOp.ids.forEach((id) => {
                    if (!(id in edits)) edits[id] = {};

                    // if this type of edit is already there, use same "before" and new "after"
                    if (newOp.kind in edits[id])
                        edits[id][newOp.kind] = {
                            before: edits[id][newOp.kind].before,
                            after: newOp.after,
                        };
                    else edits[id][newOp.kind] = { before: newOp.before, after: newOp.after };

                    // remove any added ids from master
                    if (id in added) delete added[id];
                });
            }
        };

        this.count = function () {
            return ops.length;
        };

        this.getHistory = function () {
            return ops;
        };

        this.clearAll = function () {
            ops = [];
            master = {};
        };

        this.getMaster = function () {
            return {
                added: added,
                removed: removed,
                edits: edits,
            };
        };
    }

    return EditHistory;
});

redpajama_set_name: RedPajamaGithub


text:
spidermod
=========

The original Spidermod for Garry's Mod. I don't know where I found the time to write this. :)


text:
<!DOCTYPE html>
<?php
session_start();
if (@!$_SESSION['nombre']) {
  header("Location:Index.php");
}
?>

<?php

include ("../Funciones/Conexion.php");
$mysqli=inicio();

 ?>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>RCV</title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

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

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <link rel="stylesheet" href="../plugins/jvectormap/jquery-jvectormap-1.2.2.css">

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

  <link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
  <link rel="Shortcut Icon" type="image/x-icon" href="../Img/favicon.ico" />

  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">

      Virtual Clock

        Toggle navigation

             <?php
              echo "
 ".$_SESSION['nombre']."
";
            ?>

 Notificaciones

 Usuarios

 Empresas

Reportes

 Grupos

 Incidencias

Horarios

 Ausencias

 Cerrar Sesión

Bienvenido Incidencias

  Agregar una Incidencia
   Agregar un tipo de Incidencias

          ID	ID Del Usuario	Tipo De Incidencia	Fecha Inicial	Fecha Final	Documento	Función

        <?php

     include("../Funciones/CRDincidencias.php");
?>

    Copyright ©JPRConsulting


text:
A booted ops-manager plus a whole BOATLOAD of other goodies, including:

- Friendly DNS entries brought to you by Route53
- An RDS
- A VPC, with security groups
- A whole mess of s3 buckets (5 in total - for all your storage needs)
- An amazing NAT Box
- SSH/HTTPS/TCP ELBs
- An IAM User

## Looking to setup a different IAAS

We have have other terraform templates to help you!

- [azure](https://github.com/pivotal-cf/terraforming-azure)
- [gcp](https://github.com/pivotal-cf/terraforming-gcp)

This list will be updated when more infrastructures come along.

## Prerequisites

```bash
brew update
brew install terraform
```

### AWS Permissions
- AmazonEC2FullAccess
- AmazonRDSFullAccess
- AmazonRoute53FullAccess
- AmazonS3FullAccess
- AmazonVPCFullAccess
- IAMFullAccess

## Notes

You can choose whether you would like an RDS or not. By default we have
`rds_instance_count` set to `0` but setting it to 1 will deploy an RDS.

RDS instances take FOREVER to deploy, keep that in mind.

### Var File

Copy the stub content below into a file called `terraform.tfvars` and put it in the root of this project.
These vars will be used when you run `terraform  apply`.
You should fill in the stub values with the correct content.

```hcl
env_name = "some-environment-name"
access_key = "access-key-id"
secret_key = "secret-access-key"
region = "us-west-1"
availability_zones = ["us-west-1a", "us-west-1c"]
ops_manager_ami = "ami-4f291f2f"
rds_instance_count = 1
dns_suffix = "example.com"
```

## Variables

- env_name: **(required)** An arbitrary unique name for namespacing resources
- access_key **(required)** Your Amazon access_key, used for deployment
- secret_key: **(required)** Your Amazon secret_key, also used for deployment
- region: **(required)** Region you want to deploy your resources to
- availability_zones: **(required)** List of AZs you want to deploy to
- dns_suffix: **(required)** Domain to add environment subdomain to

## Ops Manager (optional)
- ops_manager: **(default: true)** Set to false if you don't want an Ops Manager
- ops_manager_ami: **(optional)**  Ops Manager AMI, get the right AMI according to your region from the AWS guide downloaded from [Pivotal Network](https://network.pivotal.io/products/ops-manager)
- optional_ops_manager: **(default: false)** Set to true if you want an additional Ops Manager (useful for testing upgrades)
- optional_ops_manager_ami: **(optional)**  Additional Ops Manager AMI, get the right AMI according to your region from the AWS guide downloaded from [Pivotal Network](https://network.pivotal.io/products/ops-manager)
- ops_manager_instance_type: **(default: m4.large)** Ops Manager instance type

## RDS (optional)
- rds_instance_count: **(default: 0)** Whether or not you would like an RDS for your deployment
- rds_instance_class: **(default: db.m4.large)** Size of the RDS to deploy
- rds_db_username: **(default: admin)** Username for RDS authentication

## Isolation Segments (optional)
- create_isoseg_resources *(optional)* Set to 1 to create HTTP load-balancer across 3 zones for isolation segments. If set, the following 2 isoseg variables are also required.
- isoseg_ssl_cert: *(optional)* SSL certificate for HTTP load balancer configuration. Can be either trusted or self-signed.
- isoseg_ssl_cert_private_key:  *(optional)* Private key for above SSL certificate.

## Running

Note: please make sure you have created the `terraform.tfvars` file above as mentioned.

### Standing up environment

```bash
terraform init
terraform apply
```

### Tearing down environment

```bash
terraform destroy
```


text:
function createDragDrop(DragDropSelector, PanelSelector)
{
    // initialization options - validated in typescript
    // jqwidgets.DragDroplOptions has generated TS definition
    let dragDropOptions: jqwidgets.DragDropOptions =
        {
            restricter: 'parent', dropTarget: '.drop-target'
        };
    let panelOptions: jqwidgets.PanelOptions =
        {
            width: 260, height: 330
        };

    // creates an instance
    let myDragDrop: jqwidgets.jqxDragDrop = jqwidgets.createInstance(DragDropSelector, 'jqxDragDrop', dragDropOptions);
    let myPanel: jqwidgets.jqxPanel = jqwidgets.createInstance(PanelSelector, 'jqxPanel', panelOptions);

    myDragDrop.addEventHandler('dragStart', function (event)
    {
        addEvent(event.type, event.args.position);
    });
    myDragDrop.addEventHandler('dragEnd', function (event)
    {
        addEvent(event.type, event.args.position);
    });
    myDragDrop.addEventHandler('dropTargetEnter', function (event)
    {
        addEvent(event.type, event.args.position);
    });
    myDragDrop.addEventHandler('dropTargetLeave', function (event)
    {
        addEvent(event.type, event.args.position);
    });

    function addEvent(type, position)
    {
        position.left = position.left.toString().match(/([^.]+)/);
        position.top = position.top.toString().match(/([^.]+)/);
        position.left[0] === '-0' ? position.left[0] = 0 : position.left[0] = position.left[0];
        position.top[0] === '-0' ? position.top[0] = 0 : position.top[0] = position.top[0];
        myPanel.prepend('
Event: ' + type + ', (' + position.left[0] + ', ' + position.top[0] + ')
');
    }

    (function centerLabels()
    {
        let labels = document.getElementsByClassName('label');
        for (let i = 0; i < labels.length; i++)
        {
            let parentHeight = labels[i].parentElement.offsetHeight;
            let elementheight = labels[i].clientHeight;
            let top = (parentHeight - elementheight) / 2;
            (<HTMLElement>labels[i]).style.top = top + 'px';
        }
    } ());

}


text:
require 'test/unit'

# Optionally load RubyGems.
begin
  require 'rubygems'
rescue LoadError
end

# Mock out what we need from AR::Base.
module ActiveRecord
  class Base
    class << self
      attr_accessor :pluralize_table_names
    end
    self.pluralize_table_names = true
  end
end

# And what we need from ActionView
module ActionView
  module Helpers
    module ActiveRecordHelper; end
    class InstanceTag; end
  end
end

# Must set before requiring generator libs.
if defined?(RAILS_ROOT)
  RAILS_ROOT.replace "#{File.dirname(__FILE__)}/fixtures"
else
  RAILS_ROOT = "#{File.dirname(__FILE__)}/fixtures"
end

$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
require 'rails_generator'

class RailsGeneratorTest < Test::Unit::TestCase
  BUILTINS = %w(controller integration_test mailer migration model observer plugin resource scaffold session_migration)
  CAPITALIZED_BUILTINS = BUILTINS.map { |b| b.capitalize }

  def setup
    ActiveRecord::Base.pluralize_table_names = true
  end

  def test_sources
    expected = [:lib, :vendor,
                :plugins, :plugins, # <plugin>/generators and <plugin>/rails_generators
                :user,
                :RubyGems, :RubyGems, # gems named <x>_generator, gems containing /rails_generator/ folder
                :builtin]
    expected.delete(:RubyGems) unless Object.const_defined?(:Gem)
    assert_equal expected, Rails::Generator::Base.sources.map { |s| s.label }
  end

  def test_lookup_builtins
    (BUILTINS + CAPITALIZED_BUILTINS).each do |name|
      assert_nothing_raised do
        spec = Rails::Generator::Base.lookup(name)
        assert_not_nil spec
        assert_kind_of Rails::Generator::Spec, spec

        klass = spec.klass
        assert klass < Rails::Generator::Base
        assert_equal spec, klass.spec
      end
    end
  end

  def test_autolookup
    assert_nothing_raised { ControllerGenerator }
    assert_nothing_raised { ModelGenerator }
  end

  def test_lookup_missing_generator
    assert_raise(MissingSourceFile) {
      Rails::Generator::Base.lookup('missing_generator').klass
    }
  end

  def test_lookup_missing_class
    spec = nil
    assert_nothing_raised { spec = Rails::Generator::Base.lookup('missing_class') }
    assert_not_nil spec
    assert_kind_of Rails::Generator::Spec, spec
    assert_raise(NameError) { spec.klass }
  end

  def test_generator_usage
    (BUILTINS - ["session_migration"]).each do |name|
      assert_raise(Rails::Generator::UsageError, "Generator '#{name}' should raise an error without arguments") {
        Rails::Generator::Base.instance(name)
      }
    end
  end

  def test_generator_spec
    spec = Rails::Generator::Base.lookup('working')
    assert_equal 'working', spec.name
    assert_equal "#{RAILS_ROOT}/lib/generators/working", spec.path
    assert_equal :lib, spec.source
    assert_nothing_raised { assert_match(/WorkingGenerator$/, spec.klass.name) }
  end

  def test_named_generator_attributes
    g = Rails::Generator::Base.instance('working', %w(admin/foo bar baz))
    assert_equal 'admin/foo', g.name
    assert_equal %w(admin), g.class_path
    assert_equal 'Admin', g.class_nesting
    assert_equal 'Admin::Foo', g.class_name
    assert_equal 'foo', g.singular_name
    assert_equal 'foos', g.plural_name
    assert_equal g.singular_name, g.file_name
    assert_equal "admin_#{g.plural_name}", g.table_name
    assert_equal %w(bar baz), g.args
  end

  def test_named_generator_attributes_without_pluralized
    ActiveRecord::Base.pluralize_table_names = false
    g = Rails::Generator::Base.instance('working', %w(admin/foo bar baz))
    assert_equal "admin_#{g.singular_name}", g.table_name
  end

  def test_session_migration_generator_with_pluralization
    g = Rails::Generator::Base.instance('session_migration')
    assert_equal 'session'.pluralize, g.send(:default_session_table_name)
    ActiveRecord::Base.pluralize_table_names = false
    assert_equal 'session', g.send(:default_session_table_name)
  end

  def test_scaffold_controller_name
    # Default behaviour is use the model name
    g = Rails::Generator::Base.instance('scaffold', %w(Product))
    assert_equal "Products", g.controller_name
  end
end


text:
+++
title = "Best new (to me) fiction of 2016"
original_date = 2016-12-24T10:58:01
path = "posts/2016/12/24/best-new-fiction-of-2016"

[taxonomies]
tags = ["fiction", "books"]
+++

At least as far as my reading went, 2016 wasn't a great year for fiction, but I did have more time for reading fiction
than I've had since I was a grad student and that was my job. This isn't the usual kind of thing I do with this blog,
but here are thirty or so one-or-two-sentence reviews of some of the novels that I read for the first time this year
(sorted roughly in decreasing order of importance they had for me).

<!-- more -->

### [Geek Love](https://www.amazon.com/gp/product/0375713344) by Katherine Dunn (1989)

This book was published in 1989, but somehow I don't remember ever hearing anything about it before this January (if I
had known anything about it I would have read it immediately). Just go read it if you haven't.

### [The Story of a New Name](https://www.amazon.com/gp/product/B00ETSEZDC) by Elena Ferrante (2013)

I went into this series without many expectations (people said it was good, I liked [the covers](http://www.theatlantic.com/entertainment/archive/2016/07/elena-ferrante-covers-bad-no-good/488732/)). I definitely had no
idea that it would be the most compelling fictional portrayal of the excitement and opportunity and frustration of
software development I've ever read.

> The development phases of the programs are really wonderful. The operational phases a little less. The cards often jam
> and break in the sorters. Very often a container in which the cards have just been sorted falls and the cards scatter
> on the floor. But it's great, it's great even then.

This is the third novel in the series, and probably my favorite.

### [The Story of the Lost Child](https://www.amazon.com/gp/product/B00XIYG8WE) by Elena Ferrante (2014)

Lila, near the end of the book:

> One can't go on anymore, she said, electronics seems so clean and yet it dirties, dirties tremendously, and it obliges
> you to leave traces of yourself everywhere as if you were shitting and peeing on yourself continuously: I want to
> leave nothing, my favorite key is the one that deletes.

### [My Brilliant Friend](https://www.amazon.com/gp/product/B008H7KGFC) by Elena Ferrante (2011)

Somehow I read a lot of novels this year about childhood friends who grow up to lead very different lives, but this was
the most confident portrayal of the childhood part.

### [Those Who Leave and Those Who Stay](https://www.amazon.com/gp/product/B00IOE4JQK) by Elena Ferrante (2012)

I found the second novel in the series a little more slow-going than the others, but that was in March—all the stuff
about anti-fascist organization and action would probably feel more relevant now.

### [The Childhood of Jesus](https://www.amazon.com/gp/product/0143125761) by J. M. Coetzee (2013)

While I was a grad student in the English department at the University of Texas at Austin I learned that forty years
earlier Coetzee had also been a grad student in the English department at the University of Texas at Austin. We were
both interested in quantitative methods, but he did stylistic analysis and I mostly worked on literary-historical
projects. Also he finished his Ph.D. in half the time it took me to drop out.

That doesn't have anything to do with this book, which isn't my favorite Coetzee, but is still worth reading before the
sequel comes out in February.

### [The Folding Star](https://www.amazon.com/gp/product/B002STNBVQ) by Alan Hollinghurst (1994)

I read this immediately after _The Stranger's Child_, which I had found kind of disappointing. This old Hollinghurst is
brilliant, though—I don't know how I missed it until this year.

### [Swing Time](https://www.amazon.com/gp/product/1594203989) by Zadie Smith (2016)

This book made me ashamed of the fact that I'd never read any Zadie Smith before (I'm fixing that in 2017).

### [Mr. Splitfoot](https://www.amazon.com/gp/product/B00QPIGTYM) by Samantha Hunt (2016)

This is like if Stephen King had a sense of humor and knew how to write women.

### [The Nix](https://www.amazon.com/gp/product/B01A4B1PEE) by [Nathan Hill](https://twitter.com/nathanreads) (2016)

This book starts with a lot of unfunny, unoriginal satire about MMORPGs and how undergraduate women talk, but on
the whole I'm glad I made it through.

### [The Casual Vacancy](https://www.amazon.com/gp/product/B007THA4FI) by [J.K. Rowling](https://twitter.com/jk_rowling) (2012)

I never read any of the Harry Potter books, and I picked this up after reading Rowling's Cormoran Strike novels, which I
thought were pretty fun. This is far better than the Strike novels, though—it's a really nice balance of mean and funny and humane.

### [All That Man Is](https://www.amazon.com/gp/product/1555977537) by David Szalay (2016)

I usually avoid short story collections, and I didn't know that's what this was when I started it, but I'm
glad I got tricked into reading it (thanks Booker Prize people).

### [In the Light of What We Know](https://www.amazon.com/gp/product/B00HTJBD88) by [Zia Haider Rahman](https://twitter.com/ziahaiderrahman) (2014)

Like a talkier, male-er, thriller-ier _Swing Time_ (but not nearly as good).

### [Luna: New Moon](https://www.amazon.com/gp/product/B00V34YJE0) by Ian McDonald (2015)

For whatever reason I didn't read much sci-fi this year, but this was excellent, and I'm looking forward to the
sequel in March.

### [We Have Always Lived in the Castle](https://www.amazon.com/gp/product/B004SS1MH0) by Shirley Jackson (1962)

Before this year the only Shirley Jackson I'd read was "The Lottery", because of course it was. I picked this up after
reading _Geek Love_ because of some comparison in some review somewhere, and I like it for a lot of the same reasons I
liked _Geek Love_ (although it's much quieter and less entirely fucked up).

### [The Haunting of Hill House](https://www.amazon.com/gp/product/B00INIXLRK) by Shirley Jackson (1959)

I didn't enjoy it as much as _We Have Always Lived in the Castle_ but I still feel like I should have read it years ago.

### [A Gentleman in Moscow](https://www.amazon.com/gp/product/B01COJUEZ0) by [Amor Towles](https://twitter.com/amortowles) (2016)

Because retreating into your own little world of elegant pleasures gets more tempting every day.

### [Eileen](https://www.amazon.com/gp/product/B00OZ0TM32) by Ottessa Moshfegh (2016)

I read this immediately after _A Gentleman in Moscow_ and the non-stop nastiness was a good palate cleanser.

### [The Cuckoo's Calling](https://www.amazon.com/gp/product/B00AA20E5Y) by [Robert Galbraith](https://twitter.com/jk_rowling) (2013)

Together with _The Casual Vacancy_ this has almost convinced me that I need to read Harry Potter.

### [The Essex Serpent](https://www.amazon.com/gp/product/0062666371) by [Sarah Perry](https://twitter.com/SarahGPerry) (2016)

The thing I like about the nineteenth century is all the excitement about finally being done with religion, and this
book does a good job of capturing that.

### [The Loney](https://www.amazon.com/gp/product/B011H55QE6) by Andrew Michael Hurley (2016)

This would be the best gothic horror novel of the year if it weren't for _Mr. Splitfoot_. (It's much better than the
similarly-named and otherwise kind of similar _The Many_, which didn't make my cut but somehow did make the Booker long
list.)

### [His Bloody Project](https://www.amazon.com/gp/product/B01JY0M824) by [Graeme MaCrae Burnet](https://twitter.com/GMacraeBurnet) (2016)

This never really turned into the book I wanted it to be, but I'm not sure it's a bad thing that it stays so small and literal.

### [The Sellout](https://www.amazon.com/gp/product/1250083257) by Paul Beatty (2016)

I don't tend to like books that try this hard to be funny, and I didn't appreciate this one as much as a lot of people seem to, but
it's one of the most surprising books I've read this year, and parts of it are really beautiful.

### [The Long Walk](https://www.amazon.com/gp/product/B018ER7IPK) by Stephen King (1979)

For some reason I read a bunch of old Stephen King books over the summer. I don't know why—I don't like Stephen King that
much. This is the one that stood out—it's small, it's actually kind of disturbing, and it stays sharp all the way through
instead of devolving into sentimental saccharine crap like most King novels.

### [Before the Fall](https://www.amazon.com/gp/product/B0151YQUTE) by Noah Hawley (2016)

I don't know much about the airport thriller genre, which I'm assuming this book falls into (mostly since I've
seen it at airports but not anywhere else), but it was pretty fun.

### [The Stranger's Child](https://www.amazon.com/gp/product/B004JN1CHY) by Alan Hollinghurst (2011)

I love Hollinghurst and I love novels about biographies of authors, but this just didn't work as well as it should have for me.

### [Career of Evil](https://www.amazon.com/gp/product/B0106E2CO6) by [Robert Galbraith](https://twitter.com/jk_rowling) (2015)

Maybe not a terribly good mystery novel but by this point it's just the Strike and Robin show anyway.

### [The Silkworm](https://www.amazon.com/gp/product/B00IJJUIOM) by [Robert Galbraith](https://twitter.com/jk_rowling) (2014)

Quite a bit weaker than the other two Strike novels.

### [The Fireman](https://www.amazon.com/gp/product/B013C5M08O) by Joe Hill (2016)

Kind of silly but there's just enough interesting world-building for it to make the list.

### [Underground Airlines](https://www.amazon.com/gp/product/B017RQP41O) by Ben Winters (2016)

This barely made the cut, but I'm a sucker for alternate histories.


text:
'use strict';

describe('forwardRef', () => {
  let React;
  let ReactFeatureFlags;
  let ReactNoop;
  let Scheduler;

  beforeEach(() => {
    jest.resetModules();
    ReactFeatureFlags = require('shared/ReactFeatureFlags');
    ReactFeatureFlags.debugRenderPhaseSideEffectsForStrictMode = false;
    ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
    React = require('react');
    ReactNoop = require('react-noop-renderer');
    Scheduler = require('scheduler');
  });

  it('should work without a ref to be forwarded', () => {
    class Child extends React.Component {
      render() {
        Scheduler.unstable_yieldValue(this.props.value);
        return null;
      }
    }

    function Wrapper(props) {
      return <Child {...props} ref={props.forwardedRef} />;
    }

    const RefForwardingComponent = React.forwardRef((props, ref) => (
      <Wrapper {...props} forwardedRef={ref} />
    ));

    ReactNoop.render(<RefForwardingComponent value={123} />);
    expect(Scheduler).toFlushAndYield([123]);
  });

  it('should forward a ref for a single child', () => {
    class Child extends React.Component {
      render() {
        Scheduler.unstable_yieldValue(this.props.value);
        return null;
      }
    }

    function Wrapper(props) {
      return <Child {...props} ref={props.forwardedRef} />;
    }

    const RefForwardingComponent = React.forwardRef((props, ref) => (
      <Wrapper {...props} forwardedRef={ref} />
    ));

    const ref = React.createRef();

    ReactNoop.render(<RefForwardingComponent ref={ref} value={123} />);
    expect(Scheduler).toFlushAndYield([123]);
    expect(ref.current instanceof Child).toBe(true);
  });

  it('should forward a ref for multiple children', () => {
    class Child extends React.Component {
      render() {
        Scheduler.unstable_yieldValue(this.props.value);
        return null;
      }
    }

    function Wrapper(props) {
      return <Child {...props} ref={props.forwardedRef} />;
    }

    const RefForwardingComponent = React.forwardRef((props, ref) => (
      <Wrapper {...props} forwardedRef={ref} />
    ));

    const ref = React.createRef();

    ReactNoop.render(

        <RefForwardingComponent ref={ref} value={123} />

,
    );
    expect(Scheduler).toFlushAndYield([123]);
    expect(ref.current instanceof Child).toBe(true);
  });

  it('should maintain child instance and ref through updates', () => {
    class Child extends React.Component {
      constructor(props) {
        super(props);
      }
      render() {
        Scheduler.unstable_yieldValue(this.props.value);
        return null;
      }
    }

    function Wrapper(props) {
      return <Child {...props} ref={props.forwardedRef} />;
    }

    const RefForwardingComponent = React.forwardRef((props, ref) => (
      <Wrapper {...props} forwardedRef={ref} />
    ));

    let setRefCount = 0;
    let ref;

    const setRef = r => {
      setRefCount++;
      ref = r;
    };

    ReactNoop.render(<RefForwardingComponent ref={setRef} value={123} />);
    expect(Scheduler).toFlushAndYield([123]);
    expect(ref instanceof Child).toBe(true);
    expect(setRefCount).toBe(1);
    ReactNoop.render(<RefForwardingComponent ref={setRef} value={456} />);
    expect(Scheduler).toFlushAndYield([456]);
    expect(ref instanceof Child).toBe(true);
    expect(setRefCount).toBe(1);
  });

  it('should not break lifecycle error handling', () => {
    class ErrorBoundary extends React.Component {
      state = {error: null};
      componentDidCatch(error) {
        Scheduler.unstable_yieldValue('ErrorBoundary.componentDidCatch');
        this.setState({error});
      }
      render() {
        if (this.state.error) {
          Scheduler.unstable_yieldValue('ErrorBoundary.render: catch');
          return null;
        }
        Scheduler.unstable_yieldValue('ErrorBoundary.render: try');
        return this.props.children;
      }
    }

    class BadRender extends React.Component {
      render() {
        Scheduler.unstable_yieldValue('BadRender throw');
        throw new Error('oops!');
      }
    }

    function Wrapper(props) {
      Scheduler.unstable_yieldValue('Wrapper');
      return <BadRender {...props} ref={props.forwardedRef} />;
    }

    const RefForwardingComponent = React.forwardRef((props, ref) => (
      <Wrapper {...props} forwardedRef={ref} />
    ));

    const ref = React.createRef();

    ReactNoop.render(
      <ErrorBoundary>
        <RefForwardingComponent ref={ref} />
      </ErrorBoundary>,
    );
    expect(Scheduler).toFlushAndYield([
      'ErrorBoundary.render: try',
      'Wrapper',
      'BadRender throw',

      // React retries one more time
      'ErrorBoundary.render: try',
      'Wrapper',
      'BadRender throw',

      // Errored again on retry. Now handle it.
      'ErrorBoundary.componentDidCatch',
      'ErrorBoundary.render: catch',
    ]);
    expect(ref.current).toBe(null);
  });

  it('should not re-run the render callback on a deep setState', () => {
    let inst;

    class Inner extends React.Component {
      render() {
        Scheduler.unstable_yieldValue('Inner');
        inst = this;
        return
;
      }
    }

    function Middle(props) {
      Scheduler.unstable_yieldValue('Middle');
      return <Inner {...props} />;
    }

    const Forward = React.forwardRef((props, ref) => {
      Scheduler.unstable_yieldValue('Forward');
      return <Middle {...props} forwardedRef={ref} />;
    });

    function App() {
      Scheduler.unstable_yieldValue('App');
      return <Forward />;
    }

    ReactNoop.render(<App />);
    expect(Scheduler).toFlushAndYield(['App', 'Forward', 'Middle', 'Inner']);

    inst.setState({});
    expect(Scheduler).toFlushAndYield(['Inner']);
  });
});


text:
module CelluloidIOPGListener
  module Examples
    class NotifyServerByInheritance < CelluloidIOPGListener::Examples::Client

    end
  end
end


text:
// Note: This automatic widget to dialog window binding (the fact that every field is set up from the widget
// and is committed to the widget) is only possible when the dialog is opened by the Widgets System
// (i.e. the widgetDef.dialog property is set).
// When you are opening the dialog window by yourself, you need to take care of this by yourself too.

CKEDITOR.dialog.add( 'cksqlite', function( editor ) {
	return {
		title: 'Sqlite Query Editor',
		minWidth: 800,
		minHeight: 150,
		contents: [
			{
				id: 'info',
				elements: [
				    {
						id:'functions',
    					type: 'hbox',
   	 					widths: [ '25%', '25%', '50%' ],
    					children: [
        							{
            							type: 'button',
            							id: 'setformat',
            							label: 'Format',
            							onClick: function(){
            								// calculate and reset the Format
            								var widget = this.getDialog().widget;
            								var content = this.getDialog().getContentElement('info','content').getValue();
            								var format = widget.resetFormat(JSON.parse(content));
            								this.getDialog().getContentElement('info','format').setValue(format);
            							}
        							},
        							{
            							type: 'button',
            							id: 'setTemplate',
            							label: 'Template',
            							onClick: function(){
            								// calculate and reset the Format
            								var widget = this.getDialog().widget;
            								var format = this.getDialog().getContentElement('info','format').getValue();
            								var type = this.getDialog().getContentElement('info','type').getValue();
            								var template = widget.resetTemplate(format,type);
            								this.getDialog().getContentElement('info','template').setValue(template);
            							}
        							},
        							{
            							type: 'button',
            							id: 'fun3',
            							label: 'tbd',
        							}
    								]
					},
				    {
						id:'references',
    					type: 'hbox',
   	 					widths: [ '25%', '25%' , '25%' , '25%'],
    					children: [
							{
								id: 'select',
								type: 'text',
								label: 'Rest SQL Url (ArrestDB)',
								width: '250px',
								setup: function( widget ) {
									// save the widget context into the dialog to be able to use widget functions
									// must be in the first elements
									this.getDialog().start=true; // tell it's the dialog boot
									this.getDialog().widget = widget;
									this.setValue( widget.editor.cksqlite[widget.data.name].select );
									var sqlData = widget.getContent();
                   				    this.getDialog().getContentElement('info','content').setValue(JSON.stringify(sqlData));
								},
								commit: function( widget ) {
									// persist into DOM
									widget.setData('refresh',"0");
									widget.setData('refresh',"1");
									widget.editor.cksqlite[widget.data.name].select=this.getValue();
								},
								onChange: function(api){
									if (this.getDialog().start) return;
									var widget = this.getDialog().widget;
									if((widget!=undefined)&&(widget!=null)){
										widget.editor.cksqlite[widget.data.name].select = this.getValue();
										var sqlData = widget.getContent();
                   				    	this.getDialog().getContentElement('info','content').setValue(JSON.stringify(sqlData));
                   				    }
								}
							},
							{
								id: 'name',
								type: 'text',
								label: 'Widget Instance Name',
								width: '250px',
								setup: function( widget ) {
									this.setValue( widget.data.name );
								},
								commit: function( widget ) {
									widget.element.setAttribute('data-name',this.getValue());
									widget.setData( 'name', this.getValue() );
								},
								onChange: function(api){
									var widget = this.getDialog().widget;
									var name = this.getValue();
                    				// if name has changed, links may be broken
                    				// forbid changing name if not new
                    				if (widget.data.name=='new name'){
										// new but ...
                    					// must check it's unique (and cannot rename for now...)
                    					var w = widget.findCksqlite(name);
                    					if((w!=null)&&(w!=widget)){
                    						// name not unique... add an underscore
                    						name = name+"_";
                    						this.getDialog().getContentElement('info','name').setValue(name);
                    					}
                    					// copy all attribute to the new name
                    					var copie = Object.assign({},widget.editor.cksqlite[widget.data.name]);
                    					delete widget.editor.cksqlite[widget.data.name];
                    					widget.editor.cksqlite[name]=copie;
                    					widget.data.name=name;
                    				} else {
                    					if(name != widget.data.name){
                    						this.getDialog().getContentElement('info','name').setValue(widget.data.name);
                    					}
                    				}
								}

							},
							{
								id: 'page',
								type: 'text',
								label: '?limit=',
								width: '75px',
								setup: function( widget ) {
									this.setValue( widget.editor.cksqlite[widget.data.name].page );
								},
								commit: function( widget ) {
									widget.editor.cksqlite[widget.data.name].page=parseInt(this.getValue());
								},
								onChange: function(api){
									if (this.getDialog().start) return;
									var widget = this.getDialog().widget;
									if((widget!=undefined)&&(widget!=null)){
										widget.editor.cksqlite[widget.data.name].page = parseInt(this.getValue());
										// when I change the page size, I need to refresh content
										var sqlData = widget.getContent();
                   				    	this.getDialog().getContentElement('info','content').setValue(JSON.stringify(sqlData));
                   				    }
								}
							},
							{
								id: 'offset',
								type: 'text',
								label: '?offset=',
								width: '75px',
								setup: function( widget ) {
									this.setValue( widget.editor.cksqlite[widget.data.name].offset );
								},
								commit: function( widget ) {
									widget.editor.cksqlite[widget.data.name].offset=parseInt(this.getValue());
								},
								onChange: function(api){
									if (this.getDialog().start) return;
									var widget = this.getDialog().widget;
									if((widget!=undefined)&&(widget!=null)){
										widget.editor.cksqlite[widget.data.name].offset=parseInt(this.getValue());
										// when I change the page size, I need to refresh content
										var sqlData = widget.getContent();
                   				    	this.getDialog().getContentElement('info','content').setValue(JSON.stringify(sqlData));
                   				    }
								}
							},
							{
								id: 'master',
								type: 'select',
								label: 'Master link',
								items:  [["none", "-1"]],
								// When setting up this field, set its value to the "master" value from widget data.
								setup: function( widget ) {
									this.clear();
									this.add("none","-1");
									var options = widget.masterList();
									for(var i=0; i<options.length; i++){
										this.add(options[i][0], options[i][1]);
									}
									this.setValue( widget.editor.cksqlite[widget.data.name].master );
								},
								// When committing (saving) this field, set its value to the widget data.
								commit: function( widget ) {
									widget.editor.cksqlite[widget.data.name].master=this.getValue();
								},
								onChange: function(api){
									// need to recompute content
									// 1- select a table ex: /Orders?limit=2
									// 2- restrict to a field ex: /Orders/CustomerID/VINET
									// 3- select the master link
									// the sample value is replace by the indexed value from the master
									// the column name is the token before the value
									if (this.getDialog().start) { this.getDialog().start=false ; return;}
									var widget = this.getDialog().widget;
									if((widget!=undefined)&&(widget!=null)){
										// if already subscribed, unsubscribe
										if(!!widget.token){
											widget.PubSub.unsubscribe(widget.token);
										}
										// now subscribe to the new master
										var eventb = widget.event.bind(widget);
                   						// token is a widget variable which reference the subscribe token
                   						widget.token = widget.PubSub.subscribe(this.getValue(),eventb);
									    widget.editor.cksqlite[widget.data.name].master=this.getValue();
										var sqlData = widget.getContent();
                   				    	this.getDialog().getContentElement('info','content').setValue(JSON.stringify(sqlData));
									}
								}
							},

					    ]
					},
					{
						id: 'content',
						type: 'textarea',
						label: 'ArrestDB Content',
						'default':'',
						setup: function( widget ) {
						},
						commit: function( widget ) {
							widget.editor.cksqlite[widget.data.name]['content']=this.getValue();
						}
					},
					{
						id: 'format',
						type: 'textarea',
						label: 'Format',
						'default':'',
						setup: function( widget ) {
							this.setValue(widget.editor.cksqlite[widget.data.name].format );
						},
						commit: function( widget ) {
							widget.editor.cksqlite[widget.data.name].format = this.getValue();
						}
					},
					{
						id: 'template',
						type: 'textarea',
						label: 'Template',
						'default':'',
						setup: function( widget ) {
							this.setValue( widget.editor.cksqlite[widget.data.name].template );
						},
						commit: function( widget ) {
							widget.editor.cksqlite[widget.data.name].template=this.getValue();
						},
						onChange: function(api){
							if (this.getDialog().start) return;
							var widget = this.getDialog().widget;
							if((widget==undefined)||(widget==null))return;
							// update widget rendering
							widget.editor.cksqlite[widget.data.name].template=this.getValue();
							widget.refresh();
						}
					},
					{
						id: 'type',
						type: 'radio',
						label: 'Type',
						items: [
							[ 'horizontal', 'horizontal' ],
							[ 'vertical', 'vertical' ],
						],
						'default':'horizontal',
						// When setting up this field, set its value to the "type" value from widget data.
						setup: function( widget ) {
							this.setValue( widget.editor.cksqlite[widget.data.name].type );
						},
						// When committing (saving) this field, set its value to the widget data.
						commit: function( widget ) {
							widget.editor.cksqlite[widget.data.name].type=this.getValue();
						}
					},
					{
						id:'positionning',
    					type: 'hbox',
   	 					widths: [ '50%', '50%' ],
    					children: [
							{
								id: 'align',
								type: 'select',
								label: 'Align',
								items: [
									[ editor.lang.common.notSet, '' ],
									[ editor.lang.common.alignLeft, 'left' ],
									[ editor.lang.common.alignRight, 'right' ],
									[ editor.lang.common.alignCenter, 'center' ]
								],
								// When setting up this field, set its value to the "align" value from widget data.
								// Note: Align values used in the widget need to be the same as those defined in the "items" array above.
								setup: function( widget ) {
								this.setValue( widget.data.align );

								},
								// When committing (saving) this field, set its value to the widget data.
								commit: function( widget ) {
									widget.setData( 'align', this.getValue() );
								}
							},
							{
								id: 'width',
								type: 'text',
								label: 'Width',
								width: '50px',
								setup: function( widget ) {
									this.setValue( widget.data.width );
								},
								commit: function( widget ) {
									widget.setData( 'width', this.getValue() );
								}
							}
					]
					}
				]
			}
		]
	};
} );


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

<title>GNU libgomp: omp_in_parallel</title>

<meta name="description" content="GNU libgomp: omp_in_parallel">
<meta name="keywords" content="GNU libgomp: omp_in_parallel">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Library-Index.html#Library-Index" rel="index" title="Library Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Runtime-Library-Routines.html#Runtime-Library-Routines" rel="up" title="Runtime Library Routines">
<link href="omp_005fin_005ffinal.html#omp_005fin_005ffinal" rel="next" title="omp_in_final">
<link href="omp_005fget_005fthread_005fnum.html#omp_005fget_005fthread_005fnum" rel="prev" title="omp_get_thread_num">

Next: omp_in_final, Previous: omp_get_thread_num, Up: Runtime Library Routines   [Contents][Index]

2.20 omp_in_parallel – Whether a parallel region is active

Description:

This function returns true if currently running in parallel,
false otherwise.  Here, true and false represent
their language-specific counterparts.

C/C++:

Prototype:	int omp_in_parallel(void);

Fortran:

Interface:	logical function omp_in_parallel()

Reference:

OpenMP specification v4.0, Section 3.2.6.


text:
import os
import sys
import tempfile

from bzt import TaurusConfigError
from bzt.modules import ConsolidatingAggregator
from bzt.modules.aggregator import DataPoint, KPISet
from bzt.modules._apiritif import ApiritifNoseExecutor
from bzt.modules._apiritif.executor import ApiritifLoadReader, ApiritifFuncReader
from bzt.utils import EXE_SUFFIX
from tests.unit import RESOURCES_DIR, ExecutorTestCase, EngineEmul

class TestApiritifScriptGeneration(ExecutorTestCase):
    EXECUTOR = ApiritifNoseExecutor

    def obj_prepare(self):
        tmp_exec = sys.executable
        try:
            sys.executable = os.path.join(RESOURCES_DIR, "python-pip", 'python-pip' + EXE_SUFFIX)
            self.obj.prepare()
        finally:
            sys.executable = tmp_exec

    def test_transactions(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": [
                        "url_0",
                        {"transaction": "t_1", "do": [
                            "url_1.0",
                            {"url": "url_1.1", "headers": {"o": "ne", "t": "wo"}}]},
                        {"transaction": "t_2", "do": [
                            {"url": "url_2.0", "think-time": 2},
                            {"transaction": "t_22", "do": [
                                {"url": "url_22.0", "think-time": 3}]}]}]}}]})
        self.obj_prepare()

        exp_file = RESOURCES_DIR + "apiritif/test_transactions.py"
        self.assertFilesEqual(exp_file, self.obj.script, python_files=True)

    def test_keepalive_only(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "keepalive": True,
                    "requests": [
                        "http://blazedemo.com/"]}}]})
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("target = apiritif.http.target('')", test_script)

    def test_keepalive(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "keepalive": False,
                    "requests": [
                        "/",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("target.keep_alive(False)", test_script)

    def test_nfc(self):
        # nose flow control: setup/teardown + graceful
        self.obj.engine.config.load([RESOURCES_DIR + 'apiritif/test_nfc.yml'])
        self.configure(self.obj.engine.config['execution'][0])
        self.obj.settings['verbose'] = True
        self.obj_prepare()
        exp_file = RESOURCES_DIR + 'apiritif/test_nfc.py'
        content = open(self.obj.script).read()
        self.assertFilesEqual(exp_file, self.obj.script, python_files=True)

    def test_timeout_default(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertNotIn("timeout=30.0", test_script)

    def test_timeout(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "timeout": "10s",
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/?tag=1",
                        {
                            "url": "/?tag=2",
                            "timeout": "2s",
                        }
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("target.timeout(10.0)", test_script)
        self.assertNotIn("get('/?tag=1', timeout=10.0", test_script)
        self.assertIn("get('/?tag=2', timeout=2.0", test_script)

    def test_timeout_notarget(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "timeout": "10s",
                    "requests": [
                        "http://blazedemo.com/",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("get('http://blazedemo.com/', timeout=10.0", test_script)

    def test_think_time(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        {
                            "url": "/?tag=2",
                            "think-time": "1s500ms",
                        }
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("sleep(1.5)", test_script)

    def test_methods(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        {"url": "/?tag=get",
                         "method": "GET"},
                        {"url": "/?tag=post",
                         "method": "POST"},
                        {"url": "/?tag=put",
                         "method": "PUT"},
                        {"url": "/?tag=patch",
                         "method": "PATCH"},
                        {"url": "/?tag=head",
                         "method": "HEAD"},
                        {"url": "/?tag=delete",
                         "method": "DELETE"},
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("get('/?tag=get'", test_script)
        self.assertIn("post('/?tag=post'", test_script)
        self.assertIn("put('/?tag=put'", test_script)
        self.assertIn("patch('/?tag=patch'", test_script)
        self.assertIn("head('/?tag=head'", test_script)
        self.assertIn("delete('/?tag=delete'", test_script)

    def test_default_address_path_prefix(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "https://a.blazemeter.com",
                    "base-path": "/api/latest",
                    "requests": [
                        "/user",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("target('https://a.blazemeter.com')", test_script)
        self.assertIn("target.base_path('/api/latest')", test_script)

    def test_headers(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "headers": {"X-Foo": "foo"},
                    "requests": [{
                        "url": "/",
                        "headers": {"X-Bar": "bar"}
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("'X-Foo': 'foo'", test_script)
        self.assertIn("'X-Bar': 'bar'", test_script)

    def test_follow_redirects_default(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("target.allow_redirects(True)", test_script)
        self.assertNotIn("allow_redirects=True", test_script)

    def test_follow_redirects(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "follow-redirects": False,
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("allow_redirects=False", test_script)

    def test_body_params(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "body": {
                            "foo": "bar",
                        },
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("params={'foo': 'bar'}", test_script)

    def test_body_json(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "headers": {
                            "Content-Type": "application/json",
                        },
                        "body": {
                            "foo": "bar",
                        },
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("json={'foo': 'bar'}", test_script)

    def test_body_string(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "body": "MY PERFECT BODY"
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("data='MY PERFECT BODY'", test_script)

    def test_body_unknown(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "body": 123
                    }]
                }
            }]
        })
        self.assertRaises(TaurusConfigError, self.obj_prepare)

    def test_plain_assertions(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "assert": [
                            "Welcome", "Simple Travel Agency"
                        ]
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("response.assert_regex_in_body('Welcome')", test_script)
        self.assertIn("response.assert_regex_in_body('Simple Travel Agency')", test_script)

    def test_plain_assertion_kinds(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [{
                        "url": "/",
                        "assert": [
                            {"contains": ["1"], "regexp": False, "not": False},
                            {"contains": ["2"], "regexp": False, "not": True},
                            {"contains": ["3"], "regexp": True, "not": False},
                            {"contains": ["4"], "regexp": True, "not": True},
                            {"contains": ["5"], "regexp": False, "not": False, "subject": "headers"},
                            {"contains": ["6"], "regexp": False, "not": True, "subject": "headers"},
                            {"contains": ["7"], "regexp": True, "not": False, "subject": "headers"},
                            {"contains": ["8"], "regexp": True, "not": True, "subject": "headers"},
                            {"contains": ["8"], "regexp": True, "not": True, "subject": "headers"},
                            {"contains": ["9"], "not": False, "subject": "http-code"},
                            {"contains": ["10"], "not": True, "subject": "http-code"},
                        ]
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("assert_in_body('1')", test_script)
        self.assertIn("assert_not_in_body('2')", test_script)
        self.assertIn("assert_regex_in_body('3')", test_script)
        self.assertIn("assert_regex_not_in_body('4')", test_script)
        self.assertIn("assert_in_headers('5')", test_script)
        self.assertIn("assert_not_in_headers('6')", test_script)
        self.assertIn("assert_regex_in_headers('7')", test_script)
        self.assertIn("assert_regex_not_in_headers('8')", test_script)
        self.assertIn("assert_status_code('9')", test_script)
        self.assertIn("assert_not_status_code('10')", test_script)

    def test_jsonpath_assertions(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "https://api.github.com",
                    "requests": [{
                        "url": "/",
                        "assert-jsonpath": [
                            "$.foo.bar"
                        ]
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("assert_jsonpath('$.foo.bar', expected_value=None)", test_script)

    def test_jsonpath_assertions_kinds(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "https://api.github.com",
                    "requests": [{
                        "url": "/",
                        "assert-jsonpath": [
                            {"jsonpath": "$.1", "invert": False},
                            {"jsonpath": "$.2", "invert": True},
                            {"jsonpath": "$.3", "expected-value": "value"},
                        ]
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("assert_jsonpath('$.1', expected_value=None)", test_script)
        self.assertIn("assert_not_jsonpath('$.2', expected_value=None)", test_script)
        self.assertIn("assert_jsonpath('$.3', expected_value='value')", test_script)

    def test_xpath_assertions(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "https://api.github.com",
                    "requests": [{
                        "url": "/",
                        "assert-xpath": [
                            "//head/title"
                        ]
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("assert_xpath('//head/title', parser_type='html', validate=False)", test_script)

    def test_xpath_assertions_kinds(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "https://api.github.com",
                    "requests": [{
                        "url": "/",
                        "assert-xpath": [
                            {"xpath": "//1", "invert": False},
                            {"xpath": "//2", "invert": True},
                            {"xpath": "//3", "validate-xml": True},
                            {"xpath": "//4", "validate-xml": False, "use-tolerant-parser": False},
                        ]
                    }]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("assert_xpath('//1', parser_type='html', validate=False)", test_script)
        self.assertIn("assert_not_xpath('//2', parser_type='html', validate=False)", test_script)
        self.assertIn("assert_xpath('//3', parser_type='html', validate=True)", test_script)
        self.assertIn("assert_xpath('//4', parser_type='xml', validate=False)", test_script)

    def test_complex_codegen(self):
        """ This test serves code review purposes, to make changes more visible """
        self.obj.engine.config.load([RESOURCES_DIR + 'apiritif/test_codegen.yml'])
        self.configure(self.obj.engine.config['execution'][0])
        self.obj.settings['verbose'] = True
        self.obj_prepare()
        exp_file = RESOURCES_DIR + 'apiritif/test_codegen.py'
        # import shutil; shutil.copy2(self.obj.script, exp_file)  # keep this comment to ease updates
        self.assertFilesEqual(exp_file, self.obj.script, python_files=True)

    def test_jmeter_functions_time(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/?time=${__time()}",
                        "/?time=${__time(MM/dd/yy)}",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("'/?time={}'.format(apiritif.format_date())", test_script)
        self.assertIn("'/?time={}'.format(apiritif.format_date('MM/dd/yy'))", test_script)

    def test_jmeter_functions_random(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/?random=${__Random(1, 10)}",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("'/?random={}'.format(apiritif.random_uniform(1, 10))", test_script)

    def test_jmeter_functions_random_string(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/?rs=${__RandomString(3)}",
                        "/?rs=${__RandomString(4,abcdef)}",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("'/?rs={}'.format(apiritif.random_string(3))", test_script)
        self.assertIn("'/?rs={}'.format(apiritif.random_string(4, 'abcdef'))", test_script)

    def test_jmeter_functions_base64_encode(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "headers": {
                        "Authorization": "Basic ${__base64Encode(user:pass)}",
                    },
                    "requests": [
                        "/",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("base64_encode('user:pass')", test_script)

    def test_jmeter_functions_base64_decode(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "headers": {
                        "Additional": "${__base64Decode(dGVzdCBzdHJpbmc=)}",
                    },
                    "requests": [
                        "/",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("base64_decode('dGVzdCBzdHJpbmc=')", test_script)

    def test_jmeter_functions_urlencode(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/${__urlencode(Foo Bar Baz)}",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("encode_url('Foo Bar Baz')", test_script)

    def test_jmeter_functions_uuid(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "requests": [
                        "/${__UUID()}",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("uuid()", test_script)

    def test_load_reader(self):
        reader = ApiritifLoadReader(self.obj.log)
        reader.engine = EngineEmul()

        # add empty reader
        with tempfile.NamedTemporaryFile() as f_name:
            reader.register_file(f_name.name)
            items = list(reader.datapoints(True))

        self.assertEqual(len(items), 0)
        self.assertFalse(reader.read_records)
        reader.register_file(RESOURCES_DIR + "jmeter/jtl/tranctl.jtl")
        items = list(reader.datapoints(True))
        self.assertEqual(len(items), 1)
        items = list(reader.datapoints(True))
        self.assertEqual(len(items), 0)
        reader.register_file(RESOURCES_DIR + "jmeter/jtl/tranctl.jtl")
        reader.register_file(RESOURCES_DIR + "jmeter/jtl/tranctl.jtl")
        items = list(reader.datapoints(True))
        self.assertTrue(reader.read_records)
        self.assertEqual(len(items), 1)

    def test_load_reader_real2(self):
        reader1 = ApiritifLoadReader(self.obj.log)
        reader1.engine = EngineEmul()
        reader1.register_file(RESOURCES_DIR + "jmeter/jtl/apiritif-results/apiritif-0.csv")
        reader1.register_file(RESOURCES_DIR + "jmeter/jtl/apiritif-results/apiritif-1.csv")

        reader2 = ApiritifLoadReader(self.obj.log)
        reader2.engine = EngineEmul()
        reader2.register_file(RESOURCES_DIR + "jmeter/jtl/apiritif-results/apiritif--10.csv")
        reader2.register_file(RESOURCES_DIR + "jmeter/jtl/apiritif-results/apiritif--11.csv")

        reader = ConsolidatingAggregator()
        reader.engine = EngineEmul()
        reader.add_underling(reader1)
        reader.add_underling(reader2)

        items = list(reader.datapoints())
        self.assertEqual(39, len(items))
        self.assertEqual(4, items[-1][DataPoint.CURRENT][''][KPISet.CONCURRENCY])

    def test_func_reader(self):
        reader = ApiritifFuncReader(self.obj.engine, self.obj.log)
        items = list(reader.read())
        self.assertEqual(len(items), 0)
        reader.register_file(RESOURCES_DIR + "apiritif/transactions.ldjson")
        reader.register_file(RESOURCES_DIR + "apiritif/transactions.ldjson")
        items = list(reader.read())
        self.assertEqual(len(items), 18)

    def test_data_sources(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "variables": {"cn": "cv"},
                    "default-address": "http://localhost:8000/",
                    "requests": ["${an}", "${bn}", "${cn}"],
                    "data-sources": [
                        "first-file.csv", {
                            "path": "/second/file.csv",
                            "delimiter": "-",
                            "loop": True,
                            "quoted": False,
                            "variable-names": "bn, bbn"}]}}]})

        self.obj_prepare()
        exp_file = RESOURCES_DIR + "/apiritif/test_data_sources.py"
        self.assertFilesEqual(exp_file, self.obj.script, python_files=True)

    def test_vars(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "variables": {"an": "av"},
                    "default-address": "http://localhost:8000/",
                    "requests": [
                        "${an}",
                        {"set-variables": {
                            "an": "another_path1",
                            "bn": "another_path2"}},
                        "${an}"],
                }}]})

        self.obj.engine.aggregator = ConsolidatingAggregator()
        self.obj_prepare()
        exp_file = RESOURCES_DIR + "/apiritif/test_vars.py"
        self.assertIn("set_variables", self.obj.engine.aggregator.ignored_labels)
        self.assertFilesEqual(exp_file, self.obj.script, python_files=True)

    def test_codegen_requests(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": [{
                        "url": "http://localhost:8000/",
                        "label": "apiritif",
                    }]
                }
            }]
        })
        self.obj_prepare()
        exp_file = RESOURCES_DIR + "/apiritif/test_codegen_requests.py"
        self.assertFilesEqual(exp_file, self.obj.script, python_files=True)

    def test_numeric_label(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": [{
                        "url": "http://localhost:8000/",
                        "label": 123}]}}]})
        self.obj_prepare()
        with open(self.obj.script) as script:
            content = script.read()

        self.assertIn("123", content)

    def test_generator_crash(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "default-address": "http://blazedemo.com",
                    "variables": {
                        "product_id": "5b6c",
                    },
                    "requests": [{
                        "url": "/",
                        "method": "POST",
                        "body": {
                            "product": "${product_id}"  # notice the space
                        }
                    }]
                }
            }]
        })
        self.obj_prepare()  # Unparser shouldn't crash with AttributeError because of malformed AST
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("data=[('product', self.vars['product_id'])]", test_script)

    def test_inherit_test_case(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": [
                        "http://example.com/",
                    ]
                }
            }]
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.obj.log.info(test_script)
        self.assertIn("class TestAPI(unittest.TestCase", test_script)

    def test_unknown_action(self):
        self.configure({
            'execution': [{
                'executor': 'selenium',
                'scenario': 'sample'
            }],
            'scenarios': {
                'sample': {
                    'requests': [{
                        'url': 'http://blazedemo.com',
                        'actions': ['definitelyUnknownAction(unknownSelector)']
                    }]
                }
            },
            'modules': {
                'apiritif': {
                    'ignore-unknown-actions': True
                }
            }
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertNotIn("definitelyUnknownAction(unknownSelector)", test_script)

    def test_set_variables(self):
        self.configure({
            'execution': [{
                'executor': 'selenium',
                'scenario': 'sample'
            }],
            'scenarios': {
                'sample': {
                    'variables': {
                        'var1': 'val1'
                    },
                    'requests': [{
                        'transaction': 'second',
                        'do': [
                            'http://blazedemo.com/',
                            'http://blazedemo.com/receive/${var1}',
                            {'set-variables': {'var1': 'val2'}},
                        ]
                    }]
                }
            }
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("'var1': 'val1'", test_script)
        self.assertIn("self.vars['var1'] = 'val2'", test_script)

    def test_include_scenario(self):
        self.configure({
            "execution": [{
                "executor": "apiritif",
                "scenario": "simple"
            }],
            "scenarios": {
                "simple": {
                    "requests": [{
                        "url": "http://blazedemo.com/"
                    }, {
                        "include-scenario": "inner"
                    }]
                },
                "inner": {
                    "requests": [{
                        "url": "http://blazedemo.com/vacation.html"
                    }]
                }
            }
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("http://blazedemo.com/vacation.html", test_script)

    def test_double_include(self):
        self.configure({
            "execution": [{
                "executor": "apiritif",
                "scenario": "simple"
            }],
            "scenarios": {
                "simple": {
                    "requests": [{
                        "include-scenario": "inner"
                    }]
                },
                "inner": {
                    "requests": [{
                        "url": "http://blazedemo.com/"
                    }, {
                        "include-scenario": "inner2"
                    }]
                },
                "inner2": {
                    "requests": [{
                        "url": "http://blazedemo.com/vacation.html"
                    }]
                }
            }
        })
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("http://blazedemo.com/", test_script)
        self.assertIn("http://blazedemo.com/vacation.html", test_script)

    def test_delimiter_tab(self):
        """
        Check if 'tab' is converted to '\t' ('\\t' when read from .py file)
        """
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": ["http://blazedemo.com/"],
                    "data-sources": [{
                        "path": "file.csv",
                        "delimiter": "tab",
                        "loop": True}]}}]})

        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("reader_1 = apiritif.CSVReaderPerThread('file.csv', loop=True, delimiter='\\t')", test_script)

    def test_encoding(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": ["http://blazedemo.com/"],
                    "data-sources": [{
                        "path": "file.csv",
                        "encoding": "UTF-16"}]}}]})

        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("reader_1 = apiritif.CSVReaderPerThread('file.csv', loop=True, encoding='UTF-16')", test_script)

    def test_cert_pass(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": ["http://blazedemo.com/"],
                    "certificate": "certificate_file.pem",
                    "passphrase": "certificate-passphrase"}}]})
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("cert=('certificate_file.pem', 'certificate-passphrase'))", test_script)

    def test_cert_no_pass(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": ["http://blazedemo.com/"],
                    "certificate": "certificate_file.pem"}}]})
        self.obj_prepare()
        with open(self.obj.script) as fds:
            test_script = fds.read()
        self.assertIn("cert=('certificate_file.pem', None)", test_script)

    def test_no_cert_pass(self):
        self.configure({
            "execution": [{
                "test-mode": "apiritif",
                "scenario": {
                    "requests": ["http://blazedemo.com/"],
                    "passphrase": "certificate-passphrase"}}]})
        self.sniff_log(self.obj.log)
        self.obj_prepare()
        warnings = self.log_recorder.warn_buff.getvalue()
        self.assertIn("Passphrase was found, but certificate is missing!", warnings)


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace VsChromium.Core.Win32 {
  public struct ComPtr<T> : IDisposable  where T : class {
    private T ptr;

    public ComPtr(T ptr) {
      Debug.Assert(ptr == null || Marshal.IsComObject(ptr));
      this.ptr = ptr;
    }

    public T Ptr { get { return ptr; } }

    public void Dispose() {
      if (ptr != null)
        Marshal.ReleaseComObject(ptr);

      ptr = null;
    }

    public T Detach() {
      T result = ptr;
      ptr = null;
      return result;
    }
  }

  public static class ComPtr {
    public static ComPtr<T> Create<T>(T ptr) where T : class {
      return new ComPtr<T>(ptr);
    }
  }
}


text:
.tabs-x .tab-content > .tab-pane {
    display: none;
}

.tabs-x .nav-link.disabled {
    cursor: not-allowed;
}

.tabs-x .tab-content > .active {
    display: block;
}

.tabs-x  .nav-tabs {
    display: flex;
}

.tabs-left .nav-tabs, .tabs-right .nav-tabs, .tabs-left .tab-content, .tabs-right .tab-content {
    height: 100%;
}

.tab-align-center .nav-tabs {
    justify-content: center;
}

.tab-align-right .nav-tabs {
    justify-content: flex-end;
}

.tab-align-right .nav-tabs .nav-item:last-child {
    margin-right: -2px;
}

.tab-height-xs .tab-content {
    height: 135px !important;
    overflow: auto;
}

.tab-height-sm .tab-content {
    height: 195px !important;
    overflow: auto;
}

.tab-height-md .tab-content {
    height: 280px !important;
    overflow: auto;
}

.tab-height-lg .tab-content {
    height: 400px !important;
    overflow: auto;
}

.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
    border-bottom: none;
}

.tabs-below > .nav-tabs {
    border-top: 1px solid #ddd;
}

.tabs-below .nav-tabs .nav-link {
    border-radius: 0 0 4px 4px;
    margin-top: -1px;
}

.tabs-below .nav-tabs .nav-link.active {
    border-color: #fff #ddd #ddd;
}
.tabs-left > .nav-tabs .nav-item,
.tabs-right > .nav-tabs .nav-item {
    float: none;
    margin: 0;
    padding: 0;
    width: 100%;
}
.tabs-left > .nav-tabs {
    float: left;
    margin-right: 19px;
    border-right: 1px solid #ddd;
}

.tabs-left > .nav-tabs .nav-link {
    margin-right: -1px;
    border-radius: 4px 0 0 4px;
}

.tabs-left > .nav-tabs .nav-link.active {
    border-color: #ddd #fff #ddd #ddd;
}

.tabs-right > .nav-tabs {
    float: right;
    border-left: 1px solid #ddd;
}

.tabs-right > .nav-tabs .nav-link {
    margin-left: -1px;
    border-radius: 0 4px 4px 0;
}

.tabs-right > .nav-tabs .nav-link.active {
    border-color: #ddd #ddd #ddd #fff;
}

.tab-content {
    padding: 10px;
}

.tabs-above.tab-bordered .tab-content {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.tabs-below.tab-bordered .tab-content {
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.tabs-left .nav-tabs, .tabs-right .nav-tabs, .tabs-left .tab-content, .tabs-right .tab-content {
    height: 100%;
}

.tabs-left .tab-content {
    border: none;
    border-left: 1px solid #ddd;
}

.tabs-right .tab-content {
    border: none;
    border-right: 1px solid #ddd;
}

.tabs-left.tab-bordered .tab-content {
    border: 1px solid #ddd;
    border-radius: 0 4px 4px 0;
}

.tabs-left.tab-bordered .tab-content .tab-pane, .tabs-right.tab-bordered .tab-content .tab-pane {
    margin-left: 0;
}

.tabs-left .nav-tabs, .tabs-right .nav-tabs {
    margin-left: 0;
    margin-right: 0;
}

.tabs-right.tab-bordered .tab-content {
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.kv-tab-loading {
    background-image: url('../img/loading.gif');
    background-position: right 2px center;
    background-repeat: no-repeat;
    z-index: 15000;
    cursor: wait;
    opacity: 0.6;
}

/**
 * sideways tabs
 */
.tab-sideways .nav-tabs {
    margin-top: 51px;
    border: none;
    position: relative;
}

.tab-sideways .nav-tabs .nav-link {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    border-radius: 4px 4px 0px 0px;
    border-bottom-color: transparent;
}

.tab-sideways .nav-tabs .nav-link.active {
    border: 1px solid #ddd;
    border-bottom: 1px solid #fff;
}

.tabs-right.tab-sideways .nav-tabs .nav-item {
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    transform: rotate(90deg);
}

.tabs-left.tab-sideways .nav-tabs .nav-item {
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    -o-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

/**
 * krajee tabs style
 * for left & right positioned tabs
 */
.tabs-krajee.tabs-left .nav-tabs, .tabs-krajee.tabs-right .nav-tabs {
    width: 130px;
}

.tabs-krajee.tabs-left .tab-content {
    margin-left: 129px;
}

.tabs-krajee.tabs-right .tab-content {
    margin-right: 129px;
}

.tabs-krajee.tab-sideways .nav-tabs .nav-item {
    height: 20px;
    width: 120px;
    margin-bottom: 101px;
}

.tabs-krajee.tabs-left.tab-sideways .nav-tabs {
    left: -50px;
    margin-right: -75px;
}

.tabs-krajee.tabs-right.tab-sideways .nav-tabs {
    right: -60px;
    margin-left: -70px;
}

.tabs-krajee.tabs-right.tab-sideways .nav-tabs .dropdown-menu {
    margin-left: 110px!important;
}

.tabs-krajee.tabs-left.tab-sideways .tab-content {
    margin-left: 41px;
}

.tabs-krajee.tabs-right.tab-sideways .tab-content {
    margin-right: 41px;
}

.tabs-krajee.tabs-left.tab-sideways .nav-tabs .dropdown-menu {
    margin-top: -79px;
}

/* Need to fix tab right sideways dropdown menu left position */
.tabs-krajee.tabs-right.tab-sideways .nav-tabs .dropdown-menu {
    margin-top: -80px;
}


text:
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>

<!--

Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University).  All
Rights Reserved.  This program is distributed under the W3C's Software
Intellectual Property License.  This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

See W3C License http://www.w3.org/Consortium/Legal/ for more details.

-->

<!DOCTYPE test SYSTEM "dom3.dtd">
<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="documentsetdocumenturi02">
<metadata>
<title>documentsetdocumenturi02</title>
<creator>IBM</creator>
<description>
	The setDocmentURI method set the location of the document.

	Set the documentURI to null and retreive the documentURI of this document and verify
	if it is was set to null.
</description>
<contributor>Neil Delima</contributor>
<date qualifier="created">2002-06-10</date>
<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-documentURI"/>
</metadata>
<var name="doc" type="Document"/>
<var name="docURI" type="DOMString"/>
<var name="nullValue" type="DOMString" isNull="true"/>
<load var="doc" href="hc_staff" willBeModified="true"/>
<documentURI obj="doc" value="nullValue"/>
<documentURI var="docURI" obj="doc" />
<assertNull actual="docURI" id="documentsetdocumenturi02"/>
</test>


text:
An Android application to be used for a psychophysics study at WINLAB. More details about the project and study can be found at http://sites.google.com/site/psychophysicsapp.

# Running the application

To edit and build the application, download the main file and move it to the /src/ directory in an Android Studio project.

# Running the server

Before running the server, install the packages by running the following command:
```javascript
npm install
```
Commands:
```javascript
node faye_server.js
```
Running this line will start the server and allow clients to connect.
```javascript
node faye_publish.js start
```
Running this line will publish "start" and bring the connected clients into the experiment.
```javascript
node faye_publish.js switch
```
Running this line will publish "switch" and prompt the users to rate the current video segment.
```javascript
node faye_publish.js count
```
Running this line will publish "count" and display how many clients are currently connected.
```javascript
node faye_dataorg.js
```
Running this line at the end of the experiment will organize and display all of the clients' input.

# References

[Faye](https://github.com/faye/faye) - server that PsychophysicsApplicationAndroid connects to
[FayeAndroid](https://github.com/elirex/android-faye-client) - client that PsychophysicsApplicationAndroid implements
[FayeSwift](https://github.com/hamin/FayeSwift) - implementation of Faye server utilized in the sample files

# License

This project is licensed under the MIT License.


text:
<?php

namespace Octower\Deploy\SharedGenerator;

use Symfony\Component\Filesystem\Filesystem;

class DistFileGenerator implements GeneratorInterface
{
    public function __construct()
    {

    }

    public function generate(Filesystem $filesystem, $projectRoot, $sharedPath, $path)
    {
        $distFile = $projectRoot . DIRECTORY_SEPARATOR . $path . '.dist';

        if (!file_exists($distFile)) {
            throw new \Exception(sprintf('dist file does not exists to generate shared file %s', $path));
        }

        $filesystem->copy($distFile, $sharedPath);
    }

    public function update(Filesystem $filesystem, $projectRoot, $sharedPath, $path)
    {
        // TODO: Implement update() method.
    }
}


text:
(function (ng, undefined) {
    'use strict';
    ng.module('smart-table')
        .controller('stTableController', ['$scope', '$parse', '$filter', '$attrs', function StTableController($scope, $parse, $filter, $attrs) {
            var propertyName = $attrs.stTable;
            var displayGetter = $parse(propertyName);
            var displaySetter = displayGetter.assign;
            var safeGetter;
            var orderBy = $filter('orderBy');
            var filter = $filter('filter');
            var safeCopy = copyRefs(displayGetter($scope));
            var tableState = {
                sort: {},
                search: {},
                pagination: {
                    start: 0
                }
            };
            var pipeAfterSafeCopy = true;
            var ctrl = this;

            function copyRefs(src) {
                return [].concat(src);
            }

            function updateSafeCopy() {
                safeCopy = copyRefs(safeGetter($scope));
                if (pipeAfterSafeCopy === true) {
                    ctrl.pipe();
                }
            }

            if ($attrs.stSafeSrc) {
                safeGetter = $parse($attrs.stSafeSrc);
                $scope.$watch(function () {
                    var safeSrc = safeGetter($scope);
                    return safeSrc ? safeSrc.length : 0;

                }, function (newValue, oldValue) {
                    if (newValue !== oldValue) {
                        updateSafeCopy()
                    }
                });
                $scope.$watch(function () {
                    return safeGetter($scope);
                }, function (newValue, oldValue) {
                    if (newValue !== oldValue) {
                        updateSafeCopy();
                    }
                });
            }

            /**
             * sort the rows
             * @param predicate function or string which will be used as predicate for the sorting
             * @param [optional] reverse if you want to reverse the order
             */
            this.sortBy = function sortBy(predicate, reverse) {
                tableState.sort.predicate = predicate;
                tableState.sort.reverse = reverse === true;
                tableState.pagination.start = 0;
                this.pipe();
            };

            /**
             * search matching rows
             * @param input the input string
             * @param predicate [optional] the property name against you want to check the match, otherwise it will search on all properties
             */
            this.search = function search(input, predicate) {
                var predicateObject = tableState.search.predicateObject || {};
                var prop = predicate ? predicate : '$';
                predicateObject[prop] = input;
                tableState.search.predicateObject = predicateObject;
                tableState.pagination.start = 0;
                this.pipe();
            };

            /**
             * this will chain the operations of sorting and filtering based on the current table state (sort options, filtering, ect)
             */
            this.pipe = function pipe() {
                var filtered = tableState.search.predicateObject ? filter(safeCopy, tableState.search.predicateObject) : safeCopy;
                filtered = orderBy(filtered, tableState.sort.predicate, tableState.sort.reverse);
                if (tableState.pagination.number !== undefined) {
                    tableState.pagination.numberOfPages = filtered.length > 0 ? Math.ceil(filtered.length / tableState.pagination.number) : 1;
                    filtered = filtered.slice(tableState.pagination.start, tableState.pagination.start + tableState.pagination.number);
                }
                displaySetter($scope, filtered);
            };

            /**
             * select a dataRow (it will add the attribute isSelected to the row object)
             * @param row the row to select
             * @param mode "single" or "multiple"
             */
            this.select = function select(row, mode) {
                var rows = displayGetter($scope);
                var index = rows.indexOf(row);
                if (index !== -1) {
                    if (mode === 'single') {
                        ng.forEach(displayGetter($scope), function (value, key) {
                            value.isSelected = key === index ? !value.isSelected : false;
                        });
                    } else {
                        rows[index].isSelected = !rows[index].isSelected;
                    }
                }
            };

            /**
             * take a slice of the current sorted/filtered collection (pagination)
             *
             * @param start index of the slice
             * @param number the number of item in the slice
             */
            this.slice = function splice(start, number) {
                tableState.pagination.start = start;
                tableState.pagination.number = number;
                this.pipe();
            };

            /**
             * return the current state of the table
             * @returns {{sort: {}, search: {}, pagination: {start: number}}}
             */
            this.tableState = function getTableState() {
                return tableState;
            };

            /**
             * Use a different filter function than the angular FilterFilter
             * @param filterName the name under which the custom filter is registered
             */
            this.setFilterFunction = function setFilterFunction(filterName) {
                filter = $filter(filterName);
            };

            /**
             *User a different function than the angular orderBy
             * @param sortFunctionName the name under which the custom order function is registered
             */
            this.setSortFunction = function setSortFunction(sortFunctionName) {
                orderBy = $filter(sortFunctionName);
            };

            /**
             * Usually when the safe copy is updated the pipe function is called.
             * Calling this method will prevent it, which is something required when using a custom pipe function
             */
            this.preventPipeOnWatch = function preventPipe() {
                pipeAfterSafeCopy = false;
            };
        }])
        .directive('stTable', function () {
            return {
                restrict: 'A',
                controller: 'stTableController',
                link: function (scope, element, attr, ctrl) {
                }
            };
        });
})(angular);


text:
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Internal Server Error" %}{% endblock %}
{% block content %}

{% trans "Internal Server Error" %}

{% trans "Something has gone horribly wrong!" %}

{% endblock %}