text:
require 'test/unit'
require 'rake'
require 'rake/hooks'

class Store
  def self.<<(string)
    @@data ||= ""
    @@data << string
  end

  def self.to_s
    @@data || ""
  end

  def self.clean
    @@data = ""
  end
end

class TestRakeHooks < Test::Unit::TestCase
  if defined?(Rake::DSL)
    include Rake::DSL
  end

  def setup
    if Rake::TaskManager.respond_to?(:record_task_metadata=)
      Rake::TaskManager.record_task_metadata = true
    end
    Rake::Task.clear
    Store.clean
  end

  def test_after
    task  :task do  Store << "wadus"; end
    after :task do  Store << "way"  ;  end

    execute(:task)

    assert_equal "wadusway", Store.to_s
  end

  def test_after_multiple
    task  :task_one do  Store << "wadus"; end
    task  :task_two do  Store << "badus"; end
    after :task_one, :task_two do  Store << "way"  ;  end

    execute(:task_one)
    assert_equal "wadusway", Store.to_s

    Store.clean

    execute(:task_two)
    assert_equal "badusway", Store.to_s
  end

  def test_before
    task   :supertask do Store << "wadus" ; end
    before :supertask do Store << "super" ; end

    execute(:supertask)
    assert_equal "superwadus", Store.to_s
  end

  def test_after_and_before
    task   :super_task do Store << "wadus" ; end
    before :super_task do Store << "love " ; end
    before :super_task do Store << "I "    ; end
    after  :super_task do Store << " way"  ; end
    after  :super_task do Store << "."     ; end

    execute(:super_task)
    assert_equal "I love wadus way.", Store.to_s
  end

  def test_save_comment_on_after_tasks
    desc 'this is my task'
    task :my_task do ; end

    after :my_task do; end
    assert_equal "this is my task", Rake::Task[:my_task].full_comment
  end

  def test_save_comment_on_before_tasks
    desc 'this is my task'
    task :my_task2 do ; end

    before :my_task2 do; end
    assert_equal "this is my task", Rake::Task[:my_task2].full_comment
  end

  def test_save_prerequisites_with_after_tasks
    task :a       do ; end
    task :b => :a do ; end

    assert_equal ['a'], Rake::Task[:b].prerequisites
    after :b do ; end
    assert_equal ['a'], Rake::Task[:b].prerequisites
  end

  def test_save_prerequisites_with_before_tasks
    task :a       do ; end
    task :b => :a do ; end

    assert_equal ['a'], Rake::Task[:b].prerequisites
    before :b do ; end
    assert_equal ['a'], Rake::Task[:b].prerequisites
  end

  def test_prerequisites_run_before_before_tasks
    task   :a       do Store << "a" ; end
    task   :b => :a do Store << "b" ; end
    before :b       do Store << "-BEFORE-" ; end

    invoke(:b)
    assert_equal "a-BEFORE-b", Store.to_s
  end

  def test_prerequisites_run_before_after_tasks
    task  :a       do Store << "a"       ; end
    task  :b => :a do Store << "b"       ; end
    after :b       do Store << "-AFTER-" ; end

    invoke(:b)
    assert_equal "ab-AFTER-", Store.to_s
  end

  def test_raise_exceptions_on_after_task
    task  :a do raise "ERROR"      ; end
    after :a do Store << "-AFTER-" ; end

    assert_raise RuntimeError do
      invoke(:a)
    end

    assert_equal "", Store.to_s
  end

  def test_ignore_exceptions_on_after_task
    task  :a                             do raise "ERROR"     ; end
    after :a, :ignore_exceptions => true do Store << "-AFTER-"; end

    assert_nothing_raised RuntimeError do
      invoke(:a)
    end

    assert_equal "-AFTER-", Store.to_s
  end

  def execute(task_name)
    Rake::Task[task_name].execute
  end

  def invoke(task_name)
    Rake::Task[task_name].invoke
  end
end


text:
	<title> Hello, Sine!</title>

 Hello, Sine!

 With pitch change

 	<button onclick="playsound()"> play </button>
 	<button onclick="stopsound()"> stop </button>

 	<input id="oscFrequencySlider" title="Frequency" type="range" min="100" max="4000" value="440" step=1>

redpajama_set_name: RedPajamaGithub


text:
"use strict";

(function(aScope, undefined){

	var observer = new Observer();

	var dashboardView = {

		__proto__: observer,

		/**
		 * This method is called by observed model when it is changed.
		 *
		 * @param {*} subject - reference to VM object in global application scope with model data
		 * @param {string} [message=undefined] - additional message that model may send
		 */
		update: function(subject, message) {
			resetForms();
			hideModals();
			updateStatsByCurrencies(subject);
		}

	};

	aScope.dashboardView = dashboardView;

	/* Private fields */

	/* View events triggers */

	/* Private methods */
	var resetForms = function() {

	};

	var hideModals = function() {

	};

	var updateStatsByCurrencies = function(vm) {

		var targetSection = $('#c-js-stats-by-currencies');
		var statTemplate = $('#c-js-currency-stat-template');

		var data = vm.statsByCurrency.listData;

		for(var i = 0; i < data.length; i++) {
			var chartValues = [];
			var chartLabels = [];
			var chartBGColors = [];
			var chartHoverBGColors = [];

			var stat = data[i];

			var wrapperDiv = jQueryDomBuilder.getDiv('col-sm-6 col-md-4', targetSection, stat.currency.defaultCurrency)
			var statDOM = statTemplate.clone();
			wrapperDiv.append(statDOM);

			statDOM.attr('id', 'c-js-currency-stat-' + stat.currency.id);
			var panelHeading = $('.panel-heading',statDOM);
			panelHeading.data('target', panelHeading.data('target') + '-' + stat.currency.id);
			$('h3', panelHeading).text(stat.currency.name + ' (' + stat.currency.code + '): ' + stat.currency.symbol + stat.totalAmountForCurrency.toNumber());

			var detailsDiv = $('#c-js-stat-details', statDOM);
			detailsDiv.attr('id', panelHeading.data('target').substring(1));

			var pTable = $('table', detailsDiv);

			var statAssets = stat.assets;

			for(var a = 0; a < statAssets.length; a++) {
				var statAsset = statAssets[a];
				var row = jQueryDomBuilder.getTableRow(
					[
						statAsset.name,
						statAsset.type.label,
						stat.currency.symbol + ' ' + new BigNumber(statAsset.amount).toNumber()
					],
					$('tbody', pTable)
				);

				chartLabels.push(statAsset.name);
				chartValues.push(new BigNumber(statAsset.amount).toNumber());
			}

			chartBGColors = chartHoverBGColors = randomColor({count: statAssets.length});

			if(stat.assets.length !== 0) {
				var chartJsCanvas = $(document.createElement('canvas'));
				$('.c-js-stat-chart', wrapperDiv).append(chartJsCanvas);
				var chartJsChart = new Chart(chartJsCanvas, {
					type: 'doughnut',
					data: {
						labels  : chartLabels,
						datasets: [
							{
								data                : chartValues,
								backgroundColor     : chartBGColors,
								hoverBackgroundColor: chartHoverBGColors
							}
						]
					}
				});
			}
		}

		var table = $('.c-js-datatable');
		var txDataTable = table.DataTable({
			searching: false,
			paging: false,
			info:false
		});

		$('.c-js-currency-stat-panel .panel-heading').click(function(event) {
			event.preventDefault();
			var targetSelector = $(this).data('target');
			var target = $(targetSelector);
			target.collapse('toggle');
		});
	}

})($EX);


text:
package com.raj.config;

import java.util.Properties;

import javax.sql.DataSource;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.hibernate5.HibernateTransactionManager;
import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.raj.dao.UserDAO;
import com.raj.dao.UserDAOImpl;
import com.raj.model.User;

@Configuration
@ComponentScan("com.iocl")
@EnableTransactionManagement
public class ApplicationContextConfig {

	@Bean(name = "dataSource")
	public DataSource getDataSource() {

		DriverManagerDataSource dataSource = new DriverManagerDataSource();
		dataSource.setDriverClassName("org.h2.Driver");
		dataSource.setUrl("jdbc:h2:tcp://localhost/~/MBP_ODSO");

		dataSource.setUsername("sa");
		dataSource.setPassword("");

		return dataSource;
	}

	private Properties getHibernateProperties() {

		Properties properties = new Properties();
		properties.put("hibernate.show_sql", "true");
		properties.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
		properties.put("hibernate.hbm2ddl.auto","update");
		return properties;
	}

	@Autowired
	@Bean(name = "sessionFactory")
	public SessionFactory getSessionFactory(DataSource dataSource) {
		LocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);
		sessionBuilder.addProperties(getHibernateProperties());

		sessionBuilder.addAnnotatedClasses(User.class);

		return sessionBuilder.buildSessionFactory();
	}

	@Autowired
	@Bean(name = "transactionManager")
	public HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {

		HibernateTransactionManager transactionManager = new HibernateTransactionManager(sessionFactory);

		return transactionManager;
	}

	@Autowired
	@Bean(name= "userDAO")
	 public UserDAO getUserDao(SessionFactory sessionFactory)
		{
	    	return new UserDAOImpl(sessionFactory);
	    }

}


text:
  <button type="button" class="close" ng-click="removeModal.cancel()">

  </button>

Revoke Token

      Are you sure you want to revoke the token {{removeModal.token.id}}?

      All clients using this token will need to be configured with a new token, otherwise their requests will be
      denied.

This action can't be undone.

  <button type="button" class="btn btn-default" ng-click="removeModal.cancel()">Cancel</button>
  <button type="button" class="btn btn-danger" ng-click="removeModal.revoke()">Revoke</button>


text:
require 'spec_helper'

describe Yardstick::Document, '.measure' do
  subject { described_class.measure(document, config) }

  let(:config)    { Yardstick::Config.new }
  let(:document)  { double('document')    }

  let(:registered_rules) do
    described_class.instance_variable_get(:@registered_rules)
  end

  before do
    registered_rules.each do |rule_class|
      expect(rule_class).to receive(:coerce).with(document, config)
        .and_return(ValidRule.new(document))
    end
  end

  it { should be_a(Yardstick::MeasurementSet) }

  its(:first) { should be_a(Yardstick::Measurement) }
end


text:
module FITSIO

export FITS,
       HDU,
       ImageHDU,
       TableHDU,
       ASCIITableHDU,
       FITSHeader,
       read_key,
       write_key,
       read_header,
       get_comment,
       set_comment!,
       copy_section,
       default_header

import Base: getindex,
             setindex!,
             length,
             show,
             read,
             read!,
             write,
             close,
             ndims,
             size,
             get,
             getkey,
             haskey,
             keys,
             values,
             eltype,
             deleteat!,
             delete!

# Deal with compatibility issues.
using Printf
import Base: iterate, lastindex
# Libcfitsio submodule

## Have to manually import while deprecating `libcfitsio_version`.
## After removing that, can return to using CFITSIO
import CFITSIO: FITSFile,
                FITSMemoryHandle,
                fits_open_file,
                fits_open_diskfile,
                fits_create_file,
                fits_create_diskfile,
                fits_assert_open,
                fits_file_mode,
                fits_create_img,
                fits_close_file,
                fits_write_pix,
                fits_get_num_hdus,
                fits_movabs_hdu,
                fits_delete_hdu,
                fits_get_img_size,
                fits_get_img_type,
                fits_get_img_equivtype,
                type_from_bitpix,
                fits_read_pix,
                fits_read_subset,
                fits_copy_image_section,
                fits_file_name,
                fits_get_img_dim,
                fits_read_tdim,
                fits_write_tdim,
                fits_read_col,
                fits_write_col,
                fits_get_num_cols,
                fits_get_num_rows,
                fits_get_colnum,
                fits_get_eqcoltype,
                fits_read_descript,
                fits_update_key,
                fits_write_comment,
                fits_write_history,
                fits_get_hdrspace,
                fits_hdr2str,
                fits_read_keyword,
                fits_read_keyn,
                fits_open_memfile,
                fits_movnam_hdu,
                fits_get_hdu_num,
                fits_get_hdu_type

# There are a few direct `ccall`s to libcfitsio in this module. For this, we
# need a few non-exported things from Libcfitsio: the shared library handle,
# and a helper function for raising errors.
import CFITSIO: libcfitsio,
                fits_assert_ok,
                fits_assert_isascii

import CFITSIO
@deprecate libcfitsio_version CFITSIO.libcfitsio_version

import Tables

## DEPRECATED
module Libcfitsio
    using Reexport
    @reexport using CFITSIO
end

# HDU Types
abstract type HDU end

mutable struct ImageHDU{T<:Real,N} <: HDU
    fitsfile::FITSFile
    ext::Int

    function ImageHDU(fitsfile::FITSFile, ext::Integer)
        fits_assert_open(fitsfile)
        fits_movabs_hdu(fitsfile, ext)
        N = Int(fits_get_img_dim(fitsfile))
        bitpix = fits_get_img_equivtype(fitsfile)
        T = type_from_bitpix(bitpix)
        new{T,N}(fitsfile, ext)
    end
end

mutable struct TableHDU <: HDU
    fitsfile::FITSFile
    ext::Int
end

mutable struct ASCIITableHDU <: HDU
    fitsfile::FITSFile
    ext::Int
end

# FITS
#
# The FITS type represents a FITS file. It holds a reference to a
# FITSFile object (basically the low-level CFITSIO pointer). It also
# holds a reference to all of the previously accessed HDU
# objects. This is so that only a single HDU object is created for
# each extension in the file. It also allows a FITS object to tell
# previously created HDUs about events that happen to the file, such
# as deleting extensions. This could be done by, e.g., setting ext=-1
# in the HDU object.
"""
    FITS(filename::String[, mode::String = "r"]; extendedparser = true)

Open or create a FITS file. `mode` can be one of `"r"` (read-only),
`"r+"` (read-write) or `"w"` (write). In "write" mode, any existing
file of the same name is overwritten.

A `FITS` object is a collection of "Header-Data Units" (HDUs) and
supports the following operations:

* `f[i]`: Return the `i`-th HDU.

* `f[name]` or `f[name, ver]`: Return the HDU containing the given the
  given EXTNAME (or HDUNAME) keyword (a String), and optionally the
  given EXTVER (or HDUVER) number (an Integer).

* Iteration:
  ```
  for hdu in f
      ...
  end
  ```

The keyword argument `extendedparser` may be used to enable or disable the
[extended filename parser](https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node83.html).
If disabled, `filename` is treated exactly as the name of the file and is not tokenized into
parameters.
"""
mutable struct FITS
    fitsfile::FITSFile
    filename::AbstractString
    mode::AbstractString
    hdus::Dict{Int, HDU}

    # Hold on to memory if backed by a julia buffer
    memhandle::FITSMemoryHandle
    hidden::Any

    function FITS(filename::AbstractString, mode::AbstractString="r"; extendedparser = true)
        openfn = extendedparser ? fits_open_file : fits_open_diskfile
        createfn = extendedparser ? fits_create_file : fits_create_diskfile
        f = (mode == "r"                      ? openfn(filename, 0)    :
             mode == "r+" && isfile(filename) ? openfn(filename, 1)    :
             mode == "r+"                     ? createfn(filename)     :
             mode == "w"                      ?
                (rm(filename, force = true); createfn(filename)) :
             error("invalid open mode: $mode"))

        new(f, filename, mode, Dict{Int, HDU}(), FITSMemoryHandle(), nothing)
    end

    function FITS(data::Vector{UInt8}, mode::AbstractString="r", filename = "")
        @assert mode == "r"
        f, handle = fits_open_memfile(data, 0)
        new(f, filename, mode, Dict{Int, HDU}(), handle, data)
    end
end

"""
    FITS(f::Function, args...; kwargs...)

Apply the function `f` to the result of `FITS(args...; kwargs...)` and close the
resulting file descriptor upon completion.
"""
function FITS(f::Function, args...; kwargs...)
    io = FITS(args...; kwargs...)
    try
        f(io)
    finally
        close(io)
    end
end

"""
    FITSHeader(keys::Vector{String}, values::Vector, comments::Vector{String})

An in-memory representation of the header of an HDU. It stores the
(key, value, comment) information for each 80-character "card" in a header.

Note that this structure is not linked to a FITS file in any way; it
is just a convenient structure for storing the header contents after
reading from a file. (This is similar to how an `Array` returned by
`read(f[1])` is not linked to the FITS file `f`.)  Manipulating a
`FITSHeader` will therefore have no immediate impact on any file, even
if it was created by `read_header(::HDU)`.  You can, however, write a
`FITSHeader` to a file using the `write(::FITS, ...)` methods that
append a new HDU to a file.
"""
mutable struct FITSHeader
    keys::Vector{String}
    values::Vector{Any}
    comments::Vector{String}
    map::Dict{String, Int}

    function FITSHeader(keys::Vector{String}, values::Vector,
                        comments::Vector{String})
        if ((length(keys) != length(values)) ||
            (length(keys) != length(comments)))
            error("keys, values, comments must be same length")
        end
        map = Dict{String, Int}()
        for i in 1:length(keys)
          map[keys[i]] = i
        end
        new(keys, Vector{Any}(values), comments, map)
    end
end

include("fits.jl")  # FITS methods
include("header.jl")  # FITSHeader methods
include("image.jl")  # ImageHDU methods
include("table.jl")  # TableHDU & ASCIITableHDU methods

end # module


text:
namespace {

bool IsDeviceRestrictedManagedGuestSessionEnabled() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
  bool device_restricted_managed_guest_session_enabled = false;
  ash::CrosSettings::Get()->GetBoolean(
      ash::kDeviceRestrictedManagedGuestSessionEnabled,
      &device_restricted_managed_guest_session_enabled);
  return device_restricted_managed_guest_session_enabled;
#else
  const chromeos::BrowserParamsProxy* init_params =
      chromeos::BrowserParamsProxy::Get();
  return init_params->DeviceSettings()
             ->device_restricted_managed_guest_session_enabled ==
         crosapi::mojom::DeviceSettings::OptionalBool::kTrue;
#endif
}

}  // namespace

namespace policy {

RestrictedMGSPolicyProvider::RestrictedMGSPolicyProvider() {
  UpdatePolicyBundle();
}

RestrictedMGSPolicyProvider::~RestrictedMGSPolicyProvider() = default;

// static
std::unique_ptr<RestrictedMGSPolicyProvider>
RestrictedMGSPolicyProvider::Create() {
  if (!profiles::IsPublicSession())
    return nullptr;
  std::unique_ptr<RestrictedMGSPolicyProvider> provider(
      new RestrictedMGSPolicyProvider());
  return provider;
}

void RestrictedMGSPolicyProvider::RefreshPolicies() {}

void RestrictedMGSPolicyProvider::UpdatePolicyBundle() {
  weak_factory_.InvalidateWeakPtrs();
  PolicyBundle bundle = policies().Clone();

  PolicyMap& chrome_policy =
      bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
  if (IsDeviceRestrictedManagedGuestSessionEnabled())
    ApplyRestrictedManagedGuestSessionOverride(&chrome_policy);

  UpdatePolicy(std::move(bundle));
}

// Details about the restricted managed guest session and the overridden
// policies can be found here: go/restricted-managed-guest-session.
void RestrictedMGSPolicyProvider::ApplyRestrictedManagedGuestSessionOverride(
    PolicyMap* chrome_policy) {
  std::pair<std::string, base::Value> policy_overrides[] = {
#if BUILDFLAG(IS_CHROMEOS_ASH)
    {key::kArcEnabled, base::Value(false)},
    {key::kCrostiniAllowed, base::Value(false)},
    {key::kDeletePrintJobHistoryAllowed, base::Value(true)},
    {key::kKerberosEnabled, base::Value(false)},
    {key::kNetworkFileSharesAllowed, base::Value(false)},
    {key::kUserBorealisAllowed, base::Value(false)},
    {key::kUserPluginVmAllowed, base::Value(false)},
#endif
    {key::kAllowDeletingBrowserHistory, base::Value(true)},
    {key::kCACertificateManagementAllowed,
     base::Value(static_cast<int>(CACertificateManagementPermission::kNone))},
    {key::kClientCertificateManagementAllowed,
     base::Value(
         static_cast<int>(ClientCertificateManagementPermission::kNone))},
    {key::kEnableMediaRouter, base::Value(false)},
    {key::kPasswordManagerEnabled, base::Value(false)},
    {key::kScreenCaptureAllowed, base::Value(false)},
  };

  for (auto& policy_override : policy_overrides) {
    chrome_policy->Set(policy_override.first, POLICY_LEVEL_MANDATORY,
                       POLICY_SCOPE_USER,
                       POLICY_SOURCE_RESTRICTED_MANAGED_GUEST_SESSION_OVERRIDE,
                       std::move(policy_override.second), nullptr);
  }
}

}  // namespace policy


text:
// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Net;
using Windows.Data.Json;
using Windows.Foundation;
using Windows.Foundation.Metadata;

namespace Microsoft.WindowsAzure.MobileServices
{
    /// <summary>
    /// Provides basic access to Mobile Services.
    /// </summary>
    public partial class MobileServiceClient
    {
        /// <summary>
        /// Log a user into a Mobile Services application given an access
        /// token.
        /// </summary>
        /// <param name="authenticationToken">
        /// OAuth access token that authenticates the user.
        /// </param>
        /// <returns>
        /// Task that will complete when the user has finished authentication.
        /// </returns>
        [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "Login is more appropriate than LogOn for our usage.")]
        public IAsyncOperation<MobileServiceUser> LoginAsync(string authenticationToken)
        {
            return this.SendLoginAsync(authenticationToken).AsAsyncOperation();
        }

        /// <summary>
        /// Log a user into a Mobile Services application given a provider name and optional token object.
        /// </summary>
        /// <param name="provider" type="MobileServiceAuthenticationProvider">
        /// Authentication provider to use.
        /// </param>
        /// <param name="token" type="JsonObject">
        /// Optional, provider specific object with existing OAuth token to log in with.
        /// </param>
        /// <returns>
        /// Task that will complete when the user has finished authentication.
        /// </returns>
        [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "Login is more appropriate than LogOn for our usage.")]
        public IAsyncOperation<MobileServiceUser> LoginAsync(MobileServiceAuthenticationProvider provider, JsonObject token)
        {
            return this.SendLoginAsync(provider, token).AsAsyncOperation();
        }

        /// <summary>
        /// Log a user into a Mobile Services application given a provider name.
        /// </summary>
        /// <param name="provider" type="MobileServiceAuthenticationProvider">
        /// Authentication provider to use.
        /// </param>
        /// <returns>
        /// Task that will complete when the user has finished authentication.
        /// </returns>
        [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "Login is more appropriate than LogOn for our usage.")]
        [DefaultOverloadAttribute]
        public IAsyncOperation<MobileServiceUser> LoginAsync(MobileServiceAuthenticationProvider provider)
        {
            return this.SendLoginAsync(provider, null).AsAsyncOperation();
        }

        /// <summary>
        /// Log a user into a Mobile Services application given a provider name.
        /// </summary>
        /// <param name="provider" type="MobileServiceAuthenticationProvider">
        /// Authentication provider to use.
        /// </param>
        /// <param name="useSingleSignOn">
        /// Indicates that single sign-on should be used. Single sign-on requires that the
        /// application's Package SID be registered with the Windows Azure Mobile Service, but it
        /// provides a better experience as HTTP cookies are supported so that users do not have to
        /// login in everytime the application is launched.
        /// </param>
        /// <returns>
        /// Task that will complete when the user has finished authentication.
        /// </returns>
        [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login", Justification = "Login is more appropriate than LogOn for our usage.")]
        [DefaultOverloadAttribute]
        public IAsyncOperation<MobileServiceUser> LoginAsync(MobileServiceAuthenticationProvider provider, bool useSingleSignOn)
        {
            return this.SendLoginAsync(provider, null, useSingleSignOn).AsAsyncOperation();
        }

        /// <summary>
        /// Create an exception for an invalid response to a web request.
        /// </summary>
        /// <param name="errorMessage">The error message.</param>
        /// <param name="request">The request.</param>
        /// <param name="response">The response.</param>
        [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "request", Justification = "Not used in this overload, but used by C# version")]
        [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "response", Justification = "Not used in this overload, but used by C# version")]
        private static Exception CreateMobileServiceException(string errorMessage, IServiceFilterRequest request, IServiceFilterResponse response)
        {
            Debug.Assert(!string.IsNullOrEmpty(errorMessage), "errorMessage cannot be null or empty!");
            Debug.Assert(request != null, "request cannot be null!");
            Debug.Assert(response != null, "response cannot be null!");
            return new InvalidOperationException(errorMessage);
        }
    }
}


text:
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:util="http://www.springframework.org/schema/util"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
		   http://www.springframework.org/schema/util
		   http://www.springframework.org/schema/util/spring-util-2.0.xsd">

	<bean id="BerkeleyDbPersistenceManager" class="org.jhove2.persist.berkeleydpl.BerkeleyDbPersistenceManager"
	     scope="singleton">
<!-- 	     <property name="envHome" value="C:\"/> -->
 	     <property name="entityStoreName" value="JHOVE2_Entity_Store"/>
 	     <property name="storeConfig" ref="StoreConfig"/>
	     <property name="envConfig" ref="EnvironmentConfig"/>
	</bean>

	<bean id="EnvironmentConfig" class="com.sleepycat.je.EnvironmentConfig"
          scope="singleton">
	         <property name="allowCreate" value="true"/>
	         <property name="readOnly" value="false"/>
	         <property name="transactional" value="false"/>
	</bean>

	<bean id="StoreConfig" class="com.sleepycat.persist.StoreConfig"
	      scope="singleton">
	      <property name="allowCreate" value="true"/>
	      <property name="deferredWrite" value="false"/>
	      <property name="temporary" value="true"/><!-- True may not be specified if the EntityStore is transactional -->
	</bean>

	<bean id="persistenceMgrClassName" class="java.lang.String">
	   <constructor-arg  type="java.lang.String"
	                     value="org.jhove2.config.spring.SpringBerkeleyDbPersistenceManagerFactory"/>
	</bean>

	<bean id="bdbBaseModuleAccessor"  class="org.jhove2.persist.berkeleydpl.BerkeleyDbBaseModuleAccessor" scope="prototype"/>
	<bean id="bdbIdentifierAccessor"  class="org.jhove2.persist.berkeleydpl.BerkeleyDbIdentifierAccessor" scope="prototype"/>
	<bean id="bdbAggrefierAccessor"   class="org.jhove2.persist.berkeleydpl.BerkeleyDbAggrefierAccessor" scope="prototype"/>
	<bean id="bdbFormatModuleAccessor"      class="org.jhove2.persist.berkeleydpl.BerkeleyDbFormatModuleAccessor" scope="prototype"/>
	<bean id="bdbFormatProfileAccessor"     class="org.jhove2.persist.berkeleydpl.BerkeleyDbFormatProfileAccessor" scope="prototype"/>
	<bean id="bdbFrameworkAccessor"         class="org.jhove2.persist.berkeleydpl.BerkeleyDbFrameworkAccessor" scope="prototype"/>
	<bean id="bdbApplicationModuleAccessor" class="org.jhove2.persist.berkeleydpl.BerkeleyDbApplicationModuleAccessor"/>
	<bean id="bdbSourceFactory"             class="org.jhove2.persist.berkeleydpl.BerkeleyDbSourceFactory" scope="prototype"/>
	<bean id="bdbCommandAccessor"			 class="org.jhove2.persist.berkeleydpl.BerkeleyDbCommandAccessor" scope="prototype"/>
	<bean id="bdbDisplayerAccessor"			 class="org.jhove2.persist.berkeleydpl.BerkeleyDbDisplayerAccessor" scope="prototype"/>
	<bean id="bdbRecognizerAccessor" class="org.jhove2.persist.berkeleydpl.BerkeleyDbRecognizerAccessor" scope="prototype"/>
	<bean id="bdbSourceIdentifierAccessor" class="org.jhove2.persist.berkeleydpl.BerkeleyDbSourceIdentifierAccessor" scope="prototype"/>

	    <!-- JHOVE2CommandLine application bean -->
    <bean id="bdbapp" class="org.jhove2.app.JHOVE2CommandLine" scope="singleton">
    	<constructor-arg ref="bdbApplicationModuleAccessor"/>
    </bean>

     	<!-- Text displayer bean -->
	<bean id="bdbisplayer" class="org.jhove2.module.display.TextDisplayer"
	      scope="prototype">
	    <constructor-arg ref="bdbDisplayerAccessor"/>
	    <property name="showIdentifiers" value="false"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="configInfo" ref="bdbConfigInfo"/>
	</bean>

			<!-- JHOVE2 framework bean -->
	<bean id="bdbJHOVE2" class="org.jhove2.core.JHOVE2" scope="prototype">
		<constructor-arg ref="bdbFrameworkAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="commands">
			<list value-type="org.jhove2.module.Command">
				<ref bean="bdbIdentifierCommand"/>
				<ref bean="bdbDispatcherCommand"/>
				<ref bean="bdbAggrefierCommand"/>
			</list>
		</property>
		<property name="configInfo" ref="bdbConfigInfo"/>
		<property name="sourceFactory" ref="bdbSourceFactory"/>
	</bean>

	<!-- Identifier command bean -->
	<bean id="bdbIdentifierCommand" class="org.jhove2.module.identify.IdentifierCommand" scope="prototype">
		<constructor-arg ref="bdbCommandAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="identifierFactory" ref="bdbIdentifierFactory"/>
	</bean>
			<!-- Identifier module factory bean -->
	<bean id="bdbIdentifierFactory" class="org.jhove2.config.spring.SpringIdentifierFactory" scope="singleton"/>
	<!-- Dispatcher command bean -->
	<bean id="bdbDispatcherCommand" class="org.jhove2.module.format.DispatcherCommand" scope="prototype">
	<constructor-arg ref="bdbCommandAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="formatFactory" ref="bdbFormatFactory"/>
		<property name="formatModuleFactory" ref="bdbFormatModuleFactory"/>
	</bean>
		<!--  Format module factory bean -->
	<bean id="bdbFormatModuleFactory" class="org.jhove2.config.spring.SpringFormatModuleFactory" scope="singleton"/>
		<!-- Format factory bean -->
	<bean id="bdbFormatFactory" class="org.jhove2.config.spring.SpringFormatFactory" scope="singleton"/>
	<!-- Aggrefier command Bean -->
	<bean id="bdbAggrefierCommand" class="org.jhove2.module.aggrefy.AggrefierCommand" scope="prototype" >
	<constructor-arg ref="bdbCommandAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="aggrefierFactory" ref="bdbAggrefierFactory"/>
	</bean>
		<!-- Aggrefier module factory bean -->
	<bean id="bdbAggrefierFactory" class="org.jhove2.config.spring.SpringAggrefierFactory" scope="singleton"/>
			<!-- UTF-8 module bean -->
	<bean id="bdbUTF8Module" class="org.jhove2.module.format.utf8.UTF8Module"
	      scope="prototype">
	    <constructor-arg ref="bdbUTF8Format"/>
	    <constructor-arg ref="bdbFormatModuleAccessor"/>
	    <property name="profiles">
			<list value-type="org.jhove2.module.format.FormatProfile">
				<ref bean="bdbASCIIProfile"/>
			</list>
		</property>
	     <property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
			</list>
		</property>
	</bean>

	  	<!-- ASCII profile bean -->
	<bean id="bdbASCIIProfile" class="org.jhove2.module.format.utf8.ascii.ASCIIProfile"
	      scope="prototype">
	    <constructor-arg ref="bdbASCIIFormat"/>
	    <constructor-arg ref="bdbFormatProfileAccessor"/>
	    <property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
			</list>
		</property>
	</bean>
	<!-- ASCII format bean -->
	<bean id="bdbASCIIFormat" class="org.jhove2.core.format.Format" scope="singleton">
		<constructor-arg type="java.lang.String" value="ASCII"/>
		<constructor-arg ref="bdbASCIIIdentifier"/>
		<constructor-arg type="org.jhove2.core.format.Format$Type" value="Format"/>
		<constructor-arg type="org.jhove2.core.format.Format$Ambiguity" value="Unambiguous"/>
		<property name="aliasIdentifiers">
			<set value-type="org.jhove2.core.I8R">
				<ref bean="bdbPUIDxfmt13"/>
			</set>
		</property>
	</bean>

	<!-- ASCII identifier bean -->
	<bean id="bdbASCIIIdentifier" class="org.jhove2.core.I8R" scope="singleton">
		<constructor-arg type="java.lang.String" value="http://jhove2.org/terms/format/ascii"/>
	</bean>
	<!-- PUID x-fmt/13 aliasIdentifier bean -->
	<bean id="bdbPUIDxfmt13" class="org.jhove2.core.I8R" scope="singleton">
	    <constructor-arg type="java.lang.String" value="x-fmt/13"/>
	    <constructor-arg type="org.jhove2.core.I8R$Namespace" value="PUID"/>
	</bean>

 	<!-- JSON displayer bean -->
	<bean id="dbdJSON" class="org.jhove2.module.display.JSONDisplayer"
	      scope="prototype">
	    <constructor-arg ref="bdbDisplayerAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="configInfo" ref="bdbConfigInfo"/>
	</bean>

	<!-- DROID identifier bean -->
	<bean id="bdbDROIDIdentifier" class="org.jhove2.module.identify.DROIDIdentifier"
	      scope="prototype">
	    <constructor-arg ref="bdbSourceIdentifierAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="configFileName" value="DROID_config.xml"/>
		<property name="sigFileName" value="DROID_SignatureFile_V20.xml"/>
		<property name="wrappedProduct" ref="bdbDROIDWrappedProduct"/>
	</bean>
 <!-- DROID Wrapped Product bean -->
   <bean id="bdbDROIDWrappedProduct" class="org.jhove2.core.WrappedProduct" scope="singleton" >
      	<property name="name" value="DROID"/>
      	<property name="version" value="4.0.0"/>
      	<property name="releaseDate" value="2009-07-23"/>
      	<property name="rightsStatement" value="BSD license"/>
   		<property name="authority" value="The National Archives, Digital Preservation Department  http://www.nationalarchives.gov.uk/"/>
   		<property name="environments" value="Unix Windows Macintosh"/>
   		<property name="languages" value="JAVA"/>
   		<property name="note" value="The DROID Signature and Configuration files in the JHOVE2 distribution have been edited to, among other things, detect additional signatures for formats"/>
	    <property name="openSource" value="true"/>
	</bean>
				<!-- Identifier module bean -->
	<bean id="bdbIdentifier" class="org.jhove2.module.identify.IdentifierModule"
	      scope="prototype">
	    <constructor-arg ref="bdbIdentifierAccessor"/>
		<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
		<property name="sourceIdentifier" ref="bdbDROIDIdentifier"/>
	</bean>

		<!-- Aggrefier module bean -->
<!--	<bean id="bdbAggrefierModule" class="org.jhove2.module.aggrefy.AggrefierModule"-->
<!--	      scope="prototype">-->
<!--	    <constructor-arg ref="bdbAggrefierAccessor"/>-->
<!--		<property name="developers">-->
<!--			<list value-type="org.jhove2.core.Agent">-->
<!--				<ref bean="bdbCDLAgent"/>-->
<!--				<ref bean="bdbPorticoAgent"/>-->
<!--				<ref bean="bdbStanfordAgent"/>-->
<!--			</list>-->
<!--		</property>-->
<!--		<property name="recognizers">-->
<!--			<list value-type="org.jhove2.module.aggrefy.Recognizer">-->
<!--				<ref bean="bdbShapeFileRecognizer"/>-->
<!--			</list>-->
<!--		</property>-->
<!--	</bean>-->

	<!-- Shapefile recognizer bean -->
	<bean id="bdbShapeFileRecognizer" class="org.jhove2.module.aggrefy.GlobPathRecognizer"
	 scope="prototype">
	 	<constructor-arg ref="bdbRecognizerAccessor"/>
	 	<property name="developers">
			<list value-type="org.jhove2.core.Agent">
				<ref bean="bdbCDLAgent"/>
				<ref bean="bdbPorticoAgent"/>
				<ref bean="bdbStanfordAgent"/>
			</list>
		</property>
	 	<property name="formatIdentifier" ref="bdbShapefileIdentifier"/>
	 	<property name="fileGroupingExpr" value="(.*?)\.((?i:shp\.)?\w{3})$"/>
	 	<property name="mustHaveExpr" value="^((?i:shp)|(?i:shx)|(?i:dbf))$"/>
	 	<property name="mayHaveExpr"
	 	          value="^((?i:shp.xml)|(?i:prj)|(?i:sbn)|(?i:sbx)|(?i:atx)|(?i:qix)|(?i:fix)|(?i:grx))$"/>
	 	<property name="fileGroupingCaptureGroupIndex" value="1" />
	 	<property name="mustHaveCaptureGroupIndex" value="2"/>
	 	<property name="mayHaveCaptureGroupIndex" value="2"/>
	 	<property name="minMustHavesToIdentify" value="3"/>
	  	<property name="includeUnmatchedFromGroup" value="true"/>
	</bean>

		<!-- Shapefile identifier bean -->
	<bean id="bdbShapefileIdentifier" class="org.jhove2.core.I8R" scope="singleton">
		<constructor-arg type="java.lang.String" value="http://jhove2.org/terms/format/shapefile"/>
	</bean>
		<!-- UTF-8 format bean -->
	<bean id="bdbUTF8Format" class="org.jhove2.core.format.Format" scope="singleton">
		<constructor-arg type="java.lang.String" value="UTF-8"/>
		<constructor-arg ref="bdbUTF8Identifier"/>
		<constructor-arg type="org.jhove2.core.format.Format$Type" value="Family"/>
		<constructor-arg type="org.jhove2.core.format.Format$Ambiguity" value="Unambiguous"/>
		<property name="aliasNames">
			<set>
				<value>UCS Transformation Format, 8 bit</value>
				<value>Unicode Transformation Format, 8 bit</value>
			</set>
		</property>
	</bean>

		<!-- UTF-8 identifier bean -->
	<bean id="bdbUTF8Identifier" class="org.jhove2.core.I8R" scope="singleton">
		<constructor-arg type="java.lang.String" value="http://jhove2.org/terms/format/utf-8"/>
	</bean>

	<!-- CDL agent bean -->
	<bean id="bdbCDLAgent" class="org.jhove2.core.Agent" scope="singleton">
		<constructor-arg type="java.lang.String" value="California Digital Library"/>
		<constructor-arg type="org.jhove2.core.Agent$Type" value="Corporate"/>
		<property name="URI" value="http://www.cdlib.org/"/>
	</bean>

		<!-- Portico agent bean -->
	<bean id="bdbPorticoAgent" class="org.jhove2.core.Agent" scope="singleton">
		<constructor-arg type="java.lang.String" value="Portico"/>
		<constructor-arg type="org.jhove2.core.Agent$Type" value="Corporate"/>
		<property name="URI" value="http://www.portico.org/"/>
	</bean>
	<!-- Stanford agent bean -->
	<bean id="bdbStanfordAgent" class="org.jhove2.core.Agent" scope="singleton">
		<constructor-arg type="java.lang.String" value="Stanford University"/>
		<constructor-arg type="org.jhove2.core.Agent$Type" value="Corporate"/>
		<property name="URI" value="http://www.stanford.edu/"/>
	</bean>
	<bean id="bdbConfigInfo" class="org.jhove2.config.spring.SpringConfigInfo"
	scope="singleton">
		<constructor-arg>
			<list value-type = "java.lang.String">
				<ref bean="bdbtest-bdbInfo-path"/>
<!-- 				<ref bean="bdbtest-persist-configInof-path"/> -->
			</list>
		</constructor-arg>
	</bean>
	<bean id="bdbtest-bdbInfo-path" class="java.lang.String">
		<constructor-arg type="java.lang.String" value="classpath*:**/bdb-test-config.xml"/>
	</bean>

<!--  BEAN for message properties files (used for I18N ) -->
	<!--    NOTE  BEAN MUST HAVE id "messageSource" -->
	<bean id="messageSource" class="org.jhove2.config.spring.ResourceBundleMessageSource">
		<property name="basename" >
			<!--  base name for localized message template properties files -->
			<value>messages</value>
		</property>
	</bean>

</beans>


text:
package com.twitter.zipkin.sampler

import java.util.Random

import com.twitter.util.Var
import org.scalatest.FunSuite

class SamplerTest extends FunSuite {
  val rnd = new Random(1L)

  test("is permissive when the rate is 1") {
    val sampler = new Sampler(Var(1.0))
    assert(sampler(Long.MaxValue))
    assert(sampler(Long.MinValue))
    assert(sampler(rnd.nextLong()))
  }

  test("is exclusive when the rate is 0") {
    val sampler = new Sampler(Var(0.0))
    assert(!sampler(Long.MaxValue))
    assert(!sampler(Long.MinValue))
    assert(!sampler(rnd.nextLong()))
  }

  test("samples based on the given number") {
    val sampler = new Sampler(Var(0.5))
    assert(sampler(Long.MaxValue))
    assert(!sampler((Long.MaxValue * 0.5).toLong))
  }

  test("will update based on the given Var") {
    val v = Var(0.0)
    val sampler = new Sampler(v)
    assert(!sampler(Long.MaxValue))

    v.update(1.0)
    assert(sampler(Long.MaxValue))
  }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 29.06.2015
 * Time: 17:13
 */

use yiicms\components\core\widgets\SubmitButton;
use yiicms\models\core\Settings;
use yiicms\modules\users\models\ResetPasswordForm;
use yii\bootstrap\ActiveForm;

/**  @var $this \yii\web\View */
/** @var $form  ResetPasswordForm */

Yii::$app->controller->layout = '@theme/views/layouts/login-layout';

?>

        <?= Settings::get('core.siteName') ?>

<?= $this->title ?>

        <?php $activeForm = ActiveForm::begin(); ?>
        <?= $activeForm->field($form, 'email')->label(false)->textInput(['placeholder' => $form->getAttributeLabel('email')]); ?>

                <?= SubmitButton::widget(['title' => \Yii::t('modules/users', 'Сбросить пароль'), 'icon' => 'exchange']); ?>

        <?php ActiveForm::end(); ?>


text:
#pragma once
#pragma managed(push, off)
/*!
 * @file vxcloth.h
 * @brief Havok cloth simulation wrappers.
 *
 * Encapsulates Havok cloth  related engines
 *
 * @author Nola Donato
 * @ingroup vixen
 */
#pragma once
class hclWorld;
class hclClothData;
class hclClothInstance;
class hclCollidable;
class hclNamedSetupMesh;
class hclTransformSet;
class hclUserSetupRuntimeDisplayData;
class hclClothSetupObject;
class hkJobQueue;
class hkJobThreadPool;
class hkxScene;

namespace Vixen {

/*!
 * @class ClothSim
 *
 * @brief Engine which contains one or more related cloth simulations.
 *
 * This class controls the overall properties of cloth simulation,
 * performs cloth setup and handles multithreading and load balancing
 * for cloth. All of the Vixen engines which relate to Havok cloth
 * must be children of the single ClothSim engine.
 *
 * @see Physics ClothSkin
 * @ingroup vixen
 */
class ClothSim : public Engine
{
public:
	VX_DECLARE_CLASS(ClothSim);
	ClothSim(hclWorld* world = NULL);
	~ClothSim();

	//! Establish ground plane for cloth collision.
	void				SetGroundPlane(const Vec4& groundplane);

	//! Get ground plane for cloth collision.
	const Vec4&			GetGroundPlane() const	{ return m_GroundPlane; }

	//! Get Havok ground collidable.
	hclCollidable*		GetGroundCollide() const{ return m_GroundCollidable; }

	//! Get the one and only ClothSim instance.
	static	ClothSim*	Get()					{ return s_OnlyOne; }

	//! Get the one and only Havok cloth world.
	static hclWorld*	GetWorld()				{ if (s_OnlyOne) return s_OnlyOne->m_ClothWorld; else return NULL; }

	//! Get the Havok thread pool for cloth simulation.
	hkJobThreadPool*	GetThreadPool() const;

	hkxScene*			GetHavokScene() const	{ return m_Scene; }

	//! Shut down cloth simulation.
	static void			Shutdown();

//
// Overrides
//
	virtual bool		Eval(float);
	virtual	bool		OnStart();
	virtual	void		Empty();

protected:
	Plane				m_GroundPlane;
	hclWorld*			m_ClothWorld;
	hclCollidable*		m_GroundCollidable;
	hkJobQueue*			m_ClothJobs;
	hkxScene*			m_Scene;
	float				m_TimeStep;
	static ClothSim*	s_OnlyOne;
};

/*!
 * @class ClothSkin
 * Deforms a target mesh based on Havok cloth simulation.
 * A ClothSkin can only be created by loading a Havok physics file
 * which contains a cloth simulation.
 * Havok cloth simulation directly updates the vertices in the target mesh
 * when this engine is running. It must have a ClothSim engine as a parent.
 *
 * @see Physics ClothSim Skin RagDoll
 * @ingroup vixen
 */
class ClothSkin : public Skin
{
public:
	VX_DECLARE_CLASS(ClothSkin);
	ClothSkin();
	ClothSkin(hclClothData* data);
	~ClothSkin();

//
// Overrides
//
	virtual	void		SetActive(bool);
	virtual bool		Eval(float);
	virtual	bool		OnStart();
	virtual void		SetTarget(SharedObj*);
	virtual	void		Empty();
	virtual float		ComputeTime(float);

protected:
	void				UpdateTransforms();

	RefArray<Skeleton>	m_Skeletons;
	hclClothData*		m_ClothData;
	hclClothInstance*	m_ClothInstance;
};

/*!
 * Perform Havok cloth setup.
 * This function is called when loading a Havok physics file which contains cloth.
 */
extern ClothSkin* SetupCloth(Scene* vixenscene, hkxScene* havokscene, hclClothSetupObject* setupinfo);

}	// end Vixen

#pragma managed(pop)


text:
<?php

namespace Badger\Component\Game\Repository;

use Badger\Component\Game\Model\TagInterface;

/**
 * Repository interface for tag searchable entities.
 *
 * @author Olivier Soulet <olivier.soulet@akeneo.com>
 * @license http://opensource.org/licenses/MIT The MIT License (MIT)
 */
interface TagSearchableRepositoryInterface
{
    /**
     * Return all entities filtered by Tags
     *
     * @param TagInterface[] $tags
     *
     * @return mixed
     */
    public function findByTags(array $tags);
}


text:
package com.raizlabs.android.dbflow.sql.language;

import com.raizlabs.android.dbflow.sql.Query;
import com.raizlabs.android.dbflow.sql.QueryBuilder;
import com.raizlabs.android.dbflow.sql.language.Condition.Operation;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Allows combining of {@link SQLCondition} into one condition.
 */
public class ConditionGroup extends BaseCondition implements Query, Iterable<SQLCondition> {

    /**
     * @return Starts an arbitrary clause of conditions to use.
     */
    public static ConditionGroup clause() {
        return new ConditionGroup();
    }

    /**
     * @return Starts an arbitrary clause of conditions to use with first param as condition.
     */
    public static ConditionGroup clause(SQLCondition condition) {
        return new ConditionGroup().and(condition);
    }

    /**
     * @return Starts an arbitrary clause of conditions to use, that when included in other {@link SQLCondition},
     * does not append parenthesis to group it.
     */
    public static ConditionGroup nonGroupingClause() {
        return new ConditionGroup().setUseParenthesis(false);
    }

    private final List<SQLCondition> conditionsList = new ArrayList<>();

    private QueryBuilder query;
    private boolean isChanged;
    private boolean allCommaSeparated;
    private boolean useParenthesis = true;

    protected ConditionGroup(NameAlias columnName) {
        super(columnName);

        // default is AND
        separator = Operation.AND;
    }

    protected ConditionGroup() {
        this(null);
    }

    /**
     * Will ignore all separators for the group and make them separated by comma. This is useful
     * in {@link Set} statements.
     *
     * @param allCommaSeparated All become comma separated.
     * @return This instance.
     */
    public ConditionGroup setAllCommaSeparated(boolean allCommaSeparated) {
        this.allCommaSeparated = allCommaSeparated;
        isChanged = true;
        return this;
    }

    /**
     * Sets whether we use paranthesis when grouping this within other {@link SQLCondition}. The default
     * is true, but if no conditions exist there are no paranthesis anyways.
     *
     * @param useParenthesis true if we use them, false if not.
     */
    public ConditionGroup setUseParenthesis(boolean useParenthesis) {
        this.useParenthesis = useParenthesis;
        isChanged = true;
        return this;
    }

    /**
     * Appends the {@link SQLCondition} with an {@link Operation#OR}
     *
     * @param sqlCondition The condition to append.
     * @return This instance.
     */
    public ConditionGroup or(SQLCondition sqlCondition) {
        return operator(Operation.OR, sqlCondition);
    }

    /**
     * Appends the {@link SQLCondition} with an {@link Operation#AND}
     *
     * @param sqlCondition The condition to append.
     * @return This instance.
     */
    public ConditionGroup and(SQLCondition sqlCondition) {
        return operator(Operation.AND, sqlCondition);
    }

    /**
     * Applies the {@link Operation#AND} to all of the passed
     * {@link SQLCondition}.
     *
     * @param sqlConditions
     * @return
     */
    public ConditionGroup andAll(SQLCondition... sqlConditions) {
        for (SQLCondition sqlCondition : sqlConditions) {
            and(sqlCondition);
        }
        return this;
    }

    /**
     * Applies the {@link Operation#AND} to all of the passed
     * {@link SQLCondition}.
     *
     * @param sqlConditions
     * @return
     */
    public ConditionGroup andAll(List<SQLCondition> sqlConditions) {
        for (SQLCondition sqlCondition : sqlConditions) {
            and(sqlCondition);
        }
        return this;
    }

    /**
     * Applies the {@link Operation#AND} to all of the passed
     * {@link SQLCondition}.
     *
     * @param sqlConditions
     * @return
     */
    public ConditionGroup orAll(SQLCondition... sqlConditions) {
        for (SQLCondition sqlCondition : sqlConditions) {
            or(sqlCondition);
        }
        return this;
    }

    /**
     * Applies the {@link Operation#AND} to all of the passed
     * {@link SQLCondition}.
     *
     * @param sqlConditions
     * @return
     */
    public ConditionGroup orAll(List<SQLCondition> sqlConditions) {
        for (SQLCondition sqlCondition : sqlConditions) {
            or(sqlCondition);
        }
        return this;
    }

    /**
     * Appends the {@link SQLCondition} with the specified operator string.
     *
     * @param sqlCondition The condition to append.
     * @return This instance.
     */
    private ConditionGroup operator(String operator, SQLCondition sqlCondition) {
        setPreviousSeparator(operator);
        conditionsList.add(sqlCondition);
        isChanged = true;
        return this;
    }

    @Override
    public void appendConditionToQuery(QueryBuilder queryBuilder) {
        int conditionListSize = conditionsList.size();
        if (useParenthesis && conditionListSize > 0) {
            queryBuilder.append("(");
        }
        for (int i = 0; i < conditionListSize; i++) {
            SQLCondition condition = conditionsList.get(i);
            condition.appendConditionToQuery(queryBuilder);
            if (condition.hasSeparator() && i < conditionListSize - 1) {
                queryBuilder.appendSpaceSeparated(condition.separator());
            }
        }
        if (useParenthesis && conditionListSize > 0) {
            queryBuilder.append(")");
        }
    }

    /**
     * Sets the last condition to use the separator specified
     *
     * @param separator AND, OR, etc.
     */
    private void setPreviousSeparator(String separator) {
        if (conditionsList.size() > 0) {
            // set previous to use OR separator
            conditionsList.get(conditionsList.size() - 1).separator(separator);
        }
    }

    @Override
    public String getQuery() {
        if (isChanged) {
            query = getQuerySafe();
        }
        return query == null ? "" : query.toString();
    }

    @Override
    public String toString() {
        return getQuerySafe().toString();
    }

    public int size() {
        return conditionsList.size();
    }

    public List<SQLCondition> getConditions() {
        return conditionsList;
    }

    @Override
    public Iterator<SQLCondition> iterator() {
        return conditionsList.iterator();
    }

    private QueryBuilder getQuerySafe() {
        QueryBuilder query = new QueryBuilder();

        int count = 0;
        int size = conditionsList.size();
        for (int i = 0; i < size; i++) {
            SQLCondition condition = conditionsList.get(i);
            if (condition != null) {
                condition.appendConditionToQuery(query);
                if (count < size - 1) {
                    if (!allCommaSeparated) {
                        query.appendSpace().append(condition.hasSeparator() ? condition.separator() : separator);
                    } else {
                        query.append(",");
                    }
                    query.appendSpace();
                }
            }
            count++;
        }
        return query;
    }
}


text:
/*
 *
 *  o                        o     o   o         o
 *  |             o          |     |\ /|         | /
 *  |    o-o o--o    o-o  oo |     | O |  oo o-o OO   o-o o   o
 *  |    | | |  | | |    | | |     |   | | | |   | \  | |  \ /
 *  O---oo-o o--O |  o-o o-o-o     o   o o-o-o   o  o o-o   o
 *              |
 *           o--o
 *  o--o              o               o--o       o    o
 *  |   |             |               |    o     |    |
 *  O-Oo   oo o-o   o-O o-o o-O-o     O-o    o-o |  o-O o-o
 *  |  \  | | |  | |  | | | | | |     |    | |-' | |  |  \
 *  o   o o-o-o  o  o-o o-o o o o     o    | o-o o  o-o o-o
 *
 *  Logical Markov Random Fields (LoMRF).
 *
 *
 */

package lomrf.mln.learning.supervision.graphs

import breeze.linalg.{ DenseVector, argtopk }

/**
  * A GraphConnector is a higher order function that changes the number of connected
  * neighbors (edges) to the vertex according to a strategy. The edges are represented by a
  * vector containing their costs.
  */
trait GraphConnector extends (DenseVector[Double] => DenseVector[Double])

/**
  * A FullConnector is used to essentially construct a fully connected graph. Therefore,
  * for a given cost vector of a vertex it changes nothing.
  */
object FullConnector extends GraphConnector {

  /**
    * @param neighbors a vector containing the costs for each neighbor of the vertex
    *
    * @return the vector itself
    */
  override def apply(neighbors: DenseVector[Double]): DenseVector[Double] = neighbors
}

/**
  * A kNNConnector is used to essentially construct a kNN graph. For the neighbors of
  * the vertex it only keeps the top k nearest neighbors by setting everything else to zero.
  *
  * @note kNN graphs having small k tends to perform better
  *
  * @param k the number of nearest neighbors to be retained
  */
final case class kNNConnector(k: Int) extends GraphConnector {

  /**
    * @param neighbors a vector containing the costs for each neighbor of the vertex
    *
    * @return a vector having costs only for the k nearest neighbors (top k costs),
    *         everything else is unconnected (zero)
    */
  override def apply(neighbors: DenseVector[Double]): DenseVector[Double] = {
    // find distinct costs in the neighbor vector
    val distinctCosts = DenseVector(neighbors.data.distinct)

    if (distinctCosts.length > k) {
      val topK = argtopk(distinctCosts, k).map(distinctCosts.apply)
      neighbors.map {
        cost => if (topK.contains(cost)) cost else UNCONNECTED
      }
    } else neighbors
  }
}

/**
  * A eNNConnector is used to essentially construct an eNN graph. For the neighbors of
  * the vertex it only keeps the ones having cost greater than a given epsilon value.
  *
  * @param epsilon the threshold epsilon
  */
final case class eNNConnector(epsilon: Double) extends GraphConnector {

  /**
    * @param neighbors a vector containing the costs for each neighbor of a vertex
    *
    * @return a vector having retained only costs that are greater than epsilon,
    *         everything else unconnected (zero)
    */
  override def apply(neighbors: DenseVector[Double]): DenseVector[Double] =
    neighbors.map(cost => if (cost < epsilon) UNCONNECTED else cost)
}


text:
Tempo Daily Status
==================

Script that sends daily status email based on TEMPO Worklogs

Requirements:

* [Atlassian JIRA](https://www.atlassian.com/software/jira)
* [JIRA TEMPO plugin](http://www.tempoplugin.com)
* Python 2.6+
* Python libs:
  * requests>=2.3.0
  * jinja2>=2.7

Installation
------------

1) [Download latest source code archive](https://github.com/anodamobi/Tempo-Daily-Status/archive/master.zip) or clone this repo to your server:

```
git clone https://github.com/anodamobi/Tempo-Daily-Status.git
```

2) Install all requirements

```
pip install -r requirements.txt
```

3) Copy `tds.conf.example` to `tds.conf` and edit it:

```
cp tds.conf.example tds.conf
nano tds.conf
```

4) Make test run

```
./tempo-daily-status.py
```

Usage
-----

Run it manually

```
./tempo-daily-status.py
```

or add it to your crontab (`crontab -e`)

```
0 18 * * * /home/user/Tempo-Daily-Status/tempo-daily-status.py
```

This will run the script everyday at 6 PM

Troubleshooting
---------------

### ??? instead of Unicode characters

Add `-Dfile.encoding=utf-8` to the JIRA startup options. See [JIRA Knowledgebase](https://confluence.atlassian.com/display/JIRAKB/Internationalisation+and+Encoding+Troubleshooting)

Feedback & Contribution
-----------------------

Send your feedback and bugreports on [alex@anoda.mobi](mailto:alex@anoda.mobi) and GitHub issues.

Feel free to fork, update and submit pull-requests.


text:
<?php
include_once 'headerDB.inc.php';

$values=array();
$values['itemId'] = (int) $_GET['itemId'];
$pageURL="{$pagename}.php?itemId={$values['itemId']}";
//Get item details
$values['childfilterquery']=' WHERE '.sqlparts('singleitem',$values);
$values['filterquery']='';
$values['extravarsfilterquery'] ='';
$result = query("getitemsandparent",$values);
if (!$result) {
    include_once 'header.inc.php';
    echo ("
Failed to find item {$values['itemId']}
");
    include_once 'footer.inc.php';
    die;
}

$item=$result[0]; // $item will store the values for the item being viewed

$values['isSomeday']=($item['isSomeday']=="y")?'y':'n';
$values['type']=$item['type'];

/* -------------------------------------------
    Find previous and next projects
*/
if (isset($_SESSION['idlist-'.$item['type']])) {
    $ndx=$_SESSION['idlist-'.$item['type']];
    unset($result);
} else {
    $values['filterquery']  = " WHERE ".sqlparts("typefilter",$values);
    $values['filterquery'] .= " AND ".sqlparts("activeitems",$values);
    $values['filterquery'] .= " AND ".sqlparts("pendingitems",$values);
    $values['filterquery'] .= " AND ".sqlparts("issomeday",$values);
    $result = query("getitems",$values);
    $c=0;
    $ndx=array();
    if ($result) {
        foreach ($result as $row) $ndx[]=$row['itemId'];
        $_SESSION['idlist-'.$item['type']]=$ndx;
    }
}

$cnt=count($ndx);
if($cnt>1) {
    $key=array_search($values['itemId'],$ndx);
    if ($key===false) {
        $next=0;
        $prev=$cnt-1;
    } else {
        if ($key==0)
            $prev=$cnt-1;
        else
            $prev=$key-1;

        if ($key==$cnt-1)
            $next=0;
        else
            $next=$key+1;
    }
    $previousId=$ndx[$prev];
    $nextId    =$ndx[$next];
    if (isset($result)) {
        $previoustitle=$result[$prev]['title'];
        $nexttitle    =$result[$next]['title'];
    } else {
        $previtem = query("selectitemtitle",array('itemId'=>$previousId));
        $previoustitle=$previtem[0]['title'];
        $nextitem = query("selectitemtitle",array('itemId'=>$nextId));
        $nexttitle    =$nextitem[0]['title'];
    }
}
/*
    Got previous and next projects
----------------------------------------------------------*/

$afterTypeChange=$pageURL;
if (empty($item['parentId'])) {
    $pids=$pnames=array();
} else {
    $pids=explode(',',$item['parentId']);
    $pnames=explode($_SESSION['config']['separator'],$item['ptitle']);
}
$values['parentId']=$values['itemId'];
/* -------------------------------------------------------------------
    get all children for this item, and accumulate them into arrays,
    grouped by completion status and child item type
*/

// initiate arrays for children tables
$maintableReferrer=$pageURL;

$AcreateItemId=$AnoEntries=$Athistableid=$AwasNAonEntry=$Afootertext=$AdispArray
    =$Amaintable=array();
$childtype=getChildType($item['type']); // array of item types that can be children of this item
if (false!==($ndx=array_search('p',$childtype,true)))
    array_splice($childtype,$ndx+1,0,'s');
// loop to build tables of children, by completion status and type
if (!empty($childtype)) foreach (array('n','y') as $comp) foreach ($childtype as $thistype) {
    // reset arrays for each table
    $wasNAonEntry=$footertext=$dispArray=$maintable=array();

    $thistableid="i$comp$thistype"; // set the unique id for each table
    $thischildtype=getTypes($thistype,$item['type']);
    $sectiontitle=(($comp==="y")?'Completed ':'').$thischildtype.'s';
    /* -------------------------------------
        Query: select children for this type
    */
    if ($thistype==='s') {
       $values['type']='p';
       $values['isSomeday']='y';
       $values['filterquery'] ='';
    } else {
        $values['isSomeday']='n';
        $values['type']=$thistype;
	    $values['filterquery'] = " AND ".sqlparts("typefilter",$values); // only filter on type if not a someday
    }
    $values['filterquery'] .= " AND ".sqlparts("issomeday",$values);

    $q=($comp==='y')?'completeditems':'pendingitems';  //suppressed items will be shown on report page
	$values['filterquery'] .= " AND ".sqlparts($q,$values);
    $maintable = query("getchildren",$values);
    if (!$maintable) $maintable=array();
    /*
        end of query
    ----------------------------------------*/
    if ($comp==='n') {
        // inherit some defaults from parent:
        $createItemId="0&parentId={$values['itemId']}&type=$thistype";
        foreach (array('categoryId','contextId') as $field)
            if ($item[$field]) $createItemId.="&$field={$item[$field]}";
        if ($item['deadline']) $createItemId.="&deadline=".date('Y-m-d',$item['deadline']);
    }
    $addnew="Add new $thischildtype";
    // prepare text to display for use if there are no children:
    $noEntries= "
No $sectiontitle".(($comp==='n')?" - $addnew":'' )."
";
    /* set limit on number of children to dispay, if we are processing completed items,
        and the number of returned items is greater than the user-configured display limit */
    if ($comp==='y' && $_SESSION['config']['ReportMaxCompleteChildren']
        && count($maintable) > $_SESSION['config']['ReportMaxCompleteChildren']
        && $item['type']!=='L' && $item['type']!=='C' ) {
        $limit=$_SESSION['config']['ReportMaxCompleteChildren'];
        $footertext[]="".(count($maintable)-$limit)." more... (".count($maintable)." items in total)";
    } else {
        $limit=count($maintable);
        if ($comp==='n')
            $footertext[]=$addnew;
    }
    /* ------------------------------------------------
        decide which fields to tabulate, based on child item type, and completion status
    */
	$shownext= ($comp==='n') && ($values['type']==='a' || $values['type']==='w');
	$suppressed=0;
    $trimlength=$_SESSION['config'][($comp==="n")?'trimLengthInReport':'trimLength'];
    if($trimlength) {
	    $descriptionField='shortdesc';
	    $outcomeField='shortoutcome';
    } else {
        $descriptionField='description';
        $outcomeField='desiredOutcome';
    }
    if ($shownext) $dispArray['NA']='NA';
    $dispArray['title']=$sectiontitle;
    $dispArray[$descriptionField]='Description';

    switch ($values['type']) {
        case 'T':
            // prevent display of category for (check)list items
            break;
        case 'a': // deliberately flows through to 'w'
        		if ($comp=="n") {
          			$dispArray['recurdesc']='Repeat';
            }
        case 'w': // deliberately flows through to 'r'
            if ($comp=="n") {
                $dispArray['tickledate']='Suppress until';
    			      $dispArray['deadline']='Deadline';
            }
        case 'r':
            $dispArray['context']='context';
            $dispArray['timeframe']='time';
            break;
        case 'm': // deliberately flows through to 'p;
        case 'v': // deliberately flows through to 'p;
        case 'o': // deliberately flows through to 'p;
        case 'g': // deliberately flows through to 'p;
        case 's': // deliberately flows through to 'p;
        case 'p': // deliberately flows through to default;
            $dispArray[$outcomeField]='Outcome';
        default:
            $dispArray['category']='category';
            break;
    }

    $dispArray['dateCreated']='Date Created';
	if ($comp=="n" || $item['type']==='C') {
		$dispArray['checkbox']='Complete';
	} else {
		$dispArray['dateCompleted']='Date Completed';
	}
    foreach ($dispArray as $key=>$val) $show[$key]=true;
    /*  finished choosing which fields to display
        ----------------------------------------------------------
        now process the query result, row by row, ready for tabulation
    */
	$i=0;

    while ($i < count($maintable)) {
        $row=&$maintable[$i];
        $cleantitle=makeclean($row['title']);

        $row['doreport']=!($row['type']=="a" || $row['type']==="r" || $row['type']==="w" || $row['type']==="i");

        if ($i >= $limit) {
            if ($_SESSION['useLiveEnhancements']) {
                $row['row.class']='togglehidden';
            } else {
                array_splice($maintable,$i);
                break;
            }
        }
        $row['type']=$childtype;
        $row[$descriptionField]=$row['description'];
        $row[$outcomeField]=$row['desiredOutcome'];
		$row['category']=makeclean($row['category']);

		$row['context']=makeclean($row['cname']);
		$row['context.title']='Go to '.$row['context'].' context report';

		$row['timeframe']=makeclean($row['timeframe']);
        $row['timeframe.title']='Go to '.$row['timeframe'].' time-context report';

		if ($comp==='n') {
			if ($row['tickledate']>time()) { // item is not yet tickled - count it, then skip displaying it
				$suppressed++;
				if ($_SESSION['useLiveEnhancements'])
                    $row['row.class']='togglehidden';
                else {
                    array_splice($maintable,$i,1);
                    continue;
                }
			}

            if (!empty($row['deadline'])) {
                $deadline=prettyDueDate($row['deadline'],$row['daysdue']);
                $row['deadline']      =$deadline['date'];
                $row['deadline.class']=$deadline['class'];
                $row['deadline.title']=$deadline['title'];
            }

			if ($shownext) {
                $row['NA']=$comp!=="y" && $row['nextaction']==='y';
                $row['NA.title']='Mark as a Next Action';
                if ($row['NA']) array_push($wasNAonEntry,$row['itemId']);
            }
		}

		$row['checkbox.title']="Mark $cleantitle ".
                ( ($comp==='y') ? 'in' : '' ).
                "complete";
		$row['checkboxname']='isMarked[]';
		$row['checkboxvalue']=$row['itemId'];
        $row['checkboxchecked']=($comp==='y');

		$i++;
    }
    unset($row);
    /*  finished row-by row processing
        ------------------------------------------------
        now set table footer
    */
	if ($suppressed) {
        $is=($suppressed===1)?'is':'are';
        $also=(count($maintable))?'also':'';
        $plural=($suppressed===1)?'':'s';
		array_unshift($footertext,
            "There $is $also $suppressed tickler $thischildtype$plural not yet due for action"
        );
	}
    /*  finished table footer
        ------------------------------------------------
        accumulate arrays for this child type and completion status,
        into the master arrays of all children
    */

    $AwasNAonEntry[$comp][$thistype]=$wasNAonEntry;
    $Athistableid[$comp][$thistype] =$thistableid;
    $AwasNAonEntry[$comp][$thistype]=$wasNAonEntry;
    $Afootertext[$comp][$thistype]  =$footertext;
    $AdispArray[$comp][$thistype]   =$dispArray;
    $Amaintable[$comp][$thistype]   =$maintable;
    $AnoEntries[$comp][$thistype]   =$noEntries;
    $AcreateItemId[$comp][$thistype]=$createItemId;
}
/*
    end of loop to build tables of children
    ============================================================================
    and end of data processing
    ============================================================================
    got all data - now display page
*/
$title="View ".makeclean($item['title']);

$titlefull="";
if(isset($previousId))
    $titlefull.= " < ";

$titlefull.= " "
        ."  "
        ." ";

if(isset($nextId))
    $titlefull.= "  >  \n";

$titlefull.= "".getTypes($item['type'])." Report: "
    .makeclean($item['title']);

if ($item['isSomeday']==='y')
    $titlefull.= ' (Someday) ';

include_once 'headerHtml.inc.php';
gtd_handleEvent(_GTD_ON_DATA,$pagename);
include_once 'header.inc.php';

if ($item['type']==='i')
    echo "
"
        ,"[Set type] \n"
        ,"
";
/* --------------------------------------------------
    display values for this item
*/
?>

<?php
//Item details
if ($item['description'])
    echo "
Description:	"
        ,nl2br(escapeChars($item['description'])),"
\n";

if ($item['desiredOutcome'])
    echo "
Desired Outcome:	"
        ,nl2br(escapeChars($item['desiredOutcome'])),"
\n";

if (!empty($pids)) {
    echo "
Parents: 	";
    $brk='';
    foreach ($pids as $pkey=>$pid) {
        $thisparent=makeclean($pnames[$pkey]);
        echo "$brk$thisparent ";
        $brk=', ';
    }
    echo "
\n";
}

if ($item['categoryId'])
    echo "
Category:	"
        ,makeclean($item['category']),"
\n";

if ($item['contextId'])
    echo "
Space Context:	"
        ,makeclean($item['cname']),"
\n";

if ($item['timeframeId'])
    echo "
Time Context:	"
        ,makeclean($item['timeframe']),"
\n";

if ($item['deadline']) {
    $deadline=prettyDueDate($item['deadline'],$item['daysdue']);
    echo "
Deadline:	',$deadline['date'],"
\n";
}

if ($item['type']==='a' || $item['type']==='w')
    echo "
Next Action?	"
        ,($item['nextaction']==='y')?'Yes':'No',"
\n";

if (!empty($item['recurdesc']) || !empty($item['recur']))
    echo "
Repeat	{$item['recurdesc']} ({$item['recur']})
\n";

if (!empty($item['tickledate']))
	echo "
Suppressed Until:	"
        ,date($_SESSION['config']['datemask'],$item['tickledate'])
        ,"
\n";

if (!empty($item['tags'])) {
	echo "
Tags:	";
    $taglist=explode(',',$item['tags']);
    $sep='';
    foreach ($taglist as $tag) {
      echo "$sep$tag";
      $sep=', ';
    }
    echo "
\n";
}

echo "
Created:	"
    ,date($_SESSION['config']['datemask'],$item['dateCreated'])
    ,"
\n";

if ($item['lastModified'])
    echo "
Last modified:	"
        ,date($_SESSION['config']['datemask'].' H:i:s',$item['lastModified'])
        ,"
\n";

echo "
\n";

if ($item['dateCompleted']) {
    echo "Completed On:	"
        ,date($_SESSION['config']['datemask'],$item['dateCompleted'])
        ,"	\n";

    } else { ?>
    Complete

        <form method='post' action='processItems.php'>

                <input type='submit' name='complete' value='Today' id='completereport' />
                <input type='hidden' name='action' value='complete' />
                <input type='hidden' name='referrer' value='<?php echo $pageURL; ?>' />
                <input type='hidden' name='itemId' value='<?php echo $values['itemId']; ?>' />

        </form>

<?php }
echo "
\n";
?>

<?php
/*
    finished displaying item values
 ============================================================================ */
if (empty($childtype)) {
    include_once 'footer.inc.php';
    exit;
}
/* ============================================================================
    now display children
*/
if ($item['type']==='C') {  // if a checklist, wrap *all* children in a single form ?>
<form action='processItems.php' method='post'>
<?php }

if (!empty($childtype)) foreach (array('n','y') as $comp) foreach ($childtype as $thistype) { //table display loop
    $wasNAonEntry=$AwasNAonEntry[$comp][$thistype];
    $thistableid =$Athistableid[$comp][$thistype] ;
    $wasNAonEntry=$AwasNAonEntry[$comp][$thistype];
    $footertext  =$Afootertext[$comp][$thistype]  ;
    $dispArray   =$AdispArray[$comp][$thistype]   ;
    $maintable   =$Amaintable[$comp][$thistype]   ;
    $noEntries   =$AnoEntries[$comp][$thistype]   ;

    if (count($maintable)) {
        ?>

        <?php
		$shownext= ($comp==='n') && ($values['type']==='a' || $values['type']==='w');
		$suppressed=0;
        $trimlength=$_SESSION['config'][($comp==="n")?'trimLengthInReport':'trimLength'];
        if ($comp==='n' && $item['type']!=='C') { ?>
<form action='processItems.php' method='post'><?php
        }
        ?>
<table class='datatable sortable' id='<?php
        echo $thistableid;
?>' summary='table of children of this item'>
        <?php
        if (empty($footertext)) {
            $tfoot='';
        } else {
            $tfoot="
\n";
            foreach ($footertext as $line) $tfoot.="
\n$line\n
\n";
            $tfoot.="
\n";
        }
        require 'displayItems.inc.php';
        ?>

    	<?php
    } else {  // end of: if (count($maintable))
        echo $noEntries;
    }
	if (   ($comp==="n" && (count($maintable)) && $item['type']!=='C')
        || ($item['type']==='C' && $comp!=="n") ) {
	   ?>

<input type="reset" class="button" />
<input type="submit" class="button" value="Update marked <?php echo getTypes($thistype,$item['type']); ?>s" name="submit" />
<input type='hidden' name='referrer' value='<?php echo "{$pagename}.php?itemId={$values['itemId']}"; ?>' />
        <?php if ($item['type']==='C') { ?>
<button type='submit' name='clearchecklist' id='clearchecklist' value='y'>Clear Checklist</button>
        <?php } else { ?>
<input type="hidden" name="multi" value="y" />
        <?php } ?>
<input type="hidden" name="parentId" value="<?php echo $item['itemId']; ?>" />
<input type='hidden' name='ptype' value='<?php echo $item['type']; ?>' />
<input type='hidden' name='type' value='<?php echo $thistype; ?>' />
<input type="hidden" name="action" value="<?php if ($item['type']==='C') echo 'check'; ?>complete" />
<input type="hidden" name="wasNAonEntry" value='<?php echo implode(' ',$wasNAonEntry); ?>' />

        <?php
        if ($item['type']!=='C') { ?>
</form>     <?php
        }
    }
    if (count($maintable)) { ?>

  <?php
    }
}  // end of foreach ($completed as $comp) foreach ($childtype as $thistype)
if ($item['type']==='C') { ?>
</form><?php
}
include_once 'footer.inc.php';
?>


text:
package org.codenarc.rule;

import org.codehaus.groovy.ast.*;
import org.codehaus.groovy.control.SourceUnit;
import org.codenarc.source.SourceCode;
import org.codenarc.util.AstUtil;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Abstract superclass for Groovy AST Visitors used with Rules
 *
 * @author Chris Mair
 * @author Hamlet D'Arcy
 */
public class AbstractAstVisitor extends ClassCodeVisitorSupport implements AstVisitor {

    // TODO Inheriting from ClassCodeVisitorSupportHack is a workaround for a known groovy issue: http://jira.codehaus.org/browse/GROOVY-4922
    // TODO Revert to inheriting from ClassCodeVisitorSupport once that Groovy issue is fixed.
    // TODO Also see CodeNarc issue #3436461: StackOverflowErrors with CodeNarc 0.16

    private final List<Violation> violations = new ArrayList<Violation>();
    private Rule rule;
    private SourceCode sourceCode;
    private Set<Object> visited = new HashSet<Object>();
    private ClassNode currentClassNode = null;

    /**
     * Return true if the AST expression has not already been visited. If it is
     * the first visit, register the expression so that the next visit will return false.
     *
     * @param expression - the AST expression to check
     * @return true if the AST expression has NOT already been visited
     */
    protected boolean isFirstVisit(Object expression) {
        if (visited.contains(expression)) {
            return false;
        }
        visited.add(expression);
        return true;
    }

    /**
     * Return the trimmed source line corresponding to the specified AST node
     *
     * @param node - the Groovy AST node
     */
    protected String sourceLineTrimmed(ASTNode node) {
        return sourceCode.line(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
    }

    /**
     * Return the raw source line corresponding to the specified AST node
     *
     * @param node - the Groovy AST node
     */
    protected String sourceLine(ASTNode node) {
        return sourceCode.getLines().get(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
    }

    /**
     * Return the last raw source line corresponding to the specified AST node
     *
     * @param node - the Groovy AST node
     */
    protected String lastSourceLine(ASTNode node) {
        return sourceCode.getLines().get(node.getLastLineNumber() - 1);
    }

    /**
     * Return the trimmed last source line corresponding to the specified AST node
     *
     * @param node - the Groovy AST node
     */
    protected String lastSourceLineTrimmed(ASTNode node) {
        return sourceCode.line(node.getLastLineNumber() - 1);
    }

    /**
     * Add a new Violation to the list of violations found by this visitor.
     * Only add the violation if the node lineNumber >= 0.
     *
     * @param node - the Groovy AST Node
     * @deprecated Always define a message. Use the other addViolation method instead of this one.
     */
    @Deprecated
    protected void addViolation(ASTNode node) {
        addViolation(node, null);
    }

    /**
     * Add a new Violation to the list of violations found by this visitor.
     * Only add the violation if the node lineNumber >= 0.
     *
     * @param node    - the Groovy AST Node
     * @param message - the message for the violation; defaults to null
     */
    protected void addViolation(ASTNode node, String message) {
        int lineNumber = node.getLineNumber();
        if (lineNumber >= 0) {
            if (node instanceof AnnotatedNode) {
                lineNumber = AstUtil.findFirstNonAnnotationLine(node, sourceCode);
            }
            String sourceLine = sourceLineTrimmed(node);
            Violation violation = new Violation();
            violation.setRule(rule);
            violation.setLineNumber(lineNumber);
            violation.setSourceLine(sourceLine);
            violation.setMessage(message);
            violations.add(violation);
        }
    }

    /**
     * Add a new Violation to the list of violations found by this visitor.
     *
     * @param violation - the violation to add
     */
    protected void addViolation(Violation violation) {
        violations.add(violation);
    }

    protected SourceUnit getSourceUnit() {
        throw new RuntimeException("should never be called");
    }

    public final void visitClass(final ClassNode node) {
        currentClassNode = node;
        visitClassEx(node);
        super.visitClass(node);
        visitClassComplete(node);
        currentClassNode = null;
    }

    protected void visitClassEx(ClassNode node) {
        // empty on purpose
    }

    protected void visitClassComplete(ClassNode node) {
        // empty on purpose
    }

    public final void visitMethod(final MethodNode node) {
        if (shouldVisitMethod(node)) {
            visitMethodEx(node);
            if (node != null && node.getParameters() != null) {
                for (Parameter parameter : node.getParameters()) {
                    if (parameter.hasInitialExpression()) {
                        parameter.getInitialExpression().visit(AbstractAstVisitor.this);
                    }
                }
            }
            super.visitMethod(node);
            visitMethodComplete(node);
        }
    }

    protected boolean shouldVisitMethod(MethodNode node) {
        return true;
    }

    protected void visitMethodComplete(MethodNode node) {
        // empty on purpose
    }

    protected void visitMethodEx(MethodNode node) {
        // empty on purpose
    }

    public void setRule(Rule rule) {
        this.rule = rule;
    }

    public void setSourceCode(SourceCode sourceCode) {
        this.sourceCode = sourceCode;
    }

    public List<Violation> getViolations() {
        return violations;
    }

    public Set<Object> getVisited() {
        return visited;
    }

    public Rule getRule() {
        return rule;
    }

    public SourceCode getSourceCode() {
        return sourceCode;
    }

    public void setVisited(Set<Object> visited) {
        this.visited = visited;
    }

    protected String getCurrentClassName() {
        return currentClassNode.getName();
    }

    protected ClassNode getCurrentClassNode() {
        return currentClassNode;
    }
}


text:
package com.lrother.accs.data.account;

import java.io.Serializable;

import com.lrother.accs.data.account.Account.Status;
import com.lrother.accs.data.owner.AccountOwnerUpdateData;

public class AccountUpdateData<T extends AccountOwnerUpdateData> implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /*
     * No login property. Login is not going to be changed.
     */

    private String password;

    private Status status;

    private T ownerUpdateData;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public T getOwnerUpdateData() {
        return ownerUpdateData;
    }

    public void setOwnerUpdateData(T ownerUpdateData) {
        this.ownerUpdateData = ownerUpdateData;
    }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>QUnit Example</title>
  <link rel="stylesheet" href="resources/qunit.css">


text:
Dir.chdir File.join File.dirname(__FILE__), '../../'
require './spec/env/kern.rb'
require './spec/lib/helpers.rb'
require './spec/lib/io_extensions.rb'
require './spec/lib/rspec_extensions.rb'

RSpec.describe "kern:event_spec" do
  include_context "kern"

  it "Can call int_event_defer" do
    #Compile the controller
    ctx = flok_new_user File.read('./spec/kern/assets/controller0.rb')

    #Register callout
    ctx.eval %{
      base = _embed("my_controller", 0, {}, null);

      //Queue up a deferred event
      int_event_defer(base, "defer_res", {});
    }

    edefer_q = ctx.dump("edefer_q")
    base = ctx.eval("base")
    expect(edefer_q).to eq([
      base, "defer_res", {}
    ])
  end

  it "Does call if_dispatch with an 'i' for incomplete" do
    #Compile the controller
    ctx = flok_new_user File.read('./spec/kern/assets/controller0.rb')

    #Register callout
    ctx.eval %{
      base = _embed("my_controller", 0, {}, null);

      //Queue up two deferred event b/c the first will get eaten
      int_event_defer(base, "defer_res", {});
      int_event_defer(base, "defer_res", {});

      //Drain queue
      int_dispatch([]);
      int_dispatch([]);
    }

    #Incomplete should have been added
    q = @driver.dump_q
    expect(q[0]).to eq("i")
  end

  it "Does call the event trigger for the controller after the dispatch" do
    #Compile the controller
    ctx = flok_new_user File.read('./spec/kern/assets/controller0defer.rb')

    #Register callout
    ctx.eval %{
      base = _embed("my_controller", 0, {}, null);
    }

    #At this point, the synchronous event should have been dispatched in the _embed
    #because int_event is located in the controller on_entry
    sync_res_params = ctx.dump("sync_res_params")
    expect(sync_res_params).to eq({
      "foo_sync" => "bar"
    })

    #But the deferred response should only be available during the
    #next int_disp
    expect {
      ctx.dump("defer_res_params")
    }.to raise_exception

    ctx.eval("int_dispatch([])")

    #At this point, we only have one int_dispatch, so the event
    #should never have been de-queued because it will on teh second one
    defer_res_params = ctx.dump("defer_res_params")
    expect(defer_res_params).to eq({
      "foo" => "bar"
    })
  end

  it "Does call the event trigger for the controller after the dispatch only one at a time" do
    #Compile the controller
    ctx = flok_new_user File.read('./spec/kern/assets/controller0defer2.rb')

    #Register callout
    ctx.eval %{
      base = _embed("my_controller", 0, {}, null);
      int_dispatch([]);
    }

    #Should have dequeued the first asynchronous event callback
    defer_res_params = ctx.dump("defer_res_params")
    expect(defer_res_params).to eq({
      "foo" => "bar"
    })

    #But the second one should not have dequeued yet
    expect {
      ctx.dump("defer_res2_params")
    }.to raise_exception

    #Until we throw another int_dispatch
    ctx.eval("int_dispatch([])")

    #And now it should be there
    defer_res2_params = ctx.dump("defer_res2_params")
    expect(defer_res2_params).to eq({
      "foo" => "bar"
    })
  end
end