text:
function Enable-StrongAuthentication
{
	[CmdletBinding()]
	param
	(
		[Parameter(Mandatory=$false)]
		[bool]$Net35,
		[Parameter(Mandatory=$false)]
		[bool]$Net4or5,
		[Parameter(Mandatory=$false)]
		[string]$ComputerName
	)
	try
	{
		$ErrorActionPreference = 'Stop';
		$Error.Clear();

		if ($Net35)
		{
			$RegPath = 'SOFTWARE\Wow6432Node\Microsoft.NETFramework\v2.0.50727';
			if ($ComputerName)
			{
				Set-RegistryValue -Hive HKEY_LOCAL_MACHINE -SubKeyName $RegPath -ValueName 'SchUseStrongCrypto' -ValueType DWORD -Value 1 -ComputerName $ComputerName;
			}
			else
			{
				Set-RegistryValue -Hive HKEY_LOCAL_MACHINE -SubKeyName $RegPath -ValueName 'SchUseStrongCrypto' -ValueType DWORD -Value 1;
			}
		}

		if ($Net4or5)
		{
			$RegPath = 'SOFTWARE\Microsoft.NETFramework\v4.0.30319';
			if ($ComputerName)
			{
				Set-RegistryValue -Hive HKEY_LOCAL_MACHINE -SubKeyName $RegPath -ValueName 'SchUseStrongCrypto' -ValueType DWORD -Value 1 -ComputerName $ComputerName;
			}
			else
			{
				Set-RegistryValue -Hive HKEY_LOCAL_MACHINE -SubKeyName $RegPath -ValueName 'SchUseStrongCrypto' -ValueType DWORD -Value 1;
			}
		}
	}
	catch
	{
		throw $_;
	}
}


text:
static bool ctdn_mode = false;

typedef enum { ctdn_mh, ctdn_ml, ctdn_sh, ctdn_sl, ctdn_stopped, ctdn_running } ctdn_state_t;
static ctdn_state_t ctdn_state = ctdn_stopped; // persist

static TextLayer *ctdn_txlayer;
static TextLayer *ctin_txlayer;
static TextLayer *ctnoop_txlayer;

static char ctdn_buffer[] = "03:00";
static char ctin_buffer[] = "03:00";
static char null_buffer[] = "";

static AppTimer *ctdn_timer = NULL;

static Sec_ms ctdn_base_time = { .sec = 0, .ms = 0 }; // persist. valid only when ctdn running
// In non-overtime, shows effective time since ctdn started (adjusted after pause/resume).
// In overtime, shows time when target reached (no adjustment because no pause).

static Sec_ms ctdn_elps_time = { .sec = 0, .ms = 0 }; // persist. valid only when ctdn paused
// In non-overtime, shows cumulative elapsed time since started (excludes time paused).
// In overtime, shows elapsed time since target (no exclusion because no pause).

static time_t ctdn_targ_secs = 3 * 60; // persist
static bool ctdn_overtime = false; // persist

// Update, start, stop

static void update_ctdn(void);
static void handle_ctdn_timer(void *ignore) {
	ctdn_timer = NULL;
	update_ctdn();
}

static void update_ctin(void) {
  GColor col = myYellow;
  switch (ctdn_state) {
	case ctdn_running: case ctdn_stopped:
    col = myGreen;
	  snprintf(ctin_buffer, sizeof(ctin_buffer), "%02d:%02d",
		  dminute_from_seconds(ctdn_targ_secs),
		  second_from_seconds(ctdn_targ_secs));
    break;
  case ctdn_mh:
		snprintf(ctin_buffer, sizeof(ctin_buffer), "%d-:--", (uint16_t)((ctdn_targ_secs / (10 * 60)) % 10));
    break;
  case ctdn_ml:
		snprintf(ctin_buffer, sizeof(ctin_buffer), "-%d:--", (uint16_t)((ctdn_targ_secs / 60) % 10));
    break;
  case ctdn_sh:
		snprintf(ctin_buffer, sizeof(ctin_buffer), "--:%d-", (uint16_t)((ctdn_targ_secs / 10) % 6));
    break;
  case ctdn_sl:
		snprintf(ctin_buffer, sizeof(ctin_buffer), "--:-%d", (uint16_t)(ctdn_targ_secs % 10));
    break;
  }
  text_layer_set_text_color(ctin_txlayer, col);
	layer_mark_dirty(text_layer_get_layer(ctin_txlayer));
}

static const uint32_t const triple_pulse_segments[] = {500, 200, 500, 200, 500};

VibePattern triple_pulse_pattern = {
  .durations = triple_pulse_segments,
  .num_segments = ARRAY_LENGTH(triple_pulse_segments),
};

static void triple_pulse(void) {
  vibes_enqueue_custom_pattern(triple_pulse_pattern);
}

// Called at load time and from button handlers (start, stop, mode) and timer handler
static void update_ctdn(void) {
	// check for timer expired (if resuming persisted app)
	// vibrate if done even if not in ctdn mode

	if (ctdn_timer != NULL) {
		app_timer_cancel(ctdn_timer);
		ctdn_timer = NULL;
	}

	uint32_t next;
	int remaining = ctdn_targ_secs - ctdn_elps_time.sec;  // For the non-running states.
	Sec_ms now;
	Sec_ms delta = { .sec = 0, .ms = 0 };

	switch (ctdn_state) {
	case ctdn_running: // running state can be countdown or overtime
		get_current_sec_ms(&now);

    delta = now;
	  subtract_sec_ms(&delta, ctdn_base_time);

    if (!ctdn_overtime) {

		  remaining = ctdn_targ_secs - delta.sec;
		  if (remaining > 0) {
        update_ctdn_status_icon(status_running);
      }
		  else {
        // Here is the transition from running to done (overtime).
        ctdn_overtime = true;
        remaining = -remaining;
        ctdn_base_time.sec += ctdn_targ_secs; // Base time is time when target was reached.
			  triple_pulse();
        update_ctdn_status_icon(status_done);
      }
    }
    else { // Already in overtime
      remaining = delta.sec;
      if (remaining < 100 * 60) {
        update_ctdn_status_icon(status_done);
      }
      else { // Automatic reset at 100 minutes overtime
        ctdn_elps_time = (Sec_ms) { 0, 0 }; // Reset
        ctdn_overtime = false;
        ctdn_state = ctdn_stopped;
        remaining = ctdn_targ_secs;
        update_ctdn_status_icon(status_reset);
      }
    }

    // Sched handler at next second (from base time) for updated running/done(overtime) display.
    if (ctdn_state == ctdn_running) { // May have just auto-stopped
      next = (uint32_t)ctdn_base_time.ms;
	    if (next < now.ms)
			  next += 1000;
	    next -= now.ms;
	    ctdn_timer = app_timer_register(next, handle_ctdn_timer, NULL);
    }

		break;

	case ctdn_stopped:
  	break;

	case ctdn_mh: case ctdn_ml: case ctdn_sh: case ctdn_sl:
		update_ctin();
    update_ctdn_status_icon(status_init);
		break;
	}

  if (ctdn_state == ctdn_stopped) {
    if (remaining == ctdn_targ_secs)
      update_ctdn_status_icon(status_reset);
    else
      update_ctdn_status_icon(status_paused);
  }

	if (ctdn_mode) {
	  uint16_t display_minute = dminute_from_seconds(remaining);
	  uint16_t display_second = second_from_seconds(remaining);

	  snprintf(ctdn_buffer, sizeof(ctdn_buffer), "%02d:%02d", display_minute, display_second);
    text_layer_set_text_color(ctdn_txlayer, ctdn_overtime ? myRed : myGreen);
	  layer_mark_dirty(text_layer_get_layer(ctdn_txlayer));
  }
}

static void ctdn_start() {
	int n = 0;

	switch (ctdn_state) {
	case ctdn_running: break; // just keep running
	case ctdn_stopped:
		if (ctdn_elps_time.sec < ctdn_targ_secs) {
			ctdn_state = ctdn_running; // start or resume

			get_current_sec_ms(&ctdn_base_time);
			subtract_sec_ms(&ctdn_base_time, ctdn_elps_time);

			if (sec_ms_is_zero(ctdn_elps_time))
				vibes_short_pulse();
		}
		break;

	case ctdn_mh:
		ctdn_targ_secs = (ctdn_targ_secs + 10 * 60) % (100 * 60);
		break;
	case ctdn_ml:
		n = (ctdn_targ_secs / 60) % 10;
		if (n == 9)
			ctdn_targ_secs -= 9 * 60;
		else
			ctdn_targ_secs += 60;
		break;
	case ctdn_sh:
		n = (ctdn_targ_secs / 10) % 6;
		if (n == 5)
			ctdn_targ_secs -= 5 * 10;
		else
			ctdn_targ_secs += 10;
		break;
	case ctdn_sl:
		n = ctdn_targ_secs % 10;
		if (n == 9)
			ctdn_targ_secs -= 9;
		else
			ctdn_targ_secs++;
		break;
	}
	update_ctdn();
}

static void ctdn_stop() {
	switch (ctdn_state) {
	case ctdn_stopped:
		if (sec_ms_is_zero(ctdn_elps_time)) // Already reset
			ctdn_state = ctdn_mh;
		else {
			ctdn_elps_time = (Sec_ms) { 0, 0 }; // Reset
      ctdn_overtime = false;
    }
		break;

	case ctdn_running: // Pause
		ctdn_state = ctdn_stopped;

    if (!ctdn_overtime) {
		  get_current_sec_ms(&ctdn_elps_time);
		  subtract_sec_ms(&ctdn_elps_time, ctdn_base_time);
    }
    else {
      ctdn_elps_time = (Sec_ms) { 0, 0 }; // Reset
      ctdn_overtime = false;
    }

		break;

	case ctdn_mh: ctdn_state = ctdn_ml; break;
	case ctdn_ml: ctdn_state = ctdn_sh; break;
	case ctdn_sh: ctdn_state = ctdn_sl; break;
	case ctdn_sl:
		if (ctdn_targ_secs == 0)
			ctdn_state = ctdn_mh;
		else {
			ctdn_state = ctdn_stopped;
			update_ctin();
		}
		break;
	}
	update_ctdn();
}

// Interface

static void enable_ctdn(void);

void ctdn_set_mode(bool ct_mode) {
	ctdn_mode = ct_mode;
	if (ct_mode) {
    enable_ctdn();
		update_ctdn();
    update_ctin();
  }
}

bool ctdn_handle_middle_click(void) {
  if (ctdn_state == ctdn_stopped || ctdn_state == ctdn_running)
    return true;

  ctdn_state = ctdn_stopped;
  update_ctin();
  return false;
}

void ctdn_handle_up_click(void) {
	ctdn_stop();
}
void ctdn_handle_down_click(void) {
	ctdn_start();
}

int persist_ctdn_data(int index) {
	persist_write_data(index++, &ctdn_state, sizeof(ctdn_state));
	persist_write_data(index++, &ctdn_base_time, sizeof(ctdn_base_time));
	persist_write_data(index++, &ctdn_elps_time, sizeof(ctdn_elps_time));
	persist_write_data(index++, &ctdn_targ_secs, sizeof(ctdn_targ_secs));
  persist_write_data(index++, &ctdn_overtime, sizeof(ctdn_overtime));

	return index;
}

int restore_ctdn_data(int index) {
	persist_read_data_if_exists(index++, &ctdn_state, sizeof(ctdn_state));
	persist_read_data_if_exists(index++, &ctdn_base_time, sizeof(ctdn_base_time));
	persist_read_data_if_exists(index++, &ctdn_elps_time, sizeof(ctdn_elps_time));
	persist_read_data_if_exists(index++, &ctdn_targ_secs, sizeof(ctdn_targ_secs));
  persist_read_data_if_exists(index++, &ctdn_overtime, sizeof(ctdn_overtime));

	return index;
}

// Init and deinit

void enable_ctdn(void) {
  text_layer_set_text_color(ctdn_txlayer, myGreen);
  //text_layer_set_background_color(ctdn_txlayer, GColorClear);
  text_layer_set_text_color(ctin_txlayer, myGreen);
  //text_layer_set_background_color(ctnoop_txlayer, GColorClear);

  text_layer_set_text(ctdn_txlayer, ctdn_buffer);
  text_layer_set_text(ctin_txlayer, ctin_buffer);
  text_layer_set_text(get_infol_txlayer(), null_buffer);
}

void init_ctdn(void) {
  ctdn_txlayer = get_time_txlayer();
  ctin_txlayer = get_infor_txlayer();
  ctnoop_txlayer = get_infol_txlayer();

  layer_mark_dirty(get_stcd_layer());
}

void deinit_ctdn(void) {
	if (ctdn_timer != NULL)
		app_timer_cancel(ctdn_timer);
  ctdn_txlayer = ctin_txlayer = NULL;
}

redpajama_set_name: RedPajamaGithub


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

%define WINSTRIPE_AERO
%include inContentUI.css
%undef WINSTRIPE_AERO


text:
module FbGraph
  class AgeRange < Range
    DEFAULT_MAX_AGE = 9999

    def initialize(attributes = {})
      super attributes[:min], attributes[:max] || DEFAULT_MAX_AGE
    end

    alias_method :min, :first
    alias_method :max, :last
  end
end


text:
#ifndef BOOST_MPL_VECTOR_AUX_PUSH_FRONT_HPP_INCLUDED
#define BOOST_MPL_VECTOR_AUX_PUSH_FRONT_HPP_INCLUDED

// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.

// $Id$
// $Date$
// $Revision$

#include <boost/mpl/push_front_fwd.hpp>
#include <boost/mpl/aux_/config/typeof.hpp>

#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)

#   include <boost/mpl/vector/aux_/item.hpp>
#   include <boost/mpl/vector/aux_/tag.hpp>

namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace mpl {

template<>
struct push_front_impl< aux::vector_tag >
{
    template< typename Vector, typename T > struct apply
    {
        typedef v_item<T,Vector,1> type;
    };
};

}}

#endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES

#endif // BOOST_MPL_VECTOR_AUX_PUSH_FRONT_HPP_INCLUDED


text:
-- =============================================
-- Author:		Duane Wingett
-- Create date: 2015-09-29
-- Description:	Truncates the volumn and performance table
-- =============================================
CREATE PROCEDURE [dbo].[VolumeAndPerformanceTruncate]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    TRUNCATE TABLE [dbo].[VolumnAndPerformance];
END


text:
<!doctype html>

		<meta charset="utf-8">
		<title>JavaScript Cookie Test Suite</title>
		<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.14.0.css">


text:
package com.blogspot.sontx.bottle.model.bean;

import lombok.Data;

@Data
public class Animal {
    private String name;
    private String imageUrl;

    public Animal(String name, String imageUrl) {
        this.name = name;
        this.imageUrl = imageUrl;
    }
}


text:
echo ">>> Installing Tileserver"

#
# Clone datasource
#
cd $ROOT_DIR
yes yes | git clone https://github.com/mapzen/vector-datasource.git
(cd vector-datasource && git checkout tags/v1.2.0)

#
# Grab some data
#
wget $EXTRACT_URL

#
# Import the data using mapzen style
#
export PGPASSWORD=PG_PASS
osm2pgsql -s -C 1024 -S vector-datasource/osm2pgsql.style -j bangkok_thailand.osm.pbf -d $PG_DB -U $PG_USER
cd $ROOT_DIR/vector-datasource/data
python bootstrap.py
make -f Makefile-import-data
./import-shapefiles.sh | psql -d $PG_DB -U $PG_USER
./perform-sql-updates.sh -d $PG_DB -U $PG_USER
make -f Makefile-import-data clean

#
# Install osm
#
cd $ROOT_DIR
yes yes | git clone https://github.com/mapzen/tileserver.git
(cd tileserver && git checkout tags/v1.4.0)
sudo pip install -U -r tileserver/requirements.txt
cd $ROOT_DIR/tileserver
sudo python setup.py develop

#
# Install tilequeue
#
cd $ROOT_DIR
yes yes | git clone https://github.com/tilezen/tilequeue.git
(cd tilequeue && git checkout tags/v1.6.0)
cd $ROOT_DIR/tilequeue
sudo python setup.py develop

cd $ROOT_DIR/vector-datasource
sudo python setup.py develop

#
# Set up config
#
cd $ROOT_DIR/tileserver
bash $SYNC_DIR/configs/ts.sh
sudo pip install gunicorn
gunicorn -b 127.0.0.1:3002 "tileserver:wsgi_server('$ROOT_DIR/tileserver/config.yaml')" &


text:
A gulp plugin that allows you to invalidate paths in AWS cloudfront

## Installation
```
npm install gulp-cloudfront-invalidate
```

## Usage

```js
var gulp = require('gulp')
  , cloudfront = require('gulp-cloudfront-invalidate');

var settings = {
  distribution: 'E2A654H2YRPD0W', // Cloudfront distribution ID
  paths: ['/index.html']          // Paths to invalidate
  accessKeyId: '...',             // AWS Access Key ID
  secretAccessKey: '...',         // AWS Secret Access Key
  sessionToken: '...',            // Optional AWS Session Token
  wait: true                      // Whether to wait until invalidation is completed (default: false)
}

gulp.task('invalidate', function () {
  return gulp.src('*')
    .pipe(cloudfront(settings));
});
```

If you like this project, please watch this and follow me.

## Contributors
Here is a list of [Contributors](http://github.com/confyio/gulp-cloudfront-invalidate/contributors)

__I accept pull requests and guarantee a reply back within a day__

## License
MIT/X11

## Bug Reports
Report [here](http://github.com/confyio/gulp-cloudfront-invalidate/issues). __Guaranteed reply within a day__.

## Contact
Pavan Kumar Sunkara (pavan.sss1991@gmail.com)

Follow me on [github](https://github.com/users/follow?target=pksunkara), [twitter](http://twitter.com/pksunkara)


text:
<!doctype html>
<title>duration for streaming video</title>

FAIL (script didn't run)


text:
namespace Prism.Regions
{
    /// <summary>
    /// Provides a way for objects involved in navigation to be notified of navigation activities.
    /// </summary>
    public interface INavigationAware
    {
        /// <summary>
        /// Called when the implementer has been navigated to.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        void OnNavigatedTo(NavigationContext navigationContext);

        /// <summary>
        /// Called to determine if this instance can handle the navigation request.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        /// <returns>
        /// <see langword="true"/> if this instance accepts the navigation request; otherwise, <see langword="false"/>.
        /// </returns>
        bool IsNavigationTarget(NavigationContext navigationContext);

        /// <summary>
        /// Called when the implementer is being navigated away from.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        void OnNavigatedFrom(NavigationContext navigationContext);
    }
}


text:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

/**
 * Allow to collect and menage of the weapons.
 */

public class GroundWeapon : MonoBehaviour {
	public int weaponNumber;
	private bool isPlayerInTrigger;
	public Text grabWeapon;

    // Use this for initialization
    void Start(){
		grabWeapon.GetComponent<Text> ();
	}

	void OnTriggerStay(Collider col){
		if (col.tag.Equals ("Player")) {
			isPlayerInTrigger = true;
			if(Input.GetKeyDown(KeyCode.E)){
				col.SendMessage("addWeapon", weaponNumber);
				isPlayerInTrigger = false;
				Destroy(gameObject);
				grabWeapon.enabled = false;
			}
		}
	}

	void OnTriggerExit(Collider col){
		if (col.tag.Equals ("Player"))
		isPlayerInTrigger = false;

	}

	void OnGUI(){
            if (isPlayerInTrigger)
                grabWeapon.enabled = true;
            else
                grabWeapon.enabled = false;
	}

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Core;

namespace Cake.Common.Build.TravisCI.Data
{
    ///
    /// Provides Travis CI environment information for the current build.
    ///
    public sealed class TravisCIEnvironmentInfo : TravisCIInfo
    {
        ///
        /// Gets Travis CI build information for the current build.
        ///
        /// <value>
        /// The build.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Build:
        ///         Branch: {0}
        ///         BuildDirectory: {1}
        ///         BuildId: {2}",
        ///         BuildSystem.TravisCI.Environment.Build.Branch,
        ///         BuildSystem.TravisCI.Environment.Build.BuildDirectory,
        ///         BuildSystem.TravisCI.Environment.Build.BuildId
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Build:
        ///         Branch: {0}
        ///         BuildDirectory: {1}
        ///         BuildId: {2}",
        ///         TravisCI.Environment.Build.Branch,
        ///         TravisCI.Environment.Build.BuildDirectory,
        ///         TravisCI.Environment.Build.BuildId
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public TravisCIBuildInfo Build { get; }

        ///
        /// Gets Travis CI pull request information.
        ///
        /// <value>
        /// The Travis CI pull request information.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"PullRequest:
        ///         IsPullRequest: {0}
        ///         Id: {1}",
        ///         BuildSystem.TravisCI.Environment.PullRequest.IsPullRequest,
        ///         BuildSystem.TravisCI.Environment.PullRequest.Id
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"PullRequest:
        ///         IsPullRequest: {0}
        ///         Id: {1}",
        ///         TravisCI.Environment.PullRequest.IsPullRequest,
        ///         TravisCI.Environment.PullRequest.Id
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public TravisCIPullRequestInfo PullRequest { get; }

        ///
        /// Gets Travis CI job information for the current build.
        ///
        /// <value>
        /// The job.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Job:
        ///         JobId: {0}
        ///         JobNumber: {1}
        ///         OSName: {2}",
        ///         BuildSystem.TravisCI.Environment.Job.JobId,
        ///         BuildSystem.TravisCI.Environment.Job.JobNumber,
        ///         BuildSystem.TravisCI.Environment.Job.OSName
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Job:
        ///         JobId: {0}
        ///         JobNumber: {1}
        ///         OSName: {2}",
        ///         TravisCI.Environment.Job.JobId,
        ///         TravisCI.Environment.Job.JobNumber,
        ///         TravisCI.Environment.Job.OSName
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public TravisCIJobInfo Job { get; }

        ///
        /// Gets Travis CI repository information for the current build.
        ///
        /// <value>
        /// The repository.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Repository:
        ///         Commit: {0}
        ///         CommitRange: {1}
        ///         PullRequest: {2}",
        ///         BuildSystem.TravisCI.Environment.Repository.Commit,
        ///         BuildSystem.TravisCI.Environment.Repository.CommitRange,
        ///         BuildSystem.TravisCI.Environment.Repository.PullRequest
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Repository:
        ///         Commit: {0}
        ///         CommitRange: {1}
        ///         PullRequest: {2}",
        ///         TravisCI.Environment.Repository.Commit,
        ///         TravisCI.Environment.Repository.CommitRange,
        ///         TravisCI.Environment.Repository.PullRequest
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public TravisCIRepositoryInfo Repository { get; }

        ///
        /// Gets a value indicating whether the current build is continuous integration.
        ///
        /// <value>
        /// <c>true</c> if ci; otherwise, <c>false</c>.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"CI: {0}",
        ///         BuildSystem.TravisCI.Environment.CI
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"CI: {0}",
        ///         TravisCI.Environment.CI
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public bool CI => GetEnvironmentBoolean("CI");

        ///
        /// Gets the Travis CI home directory.
        ///
        /// <value>
        /// The home.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Home: {0}",
        ///         BuildSystem.TravisCI.Environment.Home
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Home: {0}",
        ///         TravisCI.Environment.Home
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public string Home => GetEnvironmentString("HOME");

        ///
        /// Gets a value indicating whether the environment is Travis.
        ///
        /// <value>
        ///   <c>true</c> if Travis; otherwise, <c>false</c>.
        /// </value>
        /// <para>Via BuildSystem</para>
        /// <example>
        ///
        /// if (BuildSystem.TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Travis: {0}",
        ///         BuildSystem.TravisCI.Environment.Travis
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        /// <para>Via TravisCI</para>
        /// <example>
        ///
        /// if (TravisCI.IsRunningOnTravisCI)
        /// {
        ///     Information(
        ///         @"Travis: {0}",
        ///         TravisCI.Environment.Travis
        ///         );
        /// }
        /// else
        /// {
        ///     Information("Not running on TravisCI");
        /// }
        ///
        /// </example>
        public bool Travis => GetEnvironmentBoolean("TRAVIS");

        ///
        /// Initializes a new instance of the <see cref="TravisCIEnvironmentInfo"/> class.
        ///
        /// <param name="environment">The environment.</param>
        public TravisCIEnvironmentInfo(ICakeEnvironment environment)
            : base(environment)
        {
            Build = new TravisCIBuildInfo(environment);
            PullRequest = new TravisCIPullRequestInfo(environment);
            Job = new TravisCIJobInfo(environment);
            Repository = new TravisCIRepositoryInfo(environment);
        }
    }
}


text:
package watson.yaml;

import java.util.ArrayList;

// ----------------------------------------------------------------------------
/**
 * A {@link ValidatorNode} that expects a DOM node to be an ArrayList<>.
 *
 * If setChild() is called to set an element type, all array elements will be
 * validated against that type.
 */
public class ArrayValidatorNode extends TypeValidatorNode
{
  // --------------------------------------------------------------------------
  /**
   * Default constructor.
   *
   * Validates nodes that are ArrayList<>s.
   */
  public ArrayValidatorNode()
  {
    this(null, false, 0, Integer.MAX_VALUE);
  }

  // --------------------------------------------------------------------------
  /**
   * Constructor.
   *
   * Validates nodes that are ArrayList<>s and verifies that all elements are of
   * the specified type.
   *
   * @param child the validator for array elements.
   * @param optional if true, this node is optional.
   * @param minElements the minimum allowed number of array elements.
   * @param maxElements the maximum allowed number of array elements.
   */
  public ArrayValidatorNode(ValidatorNode child, boolean optional)
  {
    this(child, optional, 0, Integer.MAX_VALUE);
  }

  // --------------------------------------------------------------------------
  /**
   * Constructor.
   *
   * Validates nodes that are ArrayList<>s and verifies that all elements are of
   * the specified type.
   *
   * @param child the validator for array elements.
   * @param optional if true, this node is optional.
   * @param minElements the minimum allowed number of array elements.
   * @param maxElements the maximum allowed number of array elements.
   */
  public ArrayValidatorNode(ValidatorNode child, boolean optional,
                            int minElements, int maxElements)
  {
    super(ArrayList.class);
    setChild(child);
    setOptional(optional);
    setMinElements(minElements);
    setMaxElements(maxElements);
  }

  // --------------------------------------------------------------------------
  /**
   * Constructor.
   *
   * Validates nodes that are ArrayList<>s and verifies that all elements are of
   * the specified type.
   *
   * @param child the validator for array elements.
   * @param optional if true, this node is optional.
   * @param minElements the minimum allowed number of array elements.
   * @param maxElements the maximum allowed number of array elements.
   * @param defaultValue the default value.
   */
  public ArrayValidatorNode(ValidatorNode child, boolean optional,
                            int minElements, int maxElements,
                            Object defaultValue)
  {
    super(ArrayList.class);
    setChild(child);
    setOptional(optional);
    setMinElements(minElements);
    setMaxElements(maxElements);
    setDefaultValue(defaultValue);
  }

  // --------------------------------------------------------------------------
  /**
   * Set the validator for array elements.
   *
   * @param child the validator.
   */

  public void setChild(ValidatorNode child)
  {
    _child = child;
  }

  // --------------------------------------------------------------------------
  /**
   * Return the validator for array elements.
   *
   * @return the validator for array elements.
   */
  public ValidatorNode getChild()
  {
    return _child;
  }

  // --------------------------------------------------------------------------
  /**
   * Set the minimum allowable number of array elements.
   *
   * @param minElements that number.
   */
  public void setMinElements(int minElements)
  {
    _minElements = minElements;
  }

  // --------------------------------------------------------------------------
  /**
   * Return the minimum allowable number of array elements.
   *
   * @return the minimum allowable number of array elements.
   */
  public int getMinElements()
  {
    return _minElements;
  }

  // --------------------------------------------------------------------------
  /**
   * Set the maximum allowable number of array elements.
   *
   * @param maxElements that number.
   */
  public void setMaxElements(int maxElements)
  {
    _maxElements = maxElements;
  }

  // --------------------------------------------------------------------------
  /**
   * Return the maximum allowable number of array elements.
   *
   * @return the maximum allowable number of array elements.
   */
  public int getMaxElements()
  {
    return _maxElements;
  }

  // --------------------------------------------------------------------------
  /**
   * @see watson.yaml.ValidatorNode#validate(java.lang.Object, java.lang.String,
   *      watson.yaml.ValidatorMessageSink)
   */
  @Override
  public boolean validate(Object node, String path, ValidatorMessageSink sink)
  {
    // Optionality is dealt with here.
    if (!super.validate(node, path, sink))
    {
      return false;
    }

    if (getChild() != null && node != null)
    {
      @SuppressWarnings("unchecked")
      ArrayList<Object> array = (ArrayList<Object>) node;
      if (array.size() < getMinElements() || array.size() > getMaxElements())
      {
        StringBuilder text = new StringBuilder();
        text.append("array ");
        text.append(path);
        text.append(" should have ");
        if (getMinElements() == getMaxElements())
        {
          text.append("exactly ");
          text.append(getMinElements());
        }
        else
        {
          text.append("between ");
          text.append(getMinElements());
          text.append(" and ");
          text.append(getMaxElements());
        }
        text.append(" elements, rather than ");
        text.append(array.size());

        sink.message(text.toString());

        // Let the parent try to patch the DOM.
        return false;
      }
      else
      {
        boolean valid = true;
        for (int i = 0; i < array.size(); ++i)
        {
          Object element = array.get(i);
          boolean childValid = getChild().validate(element, path + "/" + i,
            sink);

          // Valid if the child is valid or has a default to patch things up.
          valid &= (childValid || getChild().hasDefaultValue());
          if (!childValid && getChild().hasDefaultValue())
          {
            // Replace that element with the default value.
            array.set(i, getChild().getDefaultValue());
          }
        } // for
        return valid;
      }
    }
    return true;
  } // validate

  // --------------------------------------------------------------------------
  /**
   * The validator of array elements.
   */
  protected ValidatorNode _child;

  /**
   * The minimum allowed number of array elements.
   */
  protected int           _minElements;

  /**
   * The maximum allowed number of array elements.
   */
  protected int           _maxElements;
} // class ArrayValidatorNode


text:
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
 */
class BunqResponseSchedulePayment extends BunqResponse
{
    /**
     * @return SchedulePayment
     */
    public function getValue(): SchedulePayment
    {
        return parent::getValue();
    }
}


text:
<?php

$content_tpl->set_block("F_CONTENT", "B_WARNING_NO_ACCESS", "H_WARNING_NO_ACCESS");
$content_tpl->set_block("F_CONTENT", "B_WARNING", "H_WARNING");
$content_tpl->set_block("F_CONTENT", "B_VIEW_NO_NEWS", "H_VIEW_NO_NEWS");
$content_tpl->set_block("F_CONTENT", "B_COMMENTS_LINK", "H_COMMENTS_LINK");
$content_tpl->set_block("F_CONTENT", "B_VIEW_NEWS", "H_VIEW_NEWS");

// Access for admins [private news]
// Access for guests [public news]
if ($user['usertype_admin'] or $_REQUEST['opt'] == 1)
{
  $id_news_group = intval($_REQUEST['opt']);
  $news_ref = dbQuery("SELECT * FROM `news` " .
		       "WHERE `id_news_group` = $id_news_group " .
		       "AND `id_season` = {$season['id']} AND `deleted` = 0 " .
		       "ORDER BY `submitted` DESC");
  if (dbNumRows($news_ref) <= 0)
  {
    $content_tpl->parse("H_VIEW_NO_NEWS", "B_VIEW_NO_NEWS");
  }
  else
  {
    while ($news_row = dbFetch($news_ref))
    {
      $users_ref = dbQuery("SELECT * FROM `users` WHERE `id` = {$news_row['id_user']}");
      $users_row = dbFetch($users_ref);

      $content_tpl->set_var("I_ID_NEWS", $news_row['id']);
      $content_tpl->set_var("I_USERNAME", htmlspecialchars($users_row['username']));
      $content_tpl->set_var("I_HEADING", htmlspecialchars($news_row['heading']));
      $content_tpl->set_var("I_BODY", Parsedown::instance()->text($news_row['body']));
      $content_tpl->set_var("I_SUBMITTED", htmlspecialchars($news_row['submitted']));

      $comments_ref = dbQuery("SELECT * FROM `news_comments` WHERE `id_news` = {$news_row['id']}");
      $content_tpl->set_var("I_NUM_COMMENTS", dbNumRows($comments_ref));
      $content_tpl->set_var("I_ID_SEASON", $season['id']);
      $content_tpl->parse("H_COMMENTS_LINK", "B_COMMENTS_LINK");
      $content_tpl->parse("H_VIEW_NEWS", "B_VIEW_NEWS", true);
    }
  }
}
else
{
  $content_tpl->parse("H_WARNING_NO_ACCESS", "B_WARNING_NO_ACCESS");
  $content_tpl->parse("H_WARNING", "B_WARNING");
}

?>


text:
$ErrorActionPreference = "Stop"

$rootFolder = ".."
$sourceFolder = "$rootFolder\Source"
$buildFolder = "$rootFolder\build"

function imports()
{
    if ((Get-ExecutionPolicy) -ne 'Bypass')
    {
        Set-ExecutionPolicy Bypass
    }

    Import-Module ".\Invoke-MsBuild.psm1"
}

function cleanup_build_folder()
{
    if (Test-Path $buildFolder)
    {
        Remove-Item $buildFolder -Recurse -Force
    }
    New-Item $buildFolder -Type Directory | Out-Null
}

function build_for_anycpu()
{
    Write-Host "Building AnyCpu version..."

    $buildSucceeded = Invoke-MsBuild -Path "$sourceFolder\FasterTests.sln" -MsBuildParameters "/target:Clean;Build /property:Configuration=Release /verbosity:Quiet"

    if ($buildSucceeded)
    {
        Copy-Item "$sourceFolder\ConsoleRunner\bin\Release\*" $buildFolder -Include *.dll,FasterTests-Run.exe
    }

    $buildSucceeded
}

function build_for_x86()
{
    Write-Host "Building x86 version..."

    $buildSucceeded = Invoke-MsBuild -Path "$sourceFolder\ConsoleRunner\ConsoleRunner.csproj" -MsBuildParameters "/target:Build /property:Configuration=Release;Platform=x86 /verbosity:Quiet"

    if ($buildSucceeded)
    {
        Copy-Item "$sourceFolder\ConsoleRunner\bin\x86\Release\FasterTests-Run.exe" "$buildFolder\FasterTests-Run-x86.exe"
    }

    $buildSucceeded
}

function copy_content()
{
    Copy-Item "$rootFolder\license.txt" $buildFolder
}

imports
cleanup_build_folder
if (-not (build_for_anycpu))
{
    return
}
if (-not (build_for_x86))
{
    return
}
copy_content

Write-Host "Build succeeded"


text:
using DemoParser_Model.Models;

namespace DemoParser_Model.Services
{
	public class ScoreBoardService : IScoreBoardService
	{
		private IRatingService ratingService = new RatingService();

		public ScoreBoard GetScoreBoard(Game game) // OrderType : Team, KDR, Rating, ...
		{
			ScoreBoard scoreBoard = new ScoreBoard();

			foreach (Player player in game.Players)
			{
				if (player.Frags.Count == 0) //TODO change to IsSpectator
					continue;

				scoreBoard.AddLine(GetScoreBoardLine(game, player));
			}

			return scoreBoard;
		}

		public ScoreBoardLine GetScoreBoardLine(Game game, Player player)
		{
			ScoreBoardLine line = new ScoreBoardLine();

			line.PlayerName = player.Name;
			line.TeamName = (player.Team != null) ? player.Team.Name : string.Empty;

			foreach (Round round in game.Rounds)
			{
				foreach (Frag frag in round.Frags)
				{
					if (frag.Killer.SteamId == player.SteamId)
					{
						line.Kills++;

						if (frag.Headshot)
						{
							line.Headshot++;
						}
					}

					if (frag.Assist != null && frag.Assist.SteamId == player.SteamId)
					{
						line.Assist++;
					}

					if (frag.Victim.SteamId == player.SteamId)
					{
						line.Deaths++;
					}
				}

				if (round.Mvp != null && round.Mvp.SteamId == player.SteamId)
				{
					line.Mvp++;
				}
			}

			PlayerRatingData data = ratingService.ComputeRatingData(game, player);
			line._1K = data._1K;
			line._2K = data._2K;
			line._3K = data._3K;
			line._4K = data._4K;
			line._5K = data._5K;

			line.Rating = ratingService.ComputeRating(game.Rounds.Count, data);

			return line;
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

using Raven.Client.Documents;
using Raven.Client.Documents.Operations;
using Raven.Client.Documents.Session;
using Raven.Client.Documents.Session.Loaders;
using Raven.Client.Documents.Session.Operations.Lazy;
using Raven.DependencyInjection;

namespace BitShuva.Chavah.Common
{
    public static class RavenExtensions
    {
        /// <summary>
        /// Add Chavah Raven Db instance with SSL Certificate loaded from Azure Vault.
        /// </summary>
        /// <param name="services"></param>
        /// <param name="configuration"></param>
        /// <returns></returns>
        public static IServiceCollection AddChavahRavenDbDocStore(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddRavenDbDocStore(options: options =>
             {
                 var settings = new RavenSettings();
                 configuration.Bind(nameof(RavenSettings), settings);
                 options.Settings = settings;

                 // password is stored in azure vault.
                 var certString = configuration.GetValue<string>(settings.CertFilePath);
                 if (certString != null)
                 {
                     var certificate = Convert.FromBase64String(certString);
                     options.Certificate = new X509Certificate2(certificate);
                 }
             });

            return services;
        }

        /// <summary>
        /// Asynchronously loads a document from Raven and stores it in an Option.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static async Task<T?> LoadOptionalAsync<T>(this IAsyncDocumentSession session, string id)
            where T : class
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return null;
            }

            return await session.LoadAsync<T>(id);
        }

        /// <summary>
        /// Loads a document from the synchronous document session as a nullable.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="id">The ID of the document to load.</param>
        public static T? LoadOptional<T>(this IDocumentSession session, string id)
            where T : class
        {
            return session.Load<T>(id);
        }

        /// <summary>
        /// Asynchronously loads multiple documents from Raven and stores it in a nullable.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="ids">The IDs of the documents to load.</param>
        /// <returns></returns>
        public static async Task<IEnumerable<T?>> LoadOptionalAsync<T>(this IAsyncDocumentSession session, IEnumerable<string> ids)
            where T : class
        {
            var result = await session.LoadAsync<T>(ids);
            return result.Values;
        }

        /// <summary>
        /// Asynchronously loads a multiple from Raven and returns the ones that aren't null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="ids"></param>
        /// <returns></returns>
        public static async Task<List<T>> LoadWithoutNulls<T>(this IAsyncDocumentSession session, IEnumerable<string> ids)
        {
            var result = await session.LoadAsync<T>(ids);
            return result.Values
                .Where(item => item != null)
                .ToList();
        }

        /// <summary>
        /// Loads a document from the session and throws if it's null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static async Task<T> LoadRequiredAsync<T>(this IAsyncDocumentSession session, string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id), "Attempted load required entity but passed in a null ID");
            }

            var result = await session.LoadAsync<T>(id);
            if (result == null)
            {
                throw new ArgumentException("Attempted to load a entity, but it wasn't found in the database.").WithData("id", id);
            }

            return result;
        }

        /// <summary>
        /// Lazily loads a document from the session. When the value is accessed, an exception will be thrown if the document is null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="sessionOps"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Lazy<Task<T>> LoadRequiredAsync<T>(this IAsyncLazySessionOperations sessionOps, string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id), "Tried to load required entity but passed in a null ID");
            }

            var loadTask = sessionOps.LoadAsync<T>(id);
            var wrappedLazy = new Lazy<Task<T>>(() =>
            {
                // When unwrapping the Lazy, return a task that does the actually loading.
                var result = loadTask.Value;
                return result.ContinueWith(t =>
                {
                    // When unwrapping the Task, return the result of the task. But if it's null, throw an execption.
                    if (t.Result == null)
                    {
                        throw new ArgumentException($"Tried to lazily load {id}, but it wasn't found in the database.");
                    }

                    return t.Result;
                }, TaskContinuationOptions.OnlyOnRanToCompletion);
            }, isThreadSafe: false);

            return wrappedLazy;
        }

        /// <summary>
        /// Loads a document from the session and throws the specified exception if null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TException"></typeparam>
        /// <param name="session"></param>
        /// <param name="id"></param>
        /// <param name="thrower"></param>
        /// <returns></returns>
        public static async Task<T> LoadRequiredAsync<T, TException>(this IAsyncDocumentSession session, string id, Func<TException> thrower) where TException : Exception
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id), "Tried to load required entity but passed in a null ID");
            }

            var result = await session.LoadAsync<T>(id);
            if (result == null)
            {
                throw thrower();
            }

            return result;
        }

        /// <summary>
        /// Loads a document from the session and throws if it's null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="ids"></param>
        /// <returns></returns>
        public static async Task<List<T>> LoadWithoutNulls<T>(this IAsyncLoaderWithInclude<T> session, IEnumerable<string> ids)
        {
            if (ids == null)
            {
                throw new ArgumentNullException(nameof(ids), "Tried to load required entity but passed in a null ID");
            }

            var results = await session.LoadAsync<T>(ids);
            return results.Values
                .Where(item => item != null)
                .ToList();
        }

        /// <summary>
        /// Loads a document from the session and throws if it's null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static async Task<T> LoadRequiredAsync<T>(this IAsyncLoaderWithInclude<T> session, string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id), "Tried to load required entity but passed in a null ID");
            }

            var result = await session.LoadAsync<T>(id);
            if (result == null)
            {
                throw new ArgumentException("Tried to load " + id + " but was null.");
            }

            return result;
        }

        /// <summary>
        /// Loads a document from the session and throws the specified exception if null.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TException"></typeparam>
        /// <param name="session"></param>
        /// <param name="id"></param>
        /// <param name="thrower"></param>
        /// <returns></returns>
        public static async Task<T> LoadRequiredAsync<T, TException>(this IAsyncLoaderWithInclude<T> session, string id, Func<TException> thrower) where TException : Exception
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id), "Tried to load required entity but passed in a null ID");
            }

            var result = await session.LoadAsync<T>(id);
            if (result == null)
            {
                throw thrower();
            }

            return result;
        }

        /// <summary>
        /// Asynchronously loads a document from Raven and stores it in an Option.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static async Task<T?> LoadOptionalAsync<T>(this IAsyncLoaderWithInclude<T> session, string id)
            where T : class
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return null;
            }

            return await session.LoadAsync<T>(id);
        }

        /// <summary>
        /// Asynchronously loads multiple documents from Raven and returns them as optional values.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="session"></param>
        /// <param name="ids"></param>
        /// <returns></returns>
        public static async Task<IEnumerable<T?>> LoadOptionalAsync<T>(this IAsyncLoaderWithInclude<T> session, IEnumerable<string> ids)
            where T : class
        {
            var result = await session.LoadAsync<T>(ids);
            return result.Values;
        }

        /// <summary>
        /// Lazily loads an entity from the Raven. The result is wrapped as an optional value.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="lazyOps"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Lazy<Task<T?>> LoadOptionAsync<T>(this IAsyncLazySessionOperations lazyOps, string id)
            where T : class
        {
            var loadTask = lazyOps.LoadAsync<T>(id);
            var optionTask = new Lazy<Task<T?>>(() =>
            {
                var result = loadTask.Value;
                return result.ContinueWith(t => t.Result, TaskContinuationOptions.OnlyOnRanToCompletion) as Task<T?>;
            }, isThreadSafe: false);

            return optionTask;
        }

        /// <summary>
        /// Sets the Raven document expiration for this object. The document will be deleted from the database after the specified date.
        /// Note: This specified object must be .Store()'d in the database before calling this method.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dbSession"></param>
        /// <param name="obj"></param>
        /// <param name="expiry"></param>
        public static void SetRavenExpiration<T>(this IAsyncDocumentSession dbSession, T obj, DateTime expiry)
        {
            dbSession.Advanced.GetMetadataFor(obj)["@expires"] = expiry.ToString("o", System.Globalization.CultureInfo.InvariantCulture);
        }

        /// <summary>
        /// Sets the Raven document expiration for this object. The document will be deleted from the database after the specified date.
        /// Note: This specified object must be .Store()'d in the database before calling this method.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dbSession"></param>
        /// <param name="obj"></param>
        /// <param name="expiry"></param>
        public static void SetRavenExpiration<T>(this IDocumentSession dbSession, T obj, DateTime expiry)
        {
            dbSession.Advanced.GetMetadataFor(obj)["@expires"] = expiry.ToString("o", System.Globalization.CultureInfo.InvariantCulture);
        }

        public static Operation PatchAll<T>(this IDocumentStore db, string jsPatchScript)
        {
            return PatchAll(db, db.Conventions.GetCollectionName(typeof(T)), jsPatchScript, null);
        }

        public static Operation PatchAll<T>(this IDocumentStore db, string jsPatchScript, Dictionary<string, object>? variables)
        {
            return PatchAll(db, db.Conventions.GetCollectionName(typeof(T)), jsPatchScript, variables);
        }

        public static Operation PatchAll(this IDocumentStore db, string collectionName, string jsPatchScript)
        {
            return PatchAll(db, collectionName, jsPatchScript, null);
        }

        public static Operation PatchAll(this IDocumentStore db, string collectionName, string jsPatchScript, Dictionary<string, object>? variables)
        {
            // Patch is in RQL. Example: "from AppUsers update { this.Foo = 123; }"
            var rqlPatch = new StringBuilder();
            rqlPatch.Append("from ").AppendLine(collectionName);
            rqlPatch.AppendLine("update {");

            // For each variable in the dictionary, declare the variable in the RQL script.
            if (variables != null)
            {
                variables
                    .Select(kv =>
                    {
                        var variableValue = kv.Value?.ToString();
                        var escapedVariableValue = variableValue?.Replace("\"", "\\\""); // replace any quotes with escaped quotes. 'Hi I am a "JS" string' -> 'Hi I am a \"JS\" string'
                        var escapedWithQuotes = kv.Value is string ? "\"" + escapedVariableValue + "\"" : escapedVariableValue; // string? Surround the value with quotes. foo -> "foo"
                        return $"var {kv.Key} = {escapedWithQuotes};"; // The actual variable declaration, e.g. var foo = "123";
                    })
                    .ForEach(v => rqlPatch.AppendLine(v));
            }

            rqlPatch.AppendLine(jsPatchScript);
            rqlPatch.Append('}');

            var patch = new PatchByQueryOperation(new Raven.Client.Documents.Queries.IndexQuery
            {
                Query = rqlPatch.ToString()
            });
            return db.Operations.Send(patch);
        }
    }
}


text:
package com.mauersu.util.ztree;

public class ZLeaf implements Comparable {

	protected String name;

	protected Object attach;

	protected ZLeaf() {

	}
	public Object getAttach() {
		return attach;
	}

	public void setAttach(Object attach) {
		this.attach = attach;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@Override
	public int compareTo(Object o) {
		if(o == null) return 1;
		if(o instanceof ZLeaf) {
			ZLeaf zlo = (ZLeaf) o;
			return this.getName().compareTo(zlo.getName());
		}
		if(o instanceof String) {
			return this.getName().compareTo(o.toString());
		}
		ZLeaf zlo = (ZLeaf) o;
		return this.getName().compareTo(zlo.getName());
	}
	@Override
	public int hashCode() {
		return this.getName().hashCode();
	}

	@Override
	public String toString() {
		return this.getName();
	}
	@Override
	public boolean equals(Object o) {
		if(o == null) return false;
		if(o instanceof ZLeaf) {
			ZLeaf zlo = (ZLeaf) o;
			return this.getName().equals(zlo.getName());
		}
		if(o instanceof String) {
			return this.getName().equals(o);
		}
		return false;
	}

}


text:
require 'spec_helper'
require 'lackeys'

describe Lackeys::Registration, type: :class do
  subject(:registration) { Lackeys::Registration.new(source, dest) }
  let(:source) { Integer }
  let(:dest) { 'String' }

  it 'sets @source instance variable to passed parameter' do
    expect(registration.instance_variable_get(:@source)).to eql(source)
    expect(registration.instance_variable_get(:@dest)).to eql(dest)
    registration
  end

  describe '#add_method' do
    subject(:method) { registration.add_method(method_name, options) }
    let(:method_name) { :foo }
    let(:options) { {} }

    it { should be_nil }

    before(:each) do
      @ex_methods = registration.instance_variable_get(:@exclusive_methods)
      @m_methods = registration.instance_variable_get(:@multi_methods)
    end

    context 'passing in a string as method name' do
      let(:method_name) { 'foo' }
      it 'should convert the name to a symbol' do
        method
        expect(registration.instance_variable_get(:@exclusive_methods))
          .to eql([:foo])
      end
    end

    it { expect { method }.to change { @ex_methods.size }.by 1 }

    context 'allow_multi is set to true' do
      let(:options) { { allow_multi: true } }

      it { expect { method }.not_to change { @ex_methods.size } }
      it { expect { method }.to change { @m_methods.size }.by 1 }

      context 'block passed' do
        subject(:method) do
          registration.add_method(method_name, options) do
            # This is a block
          end
        end

        it 'should save the block' do
          method
          expect(registration.instance_variable_get(:@return_wrappers)["#{method_name}"]).not_to be_nil
          expect(registration.instance_variable_get(:@return_wrappers)["#{method_name}"]).to be_kind_of(Proc)
        end
      end
    end

    context 'method already exists' do
      let(:error_msg) { 'foo has already been registered' }

      context 'in @exclusive_methods' do
        before(:each) do
          registration.instance_variable_set(:@exclusive_methods, [:foo])
        end

        it { expect { method }.to raise_error error_msg }
      end

      context 'in @multi_methods' do
        before(:each) do
          registration.instance_variable_set(:@multi_methods, [:foo])
        end

        it { expect { method }.to raise_error error_msg }
      end
    end
  end

  describe '#add_validation' do
    subject(:validation) { registration.add_validation(validation_name) }
    let(:validation_name) { :foo }

    before(:each) do
      @validations = registration.instance_variable_get(:@validations)
    end

    it { should be_nil }

    it { expect { validation }.to change { @validations.size }.by 1 }

    context 'passing in a string as method name' do
      let(:method_name) { 'foo' }
      it 'should convert the name to a symbol' do
        validation
        expect(registration.instance_variable_get(:@validations)).to eql([:foo])
      end
    end

    context 'method already exists' do
      before(:each) do
        registration.instance_variable_set(:@validations, [:foo])
      end
      let(:error) { 'foo has already been registered as validation' }

      it { expect { validation }.to raise_error error }
    end
  end

  describe '#add_callback' do
    subject(:callback) { registration.add_callback(callback_type, method_name) }
    let(:callback_type) { :before_save }
    let(:method_name) { :foo }

    before(:each) do
      @callbacks = registration.instance_variable_get(:@callbacks)
    end

    it { should be_nil }

    it { expect { callback }.to change { @callbacks[callback_type].size }.by 1 }

    context 'passing in a string as method name' do
      let(:method_name) { 'foo' }
      it 'should convert the name to a symbol' do
        callback
        expect(@callbacks[:before_save]).to eql([:foo])
      end
    end

    context 'passing in a string as method name' do
      let(:callback_type) { 'before_save' }
      it 'should convert the name to a symbol' do
        callback
        expect(@callbacks[:before_save]).to eql([:foo])
      end
    end

    context 'callback_type is not supported' do
      let(:callback_type) { :not_supported }

      it { expect { callback }.to raise_error 'not_supported not supported' }
    end

    context 'method already exists' do
      let(:error_msg) { 'foo has already been registered' }
      before(:each) do
        registration.instance_variable_set(:@callbacks, before_save: [:foo])
      end

      it { expect { callback }.to raise_error error_msg }
    end
  end

  describe '#to_h' do
    subject(:method) { new_reg.to_h }
    let(:new_reg) do
      Lackeys::Registration.new(Integer, 'String').tap do |r|
        r.add_method :ex_method
        r.add_method :mul_method, allow_multi: true
        r.add_method :mul_method_block, allow_multi: true do
          # This is a block
        end
        r.add_validation :val
        r.add_callback :before_save, :bs_callback
      end
    end

    it { should include(source: Integer) }
    it { should include(dest: dest) }
    it { should include(exclusive_methods: [:ex_method]) }
    it { should include(multi_methods: [:mul_method, :mul_method_block]) }
    it { should include(validations: [:val]) }
    it { should include(options: { "Integer#ex_method" => {}, "Integer#mul_method" => {}, "Integer#mul_method_block" => {} }) }
    it { should include(callbacks: { before_save: [:bs_callback], after_save: [], before_create: [], after_create: [] }) }
    it { should include(return_wrappers: { "mul_method_block" => an_instance_of(Proc) }) }
  end
end


text:
package activities

import (
	"context"
	"fmt"

	"code.gitea.io/gitea/models/db"
	repo_model "code.gitea.io/gitea/models/repo"
	user_model "code.gitea.io/gitea/models/user"
	"code.gitea.io/gitea/modules/container"
)

// ActionList defines a list of actions
type ActionList []*Action

func (actions ActionList) getUserIDs() []int64 {
	userIDs := make(container.Set[int64], len(actions))
	for _, action := range actions {
		userIDs.Add(action.ActUserID)
	}
	return userIDs.Values()
}

func (actions ActionList) loadUsers(ctx context.Context) (map[int64]*user_model.User, error) {
	if len(actions) == 0 {
		return nil, nil
	}

	userIDs := actions.getUserIDs()
	userMaps := make(map[int64]*user_model.User, len(userIDs))
	err := db.GetEngine(ctx).
		In("id", userIDs).
		Find(&userMaps)
	if err != nil {
		return nil, fmt.Errorf("find user: %w", err)
	}

	for _, action := range actions {
		action.ActUser = userMaps[action.ActUserID]
	}
	return userMaps, nil
}

func (actions ActionList) getRepoIDs() []int64 {
	repoIDs := make(container.Set[int64], len(actions))
	for _, action := range actions {
		repoIDs.Add(action.RepoID)
	}
	return repoIDs.Values()
}

func (actions ActionList) loadRepositories(ctx context.Context) error {
	if len(actions) == 0 {
		return nil
	}

	repoIDs := actions.getRepoIDs()
	repoMaps := make(map[int64]*repo_model.Repository, len(repoIDs))
	err := db.GetEngine(ctx).In("id", repoIDs).Find(&repoMaps)
	if err != nil {
		return fmt.Errorf("find repository: %w", err)
	}

	for _, action := range actions {
		action.Repo = repoMaps[action.RepoID]
	}
	return nil
}

func (actions ActionList) loadRepoOwner(ctx context.Context, userMap map[int64]*user_model.User) (err error) {
	if userMap == nil {
		userMap = make(map[int64]*user_model.User)
	}

	for _, action := range actions {
		if action.Repo == nil {
			continue
		}
		repoOwner, ok := userMap[action.Repo.OwnerID]
		if !ok {
			repoOwner, err = user_model.GetUserByIDCtx(ctx, action.Repo.OwnerID)
			if err != nil {
				if user_model.IsErrUserNotExist(err) {
					continue
				}
				return err
			}
			userMap[repoOwner.ID] = repoOwner
		}
		action.Repo.Owner = repoOwner
	}

	return nil
}

// loadAttributes loads all attributes
func (actions ActionList) loadAttributes(ctx context.Context) error {
	userMap, err := actions.loadUsers(ctx)
	if err != nil {
		return err
	}

	if err := actions.loadRepositories(ctx); err != nil {
		return err
	}

	return actions.loadRepoOwner(ctx, userMap)
}


text:
%
% Copyright 2001 Free Software Foundation, Inc.
%
% This file is part of GNU Radio
%
% GNU Radio is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3, or (at your option)
% any later version.
%
% GNU Radio is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNU Radio; see the file COPYING.  If not, write to
% the Free Software Foundation, Inc., 51 Franklin Street,
% Boston, MA 02110-1301, USA.
%
%% equivalent to the C++ code in VrComplexFIRfilter::buildFilterComplex

1;

%% hamming window, nothing fancy

function taps = build_filter_complex_lp (gain, ntaps)

  taps = gain * (0.54 - 0.46 * cos (2 * pi * (0:ntaps-1)' / (ntaps-1)));

end

%% old_taps describes a low pass filter, convert it to bandpass
%% centered at center_freq.  center_freq is normalized to Fs (sampling freq)

function new_taps = freq_shift_filter (old_taps, center_freq)

  ntaps = length(old_taps);

  new_taps = exp (j*2*pi*center_freq*(0:ntaps-1)') .* old_taps;

end


text:
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
import { StartupProfiler } from './startupProfiler';
import { StartupTimings } from './startupTimings';

// -- startup profiler

Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution(
	StartupProfiler,
	LifecyclePhase.Restored
);

// -- startup timings

Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution(
	StartupTimings,
	LifecyclePhase.Eventually
);


text:
'use strict';

const expect = require('chai').expect,
  fail = expect.fail,
  JDLBinaryOption = require('../../../lib/core/jdl_binary_option'),
  JDLEntity = require('../../../lib/core/jdl_entity'),
  BINARY_OPTIONS = require('../../../lib/core/jhipster/binary_options').BINARY_OPTIONS,
  BINARY_OPTION_VALUES = require('../../../lib/core/jhipster/binary_options').BINARY_OPTION_VALUES;

describe('JDLBinaryOption', () => {
  describe('::new', () => {
    describe('when passing no argument', () => {
      it('fails', () => {
        try {
          new JDLBinaryOption();
          fail();
        } catch (error) {
          expect(error.name).to.eq('NullPointerException');
        }
      });
    });
    describe('when passing an invalid name', () => {
      it('fails', () => {
        try {
          new JDLBinaryOption({name: 'IsNotAnOption'});
          fail();
        } catch (error) {
          expect(error.name).to.eq('IllegalArgumentException');
          expect(
            error.message
          ).to.eq(`The option's name and value must be valid, got no value for 'IsNotAnOption'.`);
        }
      });
    });
    describe('when passing a name but no value', () => {
      it('fails', () => {
        try {
          new JDLBinaryOption({name: BINARY_OPTIONS.DTO});
          fail();
        } catch (error) {
          expect(error.name).to.eq('IllegalArgumentException');
          expect(error.message).to.eq("The option's name and value must be valid, got no value for 'dto'.");
        }
      });
    });
    describe('when passing a name and a value', () => {
      it('creates the option', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        expect(option).not.to.be.null;
        expect(option.name).to.eq(BINARY_OPTIONS.DTO);
        expect(option.value).to.eq(BINARY_OPTION_VALUES.dto.MAPSTRUCT);
      });
    });
    describe('when passing a list of entity names and excluded names with some of them being repeated', () => {
      it('removes the dupes', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT,
          entityNames: ['A', 'B', 'C', 'A'],
          excludedNames: ['E', 'E', 'D']
        });
        expect(option.entityNames.size()).to.eq(3);
        expect(option.entityNames.has('A')).to.be.true;
        expect(option.entityNames.has('B')).to.be.true;
        expect(option.entityNames.has('C')).to.be.true;
        expect(option.excludedNames.size()).to.eq(2);
        expect(option.excludedNames.has('E')).to.be.true;
        expect(option.excludedNames.has('D')).to.be.true;
      });
    });
  });
  describe('::isValid', () => {
    describe('when passing a nil object', () => {
      it('returns false', () => {
        expect(JDLBinaryOption.isValid()).to.be.false;
      });
    });
    describe('when passing an object with no name', () => {
      it('returns false', () => {
        expect(JDLBinaryOption.isValid({})).to.be.false;
      });
    });
    describe('when passing an object with a name', () => {
      it('returns false', () => {
        expect(JDLBinaryOption.isValid({name: BINARY_OPTIONS.DTO})).to.be.false;
      });
    });
    describe('when passing an object with a name, entity names, excluded names and a type', () => {
      it('returns true', () => {
        const emptyOption = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        expect(
          JDLBinaryOption.isValid({
            name: BINARY_OPTIONS.DTO,
            value: BINARY_OPTION_VALUES.dto.MAPSTRUCT,
            entityNames: emptyOption.entityNames,
            excludedNames: emptyOption.excludedNames,
            getType: () => 'BINARY'
          })
        ).to.be.true;
      });
    });
  });
  describe('#addEntity', () => {
    describe('when passing a nil entity', () => {
      it('fails', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        try {
          option.addEntity(null);
          fail();
        } catch (error) {
          expect(error.name).to.eq('InvalidObjectException');
          expect(error.message).to.eq('The passed entity must be valid.\nErrors: No entity');
        }
      });
    });
    describe('when passing an invalid entity', () => {
      it('fails', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        try {
          option.addEntity({});
          fail();
        } catch (error) {
          expect(error.name).to.eq('InvalidObjectException');
          expect(
            error.message
          ).to.eq('The passed entity must be valid.\nErrors: No entity name, No table name, No fields object');
        }
      });
    });
    describe("when passing a valid entity that hasn't been added yet", () => {
      it('returns true', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        const result = option.addEntity(new JDLEntity({name: 'A'}));
        expect(result).to.be.true;
        expect(option.entityNames.size()).to.eq(1);
      });
    });
    describe('when passing a valid entity that has already been added', () => {
      it('returns false', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        option.addEntity(new JDLEntity({name: 'A'}));
        const result = option.addEntity(new JDLEntity({name: 'A'}));
        expect(result).to.be.false;
        expect(option.entityNames.size()).to.eq(1);
      });
    });
    describe('when passing an excluded entity', () => {
      it('returns false', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        option.addEntity(new JDLEntity({name: 'A'}));
        const result = option.excludeEntity(new JDLEntity({name: 'A'}));
        expect(result).to.be.false;
      });
    });
  });
  describe('#excludeEntity', () => {
    describe('when passing a nil entity', () => {
      it('fails', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        try {
          option.excludeEntity(null);
          fail();
        } catch (error) {
          expect(error.name).to.eq('InvalidObjectException');
          expect(error.message).to.eq('The passed entity must be valid.\nErrors: No entity');
        }
      });
    });
    describe('when passing an invalid entity', () => {
      it('fails', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        try {
          option.excludeEntity({});
          fail();
        } catch (error) {
          expect(error.name).to.eq('InvalidObjectException');
          expect(
            error.message
          ).to.eq('The passed entity must be valid.\nErrors: No entity name, No table name, No fields object');
        }
      });
    });
    describe("when passing a valid entity that hasn't been excluded yet", () => {
      it('returns true', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        const result = option.excludeEntity(new JDLEntity({name: 'A'}));
        expect(result).to.be.true;
        expect(option.excludedNames.size()).to.eq(1);
      });
    });
    describe('when passing a valid entity that has already been excluded', () => {
      it('returns false', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        option.excludeEntity(new JDLEntity({name: 'A'}));
        const result = option.excludeEntity(new JDLEntity({name: 'A'}));
        expect(result).to.be.false;
        expect(option.excludedNames.size()).to.eq(1);
      });
    });
    describe('when passing an added entity', () => {
      it('returns false', () => {
        const option = new JDLBinaryOption({
          name: BINARY_OPTIONS.DTO,
          value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
        });
        option.excludeEntity(new JDLEntity({name: 'A'}));
        const result = option.addEntity(new JDLEntity({name: 'A'}));
        expect(result).to.be.false;
      });
    });
  });
  describe('#toString', () => {
    it('stringifies the option', () => {
      let option = new JDLBinaryOption({
        name: BINARY_OPTIONS.DTO,
        value: BINARY_OPTION_VALUES.dto.MAPSTRUCT
      });
      expect(option.toString()).to.eq(`${BINARY_OPTIONS.DTO} * with ${BINARY_OPTION_VALUES.dto.MAPSTRUCT}`);
      option.addEntity(new JDLEntity({name: 'D'}));
      expect(option.toString()).to.eq(`${BINARY_OPTIONS.DTO} D with ${BINARY_OPTION_VALUES.dto.MAPSTRUCT}`);
      option.addEntity(new JDLEntity({name: 'E'}));
      option.addEntity(new JDLEntity({name: 'F'}));
      expect(option.toString()).to.eq(`${BINARY_OPTIONS.DTO} D, E, F with ${BINARY_OPTION_VALUES.dto.MAPSTRUCT}`);
      option.excludeEntity(new JDLEntity({name: 'A'}));
      expect(option.toString()).to.eq(`${BINARY_OPTIONS.DTO} D, E, F with ${BINARY_OPTION_VALUES.dto.MAPSTRUCT} except A`);
      option.excludeEntity(new JDLEntity({name: 'B'}));
      option.excludeEntity(new JDLEntity({name: 'C'}));
      expect(option.toString()).to.eq(`${BINARY_OPTIONS.DTO} D, E, F with ${BINARY_OPTION_VALUES.dto.MAPSTRUCT} except A, B, C`);
      option = new JDLBinaryOption({
        name: BINARY_OPTIONS.PAGINATION,
        value: BINARY_OPTION_VALUES.pagination.PAGER
      });
      expect(option.toString()).to.eq(`paginate * with ${BINARY_OPTION_VALUES.pagination.PAGER}`);
    });
  });
});


text:
The API Server stanza includes all configuration options for the control plane (master controller, api server, etc). There are configuration options for what type of loadBalancers to create for serviceType=LoadBalancer and if the cluster should have a separate etcd cluster for event.

## Options
| Key Name     | Required    | Type    | Description |
| ------------ | ----------- | ------- | ----------  |
| loadbalancer | __Required__| String  |             |
| state        | __Required__|         |             |
| events       | Optional    |         |             |

## Example

```yaml
apiServerConfigs:
  - &defaultApiServer
    name: defaultApiServer
    kind: apiServer
    loadBalancer: cloud
    state:
      etcd: *defaultEtcd
    events:
      etcd: *defaultEtcdEvents
```


text:
static easylogger::Logger TEST("TEST");
static easylogger::Logger TRACE("TRACE");
static easylogger::Logger SUB("SUB", TEST);

static void test1() {
	EASY_TRACE(TRACE, test1);

	LOG_INFO(TEST, "Hi!" << 42);
}

static void test2() {
	EASY_TRACE(TRACE, test1);

	LOG_DEBUG(TEST, "don't show me");
}

int main() {
	SUB.Level(easylogger::LEVEL_WARNING);
	TRACE.Format("[%F:%C %P] %N: %S");
	TRACE.Level(easylogger::LEVEL_TRACE);

	EASY_TRACE(TRACE, main);

	test1();
	test2();

	LOG_INFO(SUB, "info!");
	LOG_ERROR(SUB, "error!");
	//LOG_FATAL(TEST, "dead");
	//LOG_ERROR(TEST, "won't see me");

	return 0;
}


text:
#include <modules/base/basemodule.h>
#include <inviwo/core/io/serialization/versionconverter.h>
// Processors
#include <modules/base/processors/buffertomeshprocessor.h>
#include <modules/base/processors/convexhull2dprocessor.h>
#include <modules/base/processors/cubeproxygeometryprocessor.h>
#include <modules/base/processors/diffuselightsourceprocessor.h>
#include <modules/base/processors/directionallightsourceprocessor.h>
#include <modules/base/processors/distancetransformram.h>
#include <modules/base/processors/heightfieldmapper.h>
#include <modules/base/processors/imageinformation.h>
#include <modules/base/processors/inputselector.h>
#include <modules/base/processors/layerdistancetransformram.h>
#include <modules/base/processors/imageexport.h>
#include <modules/base/processors/imagesequenceelementselectorprocessor.h>
#include <modules/base/processors/imagesnapshot.h>
#include <modules/base/processors/imagesource.h>
#include <modules/base/processors/imagesourceseries.h>
#include <modules/base/processors/imagecontourprocessor.h>
#include <modules/base/processors/imagestackvolumesource.h>
#include <modules/base/processors/meshclipping.h>
#include <modules/base/processors/meshcreator.h>
#include <modules/base/processors/meshexport.h>
#include <modules/base/processors/meshinformation.h>
#include <modules/base/processors/meshmapping.h>
#include <modules/base/processors/meshsequenceelementselectorprocessor.h>
#include <modules/base/processors/meshsource.h>
#include <modules/base/processors/noiseprocessor.h>
#include <modules/base/processors/noisevolumeprocessor.h>
#include <modules/base/processors/ordinalpropertyanimator.h>
#include <modules/base/processors/orientationindicator.h>
#include <modules/base/processors/pixeltobufferprocessor.h>
#include <modules/base/processors/pixelvalue.h>
#include <modules/base/processors/pointlightsourceprocessor.h>
#include <modules/base/processors/randommeshgenerator.h>
#include <modules/base/processors/randomspheregenerator.h>
#include <modules/base/processors/singlevoxel.h>
#include <modules/base/processors/spotlightsourceprocessor.h>
#include <modules/base/processors/stereocamerasyncer.h>
#include <modules/base/processors/surfaceextraction.h>
#include <modules/base/processors/volumecreator.h>
#include <modules/base/processors/volumesequenceelementselectorprocessor.h>
#include <modules/base/processors/volumesource.h>
#include <modules/base/processors/volumeexport.h>
#include <modules/base/processors/volumebasistransformer.h>
#include <modules/base/processors/volumeslice.h>
#include <modules/base/processors/volumesubsample.h>
#include <modules/base/processors/volumesubset.h>
#include <modules/base/processors/volumesequencesource.h>
#include <modules/base/processors/volumetospatialsampler.h>
#include <modules/base/processors/volumeboundingbox.h>
#include <modules/base/processors/volumecurlcpuprocessor.h>
#include <modules/base/processors/volumedivergencecpuprocessor.h>
#include <modules/base/processors/volumegradientcpuprocessor.h>
#include <modules/base/processors/volumelaplacianprocessor.h>
#include <modules/base/processors/volumesequencetospatial4dsampler.h>
#include <modules/base/processors/worldtransform.h>
#include <modules/base/processors/camerafrustum.h>
#include <modules/base/processors/imagetospatialsampler.h>
#include <modules/base/processors/volumesequencesingletimestepsampler.h>

// Properties
#include <modules/base/properties/basisproperty.h>
#include <modules/base/properties/gaussianproperty.h>
#include <modules/base/properties/imageinformationproperty.h>
#include <modules/base/properties/layerinformationproperty.h>
#include <modules/base/properties/meshinformationproperty.h>
#include <modules/base/properties/bufferinformationproperty.h>
#include <modules/base/properties/volumeinformationproperty.h>
#include <modules/base/properties/sequencetimerproperty.h>

// Io
#include <modules/base/io/binarystlwriter.h>
#include <modules/base/io/datvolumesequencereader.h>
#include <modules/base/io/datvolumewriter.h>
#include <modules/base/io/ivfvolumereader.h>
#include <modules/base/io/ivfvolumewriter.h>
#include <modules/base/io/ivfsequencevolumereader.h>
#include <modules/base/io/stlwriter.h>
#include <modules/base/io/wavefrontwriter.h>
#include <modules/base/processors/meshconverterprocessor.h>
#include <modules/base/processors/volumeinformation.h>
#include <modules/base/processors/tfselector.h>

#include <fmt/format.h>
#include <tuple>

namespace inviwo {

using BasisTransformMesh = BasisTransform<Mesh>;
using BasisTransformVolume = BasisTransform<Volume>;

using WorldTransformMesh = WorldTransform<Mesh>;
using WorldTransformVolume = WorldTransform<Volume>;

BaseModule::BaseModule(InviwoApplication* app) : InviwoModule(app, "Base") {
    registerProcessor<ConvexHull2DProcessor>();
    registerProcessor<CubeProxyGeometry>();
    registerProcessor<DiffuseLightSourceProcessor>();
    registerProcessor<DirectionalLightSourceProcessor>();
    registerProcessor<DistanceTransformRAM>();
    registerProcessor<MeshSource>();
    registerProcessor<HeightFieldMapper>();
    registerProcessor<ImageExport>();
    registerProcessor<ImageInformation>();
    registerProcessor<ImageSnapshot>();
    registerProcessor<ImageSource>();
    registerProcessor<ImageSourceSeries>();
    registerProcessor<ImageStackVolumeSource>();
    registerProcessor<LayerDistanceTransformRAM>();
    registerProcessor<MeshClipping>();
    registerProcessor<MeshCreator>();
    registerProcessor<MeshInformation>();
    registerProcessor<MeshMapping>();
    registerProcessor<NoiseProcessor>();
    registerProcessor<PixelToBufferProcessor>();
    registerProcessor<PointLightSourceProcessor>();
    registerProcessor<OrdinalPropertyAnimator>();
    registerProcessor<SpotLightSourceProcessor>();
    registerProcessor<SurfaceExtraction>();
    registerProcessor<VolumeSource>();
    registerProcessor<VolumeExport>();
    registerProcessor<BasisTransformMesh>();
    registerProcessor<BasisTransformVolume>();
    registerProcessor<WorldTransformMesh>();
    registerProcessor<WorldTransformVolume>();
    registerProcessor<VolumeSlice>();
    registerProcessor<VolumeSubsample>();
    registerProcessor<VolumeSubset>();
    registerProcessor<ImageContourProcessor>();
    registerProcessor<VolumeSequenceSource>();
    registerProcessor<VolumeSequenceElementSelectorProcessor>();
    registerProcessor<ImageSequenceElementSelectorProcessor>();
    registerProcessor<MeshSequenceElementSelectorProcessor>();

    registerProcessor<VolumeBoundingBox>();
    registerProcessor<SingleVoxel>();
    registerProcessor<StereoCameraSyncer>();

    registerProcessor<VolumeToSpatialSampler>();
    registerProcessor<OrientationIndicator>();
    registerProcessor<PixelValue>();
    registerProcessor<VolumeSequenceToSpatial4DSampler>();
    registerProcessor<VolumeGradientCPUProcessor>();
    registerProcessor<VolumeCurlCPUProcessor>();
    registerProcessor<VolumeDivergenceCPUProcessor>();
    registerProcessor<VolumeLaplacianProcessor>();
    registerProcessor<MeshExport>();
    registerProcessor<RandomMeshGenerator>();
    registerProcessor<RandomSphereGenerator>();
    registerProcessor<NoiseVolumeProcessor>();
    registerProcessor<BufferToMeshProcessor>();
    registerProcessor<ImageToSpatialSampler>();
    registerProcessor<CameraFrustum>();
    registerProcessor<VolumeSequenceSingleTimestepSamplerProcessor>();
    registerProcessor<VolumeCreator>();
    registerProcessor<MeshConverterProcessor>();
    registerProcessor<VolumeInformation>();
    registerProcessor<TFSelector>();

    // input selectors
    registerProcessor<InputSelector<MultiDataInport<Volume>, VolumeOutport>>();
    registerProcessor<InputSelector<MultiDataInport<Mesh>, MeshOutport>>();
    registerProcessor<InputSelector<ImageMultiInport, ImageOutport>>();

    registerProperty<SequenceTimerProperty>();
    registerProperty<BasisProperty>();
    registerProperty<ImageInformationProperty>();
    registerProperty<LayerInformationProperty>();
    registerProperty<MeshInformationProperty>();
    registerProperty<BufferInformationProperty>();
    registerProperty<MeshBufferInformationProperty>();
    registerProperty<IndexBufferInformationProperty>();
    registerProperty<VolumeInformationProperty>();

    registerProperty<Gaussian1DProperty>();
    registerProperty<Gaussian2DProperty>();

    // Register Data readers
    registerDataReader(util::make_unique<DatVolumeSequenceReader>());
    registerDataReader(util::make_unique<IvfVolumeReader>());
    registerDataReader(util::make_unique<IvfSequenceVolumeReader>());
    // Register Data writers
    registerDataWriter(util::make_unique<DatVolumeWriter>());
    registerDataWriter(util::make_unique<IvfVolumeWriter>());
    registerDataWriter(util::make_unique<StlWriter>());
    registerDataWriter(util::make_unique<BinarySTLWriter>());
    registerDataWriter(util::make_unique<WaveFrontWriter>());

    util::for_each_type<OrdinalPropertyAnimator::Types>{}(RegHelper{}, *this);
}

int BaseModule::getVersion() const { return 3; }

std::unique_ptr<VersionConverter> BaseModule::getConverter(int version) const {
    return util::make_unique<Converter>(version);
}

BaseModule::Converter::Converter(int version) : version_(version) {}

bool BaseModule::Converter::convert(TxElement* root) {
    std::vector<xml::IdentifierReplacement> repl = {
        // CubeProxyGeometry
        {{xml::Kind::processor("org.inviwo.CubeProxyGeometry"),
          xml::Kind::inport("org.inviwo.VolumeInport")},
         "volume.inport",
         "volume"},
        {{xml::Kind::processor("org.inviwo.CubeProxyGeometry"),
          xml::Kind::outport("org.inviwo.MeshOutport")},
         "geometry.outport",
         "proxyGeometry"},
        // ImageSource
        {{xml::Kind::processor("org.inviwo.ImageSource"),
          xml::Kind::outport("org.inviwo.ImageOutport")},
         "image.outport",
         "image"},
        // MeshClipping
        {{xml::Kind::processor("org.inviwo.MeshClipping"),
          xml::Kind::inport("org.inviwo.MeshInport")},
         "geometry.input",
         "inputMesh"},
        {{xml::Kind::processor("org.inviwo.MeshClipping"),
          xml::Kind::outport("org.inviwo.MeshOutport")},
         "geometry.output",
         "clippedMesh"},

        // VolumeSlice
        {{xml::Kind::processor("org.inviwo.VolumeSlice"),
          xml::Kind::inport("org.inviwo.VolumeInport")},
         "volume.inport",
         "inputVolume"},
        {{xml::Kind::processor("org.inviwo.VolumeSlice"),
          xml::Kind::outport("org.inviwo.ImageOutport")},
         "image.outport",
         "outputImage"},

        // VolumeSubsample
        {{xml::Kind::processor("org.inviwo.VolumeSubsample"),
          xml::Kind::inport("org.inviwo.VolumeInport")},
         "volume.inport",
         "inputVolume"},
        {{xml::Kind::processor("org.inviwo.VolumeSubsample"),
          xml::Kind::outport("org.inviwo.VolumeOutport")},
         "volume.outport",
         "outputVolume"},

        // DistanceTransformRAM
        {{xml::Kind::processor("org.inviwo.DistanceTransformRAM"),
          xml::Kind::inport("org.inviwo.VolumeInport")},
         "volume.inport",
         "inputVolume"},
        {{xml::Kind::processor("org.inviwo.DistanceTransformRAM"),
          xml::Kind::outport("org.inviwo.VolumeOutport")},
         "volume.outport",
         "outputVolume"},

        // VolumeSubset
        {{xml::Kind::processor("org.inviwo.VolumeSubset"),
          xml::Kind::inport("org.inviwo.VolumeInport")},
         "volume.inport",
         "inputVolume"},
        {{xml::Kind::processor("org.inviwo.VolumeSubset"),
          xml::Kind::outport("org.inviwo.VolumeOutport")},
         "volume.outport",
         "outputVolume"}};

    for (const auto& id : {"org.inviwo.FloatProperty", "org.inviwo.FloatVec2Property",
                           "org.inviwo.FloatVec3Property", "org.inviwo.FloatVec4Property",
                           "org.inviwo.DoubleProperty", "org.inviwo.DoubleVec2Property",
                           "org.inviwo.DoubleVec3Property", "org.inviwo.DoubleVec4Property",
                           "org.inviwo.IntProperty", "org.inviwo.IntVec2Property",
                           "org.inviwo.IntVec3Property", "org.inviwo.IntVec4Property"}) {
        xml::IdentifierReplacement ir1 = {
            {xml::Kind::processor("org.inviwo.OrdinalPropertyAnimator"), xml::Kind::property(id)},
            id,
            dotSeperatedToPascalCase(id)};
        repl.push_back(ir1);
        xml::IdentifierReplacement ir2 = {
            {xml::Kind::processor("org.inviwo.OrdinalPropertyAnimator"), xml::Kind::property(id)},
            std::string(id) + "-Delta",
            dotSeperatedToPascalCase(id) + "-Delta"};
        repl.push_back(ir2);
    }

    bool res = false;
    switch (version_) {
        case 0: {
            res |= xml::changeIdentifiers(root, repl);
            [[fallthrough]];
        }
        case 1: {
            res |= xml::changeAttribute(
                root, {{xml::Kind::processor("org.inviwo.GeometeryGenerator")}}, "type",
                "org.inviwo.GeometeryGenerator", "org.inviwo.RandomMeshGenerator");
            [[fallthrough]];
        }
        case 2: {
            TraversingVersionConverter conv{[&](TxElement* node) -> bool {
                std::string key;
                node->GetValue(&key);
                if (key != "Property") return true;
                const auto type = node->GetAttributeOrDefault("type", "");
                if (type != "org.inviwo.VolumeBasisProperty") return true;

                TxElement newNode{"overrideModel"};
                for (const auto& item :
                     {std::make_tuple(0, "A", 0.0), std::make_tuple(1, "B", 0.0),
                      std::make_tuple(2, "C", 0.0), std::make_tuple(3, "Offset", 1.0)}) {
                    const auto path = fmt::format("Properties/Property&identifier=override{}/value",
                                                  std::get<1>(item));
                    if (auto elem = xml::getElement(node, path)) {
                        auto data = elem->Clone();
                        data->SetValue(fmt::format("col{}", std::get<0>(item)));
                        data->ToElement()->SetAttribute("w",
                                                        fmt::format("{:f}", std::get<2>(item)));
                        newNode.InsertEndChild(*data);
                    }
                }

                res = true;
                node->InsertEndChild(newNode);

                return true;
            }};

            conv.convert(root);
            return res;
        }

        default:
            return false;  // No changes
    }
}

}  // namespace inviwo


text:
<!DOCTYPE html>

You should see the word 'PASS' on a green background below

PASS


text:
package org.objectstyle.graphql.example.cayenne.auto;

import org.apache.cayenne.CayenneDataObject;
import org.apache.cayenne.exp.Property;
import org.objectstyle.graphql.example.cayenne.E1;

/**
 * Class _E2 was generated by Cayenne.
 * It is probably a good idea to avoid changing this class manually,
 * since it may be overwritten next time code is regenerated.
 * If you need to make any customizations, please use subclass.
 */
public abstract class _E2 extends CayenneDataObject {

    private static final long serialVersionUID = 1L;

    public static final String ID_PK_COLUMN = "id";

    public static final Property<String> NAME = new Property<String>("name");
    public static final Property<E1> E1 = new Property<E1>("e1");

    public void setName(String name) {
        writeProperty("name", name);
    }
    public String getName() {
        return (String)readProperty("name");
    }

    public void setE1(E1 e1) {
        setToOneTarget("e1", e1, true);
    }

    public E1 getE1() {
        return (E1)readProperty("e1");
    }

}


text:
<?php

declare(strict_types=1);

namespace Novuso\Common\Application\Messaging\Exception;

use Novuso\System\Exception\SystemException;

/**
 * Class MessageStoreException
 */
class MessageStoreException extends SystemException
{
}