text:
<?php
/**
 * Post API: WP_Post_Type class
 *
 * @package WordPress
 * @subpackage Post
 * @since 4.6.0
 */

/**
 * Core class used for interacting with post types.
 *
 * @since 4.6.0
 *
 * @see register_post_type()
 */
final class WP_Post_Type {
	/**
	 * Post type key.
	 *
	 * @since 4.6.0
	 * @var string $name
	 */
	public $name;

	/**
	 * Name of the post type shown in the menu. Usually plural.
	 *
	 * @since 4.6.0
	 * @var string $label
	 */
	public $label;

	/**
	 * Labels object for this post type.
	 *
	 * If not set, post labels are inherited for non-hierarchical types
	 * and page labels for hierarchical ones.
	 *
	 * @see get_post_type_labels()
	 *
	 * @since 4.6.0
	 * @var object $labels
	 */
	public $labels;

	/**
	 * A short descriptive summary of what the post type is.
	 *
	 * Default empty.
	 *
	 * @since 4.6.0
	 * @var string $description
	 */
	public $description = '';

	/**
	 * Whether a post type is intended for use publicly either via the admin interface or by front-end users.
	 *
	 * While the default settings of $exclude_from_search, $publicly_queryable, $show_ui, and $show_in_nav_menus
	 * are inherited from public, each does not rely on this relationship and controls a very specific intention.
	 *
	 * Default false.
	 *
	 * @since 4.6.0
	 * @var bool $public
	 */
	public $public = false;

	/**
	 * Whether the post type is hierarchical (e.g. page).
	 *
	 * Default false.
	 *
	 * @since 4.6.0
	 * @var bool $hierarchical
	 */
	public $hierarchical = false;

	/**
	 * Whether to exclude posts with this post type from front end search
	 * results.
	 *
	 * Default is the opposite value of $public.
	 *
	 * @since 4.6.0
	 * @var bool $exclude_from_search
	 */
	public $exclude_from_search = null;

	/**
	 * Whether queries can be performed on the front end for the post type as part of `parse_request()`.
	 *
	 * Endpoints would include:
	 * - `?post_type={post_type_key}`
	 * - `?{post_type_key}={single_post_slug}`
	 * - `?{post_type_query_var}={single_post_slug}`
	 *
	 * Default is the value of $public.
	 *
	 * @since 4.6.0
	 * @var bool $publicly_queryable
	 */
	public $publicly_queryable = null;

	/**
	 * Whether to generate and allow a UI for managing this post type in the admin.
	 *
	 * Default is the value of $public.
	 *
	 * @since 4.6.0
	 * @var bool $show_ui
	 */
	public $show_ui = null;

	/**
	 * Where to show the post type in the admin menu.
	 *
	 * To work, $show_ui must be true. If true, the post type is shown in its own top level menu. If false, no menu is
	 * shown. If a string of an existing top level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post type
	 * will be placed as a sub-menu of that.
	 *
	 * Default is the value of $show_ui.
	 *
	 * @since 4.6.0
	 * @var bool $show_in_menu
	 */
	public $show_in_menu = null;

	/**
	 * Makes this post type available for selection in navigation menus.
	 *
	 * Default is the value $public.
	 *
	 * @since 4.6.0
	 * @var bool $show_in_nav_menus
	 */
	public $show_in_nav_menus = null;

	/**
	 * Makes this post type available via the admin bar.
	 *
	 * Default is the value of $show_in_menu.
	 *
	 * @since 4.6.0
	 * @var bool $show_in_admin_bar
	 */
	public $show_in_admin_bar = null;

	/**
	 * The position in the menu order the post type should appear.
	 *
	 * To work, $show_in_menu must be true. Default null (at the bottom).
	 *
	 * @since 4.6.0
	 * @var int $menu_position
	 */
	public $menu_position = null;

	/**
	 * The URL to the icon to be used for this menu.
	 *
	 * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
	 * This should begin with 'data:image/svg+xml;base64,'. Pass the name of a Dashicons helper class
	 * to use a font icon, e.g. 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty
	 * so an icon can be added via CSS.
	 *
	 * Defaults to use the posts icon.
	 *
	 * @since 4.6.0
	 * @var string $menu_icon
	 */
	public $menu_icon = null;

	/**
	 * The string to use to build the read, edit, and delete capabilities.
	 *
	 * May be passed as an array to allow for alternative plurals when using
	 * this argument as a base to construct the capabilities, e.g.
	 * array( 'story', 'stories' ). Default 'post'.
	 *
	 * @since 4.6.0
	 * @var string $capability_type
	 */
	public $capability_type = 'post';

	/**
	 * Whether to use the internal default meta capability handling.
	 *
	 * Default false.
	 *
	 * @since 4.6.0
	 * @var bool $map_meta_cap
	 */
	public $map_meta_cap = false;

	/**
	 * Provide a callback function that sets up the meta boxes for the edit form.
	 *
	 * Do `remove_meta_box()` and `add_meta_box()` calls in the callback. Default null.
	 *
	 * @since 4.6.0
	 * @var string $register_meta_box_cb
	 */
	public $register_meta_box_cb = null;

	/**
	 * An array of taxonomy identifiers that will be registered for the post type.
	 *
	 * Taxonomies can be registered later with `register_taxonomy()` or `register_taxonomy_for_object_type()`.
	 *
	 * Default empty array.
	 *
	 * @since 4.6.0
	 * @var array $taxonomies
	 */
	public $taxonomies = array();

	/**
	 * Whether there should be post type archives, or if a string, the archive slug to use.
	 *
	 * Will generate the proper rewrite rules if $rewrite is enabled. Default false.
	 *
	 * @since 4.6.0
	 * @var bool|string $has_archive
	 */
	public $has_archive = false;

	/**
	 * Sets the query_var key for this post type.
	 *
	 * Defaults to $post_type key. If false, a post type cannot be loaded at `?{query_var}={post_slug}`.
	 * If specified as a string, the query `?{query_var_string}={post_slug}` will be valid.
	 *
	 * @since 4.6.0
	 * @var string|bool $query_var
	 */
	public $query_var;

	/**
	 * Whether to allow this post type to be exported.
	 *
	 * Default true.
	 *
	 * @since 4.6.0
	 * @var bool $can_export
	 */
	public $can_export = true;

	/**
	 * Whether to delete posts of this type when deleting a user.
	 *
	 * If true, posts of this type belonging to the user will be moved to trash when then user is deleted.
	 * If false, posts of this type belonging to the user will *not* be trashed or deleted.
	 * If not set (the default), posts are trashed if post_type_supports( 'author' ).
	 * Otherwise posts are not trashed or deleted. Default null.
	 *
	 * @since 4.6.0
	 * @var bool $delete_with_user
	 */
	public $delete_with_user = null;

	/**
	 * Whether this post type is a native or "built-in" post_type.
	 *
	 * Default false.
	 *
	 * @since 4.6.0
	 * @var bool $_builtin
	 */
	public $_builtin = false;

	/**
	 * URL segment to use for edit link of this post type.
	 *
	 * Default 'post.php?post=%d'.
	 *
	 * @since 4.6.0
	 * @var string $_edit_link
	 */
	public $_edit_link = 'post.php?post=%d';

	/**
	 * Post type capabilities.
	 *
	 * @since 4.6.0
	 * @var object $cap
	 */
	public $cap;

	/**
	 * Triggers the handling of rewrites for this post type.
	 *
	 * Defaults to true, using $post_type as slug.
	 *
	 * @since 4.6.0
	 * @var array|false $rewrite
	 */
	public $rewrite;

	/**
	 * The features supported by the post type.
	 *
	 * @since 4.6.0
	 * @var array|bool $supports
	 */
	public $supports;

	/**
	 * Whether this post type should appear in the REST API.
	 *
	 * Default false. If true, standard endpoints will be registered with
	 * respect to $rest_base and $rest_controller_class.
	 *
	 * @since 4.7.4
	 * @var bool $show_in_rest
	 */
	public $show_in_rest;

	/**
	 * The base path for this post type's REST API endpoints.
	 *
	 * @since 4.7.4
	 * @var string|bool $rest_base
	 */
	public $rest_base;

	/**
	 * The controller for this post type's REST API endpoints.
	 *
	 * Custom controllers must extend WP_REST_Controller.
	 *
	 * @since 4.7.4
	 * @var string|bool $rest_controller_class
	 */
	public $rest_controller_class;

	/**
	 * Constructor.
	 *
	 * Will populate object properties from the provided arguments and assign other
	 * default properties based on that information.
	 *
	 * @since 4.6.0
	 *
	 * @see register_post_type()
	 *
	 * @param string       $post_type Post type key.
	 * @param array|string $args      Optional. Array or string of arguments for registering a post type.
	 *                                Default empty array.
	 */
	public function __construct( $post_type, $args = array() ) {
		$this->name = $post_type;

		$this->set_props( $args );
	}

	/**
	 * Sets post type properties.
	 *
	 * @since 4.6.0
	 *
	 * @param array|string $args Array or string of arguments for registering a post type.
	 */
	public function set_props( $args ) {
		$args = wp_parse_args( $args );

		/**
		 * Filters the arguments for registering a post type.
		 *
		 * @since 4.4.0
		 *
		 * @param array  $args      Array of arguments for registering a post type.
		 * @param string $post_type Post type key.
		 */
		$args = apply_filters( 'register_post_type_args', $args, $this->name );

		$has_edit_link = ! empty( $args['_edit_link'] );

		// Args prefixed with an underscore are reserved for internal use.
		$defaults = array(
			'labels'                => array(),
			'description'           => '',
			'public'                => false,
			'hierarchical'          => false,
			'exclude_from_search'   => null,
			'publicly_queryable'    => null,
			'show_ui'               => null,
			'show_in_menu'          => null,
			'show_in_nav_menus'     => null,
			'show_in_admin_bar'     => null,
			'menu_position'         => null,
			'menu_icon'             => null,
			'capability_type'       => 'post',
			'capabilities'          => array(),
			'map_meta_cap'          => null,
			'supports'              => array(),
			'register_meta_box_cb'  => null,
			'taxonomies'            => array(),
			'has_archive'           => false,
			'rewrite'               => true,
			'query_var'             => true,
			'can_export'            => true,
			'delete_with_user'      => null,
			'show_in_rest'          => false,
			'rest_base'             => false,
			'rest_controller_class' => false,
			'_builtin'              => false,
			'_edit_link'            => 'post.php?post=%d',
		);

		$args = array_merge( $defaults, $args );

		$args['name'] = $this->name;

		// If not set, default to the setting for public.
		if ( null === $args['publicly_queryable'] ) {
			$args['publicly_queryable'] = $args['public'];
		}

		// If not set, default to the setting for public.
		if ( null === $args['show_ui'] ) {
			$args['show_ui'] = $args['public'];
		}

		// If not set, default to the setting for show_ui.
		if ( null === $args['show_in_menu'] || ! $args['show_ui'] ) {
			$args['show_in_menu'] = $args['show_ui'];
		}

		// If not set, default to the whether the full UI is shown.
		if ( null === $args['show_in_admin_bar'] ) {
			$args['show_in_admin_bar'] = (bool) $args['show_in_menu'];
		}

		// If not set, default to the setting for public.
		if ( null === $args['show_in_nav_menus'] ) {
			$args['show_in_nav_menus'] = $args['public'];
		}

		// If not set, default to true if not public, false if public.
		if ( null === $args['exclude_from_search'] ) {
			$args['exclude_from_search'] = ! $args['public'];
		}

		// Back compat with quirky handling in version 3.0. #14122.
		if ( empty( $args['capabilities'] ) && null === $args['map_meta_cap'] && in_array( $args['capability_type'], array( 'post', 'page' ) ) ) {
			$args['map_meta_cap'] = true;
		}

		// If not set, default to false.
		if ( null === $args['map_meta_cap'] ) {
			$args['map_meta_cap'] = false;
		}

		// If there's no specified edit link and no UI, remove the edit link.
		if ( ! $args['show_ui'] && ! $has_edit_link ) {
			$args['_edit_link'] = '';
		}

		$this->cap = get_post_type_capabilities( (object) $args );
		unset( $args['capabilities'] );

		if ( is_array( $args['capability_type'] ) ) {
			$args['capability_type'] = $args['capability_type'][0];
		}

		if ( false !== $args['query_var'] ) {
			if ( true === $args['query_var'] ) {
				$args['query_var'] = $this->name;
			} else {
				$args['query_var'] = sanitize_title_with_dashes( $args['query_var'] );
			}
		}

		if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
			if ( ! is_array( $args['rewrite'] ) ) {
				$args['rewrite'] = array();
			}
			if ( empty( $args['rewrite']['slug'] ) ) {
				$args['rewrite']['slug'] = $this->name;
			}
			if ( ! isset( $args['rewrite']['with_front'] ) ) {
				$args['rewrite']['with_front'] = true;
			}
			if ( ! isset( $args['rewrite']['pages'] ) ) {
				$args['rewrite']['pages'] = true;
			}
			if ( ! isset( $args['rewrite']['feeds'] ) || ! $args['has_archive'] ) {
				$args['rewrite']['feeds'] = (bool) $args['has_archive'];
			}
			if ( ! isset( $args['rewrite']['ep_mask'] ) ) {
				if ( isset( $args['permalink_epmask'] ) ) {
					$args['rewrite']['ep_mask'] = $args['permalink_epmask'];
				} else {
					$args['rewrite']['ep_mask'] = EP_PERMALINK;
				}
			}
		}

		foreach ( $args as $property_name => $property_value ) {
			$this->$property_name = $property_value;
		}

		$this->labels = get_post_type_labels( $this );
		$this->label  = $this->labels->name;
	}

	/**
	 * Sets the features support for the post type.
	 *
	 * @since 4.6.0
	 */
	public function add_supports() {
		if ( ! empty( $this->supports ) ) {
			add_post_type_support( $this->name, $this->supports );
			unset( $this->supports );
		} elseif ( false !== $this->supports ) {
			// Add default features.
			add_post_type_support( $this->name, array( 'title', 'editor' ) );
		}
	}

	/**
	 * Adds the necessary rewrite rules for the post type.
	 *
	 * @since 4.6.0
	 *
	 * @global WP_Rewrite $wp_rewrite WordPress Rewrite Component.
	 * @global WP         $wp         Current WordPress environment instance.
	 */
	public function add_rewrite_rules() {
		global $wp_rewrite, $wp;

		if ( false !== $this->query_var && $wp && is_post_type_viewable( $this ) ) {
			$wp->add_query_var( $this->query_var );
		}

		if ( false !== $this->rewrite && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
			if ( $this->hierarchical ) {
				add_rewrite_tag( "%$this->name%", '(.+?)', $this->query_var ? "{$this->query_var}=" : "post_type=$this->name&pagename=" );
			} else {
				add_rewrite_tag( "%$this->name%", '([^/]+)', $this->query_var ? "{$this->query_var}=" : "post_type=$this->name&name=" );
			}

			if ( $this->has_archive ) {
				$archive_slug = true === $this->has_archive ? $this->rewrite['slug'] : $this->has_archive;
				if ( $this->rewrite['with_front'] ) {
					$archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
				} else {
					$archive_slug = $wp_rewrite->root . $archive_slug;
				}

				add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$this->name", 'top' );
				if ( $this->rewrite['feeds'] && $wp_rewrite->feeds ) {
					$feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
					add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$this->name" . '&feed=$matches[1]', 'top' );
					add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$this->name" . '&feed=$matches[1]', 'top' );
				}
				if ( $this->rewrite['pages'] ) {
					add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$this->name" . '&paged=$matches[1]', 'top' );
				}
			}

			$permastruct_args         = $this->rewrite;
			$permastruct_args['feed'] = $permastruct_args['feeds'];
			add_permastruct( $this->name, "{$this->rewrite['slug']}/%$this->name%", $permastruct_args );
		}
	}

	/**
	 * Registers the post type meta box if a custom callback was specified.
	 *
	 * @since 4.6.0
	 */
	public function register_meta_boxes() {
		if ( $this->register_meta_box_cb ) {
			add_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10, 1 );
		}
	}

	/**
	 * Adds the future post hook action for the post type.
	 *
	 * @since 4.6.0
	 */
	public function add_hooks() {
		add_action( 'future_' . $this->name, '_future_post_hook', 5, 2 );
	}

	/**
	 * Registers the taxonomies for the post type.
	 *
	 * @since 4.6.0
	 */
	public function register_taxonomies() {
		foreach ( $this->taxonomies as $taxonomy ) {
			register_taxonomy_for_object_type( $taxonomy, $this->name );
		}
	}

	/**
	 * Removes the features support for the post type.
	 *
	 * @since 4.6.0
	 *
	 * @global array $_wp_post_type_features Post type features.
	 */
	public function remove_supports() {
		global $_wp_post_type_features;

		unset( $_wp_post_type_features[ $this->name ] );
	}

	/**
	 * Removes any rewrite rules, permastructs, and rules for the post type.
	 *
	 * @since 4.6.0
	 *
	 * @global WP_Rewrite $wp_rewrite          WordPress rewrite component.
	 * @global WP         $wp                  Current WordPress environment instance.
	 * @global array      $post_type_meta_caps Used to remove meta capabilities.
	 */
	public function remove_rewrite_rules() {
		global $wp, $wp_rewrite, $post_type_meta_caps;

		// Remove query var.
		if ( false !== $this->query_var ) {
			$wp->remove_query_var( $this->query_var );
		}

		// Remove any rewrite rules, permastructs, and rules.
		if ( false !== $this->rewrite ) {
			remove_rewrite_tag( "%$this->name%" );
			remove_permastruct( $this->name );
			foreach ( $wp_rewrite->extra_rules_top as $regex => $query ) {
				if ( false !== strpos( $query, "index.php?post_type=$this->name" ) ) {
					unset( $wp_rewrite->extra_rules_top[ $regex ] );
				}
			}
		}

		// Remove registered custom meta capabilities.
		foreach ( $this->cap as $cap ) {
			unset( $post_type_meta_caps[ $cap ] );
		}
	}

	/**
	 * Unregisters the post type meta box if a custom callback was specified.
	 *
	 * @since 4.6.0
	 */
	public function unregister_meta_boxes() {
		if ( $this->register_meta_box_cb ) {
			remove_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10 );
		}
	}

	/**
	 * Removes the post type from all taxonomies.
	 *
	 * @since 4.6.0
	 */
	public function unregister_taxonomies() {
		foreach ( get_object_taxonomies( $this->name ) as $taxonomy ) {
			unregister_taxonomy_for_object_type( $taxonomy, $this->name );
		}
	}

	/**
	 * Removes the future post hook action for the post type.
	 *
	 * @since 4.6.0
	 */
	public function remove_hooks() {
		remove_action( 'future_' . $this->name, '_future_post_hook', 5 );
	}
}


text:
/*
 * \brief
 * \author Sylvain Jaume, Francois Huguet
 */
/*
 * \author Sylvain Jaume, Francois Huguet
 */
#ifndef SO_VTK_EXTRACTGRID_H_
#define SO_VTK_EXTRACTGRID_H_

#include <Inventor/engines/SoSubEngine.h>

#include <Inventor/fields/SoMFInt32.h>
#include <Inventor/fields/SoSFVec3f.h>
#include <Inventor/fields/SoSFInt32.h>

#include <xip/inventor/vtk/SoSFVtkAlgorithmOutput.h>
#include <xip/inventor/vtk/SoSFVtkObject.h>

#include "vtkExtractGrid.h"
#include <xip/inventor/core/SoSFVariant.h>

class SoVtkExtractGrid : public SoEngine
{
	SO_ENGINE_HEADER( SoVtkExtractGrid );

public:

	/// Constructor
	SoVtkExtractGrid();

	/// Class Initialization
	static void initClass();

	// Inputs
	/// VOI
	SoMFInt32 VOI;
	/// SampleRate
	SoSFVec3f SampleRate;
	/// Input data of type vtkDataObject
	SoSFVtkObject Input;
	/// InputArrayToProcess
	SoSFVariant InputArrayToProcess;
	/// IncludeBoundary
	SoSFInt32 IncludeBoundary;
	/// Input connection
	SoSFVtkAlgorithmOutput InputConnection;

	// Outputs
	/// SoSFVtkObject of type vtkStructuredGrid
	SoEngineOutput Output;
	/// SoSFVtkAlgorithmOutput
	SoEngineOutput OutputPort;

protected:

	/// Destructor
	~SoVtkExtractGrid();

	/// Evaluate Function
	virtual void evaluate();

	virtual void inputChanged(SoField *);

	/// vtkStructuredGrid
	SoVtkObject *mOutput;
	/// vtkAlgorithm
	SoVtkAlgorithmOutput *mOutputPort;

private:

	vtkExtractGrid* mObject;
};

#endif // SO_VTK_EXTRACTGRID_H_

redpajama_set_name: RedPajamaGithub


text:
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */

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

MathJax.Localization.addTranslation("da","MathMenu",{
        version: "2.3",
        isLoaded: true,
        strings: {
          Show: "Vis matematik som",
          MathMLcode: "MathML kode",
          OriginalMathML: "Oprindelige MathML",
          TeXCommands: "TeX kommandoer",
          AsciiMathInput: "AsciiMathML input",
          Original: "Oprindelige format",
          ErrorMessage: "Fejlmeddelelse",
          Annotation: "Anm\u00E6rkning",
          TeX: "TeX",
          StarMath: "StarMath",
          Maple: "Maple",
          ContentMathML: "Content MathML",
          OpenMath: "OpenMath",
          texHints: "Vis TeX hints i MathML",
          Settings: "Matematikindstillinger",
          ZoomTrigger: "Zoom udl\u00F8ser",
          Hover: "Hover",
          Click: "Klik",
          DoubleClick: "Dobbeltklik",
          NoZoom: "Ingen zoom",
          TriggerRequires: "Udl\u00F8ser kr\u00E6ver:",
          Option: "Option",
          Alt: "Alt",
          Command: "Command",
          Control: "Ctrl",
          Shift: "Shift",
          ZoomFactor: "Zoomfaktor",
          Renderer: "Matematik renderer",
          MPHandles: "Lad MathPlayer h\u00E5ndtere:",
          MenuEvents: "Menubegivenheder",
          MouseEvents: "Musebegivenheder",
          MenuAndMouse: "Muse- og menu-begivenheder",
          FontPrefs: "Skrifttype indstillinger",
          ForHTMLCSS: "For HTML-CSS:",
          Auto: "Auto",
          TeXLocal: "TeX (lokal)",
          TeXWeb: "TeX (web)",
          TeXImage: "TeX (billede)",
          STIXLocal: "STIX (lokal)",
          ContextMenu: "Kontekstuelle menu",
          Browser: "Browser",
          Scale: "Skaler alt matematik...",
          Discoverable: "Fremh\u00E6v ved hover",
          Locale: "Sprog",
          LoadLocale: "Indl\u00E6ser fra URL...",
          About: "Om MathJax",
          Help: "MathJax hj\u00E6lp",
          localTeXfonts: "ved hj\u00E6lp af lokale TeX skrifttyper",
          webTeXfonts: "ved hj\u00E6lp af TeX webskrifttyper",
          imagefonts: "ved hj\u00E6lp af billede skrifttyper",
          localSTIXfonts: "ved hj\u00E6lp af lokale STIX skrifttyper",
          webSVGfonts: "ved hj\u00E6lp af web SVG skrifttyper",
          genericfonts: "ved hj\u00E6lp af generiske Unicode-skrifttyper",
          wofforotffonts: "WOFF eller OTF skrifttyper",
          eotffonts: "EOT skrifttyper",
          svgfonts: "SVG skrifttyper",
          WebkitNativeMMLWarning: "Din browser synes ikke at have indbygget st\u00F8tte til MathML, s\u00E5 et skift til MathML output kan for\u00E5rsage at matematik p\u00E5 siden bliver ul\u00E6selig",
          MSIENativeMMLWarning: "Internet Explorer kr\u00E6ver MathPlayer plugin for at kunne behandle MathML output.",
          OperaNativeMMLWarning: "Operas underst\u00F8ttelse af MathML er begr\u00E6nset, s\u00E5 et skift til MathML output kan for\u00E5rsage at nogle udtryk bliver vist d\u00E5rligt.",
          SafariNativeMMLWarning: "Din browsers indbyggede MathML underst\u00F8tter ikke alle de funktioner, der anvendes af MathJax, s\u00E5 nogle udtryk gengives muligvis ikke korrekt.",
          FirefoxNativeMMLWarning: "Din browsers indbyggede MathML underst\u00F8tter ikke alle de funktioner, der anvendes af MathJax, s\u00E5 nogle udtryk gengives muligvis ikke korrekt.",
          MSIESVGWarning: "SVG er ikke implementeret i Internet Explorer f\u00F8r IE9 eller n\u00E5r der emuleres IE8 eller nedefter. Et skifte til SVG-output vil for\u00E5rsage at matematik ikke vises korrekt.",
          LoadURL: "Indl\u00E6s overs\u00E6ttelsesdata fra denne URL:",
          BadURL: "URL-adressen skal v\u00E6re for en JavaScript-fil, der definerer MathJax overs\u00E6ttelsesdata. JavaScript filnavne skal afsluttes med '.js'",
          BadData: "Kunne ikke indl\u00E6se overs\u00E6ttelsesdata fra %1",
          SwitchAnyway: "Skift renderer alligevel?\n\n(Tryk p\u00E5 OK for at skifte, ANNULLER for at forts\u00E6tte med den nuv\u00E6rende renderer)",
          ScaleMath: "Skal\u00E9r alt matematik (sammenlignet med omgivende tekst) med",
          NonZeroScale: "Skaleringen m\u00E5 ikke v\u00E6re nul",
          PercentScale: "Skaleringen skal v\u00E6re en procentsats (for eksempel 120%%)",
          IE8warning: "Dette vil deaktivere MathJax funktionerne menu og zoom, men du kan ogs\u00E5 Alt-klikke p\u00E5 et udtryk for at f\u00E5 MathJax menuen i stedet.\n\nVil du virkelig \u00E6ndre indstillingerne for MathPlayer?",
          IE9warning: "Den kontekstuelle MathJax menu vil blive deaktiveret, men du kan Alt-klikke p\u00E5 et udtryk for at f\u00E5 MathJax menuen i stedet.",
          NoOriginalForm: "Ingen oprindelig form, til r\u00E5dighed",
          Close: "Luk",
          EqSource: "MathJax ligningskilde"
        }
});

MathJax.Ajax.loadComplete("[MathJax]/localization/da/MathMenu.js");


text:
layout: post
title: "Wug Wonderland"
date: 2017-02-14
summary: Follow the instructions
comments: true
categories:
- puzzles
---
Here's something a little different that I did for my sister and my brother-in-law for their shared birthday. It's in the vein of a Duck Konundrum (see a list of them [here](https://devjoe.appspot.com/huntindex/keyword/duckkonundrum)), So, it's not a puzzle *per se*, but rather a series of detailed instructions that give an answer at the end.

It was fun to write, albeit a little rushed, as I only had the idea about 2 weeks before their birthday. So, a few things could have been bit more refined and/or tested. But overall I'm pleased with the results.

Anyway, to play, grab three friends, print out the wugs, then cut them out on the lines. Each person should get a relevant page of instructions. Read carefully, write things down, and enjoy!

[Wugs](/files/puzzles/Wugs.pdf)

[Instruction Sheets](/files/puzzles/Wug_Wonderland_Instructions.pdf)

A few notes:

* My sister is a linguist, hence the [wugs](https://en.wikipedia.org/wiki/Jean_Berko_Gleason#Children.27s_learning_of_English_morphology.E2.80.94.E2.80.8B.E2.80.8Bthe_Wug_Test)
* My brother-in-law is a city planner, which is relevant to the answer
* It's probably not too hard to do on your own, but, you know, less fun


text:
/**
 *
 */
package org.apache.taverna.scufl2.validation.correctness;
/*
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
*/

import static org.junit.Assert.*;

import java.util.Collections;
import java.util.Set;

import org.apache.taverna.scufl2.api.core.Processor;
import org.apache.taverna.scufl2.api.iterationstrategy.CrossProduct;
import org.apache.taverna.scufl2.api.iterationstrategy.IterationStrategyStack;
import org.apache.taverna.scufl2.api.iterationstrategy.PortNode;
import org.apache.taverna.scufl2.api.port.InputProcessorPort;
import org.apache.taverna.scufl2.validation.correctness.CorrectnessValidator;
import org.apache.taverna.scufl2.validation.correctness.ReportCorrectnessValidationListener;
import org.apache.taverna.scufl2.validation.correctness.report.NegativeValueProblem;
import org.apache.taverna.scufl2.validation.correctness.report.NullFieldProblem;
import org.apache.taverna.scufl2.validation.correctness.report.OutOfScopeValueProblem;
import org.junit.Test;

/**
 * @author alanrw
 *
 */
public class TestPortNode {

	@Test
	public void testCorrectnessOfDesiredDepthSpecifiedIncorrectly() {
		PortNode pn = new PortNode();
		Integer desiredDepth = new Integer(-3);
		pn.setDesiredDepth(desiredDepth);
		InputProcessorPort ipp = new InputProcessorPort();
		pn.setInputProcessorPort(ipp);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, false, rcvl);

		Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems();
		assertEquals(1, negativeValueProblems.size());
		if (!negativeValueProblems.isEmpty()) {
			NegativeValueProblem problem = negativeValueProblems.iterator().next();
			assertEquals(problem.getBean(), pn);
			assertEquals(problem.getFieldName(), "desiredDepth");
			assertEquals(problem.getFieldValue(), desiredDepth);
		}

		Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
		assertEquals(Collections.EMPTY_SET, nullFieldProblems); // only done when completeness check
	}

	@Test
	public void testCompletenessOfDepthSpecifiedIncorrectly() {
		PortNode pn = new PortNode();
		Integer desiredDepth = new Integer(-3);
		pn.setDesiredDepth(desiredDepth);
		InputProcessorPort ipp = new InputProcessorPort();
		pn.setInputProcessorPort(ipp);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, true, rcvl);

		Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems();
		assertEquals(1, negativeValueProblems.size());
		if (!negativeValueProblems.isEmpty()) {
			NegativeValueProblem problem = negativeValueProblems.iterator().next();
			assertEquals(problem.getBean(), pn);
			assertEquals(problem.getFieldName(), "desiredDepth");
			assertEquals(problem.getFieldValue(), desiredDepth);
		}

		Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
		assertFalse(nullFieldProblems.isEmpty()); // parent
		boolean depthFieldProblem = false;
		for (NullFieldProblem nlp : nullFieldProblems) {
			if (nlp.getBean().equals(pn) && nlp.getFieldName().equals("desiredDepth")) {
				depthFieldProblem = true;
			}
		}
		assertFalse(depthFieldProblem);
	}

	@Test
	public void testCorrectnessOfMissingDepth() {
		PortNode pn = new PortNode();
		InputProcessorPort ipp = new InputProcessorPort();
		pn.setInputProcessorPort(ipp);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, false, rcvl);

		Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems();
		assertEquals(Collections.EMPTY_SET, negativeValueProblems);

		Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
		assertEquals(Collections.EMPTY_SET, nullFieldProblems); // only done when completeness check
	}

	@Test
	public void testCompletenessOfMissingDepth() {
		PortNode pn = new PortNode();
		InputProcessorPort ipp = new InputProcessorPort();
		pn.setInputProcessorPort(ipp);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, true, rcvl);

		Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems();
		assertEquals(Collections.EMPTY_SET, negativeValueProblems);

		Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
		assertFalse(nullFieldProblems.isEmpty());
		boolean depthFieldProblem = false;
		for (NullFieldProblem nlp : nullFieldProblems) {
			if (nlp.getBean().equals(pn) && nlp.getFieldName().equals("desiredDepth")) {
				depthFieldProblem = true;
			}
		}
		assertTrue(depthFieldProblem);

	}

	@Test
	public void testCorrectnessOfMissingInputProcessorPort() {
		PortNode pn = new PortNode();
		Integer desiredDepth = new Integer(-3);
		pn.setDesiredDepth(desiredDepth);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, false, rcvl);

		Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
		assertTrue(nullFieldProblems.isEmpty());
	}

	@Test
	public void testCompletenessOfMissingInputProcessorPort() {
		PortNode pn = new PortNode();
		Integer desiredDepth = new Integer(-3);
		pn.setDesiredDepth(desiredDepth);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, true, rcvl);

		Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
		assertFalse(nullFieldProblems.isEmpty());
		boolean depthFieldProblem = false;
		for (NullFieldProblem nlp : nullFieldProblems) {
			if (nlp.getBean().equals(pn) && nlp.getFieldName().equals("inputProcessorPort")) {
				depthFieldProblem = true;
			}
		}
		assertTrue(depthFieldProblem);

	}

	@Test
	public void testOutOfScopeInputProcessorPort() {
		Processor p = new Processor();
		InputProcessorPort ipp = new InputProcessorPort();
//		ipp.setParent(p);
		IterationStrategyStack iss = new IterationStrategyStack();
		p.setIterationStrategyStack(iss);
		CrossProduct cp = new CrossProduct();
		iss.add(cp);
		cp.setParent(iss);
		PortNode pn = new PortNode();
		pn.setInputProcessorPort(ipp);
		cp.add(pn);
		pn.setParent(cp);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, false, rcvl);

		Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
		assertFalse(outOfScopeValueProblems.isEmpty());

		boolean problem = false;
		for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
			if (nlp.getBean().equals(pn) && nlp.getFieldName().equals("inputProcessorPort") && nlp.getValue().equals(ipp)) {
				problem = true;
			}
		}
		assertTrue(problem);

	}

	@Test
	public void testInScopeInputProcessorPort() {
		Processor p = new Processor();
		InputProcessorPort ipp = new InputProcessorPort();
		ipp.setParent(p);
		IterationStrategyStack iss = new IterationStrategyStack();
		p.setIterationStrategyStack(iss);
		CrossProduct cp = new CrossProduct();
		iss.add(cp);
		cp.setParent(iss);
		PortNode pn = new PortNode();
		pn.setInputProcessorPort(ipp);
		cp.add(pn);
		pn.setParent(cp);

		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();

		cv.checkCorrectness(pn, false, rcvl);

		Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
		assertEquals(Collections.EMPTY_SET, outOfScopeValueProblems);

	}

}


text:
#include <grpcpp/grpcpp.h>
#include <jni.h>

#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/cpp/interop/interop_client.h"

std::shared_ptr<grpc::testing::InteropClient> GetClient(const char* host,
                                                        int port,
                                                        bool use_tls) {
  const int host_port_buf_size = 1024;
  char host_port[host_port_buf_size];
  snprintf(host_port, host_port_buf_size, "%s:%d", host, port);

  std::shared_ptr<grpc::ChannelCredentials> credentials;
  if (use_tls) {
    credentials = grpc::SslCredentials(grpc::SslCredentialsOptions());
  } else {
    credentials = grpc::InsecureChannelCredentials();
  }

  grpc::testing::ChannelCreationFunc channel_creation_func =
      std::bind(grpc::CreateChannel, host_port, credentials);
  return std::shared_ptr<grpc::testing::InteropClient>(
      new grpc::testing::InteropClient(channel_creation_func, true, false));
}

extern "C" JNIEXPORT jboolean JNICALL
Java_io_grpc_interop_cpp_InteropActivity_doEmpty(JNIEnv* env, jobject obj_this,
                                                 jstring host_raw,
                                                 jint port_raw,
                                                 jboolean use_tls_raw) {
  const char* host = env->GetStringUTFChars(host_raw, (jboolean*)0);
  int port = static_cast<int>(port_raw);
  bool use_tls = static_cast<bool>(use_tls_raw);

  jboolean result = GetClient(host, port, use_tls)->DoEmpty();
  env->ReleaseStringUTFChars(host_raw, host);
  return result;
}

extern "C" JNIEXPORT jboolean JNICALL
Java_io_grpc_interop_cpp_InteropActivity_doLargeUnary(JNIEnv* env,
                                                      jobject obj_this,
                                                      jstring host_raw,
                                                      jint port_raw,
                                                      jboolean use_tls_raw) {
  const char* host = env->GetStringUTFChars(host_raw, (jboolean*)0);
  int port = static_cast<int>(port_raw);
  bool use_tls = static_cast<bool>(use_tls_raw);

  jboolean result = GetClient(host, port, use_tls)->DoLargeUnary();
  env->ReleaseStringUTFChars(host_raw, host);
  return result;
}

extern "C" JNIEXPORT jboolean JNICALL
Java_io_grpc_interop_cpp_InteropActivity_doEmptyStream(JNIEnv* env,
                                                       jobject obj_this,
                                                       jstring host_raw,
                                                       jint port_raw,
                                                       jboolean use_tls_raw) {
  const char* host = env->GetStringUTFChars(host_raw, (jboolean*)0);
  int port = static_cast<int>(port_raw);
  bool use_tls = static_cast<bool>(use_tls_raw);

  jboolean result = GetClient(host, port, use_tls)->DoEmptyStream();
  env->ReleaseStringUTFChars(host_raw, host);
  return result;
}

extern "C" JNIEXPORT jboolean JNICALL
Java_io_grpc_interop_cpp_InteropActivity_doRequestStreaming(
    JNIEnv* env, jobject obj_this, jstring host_raw, jint port_raw,
    jboolean use_tls_raw) {
  const char* host = env->GetStringUTFChars(host_raw, (jboolean*)0);
  int port = static_cast<int>(port_raw);
  bool use_tls = static_cast<bool>(use_tls_raw);

  jboolean result = GetClient(host, port, use_tls)->DoRequestStreaming();
  env->ReleaseStringUTFChars(host_raw, host);
  return result;
}

extern "C" JNIEXPORT jboolean JNICALL
Java_io_grpc_interop_cpp_InteropActivity_doResponseStreaming(
    JNIEnv* env, jobject obj_this, jstring host_raw, jint port_raw,
    jboolean use_tls_raw) {
  const char* host = env->GetStringUTFChars(host_raw, (jboolean*)0);
  int port = static_cast<int>(port_raw);
  bool use_tls = static_cast<bool>(use_tls_raw);

  jboolean result = GetClient(host, port, use_tls)->DoResponseStreaming();
  env->ReleaseStringUTFChars(host_raw, host);
  return result;
}

extern "C" JNIEXPORT jboolean JNICALL
Java_io_grpc_interop_cpp_InteropActivity_doPingPong(JNIEnv* env,
                                                    jobject obj_this,
                                                    jstring host_raw,
                                                    jint port_raw,
                                                    jboolean use_tls_raw) {
  const char* host = env->GetStringUTFChars(host_raw, (jboolean*)0);
  int port = static_cast<int>(port_raw);
  bool use_tls = static_cast<bool>(use_tls_raw);

  jboolean result = GetClient(host, port, use_tls)->DoPingPong();
  env->ReleaseStringUTFChars(host_raw, host);
  return result;
}


text:
package tools.crypto;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.mockito.Mock;

import tools.crypto.keys.TestKey;

public class CryptographyManagerTest {
	private static byte[] UUID = "SIMEON:6134073789".getBytes();
	private TestKey key = new TestKey(UUID);

	private CryptographyManager manager = new CryptographyManager(3,key);
	@Mock TOTP otpGenerator;

	@Test
	public void testGetOTPShouldReturnA6DigitCode(){
		String otp = manager.getOTP();
		String otp2 = manager.getOTP(key.getHexString("SIMEON".getBytes()));

		assertNotNull(otp);
		assertFalse(otp.equals(otp2));
	}

	//time based tests suck
	//@Test
	public void testVerifyOTPShouldMatchEnteredTokenWithGeneratedOne() throws InterruptedException{
		String otp = manager.getOTP();

		Thread.sleep(1500L);
		assertNotNull(otp);
		assertTrue(manager.verifyOTP(key.getHexKey(), otp));
	}

	//@Test
	public void testVerifyOTPShouldFailIf30SecondsPass() throws InterruptedException{
		String otp = manager.getOTP();

		Thread.sleep(3100L);
		assertNotNull(otp);
		assertFalse(manager.verifyOTP(key.getHexKey(), otp));
	}

	@Test
	public void testVerifyOTPShouldFailIfWrongKey() throws InterruptedException{
		String otp = manager.getOTP();

		Thread.sleep(2100L);
		assertNotNull(otp);
		String keyString = key.getHexString("SIMEON".getBytes());
		assertFalse(manager.verifyOTP(keyString, otp));
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://xml.m4u.com.au/2009">
 <env:Body>
  <ns:blockNumbers>
   <ns:authentication>
    <ns:userId>my-user-id</ns:userId>
    <ns:password>my-password</ns:password>
   </ns:authentication>
   <ns:requestBody>
    <ns:recipients>
     <ns:recipient uid="0">61412345678</ns:recipient>
     <ns:recipient uid="1">61498765432</ns:recipient>
    </ns:recipients>
   </ns:requestBody>
  </ns:blockNumbers>
 </env:Body>
</env:Envelope>


text:
namespace Gu.Wpf.Media.Demo.UiTestWindows
{
    using System;
    using System.Globalization;
    using System.Windows.Data;

    public class ContentToIdConverter : IValueConverter
    {
        public static readonly ContentToIdConverter Default = new ContentToIdConverter();

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value?.ToString();
        }

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}


text:
package net.spy.memcached;

import java.net.InetSocketAddress;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import junit.framework.TestCase;

/**
 * Test the AddrUtils stuff.
 */
public class AddrUtilTest extends TestCase {

	public void testSingle() throws Exception {
		List<InetSocketAddress> addrs=
			AddrUtil.getAddresses("www.google.com:80");
		assertEquals(1, addrs.size());
		assertEquals("www.google.com", addrs.get(0).getHostName());
		assertEquals(80, addrs.get(0).getPort());
	}

	public void testTwo() throws Exception {
		List<InetSocketAddress> addrs=
			AddrUtil.getAddresses("www.google.com:80 www.yahoo.com:81");
		assertEquals(2, addrs.size());
		assertEquals("www.google.com", addrs.get(0).getHostName());
		assertEquals(80, addrs.get(0).getPort());
		assertEquals("www.yahoo.com", addrs.get(1).getHostName());
		assertEquals(81, addrs.get(1).getPort());
	}

	public void testThree() throws Exception {
		List<InetSocketAddress> addrs=
			AddrUtil.getAddresses(" ,  www.google.com:80 ,, ,, www.yahoo.com:81 , ,,");
		assertEquals(2, addrs.size());
		assertEquals("www.google.com", addrs.get(0).getHostName());
		assertEquals(80, addrs.get(0).getPort());
		assertEquals("www.yahoo.com", addrs.get(1).getHostName());
		assertEquals(81, addrs.get(1).getPort());
	}

	public void testBrokenHost() throws Exception {
		String s="www.google.com:80 www.yahoo.com:81:more";
		try {
			List<InetSocketAddress> addrs=AddrUtil.getAddresses(s);
			fail("Expected failure, got " + addrs);
		} catch(NumberFormatException e) {
			e.printStackTrace();
			assertEquals("For input string: \"more\"", e.getMessage());
		}
	}

	public void testBrokenHost2() throws Exception {
		String s="www.google.com:80 www.yahoo.com";
		try {
			List<InetSocketAddress> addrs=AddrUtil.getAddresses(s);
			fail("Expected failure, got " + addrs);
		} catch(IllegalArgumentException e) {
			assertEquals("Invalid server ``www.yahoo.com'' in list:  "
					+ s, e.getMessage());
		}
	}

	public void testBrokenList() throws Exception {
		String s="";
		try {
			List<InetSocketAddress> addrs=AddrUtil.getAddresses(s);
			fail("Expected failure, got " + addrs);
		} catch(IllegalArgumentException e) {
			assertEquals("No hosts in list:  ``''", e.getMessage());
		}
	}

	public void testBrokenList2() throws Exception {
		String s="   ";
		try {
			List<InetSocketAddress> addrs=AddrUtil.getAddresses(s);
			fail("Expected failure, got " + addrs);
		} catch(IllegalArgumentException e) {
			assertEquals("No hosts in list:  ``   ''", e.getMessage());
		}
	}

	public void testNullList() throws Exception {
		String s=null;
		try {
			List<InetSocketAddress> addrs=AddrUtil.getAddresses(s);
			fail("Expected failure, got " + addrs);
		} catch(NullPointerException e) {
			assertEquals("Null host list", e.getMessage());
		}
	}

	public void testIPv6Host() throws Exception {
		List<InetSocketAddress> addrs=
			AddrUtil.getAddresses("::1:80");
		assertEquals(1, addrs.size());

	        Set<String> validLocalhostNames=new HashSet<String>();
		validLocalhostNames.add("localhost");
		validLocalhostNames.add("ip6-localhost");
		validLocalhostNames.add("localhost6.localdomain6");
		validLocalhostNames.add("0:0:0:0:0:0:0:1");
		assert(validLocalhostNames.contains(addrs.get(0).getHostName()));
		assertEquals(80, addrs.get(0).getPort());
	}
}


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Web.XmlTransform;
using System.Xml;
using System.IO;

namespace UnitTests.Desktop
{
    [TestClass]
    public class XdtTests
    {
        [TestMethod]
        public void CS_D_XDT_TestInstallThenUninstall()
        {
            var tests = new int[] { 0, 2, 3 };
            foreach(int i in tests)
            {
                var filenameIn = String.Format("Package{0}.appxmanifest", i);
                var filenameInstalled = String.Format("Package{0}.installed.appxmanifest", i);
                var filenameUninstalled = String.Format("Package{0}.uninstalled.appxmanifest", i);
                var filenameReference = String.Format("Package{0}.reference.appxmanifest", i);

                Console.WriteLine("Loading {0}", filenameIn);
                var xml = new XmlDocument();
                xml.Load(filenameIn);

                Console.WriteLine("Installing XML");
                using (var transform = new XmlTransformation("Package.appxmanifest.install.xdt"))
                {
                    Assert.IsTrue(transform.Apply(xml));
                }

                Console.WriteLine("Saving {0}", filenameInstalled);
                xml.Save(filenameInstalled);

                Console.WriteLine("Verifying output");
                string actual = File.ReadAllText(filenameInstalled);
                string expected = File.ReadAllText(filenameReference);
                Assert.AreEqual(expected, actual);

                Console.WriteLine("Uninstalling XML");
                using (var transform = new XmlTransformation("Package.appxmanifest.uninstall.xdt"))
                {
                    Assert.IsTrue(transform.Apply(xml));
                }

                Console.WriteLine("Saving {0}", filenameUninstalled);
                xml.Save(filenameUninstalled);

                Console.WriteLine("Verifying output");
                actual = File.ReadAllText(filenameUninstalled);
                expected = File.ReadAllText(filenameIn);
                Assert.AreEqual(expected, actual);
            }
        }

        [TestMethod]
        public void CS_D_XDT_TestUninstall()
        {
            var filenameIn = "Package4.appxmanifest";
            var filenameUninstalled = "Package4.uninstalled.appxmanifest";
            var filenameReference = "Package4.reference.appxmanifest";

            Console.WriteLine("Loading {0}", filenameIn);
            var xml = new XmlDocument();
            xml.Load(filenameIn);

            Console.WriteLine("Uninstalling XML");
            using (var transform = new XmlTransformation("Package.appxmanifest.uninstall.xdt"))
            {
                Assert.IsTrue(transform.Apply(xml));
            }

            Console.WriteLine("Saving {0}", filenameUninstalled);
            xml.Save(filenameUninstalled);

            Console.WriteLine("Verifying output");
            string actual = File.ReadAllText(filenameUninstalled);
            string expected = File.ReadAllText(filenameReference);
            Assert.AreEqual(expected, actual);
        }
    }
}


text:
import os
import sys
from decimal import *
from django.db.models import Sum
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext_lazy as _
from fly_project import constants
from api.models import Badge
from api.models import Me
from api.models import XPLevel
from api.models import SavingsGoal
from api.models import CreditGoal
from api.models import FinalGoal
from api.models import Notification
from api.models import Course
from api.models import EnrolledCourse
from api.models import Share

class Command(BaseCommand):
    help = _('Evaluate the User\'s profile and grant reward and calculate XP.')

    def add_arguments(self, parser):
        parser.add_argument('id', nargs='+')

    def handle(self, *args, **options):
        for id in options['id']:
            try:
                me = Me.objects.get(id=id)
                self.begin_processing(me)
            except Me.DoesNotExist:
                print(_("Error - No Me profile object detected for ID: ")+str(id))

    def begin_processing(self, me):
        """
            Function looks at the User's profile and evaluate this account
            to determine various gamefication elements.
        """
        self.process_xp_score(me)
        self.process_xp_level_up(me)
        self.process_badges(me)

    def process_xp_score(self, me):
        """
            Function will iterate through all the Goals and sum the XP score.
        """
        xp_score = 0
        sum1 = SavingsGoal.objects.filter(user=me.user,is_closed=True).aggregate(Sum('earned_xp'))
        if sum1['earned_xp__sum']:
            me.xp = sum1['earned_xp__sum']

        sum2 = CreditGoal.objects.filter(user=me.user,is_closed=True).aggregate(Sum('earned_xp'))
        if sum2['earned_xp__sum']:
            me.xp = sum2['earned_xp__sum']

        sum3 = FinalGoal.objects.filter(user=me.user,is_closed=True).aggregate(Sum('earned_xp'))
        if sum3['earned_xp__sum']:
            me.xp = sum3['earned_xp__sum']

        me.save()

    def process_xp_level_up(self, me):
        """
            Function will select the User level based on the XP score.
        """
        # Algorithm:
        # 1. Get all the XPLevels (aka Tiers) there are in this game and arrange
        #    then in ascending order based on the Level number.
        # 2. Iterate through all the levels and only process the levels with
        #    level numbers ("num") where the User does not have.
        #     i. If the User's XP value is within the minimum and maximum of
        #        the new XPLevel then assign this new XPLevel to the User.
        #     ii. Make the User be aware of the new level.
        xp_tiers = XPLevel.objects.all().order_by("num")
        for xp_tier in xp_tiers:
            if me.xplevel.num < xp_tier.num:
                if me.xp >= xp_tier.min_xp and me.xp < xp_tier.max_xp:
                    me.xplevel = xp_tier
                    me.save()
                    self.create_level_up_notification(me, xp_tier)

    def create_level_up_notification(self,me, xp_tier):
        """
            Function will create a "New Experience Level" type of notification.
        """
        title = _("You've earned a new FLY level!")
        description = _("Congratulations! You've just leveled up your financial skills! Let your friends know, and keep up the good work!")
        Notification.objects.create(
            type=1,
            title=title,
            description=description,
            user=me.user,
            xplevel=xp_tier,
            badge=None,
        )

    def process_xp_level_up_badges(self, me, badge):
        """
            Function will grant the Badge to the User if it meets the requirement.
        """
        if badge.has_xp_requirement:
            if me.xp >= badge.required_xp:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

    def process_badge_per_course(self, me, badge, course_id):
        # Lookup the particular 'course_id' which is succesfully completed.
        try:
            completed_course = EnrolledCourse.objects.get(
                course_id=course_id,
                user=me.user,
                is_finished=True,
            )

            # If the User does not have a record of this course then add it
            # to the User's profile and grant the badge and make notification.
            if completed_course not in me.courses.all():
                print("Badge",badge.id)
                me.courses.add(completed_course)
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        except EnrolledCourse.DoesNotExist:
            pass

    def process_badge_for_social(self, me, badge, shares):
        if shares.count() > 0:
            me.badges.add(badge)
            self.create_new_badge_notification(me, badge)

    def process_courses_badges(self, me, badge):
        """
            Function will grant the Badge to the User if the specific Course
            requirements are met.
        """
        # Thanks for letting your friends know! - #12
        shares = Share.objects.filter(user=me.user)
        if badge.id == 12:
            self.process_badge_for_social(me, badge, shares)

        # Completed Finances 101 - #13
        if badge.id == 13:
            self.process_badge_per_course(me, badge, 1)

        # Completed Finances II - #14
        if badge.id == 14:
            self.process_badge_per_course(me, badge, 4)

        # Completed Saving & Budgeting 101 - #15
        if badge.id == 15:
            self.process_badge_per_course(me, badge, 2)

        # Saving & Budgeting II - #16
        if badge.id == 16:
            self.process_badge_per_course(me, badge, 5)

        # Completed Credit Score 101 - #17
        if badge.id == 17:
            self.process_badge_per_course(me, badge, 3)

        # Completed Credit Score II - #18
        if badge.id == 18:
            self.process_badge_per_course(me, badge, 6)

        # First Course - #11
        if badge.id == 11:
            if me.courses.count() == 1:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

    def process_badge_21(self, me, badge):
        savings_goals_failure_count = SavingsGoal.objects.filter(
            user=me.user,
            was_accomplished = False,
            is_closed = True,
        ).count()
        credit_goals_failure_count = CreditGoal.objects.filter(
            user=me.user,
            was_accomplished = False,
            is_closed = True,
        ).count()
        final_goals_failure_count = FinalGoal.objects.filter(
            user=me.user,
            was_accomplished = False,
            is_closed = True,
        ).count()

        if savings_goals_failure_count or credit_goals_failure_count or final_goals_failure_count:
            me.badges.add(badge)
            self.create_new_badge_notification(me, badge)

    def process_goals_badges(self, me, badge):
        """
            Function will grant the Badge to the User if a particular goals
            requirements have been met.
        """
        # Goal Sharing - #20
        #TODO: Implement

        # Fetch all the goals accomplished for this user which we will use
        # to evaluate handing out Badges to if certain criteria are met.
        savings_goals_count = SavingsGoal.objects.filter(
            user=me.user,
            was_accomplished = True,
            is_closed = True,
        ).count()
        credit_goals_count = CreditGoal.objects.filter(
            user=me.user,
            was_accomplished = True,
            is_closed = True,
        ).count()
        final_goals_count = FinalGoal.objects.filter(
            user=me.user,
            was_accomplished = True,
            is_closed = True,
        ).count()

        # First goal achieved - #19
        if badge.id == 19:
            if savings_goals_count or credit_goals_count or final_goals_count:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        # First goal failed - #21
        if badge.id == 21:
            self.process_badge_21(me, badge)

        # First savings goal achieved - #22
        if badge.id == 22:
            if savings_goals_count:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        # First credit goal achieved - #23
        if badge.id == 23:
            if credit_goals_count:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        # First big goal achieved - #24
        if badge.id == 24:
            if final_goals_count:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        # Savings champ - #25
        if badge.id == 25:
            if savings_goals_count >= 3:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        # Credit score champ - #26
        if badge.id == 26:
            if credit_goals_count >= 3:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

        # Big saver! - #27
        if badge.id == 27:
            if final_goals_count >= 3:
                me.badges.add(badge)
                self.create_new_badge_notification(me, badge)

    def process_badges(self, me):
        """
            Function will iterate through all the badges in our application
            and evaluate whether to grant the User the particular Badge.
        """
        badges = Badge.objects.all()
        for badge in badges.all():
            if badge not in me.badges.all():
                # (1) Evaluate the Badge and User's Me profile by comparing the
                # experience points.
                self.process_xp_level_up_badges(me, badge)

                #(2) Evaluate Badge and the User's Courses to see if the User
                # should be granted a Badge.
                self.process_courses_badges(me, badge)

                # (3) Evaluate Badge and the User's Goals to see if the User
                # should be granted a Badge.
                self.process_goals_badges(me, badge)

    def create_new_badge_notification(self, me, badge):
        """Function will create a "New Badge" type of notification."""
        title = _("You've earned a new Badge:")+" "+badge.title
        Notification.objects.create(
            type=2,
            title=title,
            description=badge.description,
            user=me.user,
            xplevel=None,
            badge=badge,
        )


text:
<?php
$Load="Weapons_Reload();Weapons_LoadInfo(Weapons_LastWeaponID);";
$Tabs=array(
	array("",Language("All weapons"),"Weapons_Reload('','all')"),
	array("favorites",Language("Favorites"),"Weapons_Reload('','favorites')")
);
?>


text:
package weed3demo.demo.model;

import org.noear.weed.GetHandlerEx;
import org.noear.weed.IBinder;

/**
 * Created by noear on 2017/7/22.
 */
public class UserInfoModel implements IBinder {
    public long user_id;
    public int role;
    public String mobile;
    public String udid;
    public int city_id;
    public String name;
    public String icon;

    public void bind(GetHandlerEx s) {
        //1.source:数据源
        //
        user_id = s.get("user_id").value(0l);
        role    = s.get("role").value(0);
        mobile  = s.get("mobile").value("");
        udid    = s.get("udid").value("");
        city_id = s.get("city_id").intValue(0);
        name    = s.get("name").value("");
        icon    = s.get("icon").value("");

    }

    public IBinder clone() {
        return new UserInfoModel();
    }
}


text:
using Should;
using NUnit.Framework;

namespace TranslateMe.Tests
{
    [TestFixture]
    public class TranslateMeTests
    {
        TMLanguagesLoader loader;

        [OneTimeSetUp]
        public void LoadTranslations()
        {
            loader = new TMLanguagesLoader(TM.Instance);

            loader.AddTranslation("SayHello", "en", "Hello");
            loader.AddTranslation("SayHello", "fr", "Bonjour");
        }

        [TestCase("TestNoTextId", "Test", null, null, ExpectedResult = "Test")]
        [TestCase("SayHello", "SH", null, null, ExpectedResult = "Hello")]
        [TestCase("SayHello", "SH", "fr", null, ExpectedResult = "Bonjour")]
        [TestCase("SayHello", "SH", "fr", "en", ExpectedResult = "Hello")]
        [TestCase("SayHello", "SH", "fr", "es", ExpectedResult = "SH")]
        public string StaticBasicTranslations(string textId, string defaultText, string currentLanguage, string forceCurrentLanguage)
        {
            if(currentLanguage != null)
                TM.Instance.CurrentLanguage = currentLanguage;

            if (forceCurrentLanguage != null)
            {
                return TM.Tr(textId, defaultText, forceCurrentLanguage);
            }
            else
            {
                return TM.Tr(textId, defaultText);
            }
        }

        [OneTimeTearDown]
        public void ClearDicts()
        {
            loader.ClearAllTranslations();
        }
    }
}


text:
class Zendesk2::GetTicketAudit
  include Zendesk2::Request

  request_method :get
  request_path { |r| "/tickets/#{r.ticket_id}/audits/#{r.audit_id}.json" }

  def audit_id
    params.fetch('id')
  end

  def ticket_id
    params.fetch('ticket_id')
  end

  def mock(_params = {})
    mock_response('ticket_audit' => find!(:ticket_audits, audit_id))
  end
end


text:
<?php

require_once 'vendor/autoload.php';

use NyanCat\Cat;
use NyanCat\Rainbow;
use NyanCat\Team;
use NyanCat\Scoreboard;

use Fab\Factory as FabFactory;

$scoreboard = new Scoreboard(
    new Cat(),
    new Rainbow(
        FabFactory::getFab(
            empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM']
        )
    ),
    array(
        new Team('pass', 'green', '^'),
        new Team('fail', 'red', 'o'),
        new Team('pending', 'cyan', '-'),
    )
);

$scoreboard->start();
for($i = 0; $i < 100; $i++) {
    usleep(90000);
    $scoreboard->score('pass');
}
$scoreboard->stop();


text:
package org.sleuthkit.autopsy.centralrepository.datamodel;

/**
 * This class abstracts a persona.
 *
 * An examiner may create a persona from an account.
 *
 */
class Persona {

    /**
     * Defines level of confidence in assigning a persona to an account.
     */
    public enum Confidence {
        UNKNOWN(1, "Unknown"),
        LOW(2, "Low confidence"),
        MEDIUM(3, "Medium confidence"),
        HIGH(4, "High confidence"),
        DERIVED(5, "Derived directly");

        private final String name;
        private final int level_id;

        Confidence(int level, String name) {
            this.name = name;
            this.level_id = level;

        }

        @Override
        public String toString() {
            return name;
        }

        public int getLevel() {
            return this.level_id;
        }
    }

    /**
     * Defines status of a persona.
     */
    public enum PersonaStatus {

        UNKNOWN(1, "Unknown"),
        ACTIVE(2, "Active"),
        MERGED(3, "Merged"),
        SPLIT(4, "Split"),
        DELETED(5, "Deleted");

        private final String description;
        private final int status_id;

        PersonaStatus(int status, String description) {
            this.status_id = status;
            this.description = description;
        }

        @Override
        public String toString() {
            return description;
        }

        public int getStatus() {
            return this.status_id;
        }
    }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.applicationinsights.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner;

/** An instance of this class provides access to all the operations defined in LiveTokensClient. */
public interface LiveTokensClient {
    /**
     * **Gets an access token for live metrics stream data.**.
     *
     * @param resourceUri The identifier of the resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response to a live token query.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LiveTokenResponseInner get(String resourceUri);

    /**
     * **Gets an access token for live metrics stream data.**.
     *
     * @param resourceUri The identifier of the resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response to a live token query along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<LiveTokenResponseInner> getWithResponse(String resourceUri, Context context);
}


text:
class axis_CoEqSt : public axis
{
public :
	axis_CoEqSt(const double &l0_, const double &L_, const int &N_);
	axis_CoEqSt(const axis_CoEqSt &that);
	~axis_CoEqSt();
	axis * clone () const;

	double val_at(const int &index) const;
	int index_at(const double &val) const;
	double k_val_at(const int &index) const;
	int k_index_at(const double &val) const;

	void resize(const int &N_);

	double S(const double &x) const;
	double dS(const int &index) const;

	// ToDo : remove
	//virtual double operator() (const int &i) const;
	//virtual int operator() (const double &x) const;
	//virtual int operator() (const double &x, double &lambda) const;
};

#endif


text:
@interface Utility : NSObject
+(bool)checkMatch:(NSString *)title
         alttitle:(NSString *)atitle
            regex:(OGRegularExpression *)regex
           option:(int)i;
+(NSString *)desensitizeSeason:(NSString *)title;
+(NSString *)seasonInWords:(int)season;
+(BOOL)checkoldAPI;
+(void)showsheetmessage:(NSString *)message
           explaination:(NSString *)explaination
                 window:(NSWindow *)w;
+(NSString *)urlEncodeString:(NSString *)string;
+(void)donateCheck:(MAL_Updater_OS_XAppDelegate*)delegate;
+(void)showDonateReminder:(MAL_Updater_OS_XAppDelegate*)delegate;
+(void)setReminderDate;
+(int)checkDonationKey:(NSString *)key name:(NSString *)name;
@end


text:
.class public Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;
.super Landroid/os/CustomFrequencyManager$FrequencyRequest;
.source "CustomFrequencyManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/os/CustomFrequencyManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "SchedTunePolicyRequest"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;
    }
.end annotation

# instance fields
.field mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

.field final synthetic this$0:Landroid/os/CustomFrequencyManager;

# direct methods
.method constructor <init>(Landroid/os/CustomFrequencyManager;IIJLjava/lang/String;)V
    .locals 0

    iput-object p1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->this$0:Landroid/os/CustomFrequencyManager;

    invoke-direct/range {p0 .. p6}, Landroid/os/CustomFrequencyManager$FrequencyRequest;-><init>(Landroid/os/CustomFrequencyManager;IIJLjava/lang/String;)V

    return-void
.end method

# virtual methods
.method public cancelFrequencyRequestImpl()V
    .locals 5

    iget-object v2, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mToken:Landroid/os/IBinder;

    monitor-enter v2

    :try_start_0
    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    if-eqz v1, :cond_0

    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    const/4 v3, 0x1

    iput-boolean v3, v1, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;->stop:Z

    :cond_0
    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->this$0:Landroid/os/CustomFrequencyManager;

    iget-object v1, v1, Landroid/os/CustomFrequencyManager;->mService:Landroid/os/ICustomFrequencyManager;

    iget-object v3, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mToken:Landroid/os/IBinder;

    iget-object v4, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mPkgName:Ljava/lang/String;

    invoke-interface {v1, v3, v4}, Landroid/os/ICustomFrequencyManager;->disableSchedTunePolicy(Landroid/os/IBinder;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :goto_0
    monitor-exit v2

    return-void

    :catch_0
    move-exception v0

    :try_start_1
    invoke-static {v0}, Landroid/os/CustomFrequencyManager;->-wrap2(Ljava/lang/Exception;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v2

    throw v1
.end method

.method public doFrequencyRequestImpl()V
    .locals 8

    const-string/jumbo v1, "CustomFrequencyManager"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "SchedTunePolicyRequest : doFrequencyRequest::  = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget v3, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mFrequency:I

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, " Timeout : "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-wide v4, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mTimeoutMs:J

    invoke-virtual {v2, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/os/CustomFrequencyManager;->-wrap1(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v2, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mToken:Landroid/os/IBinder;

    monitor-enter v2

    :try_start_0
    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->this$0:Landroid/os/CustomFrequencyManager;

    iget-object v1, v1, Landroid/os/CustomFrequencyManager;->mService:Landroid/os/ICustomFrequencyManager;

    iget-object v3, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mToken:Landroid/os/IBinder;

    iget-object v4, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mPkgName:Ljava/lang/String;

    invoke-interface {v1, v3, v4}, Landroid/os/ICustomFrequencyManager;->enableSchedTunePolicy(Landroid/os/IBinder;Ljava/lang/String;)V

    iget-wide v4, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mTimeoutMs:J

    const-wide/16 v6, -0x1

    cmp-long v1, v4, v6

    if-eqz v1, :cond_1

    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    if-eqz v1, :cond_0

    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    const/4 v3, 0x1

    iput-boolean v3, v1, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;->stop:Z

    :cond_0
    new-instance v1, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    invoke-direct {v1, p0}, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;-><init>(Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;)V

    iput-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    iget-object v1, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->this$0:Landroid/os/CustomFrequencyManager;

    iget-object v1, v1, Landroid/os/CustomFrequencyManager;->mHandler:Landroid/os/Handler;

    iget-object v3, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mSchedTunePolicyReleaser:Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest$SchedTunePolicyReleaser;

    iget-wide v4, p0, Landroid/os/CustomFrequencyManager$SchedTunePolicyRequest;->mTimeoutMs:J

    invoke-virtual {v1, v3, v4, v5}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_1
    :goto_0
    monitor-exit v2

    return-void

    :catch_0
    move-exception v0

    :try_start_1
    invoke-static {v0}, Landroid/os/CustomFrequencyManager;->-wrap2(Ljava/lang/Exception;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v2

    throw v1
.end method


text:
System.register(["aurelia-binding", "./observation-adapter"], function (_export) {
  "use strict";

  var ObjectObservationAdapter, ComputedObservationAdapter;
  _export("install", install);

  _export("declarePropertyDependencies", declarePropertyDependencies);

  function install(aurelia) {
    aurelia.withInstance(ObjectObservationAdapter, new ComputedObservationAdapter(aurelia.container));
  }

  function declarePropertyDependencies(ctor, propertyName, dependencies) {
    var descriptor = Object.getOwnPropertyDescriptor(ctor.prototype, propertyName);
    if (descriptor.set) throw new Error("The computed cannot have a setter function.");
    descriptor.get.dependencies = dependencies;
  }
  return {
    setters: [function (_aureliaBinding) {
      ObjectObservationAdapter = _aureliaBinding.ObjectObservationAdapter;
    }, function (_observationAdapter) {
      ComputedObservationAdapter = _observationAdapter.ComputedObservationAdapter;
    }],
    execute: function () {}
  };
});


text:
<?php

  namespace Amber\System\Command;

  use \GetOptionKit\OptionCollection;
  use \GetOptionKit\OptionParser;
  use \GetOptionKit\OptionPrinter\ConsoleOptionPrinter;

  class Base {

    protected $received_options = array();
    protected $parser = null;
    protected $option_printer = null;
    protected $options = null;

    public function __construct($options) {
      $this->received_options = $options;
      $this->options = new OptionCollection();
      $this->option_printer = new ConsoleOptionPrinter();
      $this->setOptions();
      $this->parser = new OptionParser($this->options);
    }

    protected function setOptions() {

    }

    protected function defaultAction() {
      echo $this->option_printer->render($this->options);
    }

    public function execute() {
      $this->defaultAction();
    }

  }


text:
(function() {
  "use strict";

  describe("aboutModule", function() {
    describe("aboutCtrl", function() {
      var $scope;

      beforeEach(module("aboutModule"));
      beforeEach(inject(function($controller, $rootScope) {
        $scope = $rootScope.$new();
        $controller("aboutCtrl", {
          $scope: $scope
        });
      }));

      describe("$scope.resources", function() {
        it("is defined", function() {
          expect($scope.resources).toBeDefined();
        });

        it("is an array", function() {
          expect(Object.prototype.toString.call($scope.resources)).toEqual("[object Array]");
        });

        it("is not empty", function() {
          expect($scope.resources.length).toBeGreaterThan(0);
        });
      });
    });
  });
})();


text:
using System;
using System.Collections.Generic;
using System.Globalization;
#if !ASP_NET_CORE
using System.Web;
using System.Collections.Specialized;
using System.Web.SessionState;
#else
using Microsoft.Extensions.Primitives;
using HttpContextBase = Microsoft.AspNetCore.Http.HttpContext;
#endif
using NLog.Web.LayoutRenderers;
using NSubstitute;
using Xunit;

namespace NLog.Web.Tests.LayoutRenderers
{
    public class AspNetItemValueLayoutRendererTests : TestBase
    {
        [Fact]
        public void NullHttpContextRendersEmptyString()
        {
            var renderer = new AspNetItemValueLayoutRenderer();

            string result = renderer.Render(new LogEventInfo());

            Assert.Empty(result);
        }

        [Fact]
        public void NullVariableRendersEmptyString()
        {
            var httpContext = Substitute.For<HttpContextBase>();

            var renderer = new AspNetItemValueLayoutRenderer();
            renderer.Variable = null;
            renderer.HttpContextAccessor = new FakeHttpContextAccessor(httpContext);

            string result = renderer.Render(new LogEventInfo());

            Assert.Empty(result);
        }

        [Fact]
        public void VariableNotFoundRendersEmptyString()
        {
            var httpContext = Substitute.For<HttpContextBase>();

            var renderer = new AspNetItemValueLayoutRenderer();
            renderer.Variable = "key";
            renderer.HttpContextAccessor = new FakeHttpContextAccessor(httpContext);

            string result = renderer.Render(new LogEventInfo());

            Assert.Empty(result);
        }

        [Theory, MemberData(nameof(VariableFoundData))]
        public void CulturedVariableFoundRendersValue(object expectedValue)
        {
            var httpContext = Substitute.For<HttpContextBase>();
#if ASP_NET_CORE
			httpContext.Items = new Dictionary<object, object>();
			httpContext.Items.Add("key", expectedValue);
#else
            httpContext.Items["key"].Returns(expectedValue);
#endif
            var cultureInfo = new CultureInfo("nl-NL");
            var renderer = new AspNetItemValueLayoutRenderer();
            renderer.Variable = "key";
            renderer.Culture = cultureInfo;
            renderer.HttpContextAccessor = new FakeHttpContextAccessor(httpContext);

            string result = renderer.Render(new LogEventInfo());

            Assert.Equal(Convert.ToString(expectedValue, cultureInfo), result);
        }

        [Theory, MemberData(nameof(VariableFoundData))]
        public void VariableFoundRendersValue(object expectedValue)
        {
            var httpContext = Substitute.For<HttpContextBase>();
#if ASP_NET_CORE
            httpContext.Items = new Dictionary<object, object>();
            httpContext.Items.Add("key", expectedValue);
#else
            httpContext.Items["key"].Returns(expectedValue);
#endif

            var renderer = new AspNetItemValueLayoutRenderer();
            renderer.Variable = "key";
            renderer.HttpContextAccessor = new FakeHttpContextAccessor(httpContext);

            string result = renderer.Render(new LogEventInfo());

            Assert.Equal(Convert.ToString(expectedValue, CultureInfo.CurrentUICulture), result);
        }

        [Theory, MemberData(nameof(NestedPropertyData))]
        public void NestedPropertyRendersValue(string itemKey, string variable, object data, object expectedValue)
        {
            var httpContext = Substitute.For<HttpContextBase>();
            httpContext.Items[itemKey].Returns(data);

            var renderer = new AspNetItemValueLayoutRenderer();
            renderer.Variable = variable;
            renderer.EvaluateAsNestedProperties = true;
            renderer.HttpContextAccessor = new FakeHttpContextAccessor(httpContext);

            string result = renderer.Render(new LogEventInfo());

            Assert.Equal(Convert.ToString(expectedValue, CultureInfo.CurrentUICulture), result);
        }

        public static IEnumerable<object[]> VariableFoundData
        {
            get
            {
                yield return new object[] { "string" };
                yield return new object[] { 1 };
                yield return new object[] { 1.5 };
                yield return new object[] { DateTime.Now };
                yield return new object[] { Tuple.Create("a", 1) };
            }
        }

        public static IEnumerable<object[]> NestedPropertyData
        {
            get
            {
                yield return new object[] { "key", "key.Item1", Tuple.Create("value"), "value" };
                yield return new object[] { "key", "key.Item1.Item1", Tuple.Create(Tuple.Create(1)), 1 };
            }
        }
    }
}


text:
package de.tu_berlin.formic.gatling.protocol

import java.net.URL

import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
import de.tu_berlin.formic.common.ClientId
import de.tu_berlin.formic.gatling.FormicGatlingComponents
import io.gatling.core.CoreComponents
import io.gatling.core.config.GatlingConfiguration
import io.gatling.core.protocol.{Protocol, ProtocolKey}

/**
  * @author Ronny Bräunlich
  */
case class FormicGatlingProtocol(serverUrl: String, bufferSize: Int, logLevel: String) extends Protocol {

  val url = new URL(serverUrl)
  val config = ConfigFactory.parseString(s"""akka {\n  loglevel = $logLevel\n  http.client.idle-timeout = 10 minutes\n}\n\nformic {\n  server {\n    address = \"${url.getHost}\"\n    port = ${url.getPort}\n  }\n  client {\n    buffersize = $bufferSize\n  }\n}""")

}

object FormicGatlingProtocol {
  val FormicGatlingProtocolKey: ProtocolKey = new ProtocolKey {

    override def newComponents(system: ActorSystem, coreComponents: CoreComponents): (FormicGatlingProtocol) => FormicGatlingComponents= {
      formicGatlingProtocol => FormicGatlingComponents(formicGatlingProtocol)
    }

    override def defaultValue(configuration: GatlingConfiguration): FormicGatlingProtocol =
      throw new IllegalStateException("Can't provide a default value for FormicGatlingProtocol")

    override def protocolClass: Class[io.gatling.core.protocol.Protocol] = classOf[FormicGatlingProtocol].asInstanceOf[Class[io.gatling.core.protocol.Protocol]]

    override type Components = FormicGatlingComponents
    override type Protocol = FormicGatlingProtocol
  }
}


text:
#ifndef INTERFACE_MODULES_WRITE_MATRIX_H
#define INTERFACE_MODULES_WRITE_MATRIX_H

#include "Interface/Modules/DataIO/ui_WriteMatrix.h"
#include <Interface/Modules/Base/ModuleDialogGeneric.h>
#include <Interface/Modules/Base/RemembersFileDialogDirectory.h>
#include <Interface/Modules/DataIO/share.h>

namespace SCIRun {
namespace Gui {

class SCISHARE WriteMatrixDialog : public ModuleDialogGeneric,
  public Ui::WriteMatrix, public RemembersFileDialogDirectory
{
	Q_OBJECT

public:
  WriteMatrixDialog(const std::string& name,
    SCIRun::Dataflow::Networks::ModuleStateHandle state,
    QWidget* parent = nullptr);
protected:
  virtual void pullSpecial() override;

private Q_SLOTS:
  void pushFileNameToState();
  void saveFile();
};

}
}

#endif


text:
import os
from functools import wraps

from nose.plugins.skip import SkipTest

def _get_site():
    return os.environ.get('DJANGO_SITE')

def skip_unless(condition):
    """Test decorator to skip a test unless a condition is met.

    The condition can either be a callable or a straight value.

    """

    def decorator(test_fn):

        @wraps(test_fn)
        def decorated(*args, **kwargs):
            if not (condition() if callable(condition) else condition):
                raise SkipTest()
            return test_fn(*args, **kwargs)

        return decorated

    return decorator

ignite_skip = skip_unless(lambda: _get_site() != 'ignite')
ignite_only = skip_unless(lambda: _get_site() == 'ignite')


text:
$script:dscModuleName = 'DnsServerDsc'
$script:dscResourceFriendlyName = 'DnsRecordAScoped'
$script:dscResourceName = "$($script:dscResourceFriendlyName)"

try
{
    Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop'
}
catch [System.IO.FileNotFoundException]
{
    throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.'
}

$initializationParams = @{
    DSCModuleName = $script:dscModuleName
    DSCResourceName = $script:dscResourceName
    ResourceType = 'Class'
    TestType = 'Integration'
}
$script:testEnvironment = Initialize-TestEnvironment @initializationParams

# Using try/finally to always cleanup.
try
{
    #region Integration Tests
    $configurationFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1"
    . $configurationFile

    Describe "$($script:dscResourceName)_Integration" {
        BeforeAll {
            $resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test"
        }

        $configurationName = "$($script:dscResourceName)_CreateRecord_Config"

        Context ('When using configuration {0}' -f $configurationName) {
            It 'Should compile and apply the MOF without throwing' {
                {
                    $configurationParameters = @{
                        OutputPath        = $TestDrive
                        ConfigurationData = $ConfigurationData
                    }

                    & $configurationName @configurationParameters

                    $startDscConfigurationParameters = @{
                        Path         = $TestDrive
                        ComputerName = 'localhost'
                        Wait         = $true
                        Verbose      = $true
                        Force        = $true
                        ErrorAction  = 'Stop'
                    }

                    Start-DscConfiguration @startDscConfigurationParameters
                } | Should -Not -Throw
            }

            It 'Should be able to call Get-DscConfiguration without throwing' {
                {
                    $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
                } | Should -Not -Throw
            }

            It 'Should have set the resource and all the parameters should match' {
                $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
                    $_.ConfigurationName -eq $configurationName -and $_.ResourceId -eq $resourceId
                }

                $shouldBeData = $ConfigurationData.NonNodeData.$configurationName

                # Key properties
                $resourceCurrentState.ZoneName | Should -Be $shouldBeData.ZoneName
                $resourceCurrentState.ZoneScope | Should -Be $shouldBeData.ZoneScope
                $resourceCurrentState.Name | Should -Be $shouldBeData.Name
                $resourceCurrentState.IPv4Address | Should -Be $shouldBeData.IPv4Address

                # Optional properties were not specified, so we just need to ensure the value exists
                $resourceCurrentState.TimeToLive | Should -Not -Be $null

                # Defaulted properties
                $resourceCurrentState.DnsServer | Should -Be 'localhost'
                $resourceCurrentState.Ensure | Should -Be 'Present'
            }

            It 'Should return $true when Test-DscConfiguration is run' {
                Test-DscConfiguration -Verbose | Should -Be 'True'
            }
        }

        Wait-ForIdleLcm -Clear

        $configurationName = "$($script:dscResourceName)_ModifyRecord_Config"

        Context ('When using configuration {0}' -f $configurationName) {
            It 'Should compile and apply the MOF without throwing' {
                {
                    $configurationParameters = @{
                        OutputPath        = $TestDrive
                        ConfigurationData = $ConfigurationData
                    }

                    & $configurationName @configurationParameters

                    $startDscConfigurationParameters = @{
                        Path         = $TestDrive
                        ComputerName = 'localhost'
                        Wait         = $true
                        Verbose      = $true
                        Force        = $true
                        ErrorAction  = 'Stop'
                    }

                    Start-DscConfiguration @startDscConfigurationParameters
                } | Should -Not -Throw
            }

            It 'Should be able to call Get-DscConfiguration without throwing' {
                {
                    $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
                } | Should -Not -Throw
            }

            It 'Should have set the resource and all the parameters should match' {
                $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
                    $_.ConfigurationName -eq $configurationName -and $_.ResourceId -eq $resourceId
                }

                $shouldBeData = $ConfigurationData.NonNodeData.$configurationName

                # Key properties
                $resourceCurrentState.ZoneName | Should -Be $shouldBeData.ZoneName
                $resourceCurrentState.ZoneScope | Should -Be $shouldBeData.ZoneScope
                $resourceCurrentState.Name | Should -Be $shouldBeData.Name
                $resourceCurrentState.IPv4Address | Should -Be $shouldBeData.IPv4Address

                # Optional properties
                $resourceCurrentState.TimeToLive | Should -Be $shouldBeData.TimeToLive

                # Defaulted properties
                $resourceCurrentState.DnsServer | Should -Be $shouldBeData.DnsServer
                $resourceCurrentState.Ensure | Should -Be $shouldBeData.Ensure
            }

            It 'Should return $true when Test-DscConfiguration is run' {
                Test-DscConfiguration -Verbose | Should -Be 'True'
            }
        }

        Wait-ForIdleLcm -Clear

        $configurationName = "$($script:dscResourceName)_DeleteRecord_Config"

        Context ('When using configuration {0}' -f $configurationName) {
            It 'Should compile and apply the MOF without throwing' {
                {
                    $configurationParameters = @{
                        OutputPath        = $TestDrive
                        ConfigurationData = $ConfigurationData
                    }

                    & $configurationName @configurationParameters

                    $startDscConfigurationParameters = @{
                        Path         = $TestDrive
                        ComputerName = 'localhost'
                        Wait         = $true
                        Verbose      = $true
                        Force        = $true
                        ErrorAction  = 'Stop'
                    }

                    Start-DscConfiguration @startDscConfigurationParameters
                } | Should -Not -Throw
            }

            It 'Should be able to call Get-DscConfiguration without throwing' {
                {
                    $script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
                } | Should -Not -Throw
            }

            It 'Should have set the resource and all the parameters should match' {
                $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
                    $_.ConfigurationName -eq $configurationName -and $_.ResourceId -eq $resourceId
                }

                $shouldBeData = $ConfigurationData.NonNodeData.$configurationName

                # Key properties
                $resourceCurrentState.ZoneName | Should -Be $shouldBeData.ZoneName
                $resourceCurrentState.ZoneScope | Should -Be $shouldBeData.ZoneScope
                $resourceCurrentState.Name | Should -Be $shouldBeData.Name
                $resourceCurrentState.IPv4Address | Should -Be $shouldBeData.IPv4Address

                # Optional properties
                if ($shouldBeData.TimeToLive)
                {
                    $resourceCurrentState.TimeToLive | Should -Be $shouldBeData.TimeToLive
                }

                # DnsServer is not specified in this test, so it defaults to 'localhost'
                $resourceCurrentState.DnsServer | Should -Be 'localhost'

                # Ensure will be Absent
                $resourceCurrentState.Ensure | Should -Be 'Absent'
            }

            It 'Should return $true when Test-DscConfiguration is run' {
                Test-DscConfiguration -Verbose | Should -Be 'True'
            }
        }

        Wait-ForIdleLcm -Clear

    }
    #endregion
}
finally
{
    Restore-TestEnvironment -TestEnvironment $script:testEnvironment
}


text:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html

module Stratosphere.Resources.CloudWatchDashboard where

import Stratosphere.ResourceImports

-- | Full data type definition for CloudWatchDashboard. See
-- 'cloudWatchDashboard' for a more convenient constructor.
data CloudWatchDashboard =
  CloudWatchDashboard
  { _cloudWatchDashboardDashboardBody :: Val Text
  , _cloudWatchDashboardDashboardName :: Maybe (Val Text)
  } deriving (Show, Eq)

instance ToResourceProperties CloudWatchDashboard where
  toResourceProperties CloudWatchDashboard{..} =
    ResourceProperties
    { resourcePropertiesType = "AWS::CloudWatch::Dashboard"
    , resourcePropertiesProperties =
        hashMapFromList $ catMaybes
        [ (Just . ("DashboardBody",) . toJSON) _cloudWatchDashboardDashboardBody
        , fmap (("DashboardName",) . toJSON) _cloudWatchDashboardDashboardName
        ]
    }

-- | Constructor for 'CloudWatchDashboard' containing required fields as
-- arguments.
cloudWatchDashboard
  :: Val Text -- ^ 'cwdDashboardBody'
  -> CloudWatchDashboard
cloudWatchDashboard dashboardBodyarg =
  CloudWatchDashboard
  { _cloudWatchDashboardDashboardBody = dashboardBodyarg
  , _cloudWatchDashboardDashboardName = Nothing
  }

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html#cfn-cloudwatch-dashboard-dashboardbody
cwdDashboardBody :: Lens' CloudWatchDashboard (Val Text)
cwdDashboardBody = lens _cloudWatchDashboardDashboardBody (\s a -> s { _cloudWatchDashboardDashboardBody = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html#cfn-cloudwatch-dashboard-dashboardname
cwdDashboardName :: Lens' CloudWatchDashboard (Maybe (Val Text))
cwdDashboardName = lens _cloudWatchDashboardDashboardName (\s a -> s { _cloudWatchDashboardDashboardName = a })


text:
<?php
/**
 * Legacy URL German language file
 *
 * (C) iionly 2012-2014
 * Dual licensed under the MIT or GPL Version 2 licenses
 *
 * https://github.com/iionly
 * Contact: iionly@gmx.de
 */

$german = array(
	'legacy_urls:message' => 'Diese Seite ist nun unter %s verfügbar. Bitte aktualisiere Dein Lesezeichen oder melde dem Seitenadminitrator den Link, der Dich hierher geleitet hat.',

	'legacy_urls:instructions' => 'Lege fest, wie Legacy-URLs (URLs voriger Elgg-Versionen, die sich in Elgg 1.9 geändert haben) behandelt werden sollen',
	'legacy_urls:immediate' => 'Leite sofort zur neuen URL weiter',
	'legacy_urls:immediate_error' => 'Leite sofort zur neuen URL weiter und gib eine Fehlermeldung aus',
	'legacy_urls:landing' => 'Zeige eine Seite mit einer Fehlermeldung und einem Link zur neuen URL an'
);

add_translation('de', $german);


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Marionette Components</title>
</head>
<body>
  Marionette Object Test
  <script src='../build/object.js'></script>
</body>
</html>


text:
@implementation PKAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    PKDemoListViewController* demoListViewController = [[PKDemoListViewController alloc] initWithStyle:UITableViewStyleGrouped];
    UINavigationController* navigationController = [[UINavigationController alloc] initWithRootViewController:demoListViewController];

    self.window.rootViewController = navigationController;

    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{

}

- (void)applicationDidEnterBackground:(UIApplication *)application
{

}

- (void)applicationWillEnterForeground:(UIApplication *)application
{

}

- (void)applicationDidBecomeActive:(UIApplication *)application
{

}

- (void)applicationWillTerminate:(UIApplication *)application
{

}

@end


text:
package org.hyperic.sigar.jmx;

/*
 * yeah, yeah, we could generate this class via xdoclet,
 * whoopdi-friggin-do... by hand is much less pain.
 */

public interface SigarProcessMBean {

    public Long getMemSize();

    /**
     * @deprecated
     * @see getMemSize
     */
    public Long getMemVsize();

    public Long getMemResident();

    public Long getMemShare();

    public Long getMemPageFaults();

    public Long getTimeUser();

    public Long getTimeSys();

    public Double getCpuUsage();

    public Long getOpenFd();

    public Double getBytesReadWriteTotal();
}