text:
#pragma once

#ifndef __INSTR86_H__
#define __INSTR86_H__

/****************************************************************************
*             real mode i286 emulator v1.4 by Fabrice Frances               *
*               (initial work based on David Hedley's pcemu)                *
****************************************************************************/

// file will be included in all cpu variants
// put non i86 instructions in own files (i286, i386, nec)
// function renaming will be added when neccessary
// timing value should move to separate array

static void PREFIX86(_add_br8)(i8086_state *cpustate);
static void PREFIX86(_add_wr16)(i8086_state *cpustate);
static void PREFIX86(_add_r8b)(i8086_state *cpustate);
static void PREFIX86(_add_r16w)(i8086_state *cpustate);
static void PREFIX86(_add_ald8)(i8086_state *cpustate);
static void PREFIX86(_add_axd16)(i8086_state *cpustate);
static void PREFIX86(_push_es)(i8086_state *cpustate);
static void PREFIX86(_pop_es)(i8086_state *cpustate);
static void PREFIX86(_or_br8)(i8086_state *cpustate);
static void PREFIX86(_or_r8b)(i8086_state *cpustate);
static void PREFIX86(_or_wr16)(i8086_state *cpustate);
static void PREFIX86(_or_r16w)(i8086_state *cpustate);
static void PREFIX86(_or_ald8)(i8086_state *cpustate);
static void PREFIX86(_or_axd16)(i8086_state *cpustate);
static void PREFIX86(_push_cs)(i8086_state *cpustate);
#ifndef I80286
static void PREFIX86(_pop_cs)(i8086_state *cpustate);
#endif
static void PREFIX86(_adc_br8)(i8086_state *cpustate);
static void PREFIX86(_adc_wr16)(i8086_state *cpustate);
static void PREFIX86(_adc_r8b)(i8086_state *cpustate);
static void PREFIX86(_adc_r16w)(i8086_state *cpustate);
static void PREFIX86(_adc_ald8)(i8086_state *cpustate);
static void PREFIX86(_adc_axd16)(i8086_state *cpustate);
static void PREFIX86(_push_ss)(i8086_state *cpustate);
static void PREFIX86(_pop_ss)(i8086_state *cpustate);
static void PREFIX86(_sbb_br8)(i8086_state *cpustate);
static void PREFIX86(_sbb_wr16)(i8086_state *cpustate);
static void PREFIX86(_sbb_r8b)(i8086_state *cpustate);
static void PREFIX86(_sbb_r16w)(i8086_state *cpustate);
static void PREFIX86(_sbb_ald8)(i8086_state *cpustate);
static void PREFIX86(_sbb_axd16)(i8086_state *cpustate);
static void PREFIX86(_push_ds)(i8086_state *cpustate);
static void PREFIX86(_pop_ds)(i8086_state *cpustate);
static void PREFIX86(_and_br8)(i8086_state *cpustate);
static void PREFIX86(_and_r8b)(i8086_state *cpustate);
static void PREFIX86(_and_wr16)(i8086_state *cpustate);
static void PREFIX86(_and_r16w)(i8086_state *cpustate);
static void PREFIX86(_and_ald8)(i8086_state *cpustate);
static void PREFIX86(_and_axd16)(i8086_state *cpustate);
static void PREFIX86(_es)(i8086_state *cpustate);
static void PREFIX86(_daa)(i8086_state *cpustate);
static void PREFIX86(_sub_br8)(i8086_state *cpustate);
static void PREFIX86(_sub_wr16)(i8086_state *cpustate);
static void PREFIX86(_sub_r8b)(i8086_state *cpustate);
static void PREFIX86(_sub_r16w)(i8086_state *cpustate);
static void PREFIX86(_sub_ald8)(i8086_state *cpustate);
static void PREFIX86(_sub_axd16)(i8086_state *cpustate);
static void PREFIX86(_cs)(i8086_state *cpustate);
static void PREFIX86(_das)(i8086_state *cpustate);
static void PREFIX86(_xor_br8)(i8086_state *cpustate);
static void PREFIX86(_xor_r8b)(i8086_state *cpustate);
static void PREFIX86(_xor_wr16)(i8086_state *cpustate);
static void PREFIX86(_xor_r16w)(i8086_state *cpustate);
static void PREFIX86(_xor_ald8)(i8086_state *cpustate);
static void PREFIX86(_xor_axd16)(i8086_state *cpustate);
static void PREFIX86(_ss)(i8086_state *cpustate);
static void PREFIX86(_aaa)(i8086_state *cpustate);
static void PREFIX86(_cmp_br8)(i8086_state *cpustate);
static void PREFIX86(_cmp_wr16)(i8086_state *cpustate);
static void PREFIX86(_cmp_r8b)(i8086_state *cpustate);
static void PREFIX86(_cmp_r16w)(i8086_state *cpustate);
static void PREFIX86(_cmp_ald8)(i8086_state *cpustate);
static void PREFIX86(_cmp_axd16)(i8086_state *cpustate);
static void PREFIX86(_ds)(i8086_state *cpustate);
static void PREFIX86(_aas)(i8086_state *cpustate);
static void PREFIX86(_inc_ax)(i8086_state *cpustate);
static void PREFIX86(_inc_cx)(i8086_state *cpustate);
static void PREFIX86(_inc_dx)(i8086_state *cpustate);
static void PREFIX86(_inc_bx)(i8086_state *cpustate);
static void PREFIX86(_inc_sp)(i8086_state *cpustate);
static void PREFIX86(_inc_bp)(i8086_state *cpustate);
static void PREFIX86(_inc_si)(i8086_state *cpustate);
static void PREFIX86(_inc_di)(i8086_state *cpustate);
static void PREFIX86(_dec_ax)(i8086_state *cpustate);
static void PREFIX86(_dec_cx)(i8086_state *cpustate);
static void PREFIX86(_dec_dx)(i8086_state *cpustate);
static void PREFIX86(_dec_bx)(i8086_state *cpustate);
static void PREFIX86(_dec_sp)(i8086_state *cpustate);
static void PREFIX86(_dec_bp)(i8086_state *cpustate);
static void PREFIX86(_dec_si)(i8086_state *cpustate);
static void PREFIX86(_dec_di)(i8086_state *cpustate);
static void PREFIX86(_push_ax)(i8086_state *cpustate);
static void PREFIX86(_push_cx)(i8086_state *cpustate);
static void PREFIX86(_push_dx)(i8086_state *cpustate);
static void PREFIX86(_push_bx)(i8086_state *cpustate);
static void PREFIX86(_push_sp)(i8086_state *cpustate);
static void PREFIX86(_push_bp)(i8086_state *cpustate);
static void PREFIX86(_push_si)(i8086_state *cpustate);
static void PREFIX86(_push_di)(i8086_state *cpustate);
static void PREFIX86(_pop_ax)(i8086_state *cpustate);
static void PREFIX86(_pop_cx)(i8086_state *cpustate);
static void PREFIX86(_pop_dx)(i8086_state *cpustate);
static void PREFIX86(_pop_bx)(i8086_state *cpustate);
static void PREFIX86(_pop_sp)(i8086_state *cpustate);
static void PREFIX86(_pop_bp)(i8086_state *cpustate);
static void PREFIX86(_pop_si)(i8086_state *cpustate);
static void PREFIX86(_pop_di)(i8086_state *cpustate);
static void PREFIX86(_jo)(i8086_state *cpustate);
static void PREFIX86(_jno)(i8086_state *cpustate);
static void PREFIX86(_jb)(i8086_state *cpustate);
static void PREFIX86(_jnb)(i8086_state *cpustate);
static void PREFIX86(_jz)(i8086_state *cpustate);
static void PREFIX86(_jnz)(i8086_state *cpustate);
static void PREFIX86(_jbe)(i8086_state *cpustate);
static void PREFIX86(_jnbe)(i8086_state *cpustate);
static void PREFIX86(_js)(i8086_state *cpustate);
static void PREFIX86(_jns)(i8086_state *cpustate);
static void PREFIX86(_jp)(i8086_state *cpustate);
static void PREFIX86(_jnp)(i8086_state *cpustate);
static void PREFIX86(_jl)(i8086_state *cpustate);
static void PREFIX86(_jnl)(i8086_state *cpustate);
static void PREFIX86(_jle)(i8086_state *cpustate);
static void PREFIX86(_jnle)(i8086_state *cpustate);
static void PREFIX86(_80pre)(i8086_state *cpustate);
static void PREFIX86(_82pre)(i8086_state *cpustate);
static void PREFIX86(_81pre)(i8086_state *cpustate);
static void PREFIX86(_83pre)(i8086_state *cpustate);
static void PREFIX86(_test_br8)(i8086_state *cpustate);
static void PREFIX86(_test_wr16)(i8086_state *cpustate);
static void PREFIX86(_xchg_br8)(i8086_state *cpustate);
static void PREFIX86(_xchg_wr16)(i8086_state *cpustate);
static void PREFIX86(_mov_br8)(i8086_state *cpustate);
static void PREFIX86(_mov_r8b)(i8086_state *cpustate);
static void PREFIX86(_mov_wr16)(i8086_state *cpustate);
static void PREFIX86(_mov_r16w)(i8086_state *cpustate);
static void PREFIX86(_mov_wsreg)(i8086_state *cpustate);
static void PREFIX86(_lea)(i8086_state *cpustate);
static void PREFIX86(_mov_sregw)(i8086_state *cpustate);
static void PREFIX86(_invalid)(i8086_state *cpustate);
#ifndef I80286
static void PREFIX86(_invalid_2b)(i8086_state *cpustate);
#endif
static void PREFIX86(_popw)(i8086_state *cpustate);
static void PREFIX86(_nop)(i8086_state *cpustate);
static void PREFIX86(_xchg_axcx)(i8086_state *cpustate);
static void PREFIX86(_xchg_axdx)(i8086_state *cpustate);
static void PREFIX86(_xchg_axbx)(i8086_state *cpustate);
static void PREFIX86(_xchg_axsp)(i8086_state *cpustate);
static void PREFIX86(_xchg_axbp)(i8086_state *cpustate);
static void PREFIX86(_xchg_axsi)(i8086_state *cpustate);
static void PREFIX86(_xchg_axdi)(i8086_state *cpustate);
static void PREFIX86(_cbw)(i8086_state *cpustate);
static void PREFIX86(_cwd)(i8086_state *cpustate);
static void PREFIX86(_call_far)(i8086_state *cpustate);
static void PREFIX86(_pushf)(i8086_state *cpustate);
static void PREFIX86(_popf)(i8086_state *cpustate);
static void PREFIX86(_sahf)(i8086_state *cpustate);
static void PREFIX86(_lahf)(i8086_state *cpustate);
static void PREFIX86(_mov_aldisp)(i8086_state *cpustate);
static void PREFIX86(_mov_axdisp)(i8086_state *cpustate);
static void PREFIX86(_mov_dispal)(i8086_state *cpustate);
static void PREFIX86(_mov_dispax)(i8086_state *cpustate);
static void PREFIX86(_movsb)(i8086_state *cpustate);
static void PREFIX86(_movsw)(i8086_state *cpustate);
static void PREFIX86(_cmpsb)(i8086_state *cpustate);
static void PREFIX86(_cmpsw)(i8086_state *cpustate);
static void PREFIX86(_test_ald8)(i8086_state *cpustate);
static void PREFIX86(_test_axd16)(i8086_state *cpustate);
static void PREFIX86(_stosb)(i8086_state *cpustate);
static void PREFIX86(_stosw)(i8086_state *cpustate);
static void PREFIX86(_lodsb)(i8086_state *cpustate);
static void PREFIX86(_lodsw)(i8086_state *cpustate);
static void PREFIX86(_scasb)(i8086_state *cpustate);
static void PREFIX86(_scasw)(i8086_state *cpustate);
static void PREFIX86(_mov_ald8)(i8086_state *cpustate);
static void PREFIX86(_mov_cld8)(i8086_state *cpustate);
static void PREFIX86(_mov_dld8)(i8086_state *cpustate);
static void PREFIX86(_mov_bld8)(i8086_state *cpustate);
static void PREFIX86(_mov_ahd8)(i8086_state *cpustate);
static void PREFIX86(_mov_chd8)(i8086_state *cpustate);
static void PREFIX86(_mov_dhd8)(i8086_state *cpustate);
static void PREFIX86(_mov_bhd8)(i8086_state *cpustate);
static void PREFIX86(_mov_axd16)(i8086_state *cpustate);
static void PREFIX86(_mov_cxd16)(i8086_state *cpustate);
static void PREFIX86(_mov_dxd16)(i8086_state *cpustate);
static void PREFIX86(_mov_bxd16)(i8086_state *cpustate);
static void PREFIX86(_mov_spd16)(i8086_state *cpustate);
static void PREFIX86(_mov_bpd16)(i8086_state *cpustate);
static void PREFIX86(_mov_sid16)(i8086_state *cpustate);
static void PREFIX86(_mov_did16)(i8086_state *cpustate);
static void PREFIX86(_ret_d16)(i8086_state *cpustate);
static void PREFIX86(_ret)(i8086_state *cpustate);
static void PREFIX86(_les_dw)(i8086_state *cpustate);
static void PREFIX86(_lds_dw)(i8086_state *cpustate);
static void PREFIX86(_mov_bd8)(i8086_state *cpustate);
static void PREFIX86(_mov_wd16)(i8086_state *cpustate);
static void PREFIX86(_retf_d16)(i8086_state *cpustate);
static void PREFIX86(_retf)(i8086_state *cpustate);
static void PREFIX86(_int3)(i8086_state *cpustate);
static void PREFIX86(_int)(i8086_state *cpustate);
static void PREFIX86(_into)(i8086_state *cpustate);
static void PREFIX86(_iret)(i8086_state *cpustate);
static void PREFIX86(_rotshft_b)(i8086_state *cpustate);
static void PREFIX86(_rotshft_w)(i8086_state *cpustate);
static void PREFIX86(_rotshft_bcl)(i8086_state *cpustate);
static void PREFIX86(_rotshft_wcl)(i8086_state *cpustate);
static void PREFIX86(_aam)(i8086_state *cpustate);
static void PREFIX86(_aad)(i8086_state *cpustate);
static void PREFIX86(_xlat)(i8086_state *cpustate);
static void PREFIX86(_escape)(i8086_state *cpustate);
static void PREFIX86(_loopne)(i8086_state *cpustate);
static void PREFIX86(_loope)(i8086_state *cpustate);
static void PREFIX86(_loop)(i8086_state *cpustate);
static void PREFIX86(_jcxz)(i8086_state *cpustate);
static void PREFIX86(_inal)(i8086_state *cpustate);
static void PREFIX86(_inax)(i8086_state *cpustate);
static void PREFIX86(_outal)(i8086_state *cpustate);
static void PREFIX86(_outax)(i8086_state *cpustate);
static void PREFIX86(_call_d16)(i8086_state *cpustate);
static void PREFIX86(_jmp_d16)(i8086_state *cpustate);
static void PREFIX86(_jmp_far)(i8086_state *cpustate);
static void PREFIX86(_jmp_d8)(i8086_state *cpustate);
static void PREFIX86(_inaldx)(i8086_state *cpustate);
static void PREFIX86(_inaxdx)(i8086_state *cpustate);
static void PREFIX86(_outdxal)(i8086_state *cpustate);
static void PREFIX86(_outdxax)(i8086_state *cpustate);
static void PREFIX86(_lock)(i8086_state *cpustate);
static void PREFIX86(_repne)(i8086_state *cpustate);
static void PREFIX86(_repe)(i8086_state *cpustate);
static void PREFIX86(_hlt)(i8086_state *cpustate);
static void PREFIX86(_cmc)(i8086_state *cpustate);
static void PREFIX86(_f6pre)(i8086_state *cpustate);
static void PREFIX86(_f7pre)(i8086_state *cpustate);
static void PREFIX86(_clc)(i8086_state *cpustate);
static void PREFIX86(_stc)(i8086_state *cpustate);
static void PREFIX86(_cli)(i8086_state *cpustate);
static void PREFIX86(_sti)(i8086_state *cpustate);
static void PREFIX86(_cld)(i8086_state *cpustate);
static void PREFIX86(_std)(i8086_state *cpustate);
static void PREFIX86(_fepre)(i8086_state *cpustate);
static void PREFIX86(_ffpre)(i8086_state *cpustate);
static void PREFIX86(_wait)(i8086_state *cpustate);

#endif /* __INSTR86_H__ */


text:
'use strict';
const log4js = require('log4js');
const path = require('path');
const config = require('./config/');
log4js.configure(path.join(__dirname, './log4js.conf.json'), {
  cwd: path.join(config.SERVER_ROOT, 'logs')
});
const logger = log4js.getLogger();
module.exports = logger;

redpajama_set_name: RedPajamaGithub


text:
KWI_Mobile
==========

| ![LoginScreen](https://raw.githubusercontent.com/Hadjimina/KWI_Mobile/master/KWIfront.png)  | ![Table](https://raw.githubusercontent.com/Hadjimina/KWI_Mobile/master/table.png) | ![Settings](https://raw.githubusercontent.com/Hadjimina/KWI_Mobile/master/settings.png) |
|:---:|:---:|:---:|
| Login Screen | Overview Table | Settings |

This is an Android application which lets the students of the KWI in switzerland access their timetable data in real time.
It was my Senior Project so the complete written documentation (45 Pages) can be found here : https://goo.gl/rBFZpq

If some KWI student wants to continue to work on this project, feel free to do so. Never the less I would appreciate a heads up. Enjoy !


text:
require 'puppetlabs_spec_helper/module_spec_helper'
require 'hiera-puppet-helper'
require 'yaml'

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))

# Add fixture lib dirs to LOAD_PATH. Work-around for PUP-3336
if Puppet.version < "4.0.0"
  Dir["#{fixture_path}/modules/*/lib"].entries.each do |lib_dir|
    $LOAD_PATH << lib_dir
  end
end

RSpec.configure do |c|
  c.formatter = :documentation
  # Enable colour in Jenkins
  c.color = true
  c.tty = true
  c.before do
    # avoid "Only root can execute commands as other users"
    Puppet.features.stubs(:root? => true)

    if ENV['RSPEC_PUPPET_DEBUG']
      Puppet::Util::Log.level = :debug
      Puppet::Util::Log.newdestination(:console)
      Puppet.settings[:graph] = true
      Puppet.settings[:graphdir] = "#{project_root}"
    end

  end
end

# use both rpsec and yaml backends .. see: https://github.com/bobtfish/hiera-puppet-helper#advanced
shared_context "hieradata" do
  let(:hiera_config) do
    { :backends => ['rspec', 'yaml'],
    :hierarchy => [
      '%{fqdn}/%{calling_module}',
      '%{calling_module}',
      'common'],
    :yaml => {
      :datadir => File.join(fixture_path, 'hieradata') },
    :rspec => respond_to?(:hiera_data) ? hiera_data : {} }
  end
end

shared_context "facter" do
  let(:default_facts) {{
    :kernel => 'Linux',
    :osfamily => 'RedHat',
    :concat_basedir => '/dne',
    :operatingsystem => 'CentOS',
    :architecture => 'x86_64',
    :path => '/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin',
    :cache_bust => Time.now,
  }}
end


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

function main(updateMask) {
  // [START composer_v1beta1_generated_Environments_UpdateEnvironment_async]
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The relative resource name of the environment to update, in the form:
   *  "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
   */
  // const name = 'abc123'
  /**
   *  A patch environment. Fields specified by the `updateMask` will be copied
   *  from the patch environment into the environment under update.
   */
  // const environment = {}
  /**
   *  Required. A comma-separated list of paths, relative to `Environment`, of
   *  fields to update.
   *  For example, to set the version of scikit-learn to install in the
   *  environment to 0.19.0 and to remove an existing installation of
   *  argparse, the `updateMask` parameter would include the following two
   *  `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and
   *  "config.softwareConfig.pypiPackages.argparse". The included patch
   *  environment would specify the scikit-learn version as follows:
   *      {
   *        "config":{
   *          "softwareConfig":{
   *            "pypiPackages":{
   *              "scikit-learn":"==0.19.0"
   *            }
   *          }
   *        }
   *      }
   *  Note that in the above example, any existing PyPI packages
   *  other than scikit-learn and argparse will be unaffected.
   *  Only one update type may be included in a single request's `updateMask`.
   *  For example, one cannot update both the PyPI packages and
   *  labels in the same request. However, it is possible to update multiple
   *  members of a map field simultaneously in the same request. For example,
   *  to set the labels "label1" and "label2" while clearing "label3" (assuming
   *  it already exists), one can
   *  provide the paths "labels.label1", "labels.label2", and "labels.label3"
   *  and populate the patch environment as follows:
   *      {
   *        "labels":{
   *          "label1":"new-label1-value"
   *          "label2":"new-label2-value"
   *        }
   *      }
   *  Note that in the above example, any existing labels that are not
   *  included in the `updateMask` will be unaffected.
   *  It is also possible to replace an entire map field by providing the
   *  map field's path in the `updateMask`. The new value of the field will
   *  be that which is provided in the patch environment. For example, to
   *  delete all pre-existing user-specified PyPI packages and
   *  install botocore at version 1.7.14, the `updateMask` would contain
   *  the path "config.softwareConfig.pypiPackages", and
   *  the patch environment would be the following:
   *      {
   *        "config":{
   *          "softwareConfig":{
   *            "pypiPackages":{
   *              "botocore":"==1.7.14"
   *            }
   *          }
   *        }
   *      }
   *  **Note:** Only the following fields can be updated:
   *  * `config.softwareConfig.pypiPackages`
   *      * Replace all custom custom PyPI packages. If a replacement
   *        package map is not included in `environment`, all custom
   *        PyPI packages are cleared. It is an error to provide both
   *        this mask and a mask specifying an individual package.
   *  * `config.softwareConfig.pypiPackages.`packagename
   *      * Update the custom PyPI package *packagename*,
   *        preserving other packages. To delete the package, include it in
   *        `updateMask`, and omit the mapping for it in
   *        `environment.config.softwareConfig.pypiPackages`. It is an error
   *        to provide both a mask of this form and the
   *        `config.softwareConfig.pypiPackages` mask.
   *  * `labels`
   *      * Replace all environment labels. If a replacement labels map is not
   *        included in `environment`, all labels are cleared. It is an error to
   *        provide both this mask and a mask specifying one or more individual
   *        labels.
   *  * `labels.`labelName
   *      * Set the label named *labelName*, while preserving other
   *        labels. To delete the label, include it in `updateMask` and omit its
   *        mapping in `environment.labels`. It is an error to provide both a
   *        mask of this form and the `labels` mask.
   *  * `config.nodeCount`
   *      * Horizontally scale the number of nodes in the environment. An integer
   *        greater than or equal to 3 must be provided in the `config.nodeCount`
   *        field. * `config.webServerNetworkAccessControl`
   *      * Replace the environment's current WebServerNetworkAccessControl.
   *  * `config.softwareConfig.airflowConfigOverrides`
   *      * Replace all Apache Airflow config overrides. If a replacement config
   *        overrides map is not included in `environment`, all config overrides
   *        are cleared.
   *        It is an error to provide both this mask and a mask specifying one or
   *        more individual config overrides.
   *  * `config.softwareConfig.airflowConfigOverrides.`section-name
   *      * Override the Apache Airflow config property *name* in the
   *        section named *section*, preserving other properties. To
   *        delete the property override, include it in `updateMask` and omit its
   *        mapping in
   *        `environment.config.softwareConfig.airflowConfigOverrides`.
   *        It is an error to provide both a mask of this form and the
   *        `config.softwareConfig.airflowConfigOverrides` mask.
   *  * `config.softwareConfig.envVariables`
   *      * Replace all environment variables. If a replacement environment
   *        variable map is not included in `environment`, all custom environment
   *        variables  are cleared.
   *        It is an error to provide both this mask and a mask specifying one or
   *        more individual environment variables.
   *  * `config.softwareConfig.imageVersion`
   *      * Upgrade the version of the environment in-place. Refer to
   *        `SoftwareConfig.image_version` for information on how to format the
   *        new image version. Additionally, the new image version cannot effect
   *        a version downgrade and must match the current image version's
   *        Composer major version and Airflow major and minor versions. Consult
   *        the Cloud Composer Version
   *        List (https://cloud.google.com/composer/docs/concepts/versioning/composer-versions)
   *        for valid values.
   *  * `config.softwareConfig.schedulerCount`
   *      * Horizontally scale the number of schedulers in Airflow. A positive
   *        integer not greater than the number of nodes must be provided in the
   *        `config.softwareConfig.schedulerCount` field. * `config.databaseConfig.machineType`
   *      * Cloud SQL machine type used by Airflow database.
   *        It has to be one of: db-n1-standard-2, db-n1-standard-4,
   *        db-n1-standard-8 or db-n1-standard-16. * `config.webServerConfig.machineType`
   *      * Machine type on which Airflow web server is running.
   *        It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4
   *        or composer-n1-webserver-8. * `config.maintenanceWindow`
   *      * Maintenance window during which Cloud Composer components may be
   *        under maintenance.
   */
  // const updateMask = {}

  // Imports the Service library
  const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1;

  // Instantiates a client
  const serviceClient = new EnvironmentsClient();

  async function callUpdateEnvironment() {
    // Construct request
    const request = {
      updateMask,
    };

    // Run request
    const [operation] = await serviceClient.updateEnvironment(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateEnvironment();
  // [END composer_v1beta1_generated_Environments_UpdateEnvironment_async]
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));


text:
package main

import (
	"bytes"
	"flag"
	"fmt"
	"os"
	"os/exec"
	"os/signal"
	"strconv"
	"strings"
	"syscall"
	"time"

	log "github.com/nickjones/proc_box/Godeps/_workspace/src/github.com/Sirupsen/logrus"
	"github.com/nickjones/proc_box/Godeps/_workspace/src/github.com/streadway/amqp"
	"github.com/nickjones/proc_box/agents"
)

var (
	uri              = flag.String("uri", "amqp://guest:guest@localhost:5672", "AMQP connection URI.")
	exchange         = flag.String("exchange", "amq.topic", "AMQP exchange to bind.")
	rmtKey           = flag.String("rkey", "proc_box.remote_control", "AMQP routing key for remote process control.")
	procStatsKey     = flag.String("skey", "proc_box.stats", "AMQP routing key prefix for proc stats.")
	statsInterval    = flag.Duration("sint", 1*time.Minute, "Interval to emit process statistics.")
	wallclockTimeout = flag.Duration("timeout", 10*time.Minute, "The time until wallclock timeout of the process.")
	stdoutByteLimit  = flag.Int64("stdoutlimit", 100*1024*1024*1024, "Threshold of emitted bytes to STDOUT by the child before calling Stop on the process (default 100GB).")
	debugMode        = flag.Bool("debug", false, "Debug logging enable")
	noWarn           = flag.Bool("nowarn", false, "Disable warnings on stats collection.")
	// Deprecated but left for backwards compatability for now.  Assumed this is
	// enabled by default.
	runAnyway   = flag.Bool("runanyway", false, "Ignore all AMQP errors (connection, message generation, etc.).")
	msgTimeout  = flag.Duration("msgtimeout", 30*time.Second, "The time allowed for a statistics mesage to be sent before giving up. (0 means never)")
	userJSON    = flag.String("json", "", "User provided JSON to include in the statistic sample.")
	multiRmtKey = flag.Bool("multiRmtKey", false, "Enable splitting multiple remote control keys with commas.")
	version     = flag.Bool("version", false, "Show version.")

	VERSION   = "development"
	BUILDDATE = "now-ish"
)

type session struct {
	amqpConn     *amqp.Connection
	job          agents.JobControl
	exchange     string
	rcRoutingKey string
	psChan       chan agents.ProcessStatCommand
	rcChan       chan chan agents.RemoteControlCommand
	amqpConfig   amqp.Config
	multiRmtKey  bool
}

func init() {
	flag.Parse()

	// Create a map of pointers to all the current flags
	flags := map[string]*flag.Flag{}
	flag.VisitAll(func(f *flag.Flag) {
		flags[f.Name] = f
	})

	// Remove the flags that were set on the command line
	flag.Visit(func(f *flag.Flag) {
		delete(flags, f.Name)
	})

	// Now for the flags that weren't set on the cli,
	// Look at the env for 'PBOX_<uppercase flag name>'
	// If it exists, use it to set the corresponding flag.
	for _, f := range flags {
		var buffer bytes.Buffer
		buffer.WriteString("PBOX_")
		buffer.WriteString(strings.ToUpper(f.Name))
		if os.Getenv(buffer.String()) != "" {
			f.Value.Set(os.Getenv(buffer.String()))
		}
	}
}

func main() {

	if *version {
		fmt.Printf("proc_box version %s built %s\n", VERSION, BUILDDATE)
		os.Exit(0)
	}
	if *debugMode {
		log.SetLevel(log.DebugLevel)
	} else if *noWarn {
		log.SetLevel(log.ErrorLevel)
	}

	// Create channel for ProcessStats to trigger a sample
	psChan := make(chan agents.ProcessStatCommand)
	// Incoming remote command channel (new with each reconnect)
	rcChan := make(chan chan agents.RemoteControlCommand)

	args := flag.Args()
	var cmdArgs []string
	var cmd string
	if len(args) > 0 {
		cmd = args[0]
	} else {
		log.Fatal("Did you forget a command to run?")
		return
	}

	log.Debugf("cmd: %s cmdArgs: %q\n", cmd, cmdArgs)

	done := make(chan error)

	// Initialize job
	job, err := agents.NewControlledProcess(cmd, args, done, *stdoutByteLimit)
	if err != nil {
		log.Fatalf("Failed to create a NewControlledProcess: %s\n", err)
		return
	}

	log.Debugf("%#v\n", job)

	signals := make(chan os.Signal, 1)
	signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT)

	timer, err := agents.NewTimer(*wallclockTimeout)
	if err != nil {
		log.Warnln("Error returned creating timeout agent", err)
	}
	log.Debugf("Starting timer with timeout of: %v\n", *wallclockTimeout)
	timer.Start()

	sess := session{
		job:          job,
		exchange:     *exchange,
		rcRoutingKey: *rmtKey,
		psChan:       psChan,
		rcChan:       rcChan,
		amqpConfig: amqp.Config{
			Properties: amqp.Table{
				"product": "proc_box",
				"version": VERSION,
			},
		},
		multiRmtKey: *multiRmtKey,
	}
	go redial(sess)

	go monitor(signals, rcChan, job, psChan, timer, done)

	err = <-done

	elapsedTime, _ := timer.ElapsedTime()
	// Print to standard out
	fmt.Printf("Task elapsed time: %.2f seconds.\n", elapsedTime.Seconds())

	if err != nil {
		if exiterr, ok := err.(*exec.ExitError); ok {
			// Non-zero exit code
			if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
				exitStatus := status.ExitStatus()
				log.Debugf("Exit Status: %d\n", exitStatus)
				os.Exit(exitStatus)
			}
		} else {
			log.Debugf("cmd.Wait: %v\n", err)
		}
	} else {
		os.Exit(0)
	}
}

func redial(sess session) {
	var err error
	var stats agents.ProcessStats
	var rc *agents.RemoteControl

	// Initialize mini-router for incoming stats agent requests
	go func() {
		for s := range sess.psChan {
			if stats == nil {
				log.Warnln("No stats agents available (yet), dropping request")
			} else if s.TimeUpdate {
				stats.NewTicker(s.NewTime)
			} else {
				stats.Sample()
			}
		}
	}()

	rcKeys := []string{*rmtKey}
	if sess.multiRmtKey {
		rcKeys = deleteEmpty(strings.Split(*rmtKey, ","))
	}
	for {
		sess.amqpConn, err = amqp.DialConfig(*uri, sess.amqpConfig)

		if err != nil {
			log.Warnf("Failed to connect to AMQP: %q", err)
			// Rate limit reconnection attempts
			time.Sleep(5 * time.Second)
		} else {
			rc, err = agents.NewRemoteControl(sess.amqpConn, rcKeys, *exchange)
			if err != nil {
				log.Warnf("Failed creating NewRemoteControl: %s", err)
			} else {
				sess.rcChan <- rc.Commands
			}

			if stats == nil {
				// initial setup
				stats, err = agents.NewProcessStats(
					sess.amqpConn,
					*procStatsKey,
					*exchange,
					&sess.job,
					*statsInterval,
					*msgTimeout,
					*userJSON,
				)
				if err != nil {
					log.Warnf("Failed creating NewProcessStats: %s", err)
				}
			} else {
				err = stats.ReinitializeConnection(sess.amqpConn)
				if err != nil {
					log.Warnf("Failed to reinitialize process stats: %s", err)
				}
			}
			closings := sess.amqpConn.NotifyClose(make(chan *amqp.Error))

			// Wait for close notification and loop back around to reconnect
			_ = <-closings
			log.Debugln("Saw a notification for closed connection, looping")
		}

	}
}

func monitor(
	signals chan os.Signal,
	rcChanChan chan chan agents.RemoteControlCommand,
	job agents.JobControl,
	psChan chan agents.ProcessStatCommand,
	timer agents.Timer,
	done chan error,
) {

	// Catch any panics here to ensure we kill the child process before going
	// to our own doom.
	defer func() {
		if e := recover(); e != nil {
			job.Kill(-9)
			panic(e)
		}
	}()
	var logSampling <-chan time.Time
	var err error

	if *stdoutByteLimit > 0 {
		ticker := time.NewTicker(100 * time.Millisecond)
		// Replace the time channel with an actual ticker if this is in use
		logSampling = ticker.C
	}

	var rcChan chan agents.RemoteControlCommand

	for {
		select {
		case rcChan = <-rcChanChan:
		// Catch incoming signals and operate on them as if they were remote commands
		case sig := <-signals:
			switch sig {
			case syscall.SIGINT:
				log.Debugln("Caught SIGINT, graceful shutdown")
				// Initiate non-blocking send
				select {
				case psChan <- agents.ProcessStatCommand{}:
					log.Debugln("Sending psChan a msg to sample")
				default:
					log.Debugln("SIGINT failed to send a sample msg on the psChan")
				}
				err = job.Stop()
			case syscall.SIGTERM:
				log.Debugln("Caught SIGTERM, end abruptly")
				job.Kill(-9)
			case syscall.SIGHUP:
				log.Debugln("Caught SIGHUP, emit stats")
				// Initiate non-blocking send
				select {
				case psChan <- agents.ProcessStatCommand{}:
					log.Debugln("Sending psChan a msg to sample")
				default:
					log.Debugln("SIGHUP failed to send a sample msg on the psChan")
				}
			case syscall.SIGQUIT:
				log.Debugln("Caught SIGQUIT, graceful shutdown")
				select {
				case psChan <- agents.ProcessStatCommand{}:
					log.Debugln("Sending psChan a msg to sample")
				default:
					log.Debugln("SIGQUIT failed to send a sample msg on the psChan")
				}
				err = job.Stop()
			}
		// Process incoming remote commands, toss unknown requests
		case cmd := <-rcChan:
			log.Debugf("Got a command %#v\n", cmd)
			switch cmd.Command {
			case "suspend":
				log.Debugln("RemoteCommand: Suspend")
				job.Suspend()
			case "resume":
				log.Debugln("RemoteCommand: Resume")
				job.Resume()
			case "kill":
				log.Debugln("RemoteCommand: Kill")
				var args int64
				if len(cmd.Arguments) == 0 {
					args = -9
				} else {
					args, err = strconv.ParseInt(cmd.Arguments[0], 10, 32)
					if err != nil {
						log.Warnf("Unable to parse kill command argument[0] into int: %s\n", err)
						args = -9
					}
				}
				job.Kill(args)
			case "stop":
				log.Debugln("RemoteCommand: Stop")
				select {
				case psChan <- agents.ProcessStatCommand{}:
					log.Debugln("Sending psChan a msg to sample")
				default:
					log.Debugln("RC Stop failed to send a sample msg on the psChan")
				}
				if err = job.Stop(); err != nil {
					log.Fatalf("Error received while stopping sub-process: %s\n", err)
				}
			case "sample":
				log.Debugln("RemoteCommand: Sample")
				select {
				case psChan <- agents.ProcessStatCommand{}:
					log.Debugln("Sending psChan a msg to sample")
				default:
					log.Debugln("RC Sample failed to send a sample msg on the psChan")
				}
			case "change_sample_rate":
				log.Debugln("RemoteCommand: Change Stats Sample Rate")
				if len(cmd.Arguments) > 0 {
					log.Debugf("change_sample_rate arg[0]: %s\n", cmd.Arguments[0])
					d, err := time.ParseDuration(cmd.Arguments[0])
					if err == nil {
						select {
						case psChan <- agents.ProcessStatCommand{
							TimeUpdate: true,
							NewTime:    d}:
							log.Debugln("Sending psChan a msg to update the ticker")
						default:
							log.Debugln("RC change_sample_rate failed to send a msg")
						}
					} else {
						log.Warnf("Unparseable duration argument to command change_sample_rate")
					}
				} else {
					log.Warnf("Missing argument to command change_sample_rate")
				}
			case "timer_reset":
				log.Debugln("RemoteCommand: Timer Reset")
				if err = timer.Reset(); err != nil {
					log.Fatalf("Error received from timer calling Reset: %s\n", err)
				}
			case "timer_start":
				log.Debugln("RemoteCommand: Timer Start")
				if err = timer.Start(); err != nil {
					log.Fatalf("Error received from timer calling Start: %s\n", err)
				}
			case "timer_stop":
				log.Debugln("RemoteCommand: Timer Stop")
				if err = timer.Stop(); err != nil {
					log.Fatalf("Error received from timer calling Stop: %s\n", err)
				}
			case "timer_resume":
				log.Debugln("RemoteCommand: Timer Resume")
				if err = timer.Resume(); err != nil {
					log.Fatalf("Error received from timer calling Resume: %s\n", err)
				}
			default:
				log.Debugf("Unknown command: %s\n", cmd)
			}
		case timeoutMsg := <-timer.Done():
			log.Debugf("Timer timeout message: %s\n", timeoutMsg)
			if err = job.Stop(); err != nil {
				log.Fatalf("Error received while stopping sub-process: %v\n", err)
				// If there was an error stopping the process, kill the porcess.
				job.Kill(-9)
			}
		case jobDone := <-job.Done():
			log.Debugln("Command exited gracefully; shutting down.")
			done <- jobDone
		case _ = <-logSampling:
			if job.StdoutByteCount() > 2*(*stdoutByteLimit) {
				err = job.Kill(-9)
			} else if job.StdoutByteCount() > *stdoutByteLimit {
				err = job.Stop()
			}
		}
	}
}

func deleteEmpty(s []string) []string {
	var r []string
	for _, v := range s {
		if len(v) > 0 {
			r = append(r, v)
		}
	}
	return r
}


text:
//$Id$

package org.hibernate.test.annotations.lob;

import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;

/**
 * @author Emmanuel Bernard
 */
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
public class LobTest extends AbstractLobTest<Book, CompiledCode> {
	@Override
	protected Class<Book> getBookClass() {
		return Book.class;
	}

	@Override
	protected Integer getId(Book book) {
		return book.getId();
	}

	@Override
	protected Class<CompiledCode> getCompiledCodeClass() {
		return CompiledCode.class;
	}

	@Override
	protected Integer getId(CompiledCode compiledCode) {
		return compiledCode.getId();
	}

	@Override
	protected Class[] getAnnotatedClasses() {
		return new Class[] {
				Book.class,
				CompiledCode.class
		};
	}
}


text:
/*
 * Manager.cpp
 *
 *  Created on: 23 Oct 2015
 *      Author: hieu
 */
#include <boost/foreach.hpp>
#include <vector>
#include <sstream>
#include "System.h"
#include "ManagerBase.h"
#include "Phrase.h"
#include "InputPathsBase.h"
#include "InputPathBase.h"
#include "TranslationModel/PhraseTable.h"
#include "legacy/Range.h"
#include "PhraseBased/Sentence.h"

using namespace std;

namespace Moses2
{
ManagerBase::ManagerBase(System &sys, const TranslationTask &task,
                         const std::string &inputStr, long translationId)
  :system(sys)
  ,task(task)
  ,m_inputStr(inputStr)
  ,m_translationId(translationId)
  ,m_pool(NULL)
  ,m_systemPool(NULL)
  ,m_hypoRecycle(NULL)
{
}

ManagerBase::~ManagerBase()
{
  system.featureFunctions.CleanUpAfterSentenceProcessing();

  if (m_pool) {
    GetPool().Reset();
  }
  if (m_hypoRecycle) {
    GetHypoRecycle().Clear();
  }
}

void ManagerBase::InitPools()
{
  m_pool = &system.GetManagerPool();
  m_systemPool = &system.GetSystemPool();
  m_hypoRecycle = &system.GetHypoRecycler();
}

}


text:
class test {
	constructor(private ngstomp: ngStomp) {
		const connectHeaders = {
			Auth: "user",
			Accept: "lol"
		};

		ngstomp.connect('/endpoint', connectHeaders)
		// frame = CONNECTED headers
		.then(function(frame) {
			this.subscription = ngstomp.subscribe('/dest', function(payload, headers, res) {
				this.payload = payload;
			}, {
				headers: "are awesome"
			});

			// Unsubscribe
			this.subscription.unsubscribe();

			// Send message
			ngstomp.send('/dest', {
				message: 'body'
			}, {
				priority: 9,
				custom: 42 // Custom Headers
			});

			// Disconnect
			ngstomp.disconnect(() => {});
		});
	}
}

angular.module("app").controller("ngStompTest", test);


text:
package io.grpc.internal;

import static io.grpc.ConnectivityState.CONNECTING;
import static io.grpc.ConnectivityState.IDLE;
import static io.grpc.ConnectivityState.READY;
import static io.grpc.ConnectivityState.SHUTDOWN;
import static io.grpc.ConnectivityState.TRANSIENT_FAILURE;
import static org.junit.Assert.assertEquals;

import com.google.common.util.concurrent.MoreExecutors;
import io.grpc.ConnectivityState;
import java.util.LinkedList;
import java.util.concurrent.Executor;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * Unit tests for {@link ConnectivityStateManager}.
 */
@RunWith(JUnit4.class)
public class ConnectivityStateManagerTest {
  @SuppressWarnings("deprecation") // https://github.com/grpc/grpc-java/issues/7467
  @Rule
  public final ExpectedException thrown = ExpectedException.none();

  private final FakeClock executor = new FakeClock();
  private final ConnectivityStateManager state = new ConnectivityStateManager();
  private final LinkedList<ConnectivityState> sink = new LinkedList<>();

  @Test
  public void noCallback() {
    state.gotoState(CONNECTING);
    assertEquals(CONNECTING, state.getState());
    state.gotoState(TRANSIENT_FAILURE);
    assertEquals(TRANSIENT_FAILURE, state.getState());
  }

  @Test
  public void registerCallbackBeforeStateChanged() {
    state.gotoState(CONNECTING);
    assertEquals(CONNECTING, state.getState());

    state.notifyWhenStateChanged(new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
        }
      }, executor.getScheduledExecutorService(), CONNECTING);

    assertEquals(0, executor.numPendingTasks());
    state.gotoState(TRANSIENT_FAILURE);
    // Make sure the callback is run in the executor
    assertEquals(0, sink.size());
    assertEquals(1, executor.runDueTasks());
    assertEquals(0, executor.numPendingTasks());
    assertEquals(1, sink.size());
    assertEquals(TRANSIENT_FAILURE, sink.poll());
  }

  @Test
  public void registerCallbackAfterStateChanged() {
    state.gotoState(CONNECTING);
    assertEquals(CONNECTING, state.getState());

    state.notifyWhenStateChanged(new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
        }
      }, executor.getScheduledExecutorService(), IDLE);

    // Make sure the callback is run in the executor
    assertEquals(0, sink.size());
    assertEquals(1, executor.runDueTasks());
    assertEquals(0, executor.numPendingTasks());
    assertEquals(1, sink.size());
    assertEquals(CONNECTING, sink.poll());
  }

  @Test
  public void callbackOnlyCalledOnTransition() {
    state.notifyWhenStateChanged(new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
        }
      }, executor.getScheduledExecutorService(), IDLE);

    state.gotoState(IDLE);
    assertEquals(0, executor.numPendingTasks());
    assertEquals(0, sink.size());
  }

  @Test
  public void callbacksAreOneShot() {
    Runnable callback = new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
        }
      };

    state.notifyWhenStateChanged(callback, executor.getScheduledExecutorService(), IDLE);
    // First transition triggers the callback
    state.gotoState(CONNECTING);
    assertEquals(1, executor.runDueTasks());
    assertEquals(1, sink.size());
    assertEquals(CONNECTING, sink.poll());
    assertEquals(0, executor.numPendingTasks());

    // Second transition doesn't trigger the callback
    state.gotoState(TRANSIENT_FAILURE);
    assertEquals(0, sink.size());
    assertEquals(0, executor.numPendingTasks());

    // Register another callback
    state.notifyWhenStateChanged(
        callback, executor.getScheduledExecutorService(), TRANSIENT_FAILURE);

    state.gotoState(READY);
    state.gotoState(IDLE);
    // Callback loses the race with the second stage change
    assertEquals(1, executor.runDueTasks());
    assertEquals(1, sink.size());
    // It will see the second state
    assertEquals(IDLE, sink.poll());
    assertEquals(0, executor.numPendingTasks());
  }

  @Test
  public void multipleCallbacks() {
    final LinkedList<String> callbackRuns = new LinkedList<>();
    state.notifyWhenStateChanged(new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
          callbackRuns.add("callback1");
        }
      }, executor.getScheduledExecutorService(), IDLE);
    state.notifyWhenStateChanged(new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
          callbackRuns.add("callback2");
        }
      }, executor.getScheduledExecutorService(), IDLE);
    state.notifyWhenStateChanged(new Runnable() {
        @Override
        public void run() {
          sink.add(state.getState());
          callbackRuns.add("callback3");
        }
      }, executor.getScheduledExecutorService(), READY);

    // callback3 is run immediately because the source state is already different from the current
    // state.
    assertEquals(1, executor.runDueTasks());
    assertEquals(1, callbackRuns.size());
    assertEquals("callback3", callbackRuns.poll());
    assertEquals(1, sink.size());
    assertEquals(IDLE, sink.poll());

    // Now change the state.
    state.gotoState(CONNECTING);
    assertEquals(2, executor.runDueTasks());
    assertEquals(2, callbackRuns.size());
    assertEquals("callback1", callbackRuns.poll());
    assertEquals("callback2", callbackRuns.poll());
    assertEquals(2, sink.size());
    assertEquals(CONNECTING, sink.poll());
    assertEquals(CONNECTING, sink.poll());

    assertEquals(0, executor.numPendingTasks());
  }

  private Runnable newRecursiveCallback(final Executor executor) {
    return new Runnable() {
      @Override
      public void run() {
        sink.add(state.getState());
        state.notifyWhenStateChanged(newRecursiveCallback(executor), executor, state.getState());
      }
    };
  }

  @Test
  public void registerCallbackFromCallback() {
    state.notifyWhenStateChanged(newRecursiveCallback(executor.getScheduledExecutorService()),
        executor.getScheduledExecutorService(), state.getState());

    state.gotoState(CONNECTING);
    assertEquals(1, executor.runDueTasks());
    assertEquals(0, executor.numPendingTasks());
    assertEquals(1, sink.size());
    assertEquals(CONNECTING, sink.poll());

    state.gotoState(READY);
    assertEquals(1, executor.runDueTasks());
    assertEquals(0, executor.numPendingTasks());
    assertEquals(1, sink.size());
    assertEquals(READY, sink.poll());
  }

  @Test
  public void registerCallbackFromCallbackDirectExecutor() {
    state.notifyWhenStateChanged(newRecursiveCallback(MoreExecutors.directExecutor()),
        MoreExecutors.directExecutor(), state.getState());

    state.gotoState(CONNECTING);
    assertEquals(1, sink.size());
    assertEquals(CONNECTING, sink.poll());

    state.gotoState(READY);
    assertEquals(1, sink.size());
    assertEquals(READY, sink.poll());
  }

  @Test
  public void shutdownThenReady() {
    state.gotoState(SHUTDOWN);
    assertEquals(SHUTDOWN, state.getState());

    state.gotoState(READY);
    assertEquals(SHUTDOWN, state.getState());
  }
}


text:
import logging, traceback, math, re

def prettyDataSize(size_in_bytes):
    """ Takes a data size in bytes and formats a pretty string. """
    unit = "B"
    size_in_bytes = float(size_in_bytes)
    if size_in_bytes > 1024:
        size_in_bytes /= 1024
        unit = "kiB"
    if size_in_bytes > 1024:
        size_in_bytes /= 1024
        unit = "MiB"
    if size_in_bytes > 1024:
        size_in_bytes /= 1024
        unit = "GiB"
    if size_in_bytes > 1024:
        size_in_bytes /= 1024
        unit = "TiB"
    print size_in_bytes, "%.1f "%size_in_bytes + unit
    return "%.1f "%size_in_bytes + unit

matheval_context = {
    "abs": abs,
    "sin": math.sin,
    "cos": math.cos,
    "sqrt": math.sqrt,
    "pow": math.pow,
    "floor": math.floor,
    "ceil": math.ceil,
    "max": max,
    "min": min,
    "float": float,
    "int": int,
}
def matheval(input, variables={}):
    """
    A safe way to evaluate mathematical expressions.

    The following Python functions are available

     * abs
     * sin
     * cos
     * sqrt
     * pow
     * floor
     * ceil
     * max
     * min
     * float
     * int

    :param input: String with mathematical expression
    :param variables: A dictionary with variables available for  input expression
    :returns: The result of the expression, or *None* in case of error.
    """

    # block everything, even builtins, and add "safe" mathematical functions.
    # Statements won't work, as well as potentially dangerous things like
    # __import__ or open.
    variables.update(matheval_context)
    try:
        return eval(input, {"__builtins__": None}, variables)
    except Exception, e:
        logging.error(traceback.format_exc())
        return None

__regex_url = re.compile(r"([-\+a-zA-Z]{2,7}://[-_a-zA-Z0-9\.\?!&/=~:]+)")
def addAutoLinks(string):
    """
    Searches for URLs in string using a regular expression and
    adds -Tags around them.
    """
    return __regex_url.sub("\\1", string)


text:
<?php

namespace Zend\Db\Sql\Platform;

use Zend\Db\Adapter\AdapterInterface;
use Zend\Db\Adapter\Platform\PlatformInterface;
use Zend\Db\Adapter\StatementContainerInterface;
use Zend\Db\Sql\Exception;
use Zend\Db\Sql\PreparableSqlInterface;
use Zend\Db\Sql\SqlInterface;

class Platform extends AbstractPlatform
{
    /**
     * @var AdapterInterface
     */
    protected $adapter = null;

    /**
     * @var PlatformInterface|null
     */
    protected $defaultPlatform;

    public function __construct(AdapterInterface $adapter)
    {
        $this->defaultPlatform = $adapter->getPlatform();

        $mySqlPlatform     = new Mysql\Mysql();
        $sqlServerPlatform = new SqlServer\SqlServer();
        $oraclePlatform    = new Oracle\Oracle();
        $ibmDb2Platform    = new IbmDb2\IbmDb2();

        $this->decorators['mysql']     = $mySqlPlatform->getDecorators();
        $this->decorators['sqlserver'] = $sqlServerPlatform->getDecorators();
        $this->decorators['oracle']    = $oraclePlatform->getDecorators();
        $this->decorators['ibmdb2']    = $ibmDb2Platform->getDecorators();
    }

    /**
     * @param string                             $type
     * @param PlatformDecoratorInterface         $decorator
     * @param AdapterInterface|PlatformInterface $adapterOrPlatform
     */
    public function setTypeDecorator($type, PlatformDecoratorInterface $decorator, $adapterOrPlatform = null)
    {
        $platformName = $this->resolvePlatformName($adapterOrPlatform);
        $this->decorators[$platformName][$type] = $decorator;
    }

    /**
     * @param PreparableSqlInterface|SqlInterface     $subject
     * @param AdapterInterface|PlatformInterface|null $adapterOrPlatform
     * @return PlatformDecoratorInterface|PreparableSqlInterface|SqlInterface
     */
    public function getTypeDecorator($subject, $adapterOrPlatform = null)
    {
        $platformName = $this->resolvePlatformName($adapterOrPlatform);

        if (isset($this->decorators[$platformName])) {
            foreach ($this->decorators[$platformName] as $type => $decorator) {
                if ($subject instanceof $type && is_a($decorator, $type, true)) {
                    $decorator->setSubject($subject);
                    return $decorator;
                }
            }
        }

        return $subject;
    }

    /**
     * @return array|PlatformDecoratorInterface[]
     */
    public function getDecorators()
    {
        $platformName = $this->resolvePlatformName($this->getDefaultPlatform());
        return $this->decorators[$platformName];
    }

    /**
     * {@inheritDoc}
     *
     * @throws Exception\RuntimeException
     */
    public function prepareStatement(AdapterInterface $adapter, StatementContainerInterface $statementContainer)
    {
        if (! $this->subject instanceof PreparableSqlInterface) {
            throw new Exception\RuntimeException('The subject does not appear to implement Zend\Db\Sql\PreparableSqlInterface, thus calling prepareStatement() has no effect');
        }

        $this->getTypeDecorator($this->subject, $adapter)->prepareStatement($adapter, $statementContainer);

        return $statementContainer;
    }

    /**
     * {@inheritDoc}
     *
     * @throws Exception\RuntimeException
     */
    public function getSqlString(PlatformInterface $adapterPlatform = null)
    {
        if (! $this->subject instanceof SqlInterface) {
            throw new Exception\RuntimeException('The subject does not appear to implement Zend\Db\Sql\SqlInterface, thus calling prepareStatement() has no effect');
        }

        $adapterPlatform = $this->resolvePlatform($adapterPlatform);

        return $this->getTypeDecorator($this->subject, $adapterPlatform)->getSqlString($adapterPlatform);
    }

    protected function resolvePlatformName($adapterOrPlatform)
    {
        $platformName = $this->resolvePlatform($adapterOrPlatform)->getName();
        return str_replace(array(' ', '_'), '', strtolower($platformName));
    }
    /**
     * @param null|PlatformInterface|AdapterInterface $adapterOrPlatform
     *
     * @return PlatformInterface
     *
     * @throws Exception\InvalidArgumentException
     */
    protected function resolvePlatform($adapterOrPlatform)
    {
        if (! $adapterOrPlatform) {
            return $this->getDefaultPlatform();
        }

        if ($adapterOrPlatform instanceof AdapterInterface) {
            return $adapterOrPlatform->getPlatform();
        }

        if ($adapterOrPlatform instanceof PlatformInterface) {
            return $adapterOrPlatform;
        }

        throw new Exception\InvalidArgumentException(sprintf(
            '$adapterOrPlatform should be null, %s, or %s',
            'Zend\Db\Adapter\AdapterInterface',
            'Zend\Db\Adapter\Platform\PlatformInterface'
        ));
    }

    /**
     * @return PlatformInterface
     *
     * @throws Exception\RuntimeException
     */
    protected function getDefaultPlatform()
    {
        if (! $this->defaultPlatform) {
            throw new Exception\RuntimeException('$this->defaultPlatform was not set');
        }

        return $this->defaultPlatform;
    }
}


text:
<?php
session_start();
include ('establecerconexion.php');
$subject = "Orden de Compra Nro: $_SESSION[orden]";
require "phpmailer/class.phpmailer.php";
$error = '';
$message ="
Datos de la Orden

				Orden Nro: $_SESSION[orden]

				Usuario: $_SESSION[comprador]

				Persona o Empresa: $_SESSION[empresa]

				RIF: $_SESSION[rif]

				Telefono: $_SESSION[telefono]

				Dirección: $_SESSION[direccion]

				Correo: $_SESSION[correo]

En cuestión de minutos nuestro equipo se pondra en contacto para concretar Formas de pago y de envio.

				Recuerda consultar la sección ''Mis Ordenes'' para obtener más información de la orden

				Tecnología Climática de Venezuela C.A. Agradece su confianza.

				''Estamos Refrescando a Venezuela, sólo nos falta usted y su organización''.

				";
if(!$error)
{
$mail = new PHPMailer;
$mail ->Host = "www.desarrollotricolor.com.ve";
$mail ->From = "soporte@tecnologiaclimatica.com";
$mail ->FromName = "Orden de Compra en Tecnologiaclimatica.com";
$mail ->Subject = $subject;
$mail ->addAddress($_SESSION[correo], $_SESSION[empresa]);
$mail ->MsgHTML($message);

if ($mail->Send()) {

$mail = new PHPMailer;
$mail ->Host = "www.desarrollotricolor.com.ve";
$mail ->From = "soporte@tecnologiaclimatica.com";
$mail ->FromName = "Orden de Compra en Tecnologiaclimatica.com";
$mail ->Subject = $subject;
$mail ->addAddress('contacto@desarrollotricolor.com.ve', $_SESSION[empresa]);
$mail ->MsgHTML($message);
if ($mail->Send()) {
	echo "";
}
}

}

?>


text:
package com.googlecode.jmapper.integrationtest.application;

import junit.framework.TestCase;

import org.apache.log4j.PropertyConfigurator;

import com.googlecode.jmapper.JMapper;
import com.googlecode.jmapper.api.enums.MappingType;
import com.googlecode.jmapper.api.enums.NullPointerControl;
import com.googlecode.jmapper.integrationtest.application.bean.Child1;
import com.googlecode.jmapper.integrationtest.application.bean.Child2;
import com.googlecode.jmapper.integrationtest.application.bean.ChildConversion;
import com.googlecode.jmapper.integrationtest.application.bean.ChildConversion2;
import com.googlecode.jmapper.integrationtest.application.bean.Class2;
import com.googlecode.jmapper.integrationtest.application.bean.Class3;
import com.googlecode.jmapper.integrationtest.application.bean.Dest;
import com.googlecode.jmapper.integrationtest.application.bean.Sour;
import com.googlecode.jmapper.integrationtest.application.bean.Target1;
import com.googlecode.jmapper.integrationtest.application.bean.Target2;

public class JMapperTest extends TestCase {

	@Override
	protected void setUp() throws Exception {
		PropertyConfigurator.configure("log4j.properties");
	}

	public void testEnumerationsUsage(){

		JMapper<Dest,Sour> mapper = new JMapper<Dest, Sour>(Dest.class, Sour.class);

		Dest destination = new Dest("empty", null, 26000);
		Sour source = new Sour("alessandro", 27, null);

		Dest result = mapper.getDestination(destination, source, MappingType.ALL_FIELDS, MappingType.ONLY_VALUED_FIELDS);

		assertEquals("Dest [name=alessandro, age=27, salary=26000]", result.toString());

		result = mapper.getDestination(new Dest("empty", null, 26000), source, MappingType.ONLY_NULL_FIELDS, MappingType.ALL_FIELDS);

		assertEquals("Dest [name=empty, age=27, salary=26000]", result.toString());

		source = null;

		Dest dest = mapper.getDestination(source, NullPointerControl.SOURCE, MappingType.ALL_FIELDS);

		assertNull(dest);
	}

	public void testAttributes(){

		JMapper<Class3, Class2> mapper = new JMapper<Class3, Class2>(Class3.class, Class2.class);
		Class3 actual = mapper.getDestination(new Class2("field"));
		assertEquals("Class3 [sourceField1=null, sourceField2=null, sourceField3=field]", actual.toString());

	}

	public void testAnnotationInheritance(){

		JMapper<Child1, Target1> mapper = new JMapper<Child1, Target1>(Child1.class, Target1.class);
		Child1 destination = mapper.getDestination(new Target1("commonTargetField1", "commonTargetField2", "specificTargetField1", "specificTargetField2"));
		assertEquals("Child1 [specificField1=specificTargetField1, specificField2=specificTargetField2, getCommonField1()=commonTargetField1, getCommonField2()=commonTargetField2]", destination.toString());

		JMapper<Child2, Target2> mapperChild2 = new JMapper<Child2, Target2>(Child2.class, Target2.class);
		Child2 child2 = mapperChild2.getDestination(new Target2("commonTargetField1", "commonTargetField2", "specificTargetField3", "specificTargetField4"));
		assertEquals("Child2 [specificField3=specificTargetField3, specificField4=specificTargetField4, getCommonField1()=commonTargetField1, getCommonField2()=commonTargetField2]", child2.toString());

		JMapper<Target1, Child1> mapper2 = new JMapper<Target1, Child1>(Target1.class, Child1.class);
		Target1 target1 = mapper2.getDestination(destination);
		assertEquals("Target1 [commonField1=commonTargetField1, commonField2=commonTargetField2, specificField1=specificTargetField1, specificField2=specificTargetField2]", target1.toString());

		JMapper<Target2, Child2> mapperTarget2 = new JMapper<Target2, Child2>(Target2.class, Child2.class);
		Target2 target2 = mapperTarget2.getDestination(child2);
		assertEquals("Target2 [commonField1=commonTargetField1, commonField2=commonTargetField2, specificField3=specificTargetField3, specificField4=specificTargetField4]", target2.toString());

	}

	public void testXMLInheritance(){

		JMapper<Child1, Target1> mapper = new JMapper<Child1, Target1>(Child1.class, Target1.class,"inheritance.xml");
		Child1 destination = mapper.getDestination(new Target1("commonTargetField1", "commonTargetField2", "specificTargetField1", "specificTargetField2"));
		assertEquals("Child1 [specificField1=specificTargetField1, specificField2=specificTargetField2, getCommonField1()=commonTargetField1, getCommonField2()=commonTargetField2]", destination.toString());

		JMapper<Child2, Target2> mapperChild2 = new JMapper<Child2, Target2>(Child2.class, Target2.class,"inheritance.xml");
		Child2 child2 = mapperChild2.getDestination(new Target2("commonTargetField1", "commonTargetField2", "specificTargetField3", "specificTargetField4"));
		assertEquals("Child2 [specificField3=specificTargetField3, specificField4=specificTargetField4, getCommonField1()=commonTargetField1, getCommonField2()=commonTargetField2]", child2.toString());

		JMapper<Target1, Child1> mapper2 = new JMapper<Target1, Child1>(Target1.class, Child1.class,"inheritance.xml");
		Target1 target1 = mapper2.getDestination(destination);
		assertEquals("Target1 [commonField1=commonTargetField1, commonField2=commonTargetField2, specificField1=specificTargetField1, specificField2=specificTargetField2]", target1.toString());

		JMapper<Target2, Child2> mapperTarget2 = new JMapper<Target2, Child2>(Target2.class, Child2.class,"inheritance.xml");
		Target2 target2 = mapperTarget2.getDestination(child2);
		assertEquals("Target2 [commonField1=commonTargetField1, commonField2=commonTargetField2, specificField3=specificTargetField3, specificField4=specificTargetField4]", target2.toString());

	}

	public void testStaticConversionInheritance(){

		JMapper<ChildConversion, Target1> mapper = new JMapper<ChildConversion, Target1>(ChildConversion.class, Target1.class);
		ChildConversion destination = mapper.getDestination(new Target1("commonTargetField1", "commonTargetField2", "specificTargetField1", "specificTargetField2"));
		assertEquals("ChildConversion [specificField1=specificTargetField1, specificField2=specificTargetField2, getCommonField1()=commonTargetField1 ANNOTATED CONVERSION, getCommonField2()=commonTargetField2]", destination.toString());

		JMapper<Target1, ChildConversion> mapper2 = new JMapper<Target1, ChildConversion>(Target1.class, ChildConversion.class);
		Target1 target1 = mapper2.getDestination(new ChildConversion("specificField1", "specificField2", "common1", "common2"));
		assertEquals("Target1 [commonField1=common1 ANNOTATED CONVERSION, commonField2=common2, specificField1=specificField1, specificField2=specificField2]", target1.toString());

		JMapper<ChildConversion, Target1> mapper3 = new JMapper<ChildConversion, Target1>(ChildConversion.class, Target1.class,"inheritance2.xml");
		ChildConversion destination2 = mapper3.getDestination(new Target1("commonTargetField1", "commonTargetField2", "specificTargetField1", "specificTargetField2"));
		assertEquals("ChildConversion [specificField1=specificTargetField1 XML CONVERSION2, specificField2=specificTargetField2 XML CONVERSION Child, getCommonField1()=commonTargetField1 XML CONVERSION common, getCommonField2()=commonTargetField2]", destination2.toString());

		JMapper<Target1, ChildConversion> mapper4 = new JMapper<Target1, ChildConversion>(Target1.class, ChildConversion.class,"inheritance2.xml");
		Target1 target2 = mapper4.getDestination(new ChildConversion("specificField1", "specificField2", "common1", "common2"));
		assertEquals("Target1 [commonField1=common1 XML CONVERSION common, commonField2=common2, specificField1=specificField1 XML CONVERSION2, specificField2=specificField2 XML CONVERSION Child]", target2.toString());

	}

	public void testDynamicConversionInheritance(){

		JMapper<ChildConversion2, Target1> mapper = new JMapper<ChildConversion2, Target1>(ChildConversion2.class, Target1.class);
		ChildConversion2 destination = mapper.getDestination(new Target1("commonTargetField1", "commonTargetField2", "specificTargetField1", "specificTargetField2"));
		assertEquals("ChildConversion [specificField1=specificTargetField1, specificField2=specificTargetField2, getCommonField1()=commonField1  = commonTargetField1 (commonField1 value) ANNOTATED CONVERSION, getCommonField2()=commonTargetField2]", destination.toString());

		JMapper<ChildConversion2, Target1> mapper2 = new JMapper<ChildConversion2, Target1>(ChildConversion2.class, Target1.class,"inheritanceDynamic.xml");
		ChildConversion2 destination2 = mapper2.getDestination(new Target1("commonTargetField1", "commonTargetField2", "specificTargetField1", "specificTargetField2"));
		assertEquals("ChildConversion [specificField1=specificTargetField1 XML DYNAMIC CONVERSION, specificField2=specificTargetField2 XML DYNAMIC CONVERSION Child, getCommonField1()=commonTargetField1 XML DYNAMIC CONVERSION, getCommonField2()=commonTargetField2]", destination2.toString());

	}
}


text:
using namespace std;
namespace bf = boost::filesystem;

namespace foundation
{

struct GenericCurveFileReader::Impl
{
    string  m_filename;
    float   m_radius;
    size_t  m_degree;
};

GenericCurveFileReader::GenericCurveFileReader(const char* filename, const float radius, const size_t degree)
  : impl(new Impl())
{
    impl->m_filename = filename;
    impl->m_radius = radius;
    impl->m_degree = degree;
}

GenericCurveFileReader::~GenericCurveFileReader()
{
    delete impl;
}

void GenericCurveFileReader::read(ICurveBuilder& builder)
{
    const bf::path filepath(impl->m_filename);
    const string extension = lower_case(filepath.extension().string());

    if (extension == ".binarycurve")
    {
        BinaryCurveFileReader reader(impl->m_filename);
        reader.read(builder);
    }
    else if (extension == ".mitshair")
    {
        MitsHairFileReader reader(impl->m_filename, impl->m_radius, impl->m_degree);
        reader.read(builder);
    }
    else
    {
        throw ExceptionUnsupportedFileFormat(impl->m_filename.c_str());
    }
}

}   // namespace foundation