text:
#include "core.h"
#include "operation.h"
#include "flags.h"
#include "register_file.h"
#include "memory.h"

#include <fstream>

using namespace std;

/*
 * Constructor of the functional simulator core.
 * Creates architectural structures.
 */
Core::Core()
{
    this->memory = new MemoryModel( 1024);
    this->rf = new RegisterFileModel( 32, 2); // 32 16-bit registers
    this->flags = new Flags();
    this->disasmPrint = false;
}

/*
 * Initialize the functional simulator.
 * Sets up start PC address.
 */
void Core::init( hostUInt16 start_pc)
{
    this->pc = start_pc;
    this->flags->init();
    this->stop = false;
    warning("Init. Start PC: 0x%X",start_pc);
}

/*
 * Run the functional simulator
 */

hostUInt64 Core::run( hostUInt64 requested)

{
    //number of steps the core has made
    hostUInt64 steps=0;

    /*
     * Infinite loop ("while (1)") should be here.
     * To avoid assert interruption ("break") should be realized in the assembler.
     * As there isn't any "return" instruction in the assembler at the moment,
     * check for "zero" instruction will be held.
     */
    while ( steps < requested )
    {
        Operation* op;

        /* Read instruction */
        MemVal* mem_value ( (MemVal*) new ByteLine( memory->read32(this->GetPC()), HIGH_FIRST));

        /* check for "zero" instruction */
        /* if (!mem_value->getHostUInt32())
        {
            break;
        } */

        op = new Operation( this);

        //cout << memory->read32(this->GetPC()) << endl;

        /* Decode the operation */
        op->decode( mem_value);

        //op->encode();

        /* Execute operation */
        op->execute();

        /* Disassembling */
        if ( disasmPrint )
        {
            op->dump();
        }

        delete( op);

        /* Add 4 bytes (32 bits) to access next instruction */
        this->pc = this->pc + 4;

        steps++;

        /* Check if it is necessary to stop instruction execution */
        if ( GetStop())
        {
            break;
        }
    }

    warning("Number of steps executed: %d", steps);
    return steps;
}

/*
 * Load instructions to the memory from the stream (file)
 */
int Core::loadBinary( ifstream& input)
{
    hostUInt32 buffer;
    for ( mathAddr addr = this->pc; !input.eof(); addr += 4)
    {
        buffer = 0;
        input.read( (char*) &buffer, 4);
        if (buffer)
        {
            this->memory->write32(addr, buffer );
        }
    }
    return 1;
}


text:
<!DOCTYPE html>

<title>Canvas test: 2d.imageData.get.source.negative</title>

<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">

2d.imageData.get.source.negative

getImageData() works with negative width and height, and returns top-to-bottom left-to-right

Actual output:

<canvas id="c" class="output" width="100" height="50">
FAIL (fallback content)
</canvas>

redpajama_set_name: RedPajamaGithub


text:
require 'syslog/logger'

module Spontaneous::Publishing::Progress
  class Syslog < Silent

    include LoggerOutput

    def initialize(program_name = 'spontaneous-publishing', facility = ::Syslog::LOG_LOCAL0)
      super()
      require 'syslog/logger'
      @logger = ::Syslog::Logger.new(program_name, facility)
    end
  end
end


text:
class PringlesPrice < ApplicationRecord
  default_scope { order('created_at DESC') }

  def css_style
    return "background-color:#00539f;border-color:#00539f" if supermarket == "Tesco"
    return "background-color:#78be20;border-color:#78be20" if supermarket == "Asda"
  end

  def self.tesco
    return PringlesPrice.where(supermarket: "Tesco")
  end

  def self.asda
    return PringlesPrice.where(supermarket: "Asda")
  end

  def self.winner
    tesco = PringlesPrice.tesco.first
    asda = PringlesPrice.asda.first
    if tesco and asda
      if tesco.price_inc_offer < asda.price_inc_offer
        return tesco
      elsif tesco.price_inc_offer > asda.price_inc_offer
        return asda
      else
        return asda
      end
    end
  end

  def self.get_tesco_pringles

    url = "https://dev.tescolabs.com/grocery/products/?query=pringles%20vinegar&offset=0&limit=5"
    begin
      response = RestClient.get url, { "Ocp-Apim-Subscription-Key": Rails.application.secrets.tesco_api_key }
    rescue => e
      logger.info "Tesco pringles search problem: " + e.message
      return
    end
    return if response.code != 200

    json = JSON.parse response.body
    if json["uk"]["ghs"]["products"]["results"].size > 0
      p = json["uk"]["ghs"]["products"]["results"][0]
      price = PringlesPrice.new
      price.supermarket = "Tesco"
      price.price = p["price"]
      price.offer = p["PromotionDescription"]
      price.price_inc_offer = parse_tesco_offer p
      return price
    else
      logger.info "Tesco pringles missing: " + e.message
      return nil
    end
  end

  def self.get_asda_pringles
    url = "https://api-groceries.asda.com/api/items/view?itemid=910003061998"

    begin
      response = RestClient.get url
    rescue => e
      logger.info "Asda pringles search problem: " + e.message
      return
    end

    return if response.code != 200
    json = JSON.parse response.body
    if json["items"].size > 0
      p = json["items"][0]
      price = PringlesPrice.new
      price.supermarket = "Asda"
      price.price = p["price"].gsub(/[^\d^\.]/, '').to_f
      price.offer = p["promoDetailFull"]
      price.price_inc_offer = parse_asda_offer p
      return price
    else
      return nil
    end
  end

  def self.parse_tesco_offer p
    if p["PromotionDescription"] == "Any 2 for £3.00"
      return 1.50
    elsif p["PromotionDescription"] == "Buy 1 Get 1 FREE Cheapest Product..."
      return p["price"] / 2
    end
    return p["price"]
  end

  def self.parse_asda_offer p
    return p["price"].gsub(/[^\d^\.]/, '').to_f
  end

  def self.update
    return if PringlesPrice.where("created_at > ?", Date.today).count > 0
    asda = get_asda_pringles
    asda.save if asda
    tesco = get_tesco_pringles
    tesco.save if tesco
  end

end


text:
#ifndef __XFS_IOMAP_H__
#define __XFS_IOMAP_H__

#define IOMAP_DADDR_NULL ((xfs_daddr_t) (-1LL))

typedef enum {				/* iomap_flags values */
	IOMAP_READ =		0,	/* mapping for a read */
	IOMAP_EOF =		0x01,	/* mapping contains EOF   */
	IOMAP_HOLE =		0x02,	/* mapping covers a hole  */
	IOMAP_DELAY =		0x04,	/* mapping covers delalloc region  */
	IOMAP_REALTIME =	0x10,	/* mapping on the realtime device  */
	IOMAP_UNWRITTEN =	0x20,	/* mapping covers allocated */
					/* but uninitialized file data  */
	IOMAP_NEW =		0x40	/* just allocate */
} iomap_flags_t;

typedef enum {
	/* base extent manipulation calls */
	BMAPI_READ = (1 << 0),		/* read extents */
	BMAPI_WRITE = (1 << 1),		/* create extents */
	BMAPI_ALLOCATE = (1 << 2),	/* delayed allocate to real extents */
	BMAPI_UNWRITTEN  = (1 << 3),	/* unwritten extents to real extents */
	/* modifiers */
	BMAPI_IGNSTATE = (1 << 4),	/* ignore unwritten state on read */
	BMAPI_DIRECT = (1 << 5),	/* direct instead of buffered write */
	BMAPI_MMAP = (1 << 6),		/* allocate for mmap write */
	BMAPI_SYNC = (1 << 7),		/* sync write to flush delalloc space */
	BMAPI_TRYLOCK = (1 << 8),	/* non-blocking request */
	BMAPI_DEVICE = (1 << 9),	/* we only want to know the device */
} bmapi_flags_t;

/*
 * xfs_iomap_t:  File system I/O map
 *
 * The iomap_bn field is expressed in 512-byte blocks, and is where the
 * mapping starts on disk.
 *
 * The iomap_offset, iomap_bsize and iomap_delta fields are in bytes.
 * iomap_offset is the offset of the mapping in the file itself.
 * iomap_bsize is the size of the mapping,  iomap_delta is the
 * desired data's offset into the mapping, given the offset supplied
 * to the file I/O map routine.
 *
 * When a request is made to read beyond the logical end of the object,
 * iomap_size may be set to 0, but iomap_offset and iomap_length should be set
 * to the actual amount of underlying storage that has been allocated, if any.
 */

typedef struct xfs_iomap {
	xfs_daddr_t		iomap_bn;	/* first 512b blk of mapping */
	xfs_buftarg_t		*iomap_target;
	xfs_off_t		iomap_offset;	/* offset of mapping, bytes */
	xfs_off_t		iomap_bsize;	/* size of mapping, bytes */
	xfs_off_t		iomap_delta;	/* offset into mapping, bytes */
	iomap_flags_t		iomap_flags;
} xfs_iomap_t;

struct xfs_iocore;
struct xfs_inode;
struct xfs_bmbt_irec;

extern int xfs_iomap(struct xfs_iocore *, xfs_off_t, ssize_t, int,
		     struct xfs_iomap *, int *);
extern int xfs_iomap_write_direct(struct xfs_inode *, xfs_off_t, size_t,
				  int, struct xfs_bmbt_irec *, int *, int);
extern int xfs_iomap_write_delay(struct xfs_inode *, xfs_off_t, size_t, int,
				 struct xfs_bmbt_irec *, int *);
extern int xfs_iomap_write_allocate(struct xfs_inode *, xfs_off_t, size_t,
				struct xfs_bmbt_irec *, int *);
extern int xfs_iomap_write_unwritten(struct xfs_inode *, xfs_off_t, size_t);

#endif /* __XFS_IOMAP_H__*/


text:
import {default as fetch} from 'node-fetch';
import execa from 'execa';
import {fetchToCurl} from '../helper';
import {Context} from '../index';
import {Rule} from '../rule';

const CMD_DUMP_SXG = `dump-signedexchange`;
const CMD_DUMP_SXG_ARGS = [`-verify`, `-json`];

function compare(expected: {[k: string]: boolean | string | number}, actual: typeof expected) {
  return Object.keys(expected).reduce((acc, k) => {
    if (typeof actual[k] === 'undefined') {
      acc[k] = `expected: [${expected[k]}], actual: property missing`;
      return acc;
    } else if (expected[k] !== actual[k]) {
      acc[k] = `expected: [${expected[k]}], actual: [${actual[k]}]`;
      return acc;
    } else {
      return acc;
    }
  }, {} as {[k: string]: string});
}

async function urlHasContentType(url: string, headers: Context['headers'], contentType: string) {
  const res = await fetch(url, {headers});
  if (!res.ok) {
    return false;
  }
  return res.headers.get('content-type') === contentType;
}

const REQUEST_HEADERS = {
  'accept': 'application/signed-exchange;v=b3',
  'amp-cache-transform': `google;v="1"`,
};
const EXPECTED_VERSION = '1b3';
const SECONDS_IN_A_DAY = 24 * 60 * 60;

export class SxgDumpSignedExchangeVerify extends Rule {
  async run({url, headers}: Context) {
    const opt = {
      headers: {
        ...REQUEST_HEADERS,
        ...headers,
      },
    };
    const res = await fetch(url, opt);
    const hdr = res.headers.get('content-type') || '';
    if (hdr.indexOf('application/signed-exchange') === -1) {
      return this.fail(
        `response is not [content-type: application/signed-exchange] [debug: ${fetchToCurl(
          url,
          opt
        )}]`
      );
    }
    const body = await res.buffer();
    const debug = `[debug: ${fetchToCurl(
      url,
      opt,
      false
    )} | ${CMD_DUMP_SXG} ${CMD_DUMP_SXG_ARGS.join(' ')}]`;
    let sxg;
    try {
      sxg = await execa(CMD_DUMP_SXG, CMD_DUMP_SXG_ARGS, {input: body}).then((spawn) => {
        const stdout = JSON.parse(spawn.stdout);
        return {
          isValid: stdout.Valid,
          version: stdout.Version,
          uri: stdout.RequestURI,
          status: stdout.ResponseStatus,
          signatures: stdout.Signatures,
        };
      });
    } catch (e) {
      return this.warn(`couldn't execute [${CMD_DUMP_SXG}] (not installed? not in PATH?)`);
    }

    const expected = {
      isValid: true,
      version: EXPECTED_VERSION,
      uri: url,
      status: 200,
    };
    const diff = compare(expected, sxg);
    if (Object.keys(diff).length !== 0) {
      return this.fail(`[${url}] is not valid [${JSON.stringify(diff)}] [${debug}]`);
    }

    const certUrl = sxg.signatures[0]['Params']['cert-url'] as string;
    if (!certUrl) {
      return this.fail(`Can't find valid [cert-url] [${JSON.stringify(sxg)}]`);
    }
    if (!(await urlHasContentType(certUrl, headers, 'application/cert-chain+cbor'))) {
      return this.fail(`cert-url [${certUrl}] is not found or has wrong content type`);
    }

    const validityUrl = sxg.signatures[0]['Params']['validity-url'] as string;
    if (!validityUrl) {
      return this.fail(`Can't find valid [cert-url] [${JSON.stringify(sxg)}]`);
    }
    if (!(await urlHasContentType(validityUrl, headers, 'application/cbor'))) {
      return this.fail(`validity-url [${validityUrl}] is not found or has wrong content type`);
    }

    const expires = sxg.signatures[0]['Params']['expires'] as number;
    if (7 * SECONDS_IN_A_DAY + Date.now() / 1000 < expires) {
      return this.fail(
        `the signed content expires more than 7 days into the future [at ${new Date(
          expires * 1000
        )}] [${debug}]`
      );
    }

    return this.pass();
  }
  meta() {
    return {
      url: '',
      title: `verification by ${CMD_DUMP_SXG} tool`,
      info: '',
    };
  }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>BitRaffle</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Organize raffle/lottery games based on the Bitcoin blockchain.">
  <link rel="canonical" href="http://bitraffle.info/">

  <link rel="shortcut icon" href="/favicon.ico" />
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />

  <meta property="og:image" content="/bitraffle.png" />
  <meta property="og:title" content="BitRaffle" />
  <meta property="og:description" content="BitRaffle is a free service that lets you organize raffle/lottery games, the ticket drawing is based on the Bitcoin blockchain and anybody can verify the result." />

  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">

 BitRaffle

Organize raffle/lottery games based on the Bitcoin blockchain.

        Ticket will drawn at block
          ( left)

The total amount gathered is

Error

Calculating winner...

Winning transaction is !

With ticket

Follow up winners:

        <form class="form-horizontal" role="form" onsubmit="return false;">

            Buy tickets

              <input type="number" class="form-control" id="tickets" value="1" min="1">

                one free every  tickets

            Price per ticket

            Total

            Number of tickets

1

        </form>

Tickets bought

            Transaction ID
            Paid
            n. of tickets

How it works?

The organizer specifies their Bitcoin address, the ticket price and the block height that the ticket draw to happens.

Each participant sends funds to the provided address and their ticket(s) hash is calculated with the following formula:

sha256(transactionHash + targetBlockHash + nonce)

Where nonce is increased for the amount of tickets bought. The person with the lowest hash value wins.

A Bitcoin block is very difficult to generate and the resulting hash is unpredictable we can safely
      assume that it is impossible to cheat. Yet because the results are derived from a public ledger, they can be
      verified independently.

The software runs in the browser and it is open source.

If you like this software, consider supporting me: 1Nn7SdKxqvxPZNYa7rpSiK2qxYr34457jY

      <form id="create-raffle" class="form-horizontal" role="form">

Create your own...

          Title

            <input required="required" type="text" class="form-control" id="title" name="title" placeholder="My lottery">
            The title of the game

          Target block

            <input required="required" type="number" min="0" class="form-control" id="block" name="block" placeholder="300000">
            The block height the ticket draw happens

          Address

            <input required="required" type="text" class="form-control" id="address" name="address" placeholder="1yourSuperCoolVanityAddress1111111">
            The organizer's Bitcoin address. Use an empty address

          Ticket price

            <input required="required" type="number" min="0.001" class="form-control" id="ticket" name="ticket" placeholder="0.01" step="0.001">
            The ticket price in

          Gift every

            <input required="required" type="number" min="0" class="form-control" id="gift" name="gift" placeholder="5">
            Give a free ticket every specified amount of tickets (0 for none)

          Max winners

            <input required="required" type="number" min="1" class="form-control" id="winners" name="winners" placeholder="1">
            How many winners there will be

            <button type="submit" class="btn btn-create">Create</button>

      </form>

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

The MIT License (MIT)

Copyright (c) 2014 Giannis Dzegoutanis

            Permission is hereby granted, free of charge, to any person obtaining a copy
            of this software and associated documentation files (the "Software"), to deal
            in the Software without restriction, including without limitation the rights
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
            copies of the Software, and to permit persons to whom the Software is
            furnished to do so, subject to the following conditions:

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

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

      © 2014 Giannis Dzegoutanis.
      Uses APIs from blockr.io.
      Read the terms of use here.


text:
package CXGN::Stock::AddStocks;

=head1 NAME

########## DEPRECATED ####################
# Please use CXGN::Stock::Accession->store. This new object inherits store procedure from CXGN::Stock, and adds complete passport info in store.
##########################################

CXGN::Stock::AddStocks - a module to add a list of stocks.

=head1 USAGE

 my $stock_add = CXGN::Stock::AddStocks->new({ schema => $schema, phenome_schema => $phenome_schema, dbh => $dbh, stocks => \@stocks, species => $species_name, owner_name => $owner_name } );
 my $validated_stocks = $stock_add->validate_stocks(); #is true when none of the stock names in the array exist in the database.
 my $validated_owner = $stock_add->validate_owner(); #is true when the owner exists in the database.
 my $validated_organism = $stock_add->validate_organism(); #is true when the organism name exists in the database.
 $stock_add->add_accessions();

=head1 DESCRIPTION

Adds an array of stocks. The stock names must not already exist in the database, and the verify function does this check.   This module is intended to be used in independent loading scripts and interactive dialogs.  Stock types "accession" and "plot" are supported by the methods add_accessions() and add_plots().

=head1 AUTHORS

 Jeremy D. Edwards (jde22@cornell.edu)

=cut

use Moose;
use MooseX::FollowPBP;
use Moose::Util::TypeConstraints;
use Try::Tiny;
use CXGN::People::Person;
use SGN::Model::Cvterm;

has 'schema' => (
		 is       => 'rw',
		 isa      => 'DBIx::Class::Schema',
		 lazy_build => 1,
		 predicate => 'has_schema',
		);
has 'stocks' => (isa => 'ArrayRef', is => 'rw', predicate => 'has_stocks');
has 'species' => (isa => 'Str', is => 'rw', predicate => 'has_species');
has 'owner_name' => (isa => 'Str', is => 'rw', predicate => 'has_owner_name',required => 1,);
has 'organization_name' => (isa => 'Str', is => 'rw', predicate => 'has_organization_name',required => 0);
has 'population_name' => (isa => 'Str', is => 'rw', predicate => 'has_population_name');
has 'dbh' => (is  => 'rw',predicate => 'has_dbh', required => 1,);
has 'phenome_schema' => (
		 is       => 'rw',
		 isa      => 'DBIx::Class::Schema',
		 predicate => 'has_phenome_schema',
		 required => 1,
		);

sub add_accessions {
  my $self = shift;
  my $added = $self->_add_stocks('accession');
  return $added;
}

sub add_plots {
  my $self = shift;
  my $added = $self->_add_stocks('plot');
  return $added;
}

#### Jeremy Edwards needs the ability to create accession groups
sub add_population {
  my $self = shift;
  my $added = $self->_add_stocks('population');
  return $added;
}
####

sub _add_stocks {
  my $self = shift;
  my $stock_type = shift;
  if (!$self->validate_stocks()) {
    return;
  }
  my $schema = $self->get_schema();
  my $species = $self->get_species();
  my $stocks_rs = $self->get_stocks();
  my @stocks = @$stocks_rs;
  my @added_stock_ids;
  my @added_stocks;
  my $phenome_schema = $self->get_phenome_schema();

  my $organism = $schema->resultset("Organism::Organism")
    ->find({
	    species => $species,
	   } );
  my $organism_id = $organism->organism_id();

  #lookup user by name
  my $owner_name = $self->get_owner_name();;
  my $dbh = $self->get_dbh();
  my $owner_sp_person_id = CXGN::People::Person->get_person_by_username($dbh, $owner_name); #add person id as an option.

  my $coderef = sub {

    my $stock_cvterm = SGN::Model::Cvterm->get_cvterm_row($schema, $stock_type,'stock_type');

    my $population_cvterm = SGN::Model::Cvterm->get_cvterm_row($schema, 'population','stock_type');

    my $population_member_cvterm =  SGN::Model::Cvterm->get_cvterm_row($schema, 'member_of','stock_relationship');

    #### assign accessions to populations
    my $population;
    if ($self->has_population_name()) {
        $population = $schema->resultset("Stock::Stock")
            ->find_or_create({
                uniquename => $self->get_population_name(),
                name => $self->get_population_name(),
                organism_id => $organism_id,
                type_id => $population_cvterm->cvterm_id(),
                   });
        if (!$population){
            print STDERR "Could not find population $population\n";
            return;
        }
    }
    ####

    foreach my $stock_name (@stocks) {
      my $stock = $schema->resultset("Stock::Stock")
	->create({
		  organism_id => $organism_id,
		  name       => $stock_name,
		  uniquename => $stock_name,
		  type_id     => $stock_cvterm->cvterm_id,
		 } );
      if ($population) {
          $stock->find_or_create_related('stock_relationship_objects', {
	      type_id => $population_member_cvterm->cvterm_id(),
	      object_id => $population->stock_id(),
	      subject_id => $stock->stock_id(),
					 } );
      }
	  if ($self->has_organization_name && $self->get_organization_name){
		  my $org_stockprop = SGN::Model::Cvterm->get_cvterm_row($schema, 'organization', 'stock_property')->name();
		  my $organization = $stock->create_stockprops({ $org_stockprop => $self->get_organization_name});
	  }
      push (@added_stock_ids,  $stock->stock_id());
      push @added_stocks, [$stock->stock_id, $stock_name];
    }
  };

  my $transaction_error;
  try {
    $schema->txn_do($coderef);
  } catch {
    $transaction_error =  $_;
  };
  if ($transaction_error) {
    print STDERR "Transaction error storing stocks: $transaction_error\n";
    return;
  }

  foreach my $stock_id (@added_stock_ids) {
    #add the owner for this stock
    $phenome_schema->resultset("StockOwner")
      ->find_or_create({
			stock_id     => $stock_id,
			sp_person_id =>  $owner_sp_person_id,
		       });
  }

  return \@added_stocks;
}

sub validate_stocks {
  my $self = shift;
  if (!$self->has_schema() || !$self->has_species() || !$self->has_stocks()) {
    return;
  }
  my $schema = $self->get_schema();
  my $species = $self->get_species();
  my $stocks_rs = $self->get_stocks();
  my @stocks = @$stocks_rs;

  my $name_conflicts = 0;
  foreach my $stock_name (@stocks) {
    my $stock_search = $schema->resultset("Stock::Stock")
      ->search({
		uniquename => $stock_name,
	       } );
    if ($stock_search->first()) {
      $name_conflicts++;
      print STDERR "Stock name conflict for: $stock_name\n";
    }
  }

  if ($name_conflicts > 0) {
    print STDERR "There were $name_conflicts conflict(s)\n";
    return;
  }

  return 1;
}

sub validate_organism {
  my $self = shift;
  if (!$self->has_schema() || !$self->has_species() || !$self->has_stocks()) {
    return;
  }
  my $schema = $self->get_schema();
  my $species = $self->get_species();
  my $organism = $schema->resultset("Organism::Organism")
    ->find({
	    species => $species,
	   } );
  if ($organism->organism_id()) {
      return 1;
  }
  return;
}

sub validate_owner {
  my $self = shift;
  if (!$self->has_schema() || !$self->has_species() || !$self->has_stocks()) {
    return;
  }
  my $schema = $self->get_schema();
  my $phenome_schema = $self->get_phenome_schema();
  my $owner_name = $self->get_owner_name();;
  my $dbh = $self->get_dbh();
  my $owner_sp_person_id = CXGN::People::Person->get_person_by_username($dbh, $owner_name);
  my $owner_search = $phenome_schema->resultset("StockOwner")
    ->find({
	sp_person_id =>  $owner_sp_person_id,
	   });
  if ($owner_search) {
      return 1;
  }
  return;
}

####  Check that accession group exists
sub validate_population {
  my $self = shift;
  if (!$self->has_schema() || !$self->has_species() || !$self->has_stocks()) {
    return;
  }
  my $schema = $self->get_schema();
  my $population_cvterm = SGN::Model::Cvterm->get_cvterm_row($schema, 'population',  'stock_type');
  my $population_search = $schema->resultset("Stock::Stock")
      ->search({
	  uniquename => $self->get_population_name(),
	  type_id => $population_cvterm->cvterm_id(),
	       } );
    if ($population_search->first()) {
	return 1;
    }
  return;
}

#######
1;
#######


text:
use std::iter::FromIterator;

use cargo::core::Workspace;
use cargo::ops::{self, MessageFormat, Packages};
use cargo::util::{CliResult, CliError, Config, CargoErrorKind};
use cargo::util::important_paths::{find_root_manifest_for_wd};

#[derive(Deserialize)]
pub struct Options {
    flag_bin: Option<String>,
    flag_example: Option<String>,
    flag_package: Option<String>,
    flag_jobs: Option<u32>,
    flag_features: Vec<String>,
    flag_all_features: bool,
    flag_no_default_features: bool,
    flag_target: Option<String>,
    flag_manifest_path: Option<String>,
    flag_verbose: u32,
    flag_quiet: Option<bool>,
    flag_color: Option<String>,
    flag_message_format: MessageFormat,
    flag_release: bool,
    flag_frozen: bool,
    flag_locked: bool,
    arg_args: Vec<String>,
    #[serde(rename = "flag_Z")]
    flag_z: Vec<String>,
}

pub const USAGE: &'static str = "
Run the main binary of the local package (src/main.rs)

Usage:
    cargo run [options] [--] [<args>...]

Options:
    -h, --help                   Print this message
    --bin NAME                   Name of the bin target to run
    --example NAME               Name of the example target to run
    -p SPEC, --package SPEC      Package with the target to run
    -j N, --jobs N               Number of parallel jobs, defaults to # of CPUs
    --release                    Build artifacts in release mode, with optimizations
    --features FEATURES          Space-separated list of features to also build
    --all-features               Build all available features
    --no-default-features        Do not build the `default` feature
    --target TRIPLE              Build for the target triple
    --manifest-path PATH         Path to the manifest to execute
    -v, --verbose ...            Use verbose output (-vv very verbose/build.rs output)
    -q, --quiet                  No output printed to stdout
    --color WHEN                 Coloring: auto, always, never
    --message-format FMT         Error format: human, json [default: human]
    --frozen                     Require Cargo.lock and cache are up to date
    --locked                     Require Cargo.lock is up to date
    -Z FLAG ...                  Unstable (nightly-only) flags to Cargo

If neither `--bin` nor `--example` are given, then if the project only has one
bin target it will be run. Otherwise `--bin` specifies the bin target to run,
and `--example` specifies the example target to run. At most one of `--bin` or
`--example` can be provided.

All of the trailing arguments are passed to the binary to run. If you're passing
arguments to both Cargo and the binary, the ones after `--` go to the binary,
the ones before go to Cargo.
";

pub fn execute(options: Options, config: &mut Config) -> CliResult {
    config.configure(options.flag_verbose,
                     options.flag_quiet,
                     &options.flag_color,
                     options.flag_frozen,
                     options.flag_locked,
                     &options.flag_z)?;

    let root = find_root_manifest_for_wd(options.flag_manifest_path, config.cwd())?;

    let (mut examples, mut bins) = (Vec::new(), Vec::new());
    if let Some(s) = options.flag_bin {
        bins.push(s);
    }
    if let Some(s) = options.flag_example {
        examples.push(s);
    }

    let packages = Vec::from_iter(options.flag_package.iter().cloned());
    let spec = Packages::Packages(&packages);

    let compile_opts = ops::CompileOptions {
        config: config,
        jobs: options.flag_jobs,
        target: options.flag_target.as_ref().map(|t| &t[..]),
        features: &options.flag_features,
        all_features: options.flag_all_features,
        no_default_features: options.flag_no_default_features,
        spec: spec,
        release: options.flag_release,
        mode: ops::CompileMode::Build,
        filter: if examples.is_empty() && bins.is_empty() {
            ops::CompileFilter::Default { required_features_filterable: false, }
        } else {
            ops::CompileFilter::new(false,
                                    &bins, false,
                                    &[], false,
                                    &examples, false,
                                    &[], false,
                                    false)
        },
        message_format: options.flag_message_format,
        target_rustdoc_args: None,
        target_rustc_args: None,
    };

    let ws = Workspace::new(&root, config)?;
    match ops::run(&ws, &compile_opts, &options.arg_args)? {
        None => Ok(()),
        Some(err) => {
            // If we never actually spawned the process then that sounds pretty
            // bad and we always want to forward that up.
            let exit = match err.exit {
                Some(exit) => exit,
                None => return Err(
                    CliError::new(CargoErrorKind::ProcessErrorKind(err).into(), 101)),
            };

            // If `-q` was passed then we suppress extra error information about
            // a failed process, we assume the process itself printed out enough
            // information about why it failed so we don't do so as well
            let exit_code = exit.code().unwrap_or(101);
            Err(if options.flag_quiet == Some(true) {
                CliError::code(exit_code)
            } else {
                CliError::new(CargoErrorKind::ProcessErrorKind(err).into(), exit_code)
            })
        }
    }
}


text:
from flask import Flask
from flask import request
import requests

app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def home():
        headers = {"Authorization": "Bearer 4SMf3bbEWuzD8tGxM7Kg9LQr4RZY7xpEPgbHde5AKGFd63CHvNajtDN3PoACybLLqce1dwa9kld2ketBUpqwvZZG41SqPXw7Mtnr",
        "User-Agent": "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2",
        "Host": "api.connector.mbed.com",
        "Accept": "*/*"
        }

        s = requests.get("https://api.connector.mbed.com/endpoints/",headers = headers)
        return str(s.request.headers) + str(s.headers) + str(s.text)

@app.route('/signin', methods=['GET'])
def signin_form():
    return '''<form action="/signin" method="post">

<input name="username">

<input name="password" type="password">

<button type="submit">Sign In</button>

              </form>'''

@app.route('/signin', methods=['POST'])
def signin():
    if request.form['username']=='admin' and request.form['password']=='password':
        return '
Hello, admin!
'
    return '
Bad username or password.
'

app.run()


text:
import isSealed from 'core-js-pure/es/object/is-sealed';

QUnit.test('Object.isSealed', assert => {
  assert.isFunction(isSealed);
  assert.arity(isSealed, 1);
  const primitives = [42, 'string', false, null, undefined];
  for (const value of primitives) {
    assert.notThrows(() => isSealed(value) || true, `accept ${ value }`);
    assert.true(isSealed(value), `returns true on ${ value }`);
  }
  assert.false(isSealed({}));
});


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

import java.util.Arrays;
import java.util.List;

import org.flowable.engine.common.api.FlowableException;
import org.flowable.engine.common.api.FlowableIllegalArgumentException;
import org.flowable.engine.delegate.VariableScope;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.impl.persistence.entity.TaskEntity;

/**
 * @author Tom Baeyens
 * @author Joram Barrez
 */
public class VariableScopeResolver implements Resolver {

  protected ProcessEngineConfigurationImpl processEngineConfiguration;
  protected VariableScope variableScope;

  protected String variableScopeKey = "execution";

  protected static final String processEngineConfigurationKey = "processEngineConfiguration";
  protected static final String runtimeServiceKey = "runtimeService";
  protected static final String taskServiceKey = "taskService";
  protected static final String repositoryServiceKey = "repositoryService";
  protected static final String managementServiceKey = "managementService";
  protected static final String historyServiceKey = "historyService";
  protected static final String formServiceKey = "formService";
  protected static final String identityServiceKey = "identityServiceKey";

  protected static final List<String> KEYS = Arrays.asList(
      processEngineConfigurationKey, runtimeServiceKey, taskServiceKey,
      repositoryServiceKey, managementServiceKey, historyServiceKey, formServiceKey, identityServiceKey);

  public VariableScopeResolver(ProcessEngineConfigurationImpl processEngineConfiguration, VariableScope variableScope) {

    this.processEngineConfiguration = processEngineConfiguration;

    if (variableScope == null) {
      throw new FlowableIllegalArgumentException("variableScope cannot be null");
    }
    if (variableScope instanceof ExecutionEntity) {
      variableScopeKey = "execution";
    } else if (variableScope instanceof TaskEntity) {
      variableScopeKey = "task";
    } else {
      throw new FlowableException("unsupported variable scope type: " + variableScope.getClass().getName());
    }
    this.variableScope = variableScope;
  }

  public boolean containsKey(Object key) {
    return variableScopeKey.equals(key) || KEYS.contains(key)|| variableScope.hasVariable((String) key);
  }

  public Object get(Object key) {
    if (variableScopeKey.equals(key)) {
      return variableScope;
    } else if (processEngineConfigurationKey.equals(key)) {
      return processEngineConfiguration;
    } else if (runtimeServiceKey.equals(key)) {
      return processEngineConfiguration.getRuntimeService();
    } else if (taskServiceKey.equals(key)) {
      return processEngineConfiguration.getTaskService();
    } else if (repositoryServiceKey.equals(key)) {
      return processEngineConfiguration.getRepositoryService();
    } else if (managementServiceKey.equals(key)) {
      return processEngineConfiguration.getManagementService();
    } else if (formServiceKey.equals(key)) {
      return processEngineConfiguration.getFormService();
    } else if (identityServiceKey.equals(key)) {
      return processEngineConfiguration.getIdentityService();
    }

    return variableScope.getVariable((String) key);
  }
}


text:
var searchData=
[
  ['parse_5fargs',['parse_args',['../auvirt_8c.html#a55aa1b5ebb750b1c8ab1cb75baff4adf',1,'auvirt.c']]],
  ['parse_5fsyscall',['parse_syscall',['../auditctl_8c.html#ab3939f6d475f10522466690f7570e30e',1,'auditctl.c']]],
  ['per_5fevent_5fprocessing',['per_event_processing',['../aureport-scan_8c.html#a0c1132cceadb6d01002ae905df1ef19d',1,'per_event_processing(llist *l): aureport-scan.c'],['../aureport-scan_8h.html#a0c1132cceadb6d01002ae905df1ef19d',1,'per_event_processing(llist *l): aureport-scan.c']]],
  ['periodics_5freify',['periodics_reify',['../ev_8c.html#a49a858d972c8768c43d63284ecd53d8b',1,'ev.c']]],
  ['plist_5fappend',['plist_append',['../audispd-llist_8c.html#a3a5bcbf025a279a624ef9cd94fbedb82',1,'plist_append(conf_llist *l, plugin_conf_t *p): audispd-llist.c'],['../audispd-llist_8h.html#a3a5bcbf025a279a624ef9cd94fbedb82',1,'plist_append(conf_llist *l, plugin_conf_t *p): audispd-llist.c']]],
  ['plist_5fclear',['plist_clear',['../audispd-llist_8c.html#a7092ffee17673d9f774d0fdf06629de3',1,'plist_clear(conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#a7092ffee17673d9f774d0fdf06629de3',1,'plist_clear(conf_llist *l): audispd-llist.c']]],
  ['plist_5fcount_5factive',['plist_count_active',['../audispd-llist_8c.html#a2ae78644bc2233facca5399a1fe9e17e',1,'plist_count_active(const conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#a2ae78644bc2233facca5399a1fe9e17e',1,'plist_count_active(const conf_llist *l): audispd-llist.c']]],
  ['plist_5fcreate',['plist_create',['../audispd-llist_8c.html#acc021700e4904030bd463dc4b0edf69b',1,'plist_create(conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#acc021700e4904030bd463dc4b0edf69b',1,'plist_create(conf_llist *l): audispd-llist.c']]],
  ['plist_5ffind_5fname',['plist_find_name',['../audispd-llist_8c.html#a7a417d464d556f56ff057254895ae2bf',1,'plist_find_name(conf_llist *l, const char *name): audispd-llist.c'],['../audispd-llist_8h.html#a7a417d464d556f56ff057254895ae2bf',1,'plist_find_name(conf_llist *l, const char *name): audispd-llist.c']]],
  ['plist_5ffind_5funchecked',['plist_find_unchecked',['../audispd-llist_8c.html#a84e11251fff082e555ada3b2ef05ac5d',1,'plist_find_unchecked(conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#a84e11251fff082e555ada3b2ef05ac5d',1,'plist_find_unchecked(conf_llist *l): audispd-llist.c']]],
  ['plist_5flast',['plist_last',['../audispd-llist_8c.html#a03972b0b1ba5bedad764a90796816bff',1,'plist_last(conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#a03972b0b1ba5bedad764a90796816bff',1,'plist_last(conf_llist *l): audispd-llist.c']]],
  ['plist_5fmark_5fall_5funchecked',['plist_mark_all_unchecked',['../audispd-llist_8c.html#a82f891da232fced4ab0045e10730a792',1,'plist_mark_all_unchecked(conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#a82f891da232fced4ab0045e10730a792',1,'plist_mark_all_unchecked(conf_llist *l): audispd-llist.c']]],
  ['plist_5fnext',['plist_next',['../audispd-llist_8c.html#a8fdc7ded4a6cabb21cafcd6666e2315f',1,'plist_next(conf_llist *l): audispd-llist.c'],['../audispd-llist_8h.html#a8fdc7ded4a6cabb21cafcd6666e2315f',1,'plist_next(conf_llist *l): audispd-llist.c']]],
  ['plugin_5fclear_5fconfig',['plugin_clear_config',['../zos-remote-config_8c.html#a672c1ef59ad06e30eb75c09cb9dc59fb',1,'plugin_clear_config(plugin_conf_t *c): zos-remote-config.c'],['../zos-remote-config_8h.html#a64f4e7fd529a1c765f5455304ebd2435',1,'plugin_clear_config(plugin_conf_t *): zos-remote-config.c']]],
  ['plugin_5ffree_5fconfig',['plugin_free_config',['../zos-remote-config_8c.html#a2df408a671de7daf5d7678488158aa3f',1,'plugin_free_config(plugin_conf_t *c): zos-remote-config.c'],['../zos-remote-config_8h.html#a0453f5d637563c760ea11e441c6f434f',1,'plugin_free_config(plugin_conf_t *): zos-remote-config.c']]],
  ['plugin_5fload_5fconfig',['plugin_load_config',['../zos-remote-config_8c.html#ac3bc4a80a50911ad5ee548e4cfe95b18',1,'plugin_load_config(plugin_conf_t *c, const char *file): zos-remote-config.c'],['../zos-remote-config_8h.html#aee38fbf07ab9c8432d9239e1a159d941',1,'plugin_load_config(plugin_conf_t *, const char *): zos-remote-config.c']]],
  ['poll_5fdestroy',['poll_destroy',['../ev__poll_8c.html#a9147020393869e9898fea714ba292a12',1,'ev_poll.c']]],
  ['poll_5finit',['poll_init',['../ev__poll_8c.html#aac00a106a521101c29cccc44f6431a2c',1,'ev_poll.c']]],
  ['pollidx_5finit',['pollidx_init',['../ev__poll_8c.html#a0fdfbd19e89760e041e33e020e97addf',1,'ev_poll.c']]],
  ['postprocess',['postprocess',['../auditctl_8c.html#a7a74064d17252d259ace459d3ff79aae',1,'auditctl.c']]],
  ['preprocess',['preprocess',['../auditctl_8c.html#a9e837d3154b7814e1d49a5691bd58ff9',1,'auditctl.c']]],
  ['pri_5fadjust',['pri_adjust',['../ev_8c.html#ae7cd26810952be6089843b258f7e194b',1,'ev.c']]],
  ['print_5fevent',['print_event',['../auvirt_8c.html#af5917f1261d2eefb805dedd4a38d275c',1,'auvirt.c']]],
  ['print_5fevents',['print_events',['../auvirt_8c.html#af370969997c9564e93bacba6afe26c81',1,'auvirt.c']]],
  ['print_5flist',['print_list',['../slist__test_8c.html#a81a19b0b52f08e680d5025d0399a3e36',1,'slist_test.c']]],
  ['print_5fper_5fevent_5fitem',['print_per_event_item',['../aureport-output_8c.html#af6dd058369de844f985c93a24006b1e6',1,'print_per_event_item(llist *l): aureport-output.c'],['../aureport-scan_8h.html#af6dd058369de844f985c93a24006b1e6',1,'print_per_event_item(llist *l): aureport-output.c']]],
  ['print_5fsummary',['print_summary',['../auvirt_8c.html#a9d484e92556bc7197b359a69a08d65f2',1,'auvirt.c']]],
  ['print_5ftitle',['print_title',['../aureport-output_8c.html#a6d06d9415d36fbd0ee0a670f5ba03f3a',1,'print_title(void): aureport-output.c'],['../aureport-scan_8h.html#a6d06d9415d36fbd0ee0a670f5ba03f3a',1,'print_title(void): aureport-output.c']]],
  ['print_5ftty_5fdata',['print_tty_data',['../ausearch-lookup_8c.html#a8c1d33de87ee0df762cdba747f5350d4',1,'print_tty_data(const char *val): ausearch-lookup.c'],['../ausearch-lookup_8h.html#a8c1d33de87ee0df762cdba747f5350d4',1,'print_tty_data(const char *val): ausearch-lookup.c']]],
  ['print_5fwrap_5fup',['print_wrap_up',['../aureport-output_8c.html#aa652ec20f528e793a946dcdf4c62136e',1,'print_wrap_up(void): aureport-output.c'],['../aureport-scan_8h.html#aa652ec20f528e793a946dcdf4c62136e',1,'print_wrap_up(void): aureport-output.c']]],
  ['process_5fanom',['process_anom',['../auvirt_8c.html#ac182dfed72bd00d08e1d2e41c5a65d23',1,'auvirt.c']]],
  ['process_5favc',['process_avc',['../auvirt_8c.html#a419a4ab0bc591a39752f9c3a4241c294',1,'auvirt.c']]],
  ['process_5favc_5fselinux',['process_avc_selinux',['../auvirt_8c.html#ad625d0c8d2aa06cdf5e9f4a9db30d049',1,'auvirt.c']]],
  ['process_5favc_5fselinux_5fcontext',['process_avc_selinux_context',['../auvirt_8c.html#ad5caddef089943b6b9719d360888d0e8',1,'auvirt.c']]],
  ['process_5fcontrol_5fevent',['process_control_event',['../auvirt_8c.html#a0ffe586bd61affabe2fdab24fb03da7c',1,'auvirt.c']]],
  ['process_5fmachine_5fid_5fevent',['process_machine_id_event',['../auvirt_8c.html#aaa6b436ac838fcee3c2e986b6ae92bf6',1,'auvirt.c']]],
  ['process_5fresource_5fevent',['process_resource_event',['../auvirt_8c.html#a976d3987ae82743493b53c58043967a6',1,'auvirt.c']]],
  ['process_5fshutdown',['process_shutdown',['../auvirt_8c.html#a3a1a6ae7545c1dc7186e679449ffa034',1,'auvirt.c']]],
  ['push_5fevent',['push_event',['../zos-remote-plugin_8c.html#acc169f18b007cb6ff995948fdf149f6c',1,'zos-remote-plugin.c']]],
  ['pydoc_5fstrvar',['PyDoc_STRVAR',['../auparse__python_8c.html#a500f21b8a69aa7cce664282eafb00a2a',1,'PyDoc_STRVAR(AuEvent_doc,"An internal object which encapsulates the timestamp, serial number\n\
and host information of an audit event. The object cannot be\n\
instantiated from python code, rather it is returned from the\n\
audit parsing API."): auparse_python.c'],['../auparse__python_8c.html#a2503554ee97fcfd4a1241c2f1d025eb9',1,'PyDoc_STRVAR(feed_doc,"feed(data) supplies new data for the parser to consume.\n\
\n\
AuParser() must have been called with a source type of AUSOURCE_FEED.\n\
The parser consumes as much data as it can invoking a user supplied\n\
callback specified with add_callback() with a cb_event_type of\n\
AUPARSE_CB_EVENT_READY each time the parser recognizes a complete event\n\
in the data stream. Data not fully parsed will persist and be prepended\n\
to the next feed data. After all data has been feed to the parser flush_feed()\n\
should be called to signal the end of input data and flush any pending\n\
parse data through the parsing system.\n\
\n\
Returns None.\n\
Raises exception (EnvironmentError) on error\n\
"): auparse_python.c'],['../auparse__python_8c.html#abfb83b1f690d4a7e952b7bbac04a640f',1,'PyDoc_STRVAR(flush_feed_doc,"flush_feed() flush any unconsumed feed data through parser\n\
\n\
flush_feed() should be called to signal the end of feed input data\n\
and flush any pending parse data through the parsing system.\n\
\n\
Returns None.\n\
Raises exception (EnvironmentError) on error\n\
"): auparse_python.c'],['../auparse__python_8c.html#a411b9b83d99f50e3bef342ed7c63c1bb',1,'PyDoc_STRVAR(add_callback_doc,"add_callback(callback, user_data) add a callback handler for notifications.\n\
\n\
auparse_add_callback adds a callback function to the parse state which\n\
is invoked to notify the application of parsing events.\n\
\n\
The signature of the callback is:\n\
\n\
callback(au, cb_event_type,user_data)\n\
\n\
When the callback is invoked it is passed:\n\
au: the AuParser object\n\
cb_event_type: enumerated value indicating the reason why the callback was invoked\n\
user_data: user supplied private data\n\
\n\
The cb_event_type argument indicates why the callback was invoked.\n\
It's possible values are:\n\
\n\
AUPARSE_CB_EVENT_READY\n\
A complete event has been parsed and is ready to be examined.\n\
This is logically equivalent to the parse state immediately following\n\
auparse_next_event()\n\
\n\
Returns None.\n\
Raises exception (EnvironmentError) on error\n\
"): auparse_python.c'],['../auparse__python_8c.html#a55cdb7b57ca75aa919363c0cd2f7a3fd',1,'PyDoc_STRVAR(set_escape_mode_doc,"set_escape_mode() Set audit parser escaping\n\
\n\
This function sets the character escaping applied to value fields in the audit record.\n\
Returns None.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a2c67b470d944c98bb13697cd489f09e6',1,'PyDoc_STRVAR(reset_doc,"reset() Reset audit parser instance\n\
\n\
reset resets all internal cursors to the beginning.\n\
It closes files and descriptors.\n\
\n\
Returns None.\n\
Raises exception (EnvironmentError) on error\n\
"): auparse_python.c'],['../auparse__python_8c.html#a04d5d95d3b9c3368e258c63568bcc5c2',1,'PyDoc_STRVAR(search_add_expression_doc,"search_add_expression(expression, how) Build up search expression\n\
\n\
\n\
ausearch_add_item adds an expression to the current audit search\n\
expression.  The search conditions can then be used to scan logs,\n\
files, or buffers for something of interest.  The expression parameter\n\
contains an expression, as specified in ausearch-expression(5).\n\
\n\
The how parameter determines how this search expression will affect the\n\
existing search expression, if one is already defined.  The possible\n\
values are:\n\
\n\
AUSEARCH_RULE_CLEAR:\n\
Clear the current search expression, if any, and use only this search\n\
expression.\n\
\n\
AUSEARCH_RULE_OR:\n\
\n\
If a search expression E is already configured, replace it by\n\
(E || this_search_expression).\n\
\n\
AUSEARCH_RULE_AND:\n\
If a search expression E is already configured, replace it by\n\
(E && this_search_expression).\n\
\n\
No Return value, raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a3b37cf200f813349274d52adad01f984',1,'PyDoc_STRVAR(search_add_item_doc,"search_add_item(field, op, value, how) Build up search rule\n\
\n\
\n\
search_add_item() adds one search condition to the current audit search\n\
expression. The search conditions can then be used to scan logs, files, or\n\
buffers for something of interest. The field value is the field name\n\
that the value will be checked for. The op variable describes what\n\
kind of check is to be done. Legal op values are:\n\
\n\
'exists':\n\
Just check that a field name exists\n\
\n\
'=':\n\
locate the field name and check that the value associated with it\n\
is equal to the value given in this rule.\n\
\n\
'!=':\n\
locate the field name and check that the value associated with\n\
it is NOT equal to the value given in this rule.\n\
\n\
The value parameter is compared to the uninterpreted field value.\n\
\n\
The how parameter determines how this search expression will affect the\n\
existing search expression, if one is already defined.  The possible\n\
values are:\n\
\n\
AUSEARCH_RULE_CLEAR:\n\
Clear the current search expression, if any, and use only this search\n\
expression.\n\
\n\
AUSEARCH_RULE_OR:\n\
\n\
If a search expression E is already configured, replace it by\n\
(E || this_search_expression).\n\
\n\
AUSEARCH_RULE_AND:\n\
If a search expression E is already configured, replace it by\n\
(E && this_search_expression).\n\
\n\
No Return value, raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a4234c1064554711852aac1f95244fdaa',1,'PyDoc_STRVAR(search_add_interpreted_item_doc,"search_add_interpreted_item(field, op, value, how) Build up search rule\n\
\n\
\n\
search_add_interpreted_item() adds one search condition to the current audit\n\
search expression. The search conditions can then be used to scan logs,\n\
files, or buffers for something of interest. The field value is the field\n\
name that the value will be checked for. The op variable describes what\n\
kind of check is to be done. Legal op values are:\n\
\n\
'exists':\n\
Just check that a field name exists\n\
\n\
'=':\n\
locate the field name and check that the value associated with it\n\
is equal to the value given in this rule.\n\
\n\
'!=':\n\
locate the field name and check that the value associated with\n\
it is NOT equal to the value given in this rule.\n\
\n\
The value parameter is compared to the interpreted field value (the value\n\
that would be returned by AuParser.interpret_field).\n\
\n\
The how parameter determines how this search expression will affect the\n\
existing search expression, if one is already defined.  The possible\n\
values are:\n\
\n\
AUSEARCH_RULE_CLEAR:\n\
Clear the current search expression, if any, and use only this search\n\
expression.\n\
\n\
AUSEARCH_RULE_OR:\n\
\n\
If a search expression E is already configured, replace it by\n\
(E || this_search_expression).\n\
\n\
AUSEARCH_RULE_AND:\n\
If a search expression E is already configured, replace it by\n\
(E && this_search_expression).\n\
\n\
No Return value, raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#aad93f1864aa4537d2c130514d0ed1400',1,'PyDoc_STRVAR(search_add_timestamp_item_doc,"search_add_timestamp_item(op, sec, milli, how) Build up search rule\n\
\n\
\n\
search_add_timestamp_item adds an event time condition to the current audit\n\
search expression. The search conditions can then be used to scan logs,\n\
files, or buffers for something of interest. The op parameter specifies the\n\
desired comparison. Legal op values are \"<\", \"<=\", \">=\", \">\" and\n\
\"=\". The left operand of the comparison operator is the timestamp of the\n\
examined event, the right operand is specified by the sec and milli\n\
parameters.\n\
\n\
The how parameter determines how this search expression will affect the\n\
existing search expression, if one is already defined.  The possible\n\
values are:\n\
\n\
AUSEARCH_RULE_CLEAR:\n\
Clear the current search expression, if any, and use only this search\n\
expression.\n\
\n\
AUSEARCH_RULE_OR:\n\
\n\
If a search expression E is already configured, replace it by\n\
(E || this_search_expression).\n\
\n\
AUSEARCH_RULE_AND:\n\
If a search expression E is already configured, replace it by\n\
(E && this_search_expression).\n\
\n\
No Return value, raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a8d0162792f3ab3e38124b17951e91820',1,'PyDoc_STRVAR(search_add_timestamp_item_ex_doc,"search_add_timestamp_item_ex(op, sec, milli, serial, how) Build up search rule\n\
search_add_timestamp_item_ex adds an event time condition to the current audit\n\
search expression. Its similar to search_add_timestamp_item except it adds\n\
the event serial number.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a0b00be14e8a633e49c9b0dc72c0d0fa5',1,'PyDoc_STRVAR(search_add_regex_doc,"search_add_regex(regexp) Add a regular expression to the search criteria.\n\
\n\
No Return value, raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a336db274a1855dc677ecdac43ddab2a8',1,'PyDoc_STRVAR(search_set_stop_doc,"search_set_stop(where) Set where cursor is positioned on search match.\n\
\n\
search_set_stop() determines where the internal cursor will stop when\n\
a search condition is met. The possible values are:\n\
\n\
AUSEARCH_STOP_EVENT:\n\
This one repositions the cursors to the first field of the first\n\
record of the event con- taining the items searched for.\n\
\n\
AUSEARCH_STOP_RECORD:\n\
This one repositions the cursors to the first field of the record\n\
containing the items searched for.\n\
\n\
AUSEARCH_STOP_FIELD:\n\
This one simply stops on the current field when the evaluation of the\n\
rules becomes true.\n\
\n\
No Return value, raises exception (ValueError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#ae8a355baee0e13b866ee281cb59c568a',1,'PyDoc_STRVAR(search_clear_doc,"search_clear() Clear search parameters.\n\
\n\
ausearch_clear clears any search parameters stored in the parser\n\
instance and frees memory associated with it.\n\
\n\
No Return value.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a311a31bbe0306169c981c1b1ba60dd85',1,'PyDoc_STRVAR(search_next_event_doc,"search_next_event() Find the next event that meets search criteria.\n\
\n\
search_next_event() will scan the input source and evaluate whether\n\
any record in an event contains the data being searched\n\
for. Evaluation is done at the record level.\n\
\n\
Returns True if a match was found\n\
Returns False if a match was not found.\n\
\n\
Raises exception (EnvironmentError) on error\n\
"): auparse_python.c'],['../auparse__python_8c.html#aaa535d47daef467843ca146f75b4a807',1,'PyDoc_STRVAR(parse_next_event_doc,"parse_next_event() Advance the parser to the next event.\n\
\n\
parse_next_event() will position the cursors at the first field of the first\n\
record of the next event in a file or buffer. It does not skip events\n\
or honor any search criteria that may be stored.\n\
\n\
Returns True if parser advances to next event.\n\
Returns False if there are no more events to parse\n\
\n\
Raises exception (EnvironmentError) on error\n\
"): auparse_python.c'],['../auparse__python_8c.html#ae8b607fc77b1d2ccc8a60b9291333d85',1,'PyDoc_STRVAR(get_timestamp_doc,"get_timestamp() Return current event's timestamp.\n\
\n\
Returns the current event's timestamp info as an AuEvent object.\n\
No Return value, raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a1be61d98ed26c868b1d8baabf313c4ae',1,'PyDoc_STRVAR(get_num_records_doc,"get_num_records() Get the number of records.\n\
\n\
Returns the number of records in the current event.\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#aaf64ee643650977828f5f4a914f01a02',1,'PyDoc_STRVAR(first_record_doc,"first_record() Reposition record cursor.\n\
\n\
first_record() repositions the internal cursors of the parsing library\n\
to point to the first record in the current event.\n\
\n\
Return True for success, False if there is no event data.\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a1c49510dc36eab47bf508d03ca605d07',1,'PyDoc_STRVAR(next_record_doc,"next_record() Advance record cursor.\n\
\n\
next_record() will move the internal library cursors to point to the\n\
next record of the current event.\n\
\n\
Returns True on success, False if no more records in current event\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#afc10437f27a8b9e92d2cc686085a186a',1,'PyDoc_STRVAR(goto_record_num_doc,"goto_record_num() Move record cursor to specific position.\n\
\n\
goto_record_num() will move the internal library cursors to point\n\
to a specific physical record number. Records within the same event are\n\
numbered  starting  from  0. This is generally not needed but there are\n\
some cases where one may want precise control  over  the  exact  record\n\
being looked at.\n\
\n\
Returns True on success, False if no more records in current event\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#ad953d4f274dc417364a64d824617ceb6',1,'PyDoc_STRVAR(get_type_doc,"get_type() Get record's type.\n\
\n\
get_type() will return the integer value for the current record of the\n\
current event.\n\
\n\
Returns record type.\n\
Raises exception (LookupError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#ab98b95263fbcc85ec85fc98edd3384e9',1,'PyDoc_STRVAR(get_type_name_doc,"get_type_name() Get current record's type name.\n\
\n\
get_type_name() allows access to the current record type name in the\n\
current event.\n\
\n\
Returns None if the record type name is unavailable.\n\
"): auparse_python.c'],['../auparse__python_8c.html#afc0ec696151b47657336aeb573ca7285',1,'PyDoc_STRVAR(get_line_number_doc,"auparse_get_line_number() get line number where record was found\n\
\n\
get_line_number will return the source input line number for\n\
the current record of the current event. Line numbers start at 1.  If\n\
the source input type is AUSOURCE_FILE_ARRAY the line numbering will\n\
reset back to 1 each time a new life in the file array is opened.\n\
"): auparse_python.c'],['../auparse__python_8c.html#abd8c2d74cfc6c354d8b89c967f2b7109',1,'PyDoc_STRVAR(get_filename_doc,"auparse_get_filename() get the filename where record was found\n\
get_filename() will return the name of the source file where the\n\
record was found if the source type is AUSOURCE_FILE or\n\
AUSOURCE_FILE_ARRAY. For other source types the return value will be\n\
None.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a30365167aac712385c085528bd56e039',1,'PyDoc_STRVAR(first_field_doc,"first_field() Reposition field cursor.\n\
\n\
Returns True on success, False if there is no event data\n\
"): auparse_python.c'],['../auparse__python_8c.html#ab54ba2f4ceb64aedd91aa48b8ad88b41',1,'PyDoc_STRVAR(next_field_doc,"next_field() Advance the field cursor.\n\
\n\
next_field() moves the library's internal cursor to point to the next\n\
field in the current record of the current event.\n\
\n\
Returns True on success, False if there is no more fields exist\n\
"): auparse_python.c'],['../auparse__python_8c.html#a0a7946d24912bc51f923ce4a7b0f2b8d',1,'PyDoc_STRVAR(get_num_fields_doc,"get_num_fields() Get the number of fields.\n\
\n\
Returns the number of fields in the current event.\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#af53fc9011612e3c65c253068da0a5370',1,'PyDoc_STRVAR(get_record_text_doc,"get_record_text() Return unparsed record data\n\
\n\
get_record_text() returns the full unparsed record.\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#aaf4e98880fba4c69c8af06de04109e0d',1,'PyDoc_STRVAR(find_field_doc,"find_field(name) Search for field name.\n\
\n\
find_field() will scan all records in an event to find the first\n\
occurance of the field name passed to it. Searching begins from the\n\
cursor's current position. The field name is stored for subsequent\n\
searching.\n\
\n\
Returns value associated with field or None if not found.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a5d49af3495a6772819fd1536e6e19e6d',1,'PyDoc_STRVAR(find_field_next_doc,"find_field_next() Get next occurrance of field name\n\
\n\
find_field_next() returns the value associated next occurrance of field name.\n\
Returns value associated with field or None if there is no next field.\n\
Raises exception (EnvironmentError) on error.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a1595de5b1801cde3fe44610afa4dae91',1,'PyDoc_STRVAR(get_field_name_doc,"get_field_name() Get current field's name.\n\
\n\
get_field_name() allows access to the current field name of the\n\
current record in the current event.\n\
\n\
Returns None if the field value is unavailable.\n\
"): auparse_python.c'],['../auparse__python_8c.html#ab7111eee293fa19173240f321f68de00',1,'PyDoc_STRVAR(get_field_str_doc,"get_field_str() get current field's value\n\
\n\
get_field_str() allows access to the value in the current field of the\n\
current record in the current event.\n\
\n\
Returns None if the field value is unavailable.\n\
"): auparse_python.c'],['../auparse__python_8c.html#aa2a78d056eb14c13e3268bd79b2e8853',1,'PyDoc_STRVAR(get_field_type_doc,"get_field_type() Get current field's data type value.\n\
\n\
get_field_type() returns a value from the auparse_type_t enum that\n\
describes the kind of data in the current field of the current record\n\
in the current event.\n\
\n\
Returns AUPARSE_TYPE_UNCLASSIFIED if the field's data type has no\n\
known description or is an integer. Otherwise it returns another enum.\n\
Fields with the type AUPARSE_TYPE_ESCAPED must be interpretted to access\n\
their value since those field's raw value is encoded.\n\
"): auparse_python.c'],['../auparse__python_8c.html#a73cd29839fc3c59f0eee257efed14027',1,'PyDoc_STRVAR(get_field_int_doc,"get_field_int() Get current field's value as an integer.\n\
\n\
get_field_int() allows access to the value as an int of the current\n\
field of the current record in the current event.\n\
\n\
Returns None if the field value is unavailable.\n\
"): auparse_python.c'],['../auparse__python_8c.html#aba5f401647ddf7bc6a3ab7c34f29c6e1',1,'PyDoc_STRVAR(interpret_field_doc,"interpret_field() Return an interpretation of the current field as a string that has the chosen character escaping applied.\n\
\n\
If the field cannot be interpreted the field is returned unmodified.\n\
Returns None if the field value is unavailable.\n\
"): auparse_python.c'],['../auparse__python_8c.html#ac4d222d21bd5d8309c9f3f0a6ba52a83',1,'PyDoc_STRVAR(AuParser_doc,"AuParser(source_type, source)\n\
\n\
Construct a new audit parser object and bind it to input data.\n\
source_type: one of the AUSOURCE_* constants.\n\
source:      the input data, dependent on the source_type as follows:\n\
\n\
AUSOURCE_LOGS:         None (system log files will be parsed)\n\
AUSOURCE_FILE:         string containing file path name\n\
AUSOURCE_FILE_ARRAY:   list or tuple of strings each containing a file path name\n\
AUSOURCE_BUFFER:       string containing audit data to parse\n\
AUSOURCE_BUFFER_ARRAY: list or tuple of strings each containing audit data to parse\n\
AUSOURCE_DESCRIPTOR:   integer file descriptor (e.g. fileno)\n\
AUSOURCE_FILE_POINTER: file object (e.g. types.FileType)\n\
AUSOURCE_FEED:         None (data supplied via feed()\n\
"): auparse_python.c'],['../auparse__python_8c.html#ae318f42e15480224b64269bb54480b8a',1,'PyDoc_STRVAR(auparse_doc,"Parsing library for audit messages.\n\
\n\
The module defines the following exceptions:\n\
\n\
NoParser: Raised if the underlying C code parser is not bound to the AuParser object.\n\
"): auparse_python.c']]]
];


text:
[![build status](https://travis-ci.org/crumblingstatue/crusty-chip.svg?branch=master)](https://travis-ci.org/crumblingstatue/crusty-chip)

crusty-chip
===========

CHIP-8 interpreter backend.
The reference frontend is [crusty-chip-sfml](sfml)


text:
{% load room_tools %}

{{ room.floor.get_number_display }}

    {% if room.size %}{{ room.size|floatformat }} {{ room.size|floatformat }}
    ft2{% else %}?size unknown
    {% endif %}

{{ room.get_occupancy_display }}

{% if room.review_set.count >= 1 %}

    {% show_stars room.average_rating %}
    overall rating

Quiet{% show_stars room.average_rating_quiet %}

Spacious{% show_stars room.average_rating_spacious %}

Temperate{% show_stars room.average_rating_temperate %}

Well Maintained{% show_stars room.average_rating_maintained %}

Cell Service{% show_stars room.average_rating_cellphone %}

{% endif %}


text:
<?php

namespace Magento\Framework\TestFramework\Unit\Helper;

/**
 * Class SelectRendererTrait
 */
trait SelectRendererTrait
{
    /**
     * @param \Magento\Framework\TestFramework\Unit\Helper\ObjectManager $objectManager
     * @return \Magento\Framework\DB\Select\SelectRenderer
     */
    protected function getSelectRenderer(\Magento\Framework\TestFramework\Unit\Helper\ObjectManager $objectManager)
    {
        return $objectManager->getObject(
            'Magento\Framework\DB\Select\SelectRenderer',
            [
                'renderers' => [
                    'distinct' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\DistinctRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'distinct',
                    ],
                    'columns' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\ColumnsRenderer',
                            [
                                'quote' => $objectManager->getObject('Magento\Framework\DB\Platform\Quote')
                            ]
                        ),
                        'sort' => 11,
                        'part' => 'columns',
                    ],
                    'union' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\UnionRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'union',
                    ],
                    'from' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\FromRenderer',
                            [
                                'quote' => $objectManager->getObject('Magento\Framework\DB\Platform\Quote')
                            ]
                        ),
                        'sort' => 11,
                        'part' => 'from',
                    ],
                    'where' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\WhereRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'where',
                    ],
                    'group' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\GroupRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'group',
                    ],
                    'having' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\HavingRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'having',
                    ],
                    'order' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\OrderRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'order',
                    ],
                    'limit' => [
                        'renderer' => $objectManager->getObject(
                            'Magento\Framework\DB\Select\LimitRenderer'
                        ),
                        'sort' => 11,
                        'part' => 'limitcount',
                    ],
                ],
            ]
        );
    }
}


text:
'use strict';

angular.module('qldarchApp').config(function($stateProvider) {
  $stateProvider.state('relationships.create', {
    url : '/create?type&archobjId&archobjType',
    templateUrl : 'views/relationships/relationships.create.html',
    resolve : {
      types : [ 'RelationshipLabels', function(RelationshipLabels) {
        return RelationshipLabels.load().then(function(response) {
          return response;
        });
      } ],
      architects : [ 'AggArchObjs', '$filter', function(AggArchObjs, $filter) {
        return AggArchObjs.loadArchitects().then(function(data) {
          angular.forEach(data, function(d) {
            d.type = 'architect';
          });
          return $filter('filter')(data, function(architect) {
            return architect.label && !(/\s/.test(architect.label.substring(0, 1)));
          });
        }).catch(function() {
          console.log('unable to load architects');
          return {};
        });
      } ],
      firms : [ 'AggArchObjs', '$filter', function(AggArchObjs, $filter) {
        return AggArchObjs.loadFirms().then(function(data) {
          angular.forEach(data, function(d) {
            d.type = 'firm';
          });
          return $filter('filter')(data, function(firm) {
            return firm.label && !(/\s/.test(firm.label.substring(0, 1)));
          });
        }).catch(function() {
          console.log('unable to load firms');
          return {};
        });
      } ],
      structures : [ 'AggArchObjs', function(AggArchObjs) {
        return AggArchObjs.loadProjects().then(function(data) {
          angular.forEach(data, function(d) {
            d.type = 'project';
          });
          return data;
        }).catch(function() {
          console.log('unable to load projects');
          return {};
        });
      } ],
      architectsFirms : [ 'architects', 'firms', function(architects, firms) {
        var entities = [];
        Array.prototype.push.apply(entities, architects);
        Array.prototype.push.apply(entities, firms);
        return entities;
      } ]
    },
    controller : 'RelationshipsCreateCtrl'
  });
});


text:
/* NetHack 3.7	win10.h	$NHDT-Date: 1596498319 2020/08/03 23:45:19 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.8 $ */
/* Copyright (C) 2018 by Bart House 	 */
/* NetHack may be freely redistributed.  See license for details. */

#ifndef WIN10_H
#define WIN10_H

#include "win32api.h"

#ifdef __MINGW32__
#ifndef DECLARE_HANDLE
#define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name
#endif
DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);

/* DPI awareness */
typedef enum DPI_AWARENESS
{
    DPI_AWARENESS_INVALID = -1,
    DPI_AWARENESS_UNAWARE = 0,
    DPI_AWARENESS_SYSTEM_AWARE,
    DPI_AWARENESS_PER_MONITOR_AWARE
} DPI_AWARENESS;

#define DPI_AWARENESS_CONTEXT_UNAWARE              ((DPI_AWARENESS_CONTEXT)-1)
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE         ((DPI_AWARENESS_CONTEXT)-2)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE    ((DPI_AWARENESS_CONTEXT)-3)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    ((DPI_AWARENESS_CONTEXT)-5)
#endif

typedef struct {
    double  scale;  // dpi of monitor / 96
    int     width;  // in pixels
    int     height; // in pixels
    int     top; // in desktop coordinate pixel space
    int     left; // in desktop coordinate pixel space
} MonitorInfo;

void win10_init();
int win10_monitor_dpi(HWND hWnd);
double win10_monitor_scale(HWND hWnd);
void win10_monitor_info(HWND hWnd, MonitorInfo * monitorInfo);
BOOL win10_is_desktop_bridge_application(void);

#endif // WIN10_H


text:
package com.metamx.emitter.core.factory;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.metamx.common.lifecycle.Lifecycle;
import com.metamx.emitter.core.Emitter;
import com.metamx.emitter.core.HttpEmitterConfig;
import com.metamx.emitter.core.HttpPostEmitter;
import com.metamx.http.client.HttpClient;

public class HttpEmitterFactory extends HttpEmitterConfig implements EmitterFactory
{

  @Override
  public Emitter makeEmitter(ObjectMapper objectMapper, HttpClient httpClient, Lifecycle lifecycle)
  {
    Emitter retVal = new HttpPostEmitter(this, httpClient, objectMapper);
    lifecycle.addManagedInstance(retVal);
    return retVal;
  }
}


text:
namespace Santase.Logic.Players
{
    using System.Collections.Generic;
    using System.Text;

    using Santase.Logic.Cards;
    using Santase.Logic.Logger;

    public class PlayerWithLoggerDecorator : PlayerDecorator
    {
        private readonly ILogger logger;

        public PlayerWithLoggerDecorator(IPlayer player, ILogger logger)
            : base(player)
        {
            this.logger = logger;
        }

        public override void StartGame(string otherPlayerIdentifier)
        {
            this.logger.LogLine($"New game vs {otherPlayerIdentifier}");
            base.StartGame(otherPlayerIdentifier);
        }

        public override void StartRound(ICollection<Card> cards, Card trumpCard, int myTotalPoints, int opponentTotalPoints)
        {
            var cardsAsString = new StringBuilder();
            foreach (var card in cards)
            {
                cardsAsString.Append(card);
            }

            this.logger.LogLine($"New round ({myTotalPoints}-{opponentTotalPoints}). Cards: {cardsAsString}. Trump card: {trumpCard}");
            base.StartRound(cards, trumpCard, myTotalPoints, opponentTotalPoints);
        }

        public override void AddCard(Card card)
        {
            this.logger.LogLine($"New card {card}");
            base.AddCard(card);
        }

        public override PlayerAction GetTurn(PlayerTurnContext context)
        {
            this.logger.LogLine("--GetTurn; "
                                + $"Trump: {context.TrumpCard}({context.CardsLeftInDeck}); "
                                + $"State: {context.State.GetType().Name.Replace("RoundState", string.Empty)}; "
                                + $"First: {context.FirstPlayedCard}({context.FirstPlayerAnnounce}); "
                                + $"I am first: {context.IsFirstPlayerTurn}");
            var action = base.GetTurn(context);
            this.logger.LogLine($"Playing {action}");
            return action;
        }

        public override void EndTurn(PlayerTurnContext context)
        {
            this.logger.LogLine(
                $"End of turn {context.FirstPlayedCard}({context.FirstPlayerAnnounce}) - {context.SecondPlayedCard}");
            base.EndTurn(context);
        }

        public override void EndRound()
        {
            base.EndRound();
            this.logger.LogLine("EndRound();");
            this.logger.LogLine(new string('-', 40));
        }

        public override void EndGame(bool amIWinner)
        {
            base.EndGame(amIWinner);
            this.logger.LogLine($"EndGame({amIWinner});");
        }
    }
}


text:
package darkrealms.emily.utils;

/**
 * Language.java
 *
 * Language bindings for the Isolation Engine.
 * Loads strings from an XML file.
 */

import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.XmlReader;
import com.badlogic.gdx.utils.XmlReader.Element;

public class Language {
	protected HashMap<String,String> map;

	public Language() {
		map = new HashMap<String,String>();
	}

	/**
	 * @param lang The FileHandle for the language file.
	 * @throws IOException
	 */
	public Language(FileHandle lang) throws IOException {
		map = new HashMap<String,String>();
		load(lang);
	}

	/**
	 * load()
	 * Loads the language file pointed to by the given FileHandle
	 * @param lang The FileHandle
	 * @throws IOException
	 */
	//TODO Make sure this doesn't crash on an empty file
	public void load(FileHandle lang) throws IOException {
		if(lang != null && lang.exists()) {
			//Parse the file
			Element root = new XmlReader().parse(lang.read());

			//Make a list of all strings
			Array<Element> list = root.getChildrenByName("string");

			//Load the strings into the hashmap
			for(int i=0; i< list.size; i++) {
				Element e = list.get(i);
				map.put(e.getAttribute("name"), e.getText());
			}//for
		}//if
	}//load()

	//Not needed? Not good to have, unless also making a string editor.
	/*public void put(String key, String value) {
		map.put(key, value);
	}*/

	/**
	 * Returns the string that is associated with the given key.
	 * @param key
	 * @return
	 */
	public String get(String key) {
		return map.get(key);
	}

	@Override
	public String toString() {
		String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n";

		Iterator<Entry<String,String>> i = map.entrySet().iterator();
		while (i.hasNext()) {
			Entry<String, String> entry = i.next();
			xml += "<string name=\"" + entry.getKey() + "\">" + entry.getValue() + "</string>\n";
		}

		xml += "</resources>";

		return xml;
	}
}


text:
using OpenMetaverse;
using OpenSim.Framework;
using System;
using System.Collections.Generic;
using OpenSim.Services.Interfaces;
using OpenSim.Data;
using Nini.Config;
using log4net;
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;

namespace OpenSim.Services.Friends
{
    public class FriendsService : FriendsServiceBase, IFriendsService
    {
        public FriendsService(IConfigSource config) : base(config)
        {
        }

        public FriendInfo[] GetFriends(UUID PrincipalID)
        {
            FriendsData[] data = m_Database.GetFriends(PrincipalID);

            List<FriendInfo> info = new List<FriendInfo>();

            foreach (FriendsData d in data)
            {
                FriendInfo i = new FriendInfo();

                i.PrincipalID = d.PrincipalID;
                i.Friend = d.Friend;
                i.MyFlags = Convert.ToInt32(d.Data["Flags"]);
                i.TheirFlags = Convert.ToInt32(d.Data["TheirFlags"]);

                info.Add(i);
            }

            return info.ToArray();
        }

        public bool StoreFriend(UUID PrincipalID, string Friend, int flags)
        {
            FriendsData d = new FriendsData();

            d.PrincipalID = PrincipalID;
            d.Friend = Friend;
            d.Data = new Dictionary<string, string>();
            d.Data["Flags"] = flags.ToString();

            return m_Database.Store(d);
        }

        public bool Delete(UUID PrincipalID, string Friend)
        {
            return m_Database.Delete(PrincipalID, Friend);
        }

    }
}


text:
#import "RCTShadowView+Layout.h"

@interface RCTShadowView ()
{
  __weak RCTRootShadowView *_rootView;
}

@end

@implementation RCTShadowView (Internal)

- (void)setRootView:(RCTRootShadowView *)rootView
{
  _rootView = rootView;
}

@end


text:
<?php
/**
 * @dataProvider data-is-path-current.ini
 */

use CzProject\PathHelper;
use Tester\Assert;

require __DIR__ . '/bootstrap.php';
require __DIR__ . '/../../src/PathHelper.php';

$args = Tester\Environment::loadData();

if ($args['result'] === '1') {
	Assert::true(PathHelper::isPathCurrent($args['source'], $args['mask']));
} else {
	Assert::false(PathHelper::isPathCurrent($args['source'], $args['mask']));
}


text:
import logging
from pyvisdk.exceptions import InvalidArgumentError

########################################
# Automatically generated, do not edit.
########################################

log = logging.getLogger(__name__)

def VirtualMachineDiskDeviceInfo(vim, *args, **kwargs):
    '''The DiskDeviceInfo class contains basic information about a specific disk
    hardware device.'''

    obj = vim.client.factory.create('ns0:VirtualMachineDiskDeviceInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'name' ]
    optional = [ 'capacity', 'vm', 'configurationTag', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj


text:
"""
This file was automatically generated.
"""

import six

class wappalyzer(object):

    def __init__(self, zap):
        self.zap = zap

    @property
    def list_sites(self):
        """
        Lists all the sites recognized by the wappalyzer addon.
        This component is optional and therefore the API will only work if it is installed
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'wappalyzer/view/listSites/')))

    @property
    def list_all(self):
        """
        Lists all sites and their associated applications (technologies).
        This component is optional and therefore the API will only work if it is installed
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'wappalyzer/view/listAll/')))

    def list_site(self, site):
        """
        Lists all the applications (technologies) associated with a specific site.
        This component is optional and therefore the API will only work if it is installed
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'wappalyzer/view/listSite/', {'site': site})))


text:
//
// Novell.Directory.Ldap.Extensions.SetReplicationFilterRequest.cs
//
// Author:
//   Sunil Kumar (Sunilk@novell.com)
//
// (C) 2003 Novell, Inc (http://www.novell.com)
//

using System;
using Novell.Directory.Ldap;
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Utilclass;

namespace Novell.Directory.Ldap.Extensions
{

	/// <summary>
	/// Sets the Replication filter for all replicas on the server.
	///
	/// The filter specified is a an array of classnames-attribute names pairs.
	///
	/// To set the filter for all replicas on the connected server, you must
	/// create an instance of this class and then call the
	/// extendedOperation method with this object as the required
	/// LdapExtendedOperation parameter.
	///
	/// The SetReplicationFilterRequest extension uses the following OID:
	/// 2.16.840.1.113719.1.27.100.35
	///
	/// The requestValue has the following format:
	///
	/// requestValue ::=
	///  serverName  LdapDN
	///  SEQUENCE of SEQUENCE {
	///  classname  OCTET STRING
	///  SEQUENCE of ATTRIBUTES
	/// }
	/// where
	/// ATTRIBUTES:: OCTET STRING
	/// </summary>
	public class SetReplicationFilterRequest:LdapExtendedOperation
	{

		/// <summary>
		/// Constructs an extended operations object which contains the ber encoded
		/// replication filter.
		///
		/// </summary>
		/// <param name="serverDN">The server on which the replication filter needs to be set
		///
		/// </param>
		/// <param name="replicationFilter">An array of String Arrays. Each array starting with
		/// a class name followed by the attribute names for that class that should comprise
		/// the replication filter.
		///
		/// </param>
		/// <exception> LdapException A general exception which includes an error
		/// message and an Ldap error code.
		/// </exception>
		public SetReplicationFilterRequest(System.String serverDN, System.String[][] replicationFilter):base(ReplicationConstants.SET_REPLICATION_FILTER_REQ, null)
		{

			try
			{

				if ((System.Object) serverDN == null)
					throw new System.ArgumentException(ExceptionMessages.PARAM_ERROR);

				System.IO.MemoryStream encodedData = new System.IO.MemoryStream();
				LBEREncoder encoder = new LBEREncoder();

				Asn1OctetString asn1_serverDN = new Asn1OctetString(serverDN);

				// Add the serverDN to encoded data
				asn1_serverDN.encode(encoder, encodedData);

				// The toplevel sequenceOF
				Asn1SequenceOf asn1_replicationFilter = new Asn1SequenceOf();

				if (replicationFilter == null)
				{
					asn1_replicationFilter.encode(encoder, encodedData);
					setValue(SupportClass.ToSByteArray(encodedData.ToArray()));
					return ;
				}

				int i = 0;
				// for every element in the array
				while ((i < replicationFilter.Length) && (replicationFilter[i] != null))
				{

					// The following additional Sequence is not needed
					// as defined by the Asn1. But the server and the
					// C client are encoding it. Remove this when server
					// and C client are fixed to conform to the published Asn1.
					Asn1Sequence buginAsn1Representation = new Asn1Sequence();

					// Add the classname to the sequence -
					buginAsn1Representation.add(new Asn1OctetString(replicationFilter[i][0]));

					// Start a sequenceOF for attributes
					Asn1SequenceOf asn1_attributeList = new Asn1SequenceOf();

					// For every attribute in the array - remember attributes start after
					// the first element
					int j = 1;
					while ((j < replicationFilter[i].Length) && ((System.Object) replicationFilter[i][j] != null))
					{

						// Add the attribute name to the inner SequenceOf
						asn1_attributeList.add(new Asn1OctetString(replicationFilter[i][j]));
						j++;
					}

					// Add the attributeList to the sequence - extra add due to bug
					buginAsn1Representation.add(asn1_attributeList);
					asn1_replicationFilter.add(buginAsn1Representation);
					i++;
				}

				asn1_replicationFilter.encode(encoder, encodedData);
				setValue(SupportClass.ToSByteArray(encodedData.ToArray()));
			}
			catch (System.IO.IOException ioe)
			{
				throw new LdapException(ExceptionMessages.ENCODING_ERROR, LdapException.ENCODING_ERROR, (System.String) null);
			}
		}
	}
}


text:
//
// $Id$

#ifndef COMMAND_MENU
#define COMMAND_MENU

#include "ui/Menu.h"

/**
 * Pops up to provide access to commands.
 */
class CommandMenu : public Menu
{
    Q_OBJECT

public:

    /**
     * Initializes the menu.
     */
    CommandMenu (Session* parent, int deleteOnReleaseKey = -1);

protected slots:

    /**
     * Creates the "new" submenu.
     */
    void createNewMenu ();

    /**
     * Creates the "edit" submenu.
     */
    void createEditMenu ();

    /**
     * Creates the "tools" submenu.
     */
    void createToolsMenu ();
};

#endif // COMMAND_MENU


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class AddForeignKeysToTeaPartiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('tea_parties', function (Blueprint $table) {
            $table->foreign('club_id')->references('id')->on('clubs')
                ->onUpdate('CASCADE')->onDelete('CASCADE');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('tea_parties', function (Blueprint $table) {
            $table->dropForeign(['club_id']);
        });
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="TVGuide\ListingsBundle\Entity\RegionChannelName">
    <id name="id" type="integer" column="id">
      <generator strategy="AUTO"/>
    </id>
    <field name="regionId" type="integer" column="region_id"/>
    <field name="channelId" type="integer" column="channel_id"/>
    <field name="channelName" type="string" column="channel_name" length="255"/>
    <many-to-one field="channels" target-entity="Channels">
      <join-columns>
        <join-column name="channel_id" referenced-column-name="id"/>
      </join-columns>
        </many-to-one>
  </entity>
</doctrine-mapping>


text:
var classorg_1_1onosproject_1_1store_1_1service_1_1StorageServiceAdapter =
[
    [ "atomicCounterBuilder", "classorg_1_1onosproject_1_1store_1_1service_1_1StorageServiceAdapter.html#ad0ff6cadc9c3d0a0848c404d3ec5ca82", null ],
    [ "transactionContextBuilder", "classorg_1_1onosproject_1_1store_1_1service_1_1StorageServiceAdapter.html#a2a1b426e534645ffe13768ad25a741e4", null ]
];


text:
<!DOCTYPE html>

    <meta charset="UTF-8"/>
    <meta name="robots" content="index, follow, all"/>
    <title>Imagine\Imagick | Imagine API</title>
    <link rel="stylesheet" type="text/css" href="../stylesheet.css">

Classes

Namespaces

Interfaces

Index

Imagine API

Namespace

Imagine\Imagick

            Drawer
            Drawer implementation using the Imagick PHP extension

            Effects
            Effects implementation using the Imagick PHP extension

            Font
            Font implementation using the Imagick PHP extension

            Image
            Image implementation using the Imagick PHP extension

            Imagine
            Imagine implementation using the Imagick PHP extension

            Layers

    Generated by Sami, the API Documentation Generator.


text:
import styles from 'part:@sanity/components/progress/circle-style'
import React from 'react'

const radiusFactor = 1.3

interface ProgressCircleProps {
  percent?: number
  text?: string
  style?: React.CSSProperties
  showPercent?: boolean
  isComplete?: boolean
  isInProgress?: boolean
}

export default class ProgressCircle extends React.PureComponent<ProgressCircleProps> {
  componentDidMount() {
    // eslint-disable-next-line no-console
    console.warn(
      "ProgressCircle from `part:@sanity/components/progress/circle` is deprecated. Please use `import {ProgressCircle} from '@sanity/base/components'` instead"
    )
  }
  render() {
    const {percent = 0, text, style, showPercent, isComplete} = this.props

    const radius = 50
    const strokeWidth = 10
    const width = radius * 2
    const height = radius * 2
    const viewBox = `0 0 ${width} ${height}`

    const dashArray = radius * Math.PI * 2
    const dashOffset = dashArray - (dashArray * percent) / 100

    return (
      <div className={isComplete ? styles.completed : styles.unCompleted} style={style}>
        <svg className={styles.svg} width={width} height={height} viewBox={viewBox}>
          <circle
            className={styles.background}
            cx={radius}
            cy={radius}
            r={radius - strokeWidth}
            strokeWidth={`${strokeWidth}px`}
          />
          <circle
            className={styles.foreground}
            cx={radius}
            cy={radius}
            r={radius - strokeWidth}
            strokeWidth={`${strokeWidth}px`}
            style={{
              strokeDasharray: dashArray,
              strokeDashoffset: dashOffset,
            }}
          />
          <circle
            className={styles.activeCircle}
            cx={radius}
            cy={radius}
            r={radius - 1}
            style={{
              strokeDasharray: Math.PI,
              strokeDashoffset: Math.PI,
            }}
          />
          {showPercent && (
            <text
              className={styles.percent}
              x={radius}
              y={text ? radius - 5 : radius}
              dy=".4em"
              textAnchor="middle"
            >
              {`${Math.round(percent)}%`}
            </text>
          )}
          {text && (
            <text
              className={styles.status}
              x={radius}
              y={radius * radiusFactor - 5}
              dy=".4em"
              textAnchor="middle"
            >
              {text}
            </text>
          )}
        </svg>
      </div>
    )
  }
}


text:
import warnings

from pilkit.processors.base import *

warnings.warn('imagekit.processors.base is deprecated use imagekit.processors instead', DeprecationWarning)

__all__ = ['ProcessorPipeline', 'Adjust', 'Reflection', 'Transpose', 'Anchor', 'MakeOpaque']


text:
ROOT_URLCONF = "example.app.urls"

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "default",
    }
}

INSTALLED_APPS = (
    "example.app",
)

SECRET_KEY = "wow much secure"

MIDDLEWARE_CLASSES = (
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
)


text:
package process;

import rewriting.terms.NameTerm;
import rewriting.terms.SpecialTerm;

/**
 * Created by mbauer on 8/2/2017.
 */
public class Resources {

    public static final SpecialTerm TAU_ACTION = new SpecialTerm("T");

    static final String BAD_ROLE_INDEX = "Role index out of bounds";

    static final String BAD_ROLE_RECIPE = "Recipe is not valid for role index";
}