text:
classdef NuttallStrandMT

    properties (SetAccess = protected)
        % reflection coefficients
        Kb;
        Kf;

        % forward error covariance
        Rf;

        % filter order
        order;

        % number of channels
        nchannels;

        % number of trials
        ntrials;

        % name
        name;

        % number of samples
        nsamples;
    end

    methods

        function obj = NuttallStrandMT(channels, order, ntrials, varargin)
            %NuttallStrandMT constructor for NuttallStrandMT
            %   NuttallStrandMT(channels, order, ...) creates a NuttallStrandMT object
            %
            %   channels (integer)
            %       number of channels
            %   order (integer)
            %       filter order
            %   ntrials (integer)
            %       number of trials
            %
            %   Parameters
            %   ----------
            %   nsamples (integer)
            %       number of samples to use in batch update

            p = inputParser();
            addRequired(p,'channels', @(x) isnumeric(x) && isscalar(x));
            addRequired(p,'order', @(x) isnumeric(x) && isscalar(x));
            addRequired(p,'ntrials', @(x) isnumeric(x) && isscalar(x));
            addParameter(p,'nsamples',[],@(x) isnumeric(x) && isscalar(x));
            p.parse(channels,order,ntrials,varargin{:});

            obj.order = order;
            obj.nchannels = channels;
            obj.ntrials = ntrials;
            obj.nsamples = p.Results.nsamples;

            zeroMat = zeros(obj.order, obj.nchannels, obj.nchannels);
            obj.Kb = zeroMat;
            obj.Kf = zeroMat;
            obj.Rf = zeros(obj.order+1, obj.nchannels, obj.nchannels);

            if isempty(obj.nsamples)
                obj.name = sprintf('NuttallStrandMT T%d C%d P%d',...
                    ntrials, channels, order);
            else
                obj.name = sprintf('NuttallStrandMT T%d C%d P%d N%d',...
                    ntrials, channels, order, obj.nsamples);
            end
        end

        function obj = normalize(obj, nsamples)
            % do nothing
        end

        function obj = update_batch(obj, x, varargin)
            %UPDATE_BATCH updates reflection coefficients
            %   UPDATE_BATCH(OBJ,X) updates the reflection coefficients
            %   using the measurement X
            %
            %   Input
            %   -----
            %   x (matrix)
            %       new batch of measurements, the vector has
            %       the size [channels trials samples]
            %
            %   Parameters
            %   ----------
            %   verbosity (integer, default = 0)
            %       vebosity level, options: 0 1 2 3

            inputs = inputParser();
            params_verbosity = [0 1 2 3];
            addParameter(inputs,'verbosity',0,@(x) any(find(params_verbosity == x)));
            parse(inputs,varargin{:});

            dims = size(x);
            if ~isequal(dims(1:2), [obj.nchannels obj.ntrials])
                error([mfilename ':update_batch'],...
                    'samples do not match filter size:\n  channels: %d\n  trials: %d',...
                    obj.nchannels, obj.ntrials);
            end

            if ~isempty(obj.nsamples)
                % select a smaller subset of samples
                x = x(:,:,1:obj.nsamples);
            end

            % compute parcor coefficients using Nuttall Strand method
            [rcf,rcb,rc_error] = nuttall_strand_rc(permute(x,[3,1,2]),obj.order);

            % save the rc coefficient, drop the first one
            obj.Kf = rcarrayformat(reshape(rcf,[obj.nchannels obj.nchannels obj.order]),'format',1);
            obj.Kb = rcarrayformat(reshape(rcb,[obj.nchannels obj.nchannels obj.order]),'format',1);
            obj.Rf = rcarrayformat(reshape(rc_error,[obj.nchannels obj.nchannels obj.order+1]),'format',1);
%             % take transpose for each order
%             obj.Kf = permute(obj.Kf,[1 3 2]);
%             obj.Kb = permute(obj.Kb,[1 3 2]);
%             obj.Rf = permute(obj.Rf,[1 3 2]);
        end
    end
end


text:
require 'rails_helper'

RSpec.describe SuperAdmins::Admin::SuperAdminsController, type: :controller do
  let(:super_admin) { create(:super_admin) }

  subject { super_admin }

  before { sign_in subject.user }

  describe 'GET #show' do
    before { get :show, params: { id: subject } }

    it 'returns http success' do
      expect(response).to be_successful
    end

    it 'assigns @super_admin' do
      expect(assigns(:super_admin)).to eq(subject)
    end
  end

  describe 'GET #edit' do
    before { get :edit, params: { id: subject } }

    it 'returns http success' do
      expect(response).to be_successful
    end

    it 'assigns @super_admin' do
      expect(assigns(:super_admin)).to eq(subject)
    end

    it 'renders the edit template' do
      expect(response).to render_template(:edit)
    end
  end

  describe 'GET #change_password' do
    before { get :change_password, params: { id: subject } }

    it 'returns http success' do
      expect(response).to be_successful
    end

    it 'assigns @super_admin' do
      expect(assigns(:super_admin)).to eq(subject)
    end

    it 'renders the change password template' do
      expect(response).to render_template(:change_password)
    end
  end

  describe 'PUT #update_password' do
    before do
      subject.user.update(password: 'password', password_confirmation: 'password')
      sign_in subject.user # need to sign in again after password change
    end

    context 'when valid' do
      before { put :update_password, params: { id: subject, super_admin: { user_attributes: { current_password: 'password', password: 'password123', password_confirmation: 'password123' } } } }

      it 'redirects to super admin show action' do
        expect(response).to redirect_to(super_admins_admin_super_admin_path(subject))
      end
    end

    context 'when mandatory params for super admin are not provided' do
      it 'raises a paramenter missing error' do
        expect {
          put :update_password, params: { id: subject, super_admin: {} }
        }.to raise_error(ActionController::ParameterMissing)
      end
    end

    context 'when invalid' do
      it 'renders the change password template' do
        put :update_password, params: { id: subject, super_admin: { user_attributes: { foo: 'bar' } } }
        expect(response).to render_template(:change_password)
      end
    end
  end

  describe 'PUT #update' do
    before do
      put :update, params: { id: subject, super_admin: { user_attributes: { first_name: 'Joshua', last_name: 'Dude', password: 'password', email: 'superadmin@bigblackhhole.com' } } }
    end

    context 'when valid' do
      it 'updates a super admin' do
        subject.reload
        expect(subject.reload.user.first_name).to eq('Joshua')
      end

      it 'redirects to super admin show page' do
        expect(response).to redirect_to(super_admins_admin_super_admin_path(subject))
      end
    end

    context 'when invalid' do
      before do
        put :update, params: { id: subject, super_admin: { user_attributes: { first_name: '' } } }
      end

      it 'does not update super admin' do
        subject.reload
        expect(subject.user.first_name).to eq('Joshua')
      end

      it 'renders the edit template' do
        expect(response).to render_template(:edit)
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
/**
 * @file webpack 配置
 * @author mengke01(kekee000@gmail.com)
 */

const fs = require('fs');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const DEMO_DIR = path.resolve(__dirname, '../demo');

function getEntries() {
    let files = fs.readdirSync(DEMO_DIR + '/js');
    let entries = {};
    for (let file of files) {
        if (file.endsWith('.js')) {
            let entryScript = file.replace('.js', '');
            entries[entryScript] = './demo/js/' + file;
        }
    }
    return entries;
}

function getHtmlPages() {
    let files = fs.readdirSync(DEMO_DIR);
    let pages = [];
    for (let file of files) {
        if (file.endsWith('.html')) {
            let entryScript = file.replace('.html', '');
            pages.push(
                new HtmlWebpackPlugin({
                    title: file,
                    filename: 'demo/' + file,
                    template: path.resolve(DEMO_DIR, file),
                    chunks: [entryScript]
                })
            );
        }
    }
    return pages;
}

module.exports = {
    entry: getEntries(),
    output: {
        path: path.resolve(__dirname, '../dist'),
        filename: 'js/[name].js'
    },
    devtool: 'inline-source-map',
    devServer: {
        contentBase: './'
    },
    resolve: {
        extensions: ['.js', '.jsx', '.json'],
        alias: {
            'css': path.resolve(__dirname, '../css'),
            'common': path.resolve(__dirname, '../src/common'),
            'graphics': path.resolve(__dirname, '../src/graphics'),
            'math': path.resolve(__dirname, '../src/math'),
            'editor': path.resolve(__dirname, '../src/editor'),
            'render': path.resolve(__dirname, '../src/render'),
            'fonteditor-core': path.resolve(__dirname, '../node_modules/fonteditor-core/src'),
            'JSZip$': path.resolve(__dirname, '../dep/jszip/jszip.min.js'),
            'inflate$': path.resolve(__dirname, '../dep/pako_inflate.min.js'),
            'deflate$': path.resolve(__dirname, '../dep/pako_deflate.min.js'),
            'paper$': path.resolve(__dirname, '../dep/paper-full.js'),
            'utpl$': path.resolve(__dirname, '../dep/utpl.min.js')
        }
    },
    externals: {
        jquery: 'window.jQuery',
        $: 'window.jQuery'
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: 'index page',
            filename: 'index.html',
            template: path.resolve(DEMO_DIR, 'index.html'),
            chunks: ['index']
        }),
        ...getHtmlPages()
    ],
    module: {
        rules: [
            {
                test: /\/(index|empty|editor)\.tpl$/,
                loader: 'index-loader'
            },
            {
                test: /template\/(.+?)\.tpl$/,
                loader: 'tpl-loader'
            },
            {
                test: /\.lesstpl$/,
                use: [
                    'css-loader',
                    'less-loader'
                ]
            },
            {
                test: /\.less$/,
                use: ['style-loader', 'css-loader', 'less-loader']
            },
            {
                test: /\.(png|svg|jpg|gif)$/,
                use: [
                    {
                        loader: 'url-loader',
                        options: {
                            limit: 1000
                        }
                    }
                ]
            },
            {
                test: /\.(woff|woff2|eot|ttf|otf|wasm)$/,
                use: [
                    {
                        loader: 'url-loader',
                        options: {
                            limit: 1000
                        }
                    }
                ]
            }
        ]
    },
    resolveLoader: {
        modules: [path.resolve(__dirname, '../build'), 'node_modules']
    }
};


text:
This package extends log4j by adding extra logging attributes useful in
distributed application server environments.  Specifically, it adds
the following text information to each logging event.

host (h) - the machine from which the message was logged

server (s) - the server process from which the message was logged

component (b) - the component from which the message was logged

version (v) - a version string for the code from which the
   message was logged

Configuration

Using this package in your programs differs little from using
{@link org.apache.log4j.Category}.  In this initial version,
only property file initialization is supported.

Automatic Configuration

The following properties serve to configure the {@link
org.apache.log4j.examples.appserver.AppServerCategoryFactory}.

PropertyDescription

log4j.categoryFactory
	The {@link org.apache.log4j.spi.CategoryFactory}
	implementation to use.

log4j.factory.server
	The value assigned to the server attribute.

log4j.factory.component
	The value assigned to the component attribute.

log4j.factory.version
	The value assigned to the version attribute.

log4j.factory.messageBundle
	The name of bundle file to populate the message
	ResourceBundle.  Because the
	ResourceBundle.getBundle method is used to load
	the message file, the ".properties" extension
	should not be included as part of this property.

A sample configuration might look like this.

log4j.categoryFactory=org.apache.log4j.examples.appserver.AppServerCategoryFactory
log4j.factory.server=TestServer
log4j.factory.component=TestComponent
log4j.factory.version=SomeVersion
log4j.factory.messageBundle=app_messages

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.examples.appserver.AppServerPatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%h:%s:%b:%v] %m%n

The only change needed to your source file is to invoke the {@link
org.apache.log4j.examples.appserver.AppServerCategory#getInstance(String)}
instead of the usual {@link org.apache.log4j.Category#getInstance(String)}
to acquire an implementation of Category.

Manual Configuration

You can manually invoke the configuration much like the static
initializer would have.

import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.examples.appserver.AppServerCategory;
...
PropertyConfigurator.configure("test.properties");
Category cat = AppServerCategory.getInstance("some.cat");
...
cat.info("This is an INFO statement.");

Very Manual Configuration

If you want complete control over the configuration process, you
can leave PropertyConfigurator out of it all
together.  This could be useful if you want only some of your
categories to be AppServerCategory instances.

Simply create an AppServerCategoryFactory instance.
The constructor automatically installs the new instance as the
default factory for future calls to {@link
org.apache.log4j.examples.appserver.AppServerCategory#getInstance(String)}.

import org.apache.log4j.Category;
import org.apache.log4j.examples.appserver.AppServerCategoryFactory;
import org.apache.log4j.examples.appserver.AppServerCategory;
...
org.apache.log4j.BasicConfigurator.configure();
new AppServerCategoryFactory("MyServer", null, null);
...
Category cat = AppServerCategory.getInstance("my.category");
cat.info("Entry");

A Note on Configurators

Using the very manual approach to configure
AppServerCategory with
PropertyConfigurator or DOMConfigurator
requires a note of caution.  Since the very manual method
does not provide the log4j.categoryFactory property,
these configurators do not know that Category has
been subclassed.  Upon
constructing a configuration from a set of properties, it will
construct Category instances rather than instances
of the desired subclass.  One way to around this is decribed
below.

By instanciating any anticipated AppServerCategory
instances before calling a configurator, the configurator will
use the instances you create rather than trying to (incorrectly)
create its own.  The consequence is that you can
not always predict which categories will be created.  Their
dynamic nature is the reason for externalizing their configuration
in the first place.  This drawback is limited to category names
explicitly defined in the configuration.

Remote Usage

Including attributes such as hostname and server are only relevant
if the logging entries somehow end up on other hosts or mixed with
those of other servers.  Remote logging in a distributed application
environment allows the logging of various remote components to be
collected together in a single location.  The basic building blocks
for remote usage are the SimpleSocketServer used in
conjunction with the SocketAppender.

The configuration of SimpleSocketServer receiving
serialized AppServerLoggingEvent classes is much the
same as with the standard LoggingEvent class.  The main
difference to keep in mind is that the layout implementation should be
org.apache.log4j.examples.appserver.AppServerPatternLayout.
This will allow for the interpretation of %h, %s, %b and %v symbols.

Try It Yourself

This package may be used as a template for
specifying your own collection of attributes or extended to include
additional attributes.  A
log4j extension manual
accompanies this distribution that will take you step by step through the
extension process.


text:
'Copyright 2019 Esri

'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.
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.Controls
Imports ESRI.ArcGIS.SystemUI
Imports ESRI.ArcGIS.Display
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.Geoprocessor
Imports ESRI.ArcGIS.Geoprocessing
Imports ESRI.ArcGIS.DataManagementTools

Public Partial Class RunGPForm
	Inherits Form
  Private _gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = Nothing

	'''
	''' A Dictionary contains the layers loaded into the application. The Keys are named appropriately.
	'''
	Private _layersDict As New Dictionary(Of String, IFeatureLayer)()

	'''
	''' A List of FeatureLayer objects each of which represents result layers that are added to the Map.
	''' In this example only one Layer is added to the List.
	'''
	Private _resultsList As New List(Of IFeatureLayer)()

	'''
	''' A Queue of GPProcess objects each of which represents a geoprocessing tool to be executed asynchronously.
	'''
	Private _myGPToolsToExecute As New Queue(Of IGPProcess)()

	'''
	''' Initializes a new instance of the RunGPForm class which represents the ArcGIS Engine application.
	''' The constructor is used to perform setup: the ListViewControl is configured, a new Geoprocessor
	''' object is created, the output result directory is specified and event handlers created in order
	''' to listen to geoprocessing events. A helper method called SetupMap is called to create, add and
	''' symbolize the layers used by the application.
	'''
	Public Sub New()
		InitializeComponent()

		'Set up ListView control
		listView1.Columns.Add("Event", 200, HorizontalAlignment.Left)
		listView1.Columns.Add("Message", 1000, HorizontalAlignment.Left)
		'The image list component contains the icons used in the ListView control
		listView1.SmallImageList = imageList1

		'Create a Geoprocessor object and associated event handlers which will be fired during tool execution
    _gp = New ESRI.ArcGIS.Geoprocessor.Geoprocessor()
		'All results will be written to the users TEMP folder
		Dim outputDir As String = System.Environment.GetEnvironmentVariable("TEMP")
		_gp.SetEnvironmentValue("workspace", outputDir)
		_gp.OverwriteOutput = True
		AddHandler _gp.ToolExecuted, New EventHandler(Of ToolExecutedEventArgs)(AddressOf _gp_ToolExecuted)
		AddHandler _gp.ProgressChanged, New EventHandler(Of ESRI.ArcGIS.Geoprocessor.ProgressChangedEventArgs)(AddressOf _gp_ProgressChanged)
		AddHandler _gp.MessagesCreated, New EventHandler(Of MessagesCreatedEventArgs)(AddressOf _gp_MessagesCreated)
		AddHandler _gp.ToolExecuting, New EventHandler(Of ToolExecutingEventArgs)(AddressOf _gp_ToolExecuting)

		'Add layers to the map, select a city, zoom in on it
		SetupMap()
	End Sub

	'''
	''' Handles the click event of the Button and runs the geoprocessing tasks asynchronously.
	'''
  Private Sub btnRunGP_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRunGP.Click
    Try
      '#Region "tidy up any previous gp runs"

      'Clear the ListView control
      listView1.Items.Clear()

      'Remove any result layers present in the map
      Dim mapLayers As IMapLayers = TryCast(axMapControl1.Map, IMapLayers)
      For Each resultLayer As IFeatureLayer In _resultsList
        mapLayers.DeleteLayer(resultLayer)
      Next

      axTOCControl1.Update()

      'Empty the results layer list
      _resultsList.Clear()

      'make sure that my GP tool queue is empty
      _myGPToolsToExecute.Clear()

      '#End Region

      'Buffer the selected cities by the specified distance
      Dim bufferTool As New ESRI.ArcGIS.AnalysisTools.Buffer()
      bufferTool.in_features = _layersDict("Cities")
      bufferTool.buffer_distance_or_field = txtBufferDistance.Text & " Miles"
      bufferTool.out_feature_class = "city_buffer.shp"

      'Clip the zip codes layer with the result of the buffer tool
      Dim clipTool As New ESRI.ArcGIS.AnalysisTools.Clip()
      clipTool.in_features = _layersDict("ZipCodes")
      clipTool.clip_features = bufferTool.out_feature_class
      clipTool.out_feature_class = "city_buffer_clip.shp"

      'To run multiple GP tools asynchronously, all tool inputs must exist before ExecuteAsync is called.
      'The output from the first buffer operation is used as an input to the second clip
      'operation. To deal with this restriction a Queue is created and all tools added to it. The first tool
      'is executed from this method, whereas the second is executed from the ToolExecuted event. This approach
      'is scalable - any additional geoprocessing tools added to this queue will also be executed in turn.
      _myGPToolsToExecute.Enqueue(bufferTool)
      _myGPToolsToExecute.Enqueue(clipTool)
      _gp.ExecuteAsync(_myGPToolsToExecute.Dequeue())
    Catch ex As Exception
      listView1.Items.Add(New ListViewItem(New String(1) {"N/A", ex.Message}, "error"))
    End Try
  End Sub

	'''
	''' Handles the ProgressChanged event.
	'''
	Private Sub _gp_ProgressChanged(sender As Object, e As ESRI.ArcGIS.Geoprocessor.ProgressChangedEventArgs)
		Dim gpResult As IGeoProcessorResult2 = DirectCast(e.GPResult, IGeoProcessorResult2)

		If e.ProgressChangedType = ProgressChangedType.Message Then
			listView1.Items.Add(New ListViewItem(New String(1) {"ProgressChanged", e.Message}, "information"))
		End If
	End Sub

	'''
	''' Handles the ToolExecuting event. All tools start by firing this event.
	'''
	Private Sub _gp_ToolExecuting(sender As Object, e As ToolExecutingEventArgs)
		Dim gpResult As IGeoProcessorResult2 = DirectCast(e.GPResult, IGeoProcessorResult2)
		listView1.Items.Add(New ListViewItem(New String(1) {"ToolExecuting", gpResult.Process.Tool.Name & " " & gpResult.Status.ToString()}, "information"))
	End Sub

	'''
	''' Handles the ToolExecuted event. All tools end by firing this event. If the tool executed successfully
	''' the next tool in the queue is removed and submitted for execution.  If unsuccessful, geoprocessing is terminated,
	''' an error message is written to the ListViewControl and the is queue cleared. After the final tool has executed
	''' the result layer is added to the Map.
	'''
	Private Sub _gp_ToolExecuted(sender As Object, e As ToolExecutedEventArgs)
		Dim gpResult As IGeoProcessorResult2 = DirectCast(e.GPResult, IGeoProcessorResult2)

		Try
			'The first GP tool has completed, if it was successful process the others
			If gpResult.Status = esriJobStatus.esriJobSucceeded Then
				listView1.Items.Add(New ListViewItem(New String(1) {"ToolExecuted", gpResult.Process.Tool.Name}, "success"))

				'Execute next tool in the queue
				If _myGPToolsToExecute.Count > 0 Then
					_gp.ExecuteAsync(_myGPToolsToExecute.Dequeue())
				Else
					'If last tool has executed add the output layer to the map
					Dim resultFClass As IFeatureClass = TryCast(_gp.Open(gpResult.ReturnValue), IFeatureClass)
					Dim resultLayer As IFeatureLayer = New FeatureLayerClass()
					resultLayer.FeatureClass = resultFClass
					resultLayer.Name = resultFClass.AliasName

					'Add the result to the map
					axMapControl1.AddLayer(DirectCast(resultLayer, ILayer), 2)
					axTOCControl1.Update()

					'add the result layer to the List of result layers
					_resultsList.Add(resultLayer)
				End If
			'If the GP process failed, do not try to process any more tools in the queue
			ElseIf gpResult.Status = esriJobStatus.esriJobFailed Then
				'The actual GP error message will be output by the MessagesCreated event handler
				listView1.Items.Add(New ListViewItem(New String(1) {"ToolExecuted", gpResult.Process.Tool.Name & " failed, any remaining processes will not be executed."}, "error"))
				'Empty the queue
				_myGPToolsToExecute.Clear()
			End If
		Catch ex As Exception
			listView1.Items.Add(New ListViewItem(New String(1) {"ToolExecuted", ex.Message}, "error"))
		End Try
	End Sub

	'''
	''' Handles the MessagesCreated event.
	'''
	Private Sub _gp_MessagesCreated(sender As Object, e As MessagesCreatedEventArgs)

		Dim gpMsgs As IGPMessages = e.GPMessages

		If gpMsgs.Count > 0 Then
			For count As Integer = 0 To gpMsgs.Count - 1
				Dim msg As IGPMessage = gpMsgs.GetMessage(count)
				Dim imageToShow As String = "information"

				Select Case msg.Type
					Case esriGPMessageType.esriGPMessageTypeAbort
            imageToShow = "warning"
						Exit Select
          Case esriGPMessageType.esriGPMessageTypeEmpty
            imageToShow = "information"
            Exit Select
					Case esriGPMessageType.esriGPMessageTypeError
						imageToShow = "error"
						Exit Select
					Case esriGPMessageType.esriGPMessageTypeGDBError
            imageToShow = "error"
						Exit Select
					Case esriGPMessageType.esriGPMessageTypeInformative
						imageToShow = "information"
						Exit Select
          Case esriGPMessageType.esriGPMessageTypeProcessDefinition
            imageToShow = "information"
            Exit Select
          Case esriGPMessageType.esriGPMessageTypeProcessStart
            imageToShow = "information"
            Exit Select
					Case esriGPMessageType.esriGPMessageTypeProcessStop
						imageToShow = "information"
						Exit Select
					Case esriGPMessageType.esriGPMessageTypeWarning
						imageToShow = "warning"
						Exit Select
					Case Else
						Exit Select
				End Select

				listView1.Items.Add(New ListViewItem(New String(1) {"MessagesCreated", msg.Description}, imageToShow))
			Next
		End If
	End Sub

	#Region "Helper methods for setting up map and layers and validating buffer distance input"

	'''
	''' Loads and symbolizes data used by the application.  Selects a city and zooms to it
	'''
	Private Sub SetupMap()
		Try
			'Relative path to the sample data from EXE location
			Dim dirPath As String = System.IO.Path.Combine (Environment.SpecialFolder.MyDocuments, "ArcGIS\data\USZipCodeData")

      'Create the cities layer
			Dim cities As IFeatureClass = TryCast(_gp.Open(dirPath & "\ZipCode_Boundaries_US_Major_Cities.shp"), IFeatureClass)
			Dim citiesLayer As IFeatureLayer = New FeatureLayerClass()
			citiesLayer.FeatureClass = cities
			citiesLayer.Name = "Major Cities"

      'Create the zip code boundaries layer
			Dim zipBndrys As IFeatureClass = TryCast(_gp.Open(dirPath & "\US_ZipCodes.shp"), IFeatureClass)
			Dim zipBndrysLayer As IFeatureLayer = New FeatureLayerClass()
			zipBndrysLayer.FeatureClass = zipBndrys
			zipBndrysLayer.Name = "Zip Code boundaries"

      'Create the highways layer
			dirPath = System.IO.Path.Combine (Environment.SpecialFolder.MyDocuments, "ArcGIS\data\USAMajorHighways")
			Dim highways As IFeatureClass = TryCast(_gp.Open(dirPath & "\usa_major_highways.shp"), IFeatureClass)
			Dim highwaysLayer As IFeatureLayer = New FeatureLayerClass()
			highwaysLayer.FeatureClass = highways
			highwaysLayer.Name = "Highways"

      '***** Important code *********
      'Add the layers to a dictionary. Layers can then easily be returned by their 'key'
      _layersDict.Add("ZipCodes", zipBndrysLayer)
      _layersDict.Add("Highways", highwaysLayer)
      _layersDict.Add("Cities", citiesLayer)

      'Symbolize and set additional properties for each layer
      'Setup and symbolize the cities layer
      citiesLayer.Selectable = True
      citiesLayer.ShowTips = True
      Dim markerSym As ISimpleMarkerSymbol = CreateSimpleMarkerSymbol(CreateRGBColor(0, 92, 230), esriSimpleMarkerStyle.esriSMSCircle)
      markerSym.Size = 9
      Dim simpleRend As ISimpleRenderer = New SimpleRendererClass()
      simpleRend.Symbol = DirectCast(markerSym, ISymbol)
      DirectCast(citiesLayer, IGeoFeatureLayer).Renderer = DirectCast(simpleRend, IFeatureRenderer)

      'Setup and symbolize the zip boundaries layer
      zipBndrysLayer.Selectable = False
      Dim fillSym As ISimpleFillSymbol = CreateSimpleFillSymbol(CreateRGBColor(0, 0, 0), esriSimpleFillStyle.esriSFSHollow, CreateRGBColor(204, 204, 204), esriSimpleLineStyle.esriSLSSolid, 0.5)
      Dim simpleRend2 As ISimpleRenderer = New SimpleRendererClass()
      simpleRend2.Symbol = DirectCast(fillSym, ISymbol)
      DirectCast(zipBndrysLayer, IGeoFeatureLayer).Renderer = DirectCast(simpleRend2, IFeatureRenderer)

      'Setup and symbolize the highways layer
      highwaysLayer.Selectable = False
      Dim lineSym As ISimpleLineSymbol = CreateSimpleLineSymbol(CreateRGBColor(250, 52, 17), 3.4, esriSimpleLineStyle.esriSLSSolid)
      Dim simpleRend3 As ISimpleRenderer = New SimpleRendererClass()
      simpleRend3.Symbol = DirectCast(lineSym, ISymbol)
      DirectCast(highwaysLayer, IGeoFeatureLayer).Renderer = DirectCast(simpleRend3, IFeatureRenderer)

			'Add the layers to the Map
			For Each layer As IFeatureLayer In _layersDict.Values
				axMapControl1.AddLayer(DirectCast(layer, ILayer))
			Next

      'Select and zoom in on Los Angeles city
			Dim qf As IQueryFilter = New QueryFilterClass()
			qf.WhereClause = "NAME='Los Angeles'"
			Dim citiesLayerSelection As IFeatureSelection = DirectCast(citiesLayer, IFeatureSelection)
			citiesLayerSelection.SelectFeatures(qf, esriSelectionResultEnum.esriSelectionResultNew, True)
			Dim laFeature As IFeature = cities.GetFeature(citiesLayerSelection.SelectionSet.IDs.[Next]())
			Dim env As IEnvelope = laFeature.Shape.Envelope
			env.Expand(0.5, 0.5, False)
			axMapControl1.Extent = env
			axMapControl1.Refresh()
			axTOCControl1.Update()

			'Enable GP analysis button
			btnRunGP.Enabled = True
		Catch ex As Exception
			MessageBox.Show("There was an error loading the data used by this sample: " & ex.Message)
		End Try
	End Sub

	#Region "Create Simple Fill Symbol"
	' ArcGIS Snippet Title:
	' Create Simple Fill Symbol
	'
	' Long Description:
	' Create a simple fill symbol by specifying a color, outline color and fill style.
	'
	' Add the following references to the project:
	' ESRI.ArcGIS.Display
	' ESRI.ArcGIS.System
	'
	' Intended ArcGIS Products for this snippet:
	' ArcGIS Desktop (Standard, Advanced, Basic)
	' ArcGIS Engine
	' ArcGIS Server
	'
	' Applicable ArcGIS Product Versions:
	' 9.2
	' 9.3
	' 9.3.1
	' 10.0
	'
	' Required ArcGIS Extensions:
	' (NONE)
	'
	' Notes:
	' This snippet is intended to be inserted at the base level of a Class.
	' It is not intended to be nested within an existing Method.
	'

	'''Create a simple fill symbol by specifying a color, outline color and fill style.
	'''
	'''<param name="fillColor">An IRGBColor interface. The color for the inside of the fill symbol.</param>
	'''<param name="fillStyle">An esriSimpleLineStyle enumeration for the inside fill symbol. Example: esriSFSSolid.</param>
	'''<param name="borderColor">An IRGBColor interface. The color for the outside line border of the fill symbol.</param>
	'''<param name="borderStyle">An esriSimpleLineStyle enumeration for the outside line border. Example: esriSLSSolid.</param>
	'''<param name="borderWidth">A System.Double that is the width of the outside line border in points. Example: 2</param>
	'''
	'''<returns>An ISimpleFillSymbol interface.</returns>
	'''
	'''<remarks></remarks>
	Public Function CreateSimpleFillSymbol(fillColor As ESRI.ArcGIS.Display.IRgbColor, fillStyle As ESRI.ArcGIS.Display.esriSimpleFillStyle, borderColor As ESRI.ArcGIS.Display.IRgbColor, borderStyle As ESRI.ArcGIS.Display.esriSimpleLineStyle, borderWidth As System.Double) As ESRI.ArcGIS.Display.ISimpleFillSymbol

		Dim simpleLineSymbol As ESRI.ArcGIS.Display.ISimpleLineSymbol = New ESRI.ArcGIS.Display.SimpleLineSymbolClass()
		simpleLineSymbol.Width = borderWidth
		simpleLineSymbol.Color = borderColor
		simpleLineSymbol.Style = borderStyle

		Dim simpleFillSymbol As ESRI.ArcGIS.Display.ISimpleFillSymbol = New ESRI.ArcGIS.Display.SimpleFillSymbolClass()
		simpleFillSymbol.Outline = simpleLineSymbol
		simpleFillSymbol.Style = fillStyle
		simpleFillSymbol.Color = fillColor

		Return simpleFillSymbol
	End Function
	#End Region

	#Region "Create Simple Line Symbol"
	' ArcGIS Snippet Title:
	' Create Simple Line Symbol
	'
	' Long Description:
	' Create a simple line symbol by specifying a color, width and line style.
	'
	' Add the following references to the project:
	' ESRI.ArcGIS.Display
	' ESRI.ArcGIS.System
	'
	' Intended ArcGIS Products for this snippet:
	' ArcGIS Desktop (Standard, Advanced, Basic)
	' ArcGIS Engine
	' ArcGIS Server
	'
	' Applicable ArcGIS Product Versions:
	' 9.2
	' 9.3
	' 9.3.1
	' 10.0
	'
	' Required ArcGIS Extensions:
	' (NONE)
	'
	' Notes:
	' This snippet is intended to be inserted at the base level of a Class.
	' It is not intended to be nested within an existing Method.
	'

	'''Create a simple line symbol by specifying a color, width and line style.
	'''
	'''<param name="rgbColor">An IRGBColor interface.</param>
	'''<param name="inWidth">A System.Double that is the width of the line symbol in points. Example: 2</param>
	'''<param name="inStyle">An esriSimpleLineStyle enumeration. Example: esriSLSSolid.</param>
	'''
	'''<returns>An ISimpleLineSymbol interface.</returns>
	'''
	'''<remarks></remarks>
	Public Function CreateSimpleLineSymbol(rgbColor As ESRI.ArcGIS.Display.IRgbColor, inWidth As System.Double, inStyle As ESRI.ArcGIS.Display.esriSimpleLineStyle) As ESRI.ArcGIS.Display.ISimpleLineSymbol
		If rgbColor Is Nothing Then
			Return Nothing
		End If

		Dim simpleLineSymbol As ESRI.ArcGIS.Display.ISimpleLineSymbol = New ESRI.ArcGIS.Display.SimpleLineSymbolClass()
		simpleLineSymbol.Style = inStyle
		simpleLineSymbol.Color = rgbColor
		simpleLineSymbol.Width = inWidth

		Return simpleLineSymbol
	End Function
	#End Region

	#Region "Create Simple Marker Symbol"
	' ArcGIS Snippet Title:
	' Create Simple Marker Symbol
	'
	' Long Description:
	' Create a simple marker symbol by specifying and input color and marker style.
	'
	' Add the following references to the project:
	' ESRI.ArcGIS.Display
	' ESRI.ArcGIS.System
	'
	' Intended ArcGIS Products for this snippet:
	' ArcGIS Desktop (Standard, Advanced, Basic)
	' ArcGIS Engine
	' ArcGIS Server
	'
	' Applicable ArcGIS Product Versions:
	' 9.2
	' 9.3
	' 9.3.1
	' 10.0
	'
	' Required ArcGIS Extensions:
	' (NONE)
	'
	' Notes:
	' This snippet is intended to be inserted at the base level of a Class.
	' It is not intended to be nested within an existing Method.
	'

	'''Create a simple marker symbol by specifying and input color and marker style.
	'''
	'''<param name="rgbColor">An IRGBColor interface.</param>
	'''<param name="inputStyle">An esriSimpleMarkerStyle enumeration. Example: esriSMSCircle.</param>
	'''
	'''<returns>An ISimpleMarkerSymbol interface.</returns>
	'''
	'''<remarks></remarks>
	Public Function CreateSimpleMarkerSymbol(rgbColor As ESRI.ArcGIS.Display.IRgbColor, inputStyle As ESRI.ArcGIS.Display.esriSimpleMarkerStyle) As ESRI.ArcGIS.Display.ISimpleMarkerSymbol

		Dim simpleMarkerSymbol As ESRI.ArcGIS.Display.ISimpleMarkerSymbol = New ESRI.ArcGIS.Display.SimpleMarkerSymbolClass()
		simpleMarkerSymbol.Color = rgbColor
		simpleMarkerSymbol.Style = inputStyle

		Return simpleMarkerSymbol
	End Function
	#End Region

	#Region "Create RGBColor"
	' ArcGIS Snippet Title:
	' Create RGBColor
	'
	' Long Description:
	' Generate an RgbColor by specifying the amount of Red, Green and Blue.
	'
	' Add the following references to the project:
	' ESRI.ArcGIS.Display
	' ESRI.ArcGIS.System
	'
	' Intended ArcGIS Products for this snippet:
	' ArcGIS Desktop (Standard, Advanced, Basic)
	' ArcGIS Engine
	' ArcGIS Server
	'
	' Applicable ArcGIS Product Versions:
	' 9.2
	' 9.3
	' 9.3.1
	' 10.0
	'
	' Required ArcGIS Extensions:
	' (NONE)
	'
	' Notes:
	' This snippet is intended to be inserted at the base level of a Class.
	' It is not intended to be nested within an existing Method.
	'

	'''Generate an RgbColor by specifying the amount of Red, Green and Blue.
	'''
	'''<param name="myRed">A byte (0 to 255) used to represent the Red color. Example: 0</param>
	'''<param name="myGreen">A byte (0 to 255) used to represent the Green color. Example: 255</param>
	'''<param name="myBlue">A byte (0 to 255) used to represent the Blue color. Example: 123</param>
	'''
	'''<returns>An IRgbColor interface</returns>
	'''
	'''<remarks></remarks>
	Public Function CreateRGBColor(myRed As System.Byte, myGreen As System.Byte, myBlue As System.Byte) As ESRI.ArcGIS.Display.IRgbColor
		Dim rgbColor As ESRI.ArcGIS.Display.IRgbColor = New ESRI.ArcGIS.Display.RgbColorClass()
		rgbColor.Red = myRed
		rgbColor.Green = myGreen
		rgbColor.Blue = myBlue
		rgbColor.UseWindowsDithering = True
		Return rgbColor
	End Function
	#End Region

  Private Sub txtBufferDistance_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles txtBufferDistance.TextChanged

    Dim txtToCheck As String = txtBufferDistance.Text

    If ((IsDecimal(txtToCheck)) Or (IsInteger(txtToCheck))) AndAlso (txtToCheck <> "0") Then
      btnRunGP.Enabled = True
    Else
      btnRunGP.Enabled = False
    End If
  End Sub

	Private Function IsDecimal(theValue As String) As Boolean
		Try
			Convert.ToDouble(theValue)
			Return True
		Catch
			Return False
		End Try
	End Function
	'IsDecimal
	Private Function IsInteger(theValue As String) As Boolean
		Try
			Convert.ToInt32(theValue)
			Return True
		Catch
			Return False
		End Try
	End Function
	'IsInteger

	#End Region

End Class


text:
//
//  ScanCardPopupViewController.m
//  BiostarMobile
//
//  Created by 정의석 on 2016. 11. 8..
//  Copyright © 2016년 suprema. All rights reserved.
//

#import "ScanCardPopupViewController.h"

@interface ScanCardPopupViewController ()

@end

@implementation ScanCardPopupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setSharedViewController:self];
    // Do any additional setup after loading the view.
    [self showPopupAnimation:containerView];
    deviceProvider = [[DeviceProvider alloc] init];
    cardProvider = [[CardProvider alloc] init];

    [confirmBtn setTitle:NSBaseLocalizedString(@"ok", nil) forState:UIControlStateNormal];

    descriptionLabel.text = NSBaseLocalizedString(@"card_on_device", nil);
    scanImage.image = [UIImage imageNamed:@"user_card1"];

    if (_deviceMode != SMART_CARD_MODE)
    {
        if ([PreferenceProvider isUpperVersion])
        {
            titleLabel.text = NSBaseLocalizedString(@"read_card", nil);
        }
        else
        {
            // 한글 일본어 일때 순서 바꾸기
            NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
            NSDictionary *languageDic = [NSLocale componentsFromLocaleIdentifier:language];
            NSString *languageCode = [languageDic objectForKey:@"kCFLocaleLanguageCodeKey"];

            if ([languageCode isEqualToString:@"ko"] || [languageCode isEqualToString:@"ja"])
            {
                titleLabel.text = [NSString stringWithFormat:@"%@ %@",NSBaseLocalizedString(@"card", nil) ,NSBaseLocalizedString(@"add", nil)];
            }
            else
            {
                titleLabel.text = [NSString stringWithFormat:@"%@ %@",NSBaseLocalizedString(@"add", nil) ,NSBaseLocalizedString(@"card", nil)];
            }

        }
        [self scanCard:self.deviceID];
    }
    else
    {
        titleLabel.text = NSBaseLocalizedString(@"write_card", nil);
        if ([_cardType integerValue] == 0)
        {
            [self scanScureCard:self.secureCredential];
        }
        else
        {
            [self scanAccessOnCard:self.accessOnCredential];
        }
    }

    isRequesting = YES;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [super popupViewDidAppear:contentView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation

 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

- (void)getScanCard:(ScanCardBlock)scanCardBlock
{
    self.scanCardBlock = scanCardBlock;
}

- (void)getScanedSmartCard:(ScanCardBlock)scanCardBlock
{
    self.scanCardBlock = scanCardBlock;
}

- (void)scanCard:(NSString*)scanDeviceID
{
    [self showPopupAnimation:containerView];

    [deviceProvider scanCard:scanDeviceID scanBlock:^(Card *scanCard) {

        if ([PreferenceProvider isUpperVersion])
        {
            if (self.scanCardBlock)
            {
                self.scanCardBlock(scanCard);
                self.scanCardBlock = nil;
            }
            [self closePopup:self parentViewController:self.parentViewController];
        }
        else
        {

            cardIDLabel.text = scanCard.card_id;
            isRequesting = NO;

            [cardConfirmView setHidden:NO];
            [scanImage setHidden:YES];
            [confirmButton setHidden:NO];
            [descriptionLabel setHidden:YES];

            scanedCard = scanCard;
        }
    } onError:^(Response *error) {
        // 재시도 할것인지에 대한 팝업 띄워주기
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Popup" bundle:nil];
        ImagePopupViewController *imagePopupCtrl = [storyboard instantiateViewControllerWithIdentifier:@"ImagePopupViewController"];
        //imagePopupCtrl.delegate = self;
        imagePopupCtrl.type = REQUEST_FAIL;
        imagePopupCtrl.titleContent = NSBaseLocalizedString(@"fail_retry", nil);
        [imagePopupCtrl setContent:error.message];

        [self showPopup:imagePopupCtrl parentViewController:self parentView:self.view];

        [imagePopupCtrl getResponse:^(ImagePopupType type, BOOL isConfirm) {
            if (isConfirm)
            {
                [self scanCard:scanDeviceID];
            }
            else
            {
                [self closePopup:self parentViewController:self.parentViewController];
            }
        }];
    }];
}

- (void)scanScureCard:(SecureCredential*)credential
{
    [self showPopupAnimation:containerView];

    [cardProvider makeSecureCredentialCard:credential resultBlock:^(AddResponse *response) {

        [self finishLoading];

        Card *newSecureCard = [Card new];
        newSecureCard.id = response.id;

        if (self.scanCardBlock)
        {
            self.scanCardBlock(newSecureCard);
            self.scanCardBlock = nil;
        }

        [self closePopup:self parentViewController:self.parentViewController];

    } onError:^(Response *error) {

        [self finishLoading];

        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Popup" bundle:nil];
        ImagePopupViewController *imagePopupCtrl = [storyboard instantiateViewControllerWithIdentifier:@"ImagePopupViewController"];
        imagePopupCtrl.type = REQUEST_FAIL;
        imagePopupCtrl.titleContent = NSBaseLocalizedString(@"fail_retry", nil);
        [imagePopupCtrl setContent:error.message];

        [self showPopup:imagePopupCtrl parentViewController:self parentView:self.view];

        [imagePopupCtrl getResponse:^(ImagePopupType type, BOOL isConfirm) {
            if (isConfirm)
            {
                [self scanScureCard:credential];
            }
            else
            {
                [self closePopup:self parentViewController:self.parentViewController];
            }
        }];

    }];
}

- (void)scanAccessOnCard:(AccessOnCredential*)credential
{
    [self showPopupAnimation:containerView];

    [cardProvider makeAccessOnCard:credential resultBlock:^(AddResponse *response) {

        [self finishLoading];

        Card *newAccessOnCard = [Card new];
        newAccessOnCard.id = response.id;

        if (self.scanCardBlock)
        {
            self.scanCardBlock(newAccessOnCard);
            self.scanCardBlock = nil;
        }

        [self closePopup:self parentViewController:self.parentViewController];

    } onError:^(Response *error) {

        [self finishLoading];

        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Popup" bundle:nil];
        ImagePopupViewController *imagePopupCtrl = [storyboard instantiateViewControllerWithIdentifier:@"ImagePopupViewController"];
        imagePopupCtrl.type = REQUEST_FAIL;
        imagePopupCtrl.titleContent = NSBaseLocalizedString(@"fail_retry", nil);
        [imagePopupCtrl setContent:error.message];

        [self showPopup:imagePopupCtrl parentViewController:self parentView:self.view];

        [imagePopupCtrl getResponse:^(ImagePopupType type, BOOL isConfirm) {
            if (isConfirm)
            {
                [self scanAccessOnCard:credential];
            }
            else
            {
                [self closePopup:self parentViewController:self.parentViewController];
            }
        }];

    }];
}

- (IBAction)confirmPopup:(id)sender
{
    if (self.scanCardBlock)
    {
        self.scanCardBlock(scanedCard);
        self.scanCardBlock = nil;
    }
    [self closePopup:self parentViewController:self.parentViewController];
}

- (void)setScanIndex:(NSInteger)index
{
    scanIndex = index;

}

@end


text:
<?php
namespace App\Repository\Code\Tests;

class FillArrayTest extends TestInterface
{
    public function getDescription()
    {
        return 'Fill an array with for';
    }

    public function run($loop)
    {
        $this->start($loop);

        $values = array();

        for ($i = 0; $i < $this->loop; $i++) {
            $values[] = $i;
        }

        return $this->end();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<datasources>

	<local-tx-datasource>
		<jndi-name>catissuecore</jndi-name>
		<connection-url>@@databaseurl@@</connection-url>
		<user-name>@@username@@</user-name>
		<password>@@pasword@@</password>
		<driver-class>@@databasedriver@@</driver-class>
		<check-valid-connection-sql>select count(*) from csm_user</check-valid-connection-sql>
	</local-tx-datasource>
	<local-tx-datasource>
		<jndi-name>dynamicextensions</jndi-name>
		<connection-url>@@databaseurl@@</connection-url>
		<user-name>@@username@@</user-name>
		<password>@@pasword@@</password>
		<driver-class>@@databasedriver@@</driver-class>
		<check-valid-connection-sql>select count(*) from DYEXTN_ABSTRACT_METADATA</check-valid-connection-sql>
	</local-tx-datasource>
	<local-tx-datasource>
		<jndi-name>query</jndi-name>
		<connection-url>@@databaseurl@@</connection-url>
		<user-name>@@username@@</user-name>
		<password>@@pasword@@</password>
		<driver-class>@@databasedriver@@</driver-class>
		<check-valid-connection-sql>select count(*) from QUERY</check-valid-connection-sql>
	</local-tx-datasource>
	<local-tx-datasource>
		<jndi-name>csm</jndi-name>
		<connection-url>@@databaseurl@@</connection-url>
		<user-name>@@username@@</user-name>
		<password>@@pasword@@</password>
		<driver-class>@@databasedriver@@</driver-class>
		<check-valid-connection-sql>select count(*) from csm_user</check-valid-connection-sql>
	</local-tx-datasource>
</datasources>


text:
  Label text
  <input type="number">


text:
package com.hp.hpl.jena.graph;

import com.hp.hpl.jena.shared.*;
import com.hp.hpl.jena.util.iterator.*;

/**
    A factory for providing instances of named graphs with appropriate storage models.
    It represents a directory, or a database, or a mapping: names map to graphs for the
    lifetime of the GraphMaker. Names can be "arbitrary" character sequences.

    A GraphMaker has a reification style which is shared by all the graphs it creates.
*/

public interface GraphMaker
{
    /**
        Answer the reification style of all the graphs that this GraphMaker constructs.
        @return the reification style given to all created graphs
    */
    public ReificationStyle getReificationStyle();

    /**
        Answer the default graph of this GraphMaker. The same graph is returned on
        each call. It may only be constructed on the first call of getGraph(), or at any
        previous time.

        @return the same default graph each time
     */
    public Graph getGraph();

    /**
        Answer the default graph of this GraphMaker, if it has one. If not,
        throw an exception.
    */
    public Graph openGraph();

    /**
        Answer a graph who's name isn't interesting. Each call delivers a different graph.
        The GraphMaker may reserve a bunch of names for this purpose, of the form
        "anon_<digits>", if it cannot support truly anonymous graphs.

        @return a fresh anonymous graph
    */
    public Graph createGraph();

    /**
        Create a new graph associated with the given name. If there is no such
        association, create one and return it. If one exists but strict
        is false, return the associated graph. Otherwise throw an AlreadyExistsException.

        @param name the name to give to the new graph
        @param strict true to cause existing bindings to throw an exception
        @exception AlreadyExistsException if that name is already bound.
    */
    public Graph createGraph( String name, boolean strict );

    /**
        Create a graph that does not already exist - equivalent to

createGraph( name, false ).
    */
    public Graph createGraph( String name );

    /**
        Find an existing graph that this factory knows about under the given
        name. If such a graph exists, return it. Otherwise, if strict
        is false, create a new graph, associate it with the name, and return it.
        Otherwise throw a DoesNotExistException.

        @param name the name of the graph to find and return
        @param strict false to create a new one if one doesn't already exist
        @exception DoesNotExistException if there's no such named graph
    */
    public Graph openGraph( String name, boolean strict );

    /**
        Equivalent to openGraph( name, false )
    */
    public Graph openGraph( String name );

    /**
        Remove the association between the name and the graph. create
        will now be able to create a graph with that name, and open will no
        longer be able to find it. Throws an exception if there's no such graph.
        The graph itself is not touched.

        @param name the name to disassociate
        @exception DoesNotExistException if the name is unbound
    */
    public void removeGraph( String name );

    /**
        return true iff the factory has a graph with the given name

        @param name the name of the graph to look for
        @return true iff there's a graph with that name
    */
    public boolean hasGraph( String name );

    /**
        Close the factory - no more requests need be honoured, and any clean-up
        can be done.
    */
    public void close();

    /**
        Answer an [extended] iterator where each element is the name of a graph in
        the maker, and the complete sequence exhausts the set of names. No particular
        order is expected from the list.
     	@return an extended iterator over the names of graphs known to this Maker.
     */
    ExtendedIterator<String> listGraphs();
}

/*
    (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


text:
You can use many alias for your gmail account, for example, emails sent to the following alias will go to okok@gmail.com:
* okok+work@gmail.com
* okok+notes@gmail.com
* okok+shopping@gmail.com

You do not do any setting for this alias function.


text:
package net.uchoice.exf.model.action;

public enum ScriptType {

	GROOVY;

	public static ScriptType of(String type) {
		if (GROOVY.name().equalsIgnoreCase(type)) {
			return GROOVY;
		}
		return null;
	}
}


text:
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Rawr.Properties
{
    public class OptimizerSettings
    {

        static OptimizerSettings()
        {
            _default = new OptimizerSettings();

            _default.WarningsEnabled = true;
            _default.Thoroughness = 150;
            _default.OverrideRegem = false;
            _default.CalculationToOptimize = "";
            _default.OverrideReenchant = false;
            _default.OptimizationMethod = OptimizationMethod.GeneticAlgorithm;
            _default.TemplateGemsEnabled = true;
            _default.GreedyOptimizationMethod = GreedyOptimizationMethod.AllCombinations;
        }

        private static OptimizerSettings _default;
        public static OptimizerSettings Default
        {
            get { return _default; }
            set { _default = value; }
        }

        public bool WarningsEnabled { get; set; }
        public int Thoroughness { get; set; }
        public bool OverrideRegem { get; set; }
        public string CalculationToOptimize { get; set; }
        public bool OverrideReenchant { get; set; }
        public Rawr.OptimizationMethod OptimizationMethod { get; set; }
        public bool TemplateGemsEnabled { get; set; }
        public Rawr.GreedyOptimizationMethod GreedyOptimizationMethod { get; set; }

    }
}


text:
type: mixin
name: align-content
params: $content
caniuse: http://caniuse.com/#search=flex
mozdev: https://developer.mozilla.org/en-US/docs/Web/CSS/align-content
source: https://github.com/bcinarli/caffeine/blob/master/lib/mixins/css3/_flex.scss#L115
---
Outputs align-content code with defined prefixes. Internet Explorer and Safari are not supporting this feature yet even with vendor prefix.

```{.language-scss}
.box {
  @include align-content('center');
}
```


text:
/*
* (C) 2014,2015,2017,2018 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#include "tests.h"
#include <memory>
#include <fstream>

#if defined(BOTAN_HAS_TLS)
  #include "test_rng.h"
  #include "test_tls_utils.h"

  #include <botan/tls_alert.h>
  #include <botan/tls_policy.h>
  #include <botan/tls_session.h>
  #include <botan/tls_version.h>

  #if defined(BOTAN_HAS_TLS_CBC)
     #include <botan/internal/tls_cbc.h>
  #endif

#endif

namespace Botan_Tests {

#if defined(BOTAN_HAS_TLS)

class TLS_Session_Tests final : public Test
   {
   public:
      std::vector<Test::Result> run() override
         {
         Test::Result result("TLS::Session");

         Botan::TLS::Session default_session;

         Botan::secure_vector<uint8_t> default_der = default_session.DER_encode();

         result.test_gte("Encoded default session has size", default_der.size(), 0);
         result.test_throws("Encoded default session cannot be read",
                            [&] { Botan::TLS::Session{default_der.data(), default_der.size()}; });

         Botan::TLS::Session session(std::vector<uint8_t>{0xAA, 0xBB},
                                     Botan::secure_vector<uint8_t>{0xCC, 0xDD},
                                     Botan::TLS::Protocol_Version::TLS_V12,
                                     0xC02F,
                                     Botan::TLS::CLIENT,
                                     true,
                                     false,
                                     std::vector<Botan::X509_Certificate>(),
                                     std::vector<uint8_t>(),
                                     Botan::TLS::Server_Information("server"),
                                     0x0000,
                                     std::chrono::system_clock::now());

         const std::string pem = session.PEM_encode();
         Botan::TLS::Session session_from_pem(pem);
         result.test_eq("Roundtrip from pem", session.DER_encode(), session_from_pem.DER_encode());

         const auto der = session.DER_encode();
         Botan::TLS::Session session_from_der(der.data(), der.size());
         result.test_eq("Roundtrip from der", session.DER_encode(), session_from_der.DER_encode());

         const Botan::SymmetricKey key("ABCDEF");
         const std::vector<uint8_t> ctext1 = session.encrypt(key, Test::rng());
         const std::vector<uint8_t> ctext2 = session.encrypt(key, Test::rng());

         result.test_ne("TLS session encryption is non-determinsitic",
                        ctext1.data(), ctext1.size(),
                        ctext2.data(), ctext2.size());

         const std::vector<uint8_t> expected_hdr = Botan::hex_decode("068B5A9D396C0000F2322CAE");

         result.test_eq("tls", "TLS session encryption same header",
                        ctext1.data(), 12, expected_hdr.data(), 12);
         result.test_eq("tls", "TLS session encryption same header",
                        ctext2.data(), 12, expected_hdr.data(), 12);

         Botan::TLS::Session dsession = Botan::TLS::Session::decrypt(ctext1.data(), ctext1.size(), key);

         Fixed_Output_RNG frng1("00112233445566778899AABBCCDDEEFF802802802802802802802802");
         const std::vector<uint8_t> ctextf1 = session.encrypt(key, frng1);
         Fixed_Output_RNG frng2("00112233445566778899AABBCCDDEEFF802802802802802802802802");
         const std::vector<uint8_t> ctextf2 = session.encrypt(key, frng2);

         result.test_eq("Only randomness comes from RNG", ctextf1, ctextf2);

         Botan::TLS::Session session2(std::vector<uint8_t>{0xAA, 0xCC},
                                     Botan::secure_vector<uint8_t>{0xCC, 0xEE},
                                     Botan::TLS::Protocol_Version::TLS_V12,
                                     0xBAAD, // cipher suite does not exist
                                     Botan::TLS::CLIENT,
                                     true,
                                     false,
                                     std::vector<Botan::X509_Certificate>(),
                                     std::vector<uint8_t>(),
                                     Botan::TLS::Server_Information("server"),
                                     0x0000,
                                     std::chrono::system_clock::now());
         const std::string pem_with_unknown_ciphersuite = session2.PEM_encode();

         result.test_throws("unknown ciphersuite during session parsing",
                            "Serialized TLS session contains unknown cipher suite (47789)",
                            [&] { Botan::TLS::Session{pem_with_unknown_ciphersuite}; });

         return {result};
         }
   };

BOTAN_REGISTER_TEST("tls", "tls_session", TLS_Session_Tests);

#if defined(BOTAN_HAS_TLS_CBC)

class TLS_CBC_Padding_Tests final : public Text_Based_Test
   {
   public:
      TLS_CBC_Padding_Tests() : Text_Based_Test("tls_cbc_padding.vec", "Record,Output") {}

      Test::Result run_one_test(const std::string& /*header*/, const VarMap& vars) override
         {
         const std::vector<uint8_t> record    = vars.get_req_bin("Record");
         const size_t output = vars.get_req_sz("Output");

         uint16_t res = Botan::TLS::check_tls_cbc_padding(record.data(), record.size());

         Test::Result result("TLS CBC padding check");
         result.test_eq("Expected", res, output);
         return result;
         }
   };

BOTAN_REGISTER_TEST("tls", "tls_cbc_padding", TLS_CBC_Padding_Tests);

class TLS_CBC_Tests final : public Text_Based_Test
   {
   public:

      class ZeroMac : public Botan::MessageAuthenticationCode
         {
         public:
            explicit ZeroMac(size_t mac_len) : m_mac_len(mac_len) {}

            void clear() override {}

            std::string name() const override { return "ZeroMac"; }
            size_t output_length() const override { return m_mac_len; }

            void add_data(const uint8_t /*input*/[], size_t /*length*/) override {}

            void final_result(uint8_t out[]) override
               {
               for(size_t i = 0; i != m_mac_len; ++i)
                  out[i] = 0;
               }

            Botan::Key_Length_Specification key_spec() const override
               {
               return Botan::Key_Length_Specification(0, 0, 1);
               }

            std::unique_ptr<MessageAuthenticationCode> new_object() const override
               {
               return std::make_unique<ZeroMac>(m_mac_len);
               }

         private:
            void key_schedule(const uint8_t /*key*/[], size_t /*length*/) override {}

            size_t m_mac_len;
         };

      class Noop_Block_Cipher : public Botan::BlockCipher
         {
         public:
            explicit Noop_Block_Cipher(size_t bs) : m_bs(bs) {}

            void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
               {
               Botan::copy_mem(out, in, blocks * m_bs);
               }

            void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
               {
               Botan::copy_mem(out, in, blocks * m_bs);
               }

            size_t block_size() const override { return m_bs; }
            void clear() override { }
            std::string name() const override { return "noop"; }

            Botan::Key_Length_Specification key_spec() const override
               {
               return Botan::Key_Length_Specification(0, 0, 1);
               }

            std::unique_ptr<BlockCipher> new_object() const override
               {
               return std::make_unique<Noop_Block_Cipher>(m_bs);
               }
         private:
            void key_schedule(const uint8_t /*key*/[], size_t /*length*/) override {}

            size_t m_bs;
         };

      TLS_CBC_Tests() : Text_Based_Test("tls_cbc.vec", "Blocksize,MACsize,Record,Valid") {}

      Test::Result run_one_test(const std::string& /*header*/, const VarMap& vars) override
         {
         Test::Result result("TLS CBC");

         const size_t block_size = vars.get_req_sz("Blocksize");
         const size_t mac_len = vars.get_req_sz("MACsize");
         const std::vector<uint8_t> record = vars.get_req_bin("Record");
         const bool is_valid = vars.get_req_sz("Valid") == 1;

         // todo test permutations
         bool encrypt_then_mac = false;

         Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption tls_cbc(
            std::unique_ptr<Botan::BlockCipher>(new Noop_Block_Cipher(block_size)),
            std::unique_ptr<Botan::MessageAuthenticationCode>(new ZeroMac(mac_len)),
            0, 0, Botan::TLS::Protocol_Version::TLS_V12, encrypt_then_mac);

         tls_cbc.set_key(std::vector<uint8_t>(0));
         std::vector<uint8_t> ad(13);
         tls_cbc.set_associated_data(ad.data(), ad.size());

         Botan::secure_vector<uint8_t> vec(record.begin(), record.end());

         try
            {
            tls_cbc.finish(vec, 0);
            if(is_valid)
               result.test_success("Accepted valid TLS-CBC ciphertext");
            else
               result.test_failure("Accepted invalid TLS-CBC ciphertext");
            }
         catch(std::exception&)
            {
            if(is_valid)
               result.test_failure("Rejected valid TLS-CBC ciphertext");
            else
               result.test_success("Accepted invalid TLS-CBC ciphertext");
            }

         return result;
         }
   };

BOTAN_REGISTER_TEST("tls", "tls_cbc", TLS_CBC_Tests);

#endif

class Test_TLS_Alert_Strings : public Test
   {
   public:
      std::vector<Test::Result> run() override
         {
         Test::Result result("TLS::Alert::type_string");

         const std::vector<Botan::TLS::Alert::Type> alert_types =
            {
               Botan::TLS::Alert::CLOSE_NOTIFY,
               Botan::TLS::Alert::UNEXPECTED_MESSAGE,
               Botan::TLS::Alert::BAD_RECORD_MAC,
               Botan::TLS::Alert::DECRYPTION_FAILED,
               Botan::TLS::Alert::RECORD_OVERFLOW,
               Botan::TLS::Alert::DECOMPRESSION_FAILURE,
               Botan::TLS::Alert::HANDSHAKE_FAILURE,
               Botan::TLS::Alert::NO_CERTIFICATE,
               Botan::TLS::Alert::BAD_CERTIFICATE,
               Botan::TLS::Alert::UNSUPPORTED_CERTIFICATE,
               Botan::TLS::Alert::CERTIFICATE_REVOKED,
               Botan::TLS::Alert::CERTIFICATE_EXPIRED,
               Botan::TLS::Alert::CERTIFICATE_UNKNOWN,
               Botan::TLS::Alert::ILLEGAL_PARAMETER,
               Botan::TLS::Alert::UNKNOWN_CA,
               Botan::TLS::Alert::ACCESS_DENIED,
               Botan::TLS::Alert::DECODE_ERROR,
               Botan::TLS::Alert::DECRYPT_ERROR,
               Botan::TLS::Alert::EXPORT_RESTRICTION,
               Botan::TLS::Alert::PROTOCOL_VERSION,
               Botan::TLS::Alert::INSUFFICIENT_SECURITY,
               Botan::TLS::Alert::INTERNAL_ERROR,
               Botan::TLS::Alert::INAPPROPRIATE_FALLBACK,
               Botan::TLS::Alert::USER_CANCELED,
               Botan::TLS::Alert::NO_RENEGOTIATION,
               Botan::TLS::Alert::MISSING_EXTENSION,
               Botan::TLS::Alert::UNSUPPORTED_EXTENSION,
               Botan::TLS::Alert::CERTIFICATE_UNOBTAINABLE,
               Botan::TLS::Alert::UNRECOGNIZED_NAME,
               Botan::TLS::Alert::BAD_CERTIFICATE_STATUS_RESPONSE,
               Botan::TLS::Alert::BAD_CERTIFICATE_HASH_VALUE,
               Botan::TLS::Alert::UNKNOWN_PSK_IDENTITY,
               Botan::TLS::Alert:: NO_APPLICATION_PROTOCOL,
            };

         std::set<std::string> seen;

         for(auto alert : alert_types)
            {
            const std::string str = Botan::TLS::Alert(alert).type_string();
            result.test_eq("No duplicate strings", seen.count(str), 0);
            seen.insert(str);
            }

         Botan::TLS::Alert unknown_alert = Botan::TLS::Alert({01, 66});

         result.test_eq("Unknown alert str", unknown_alert.type_string(), "unrecognized_alert_66");

         return {result};
         }
   };

BOTAN_REGISTER_TEST("tls", "tls_alert_strings", Test_TLS_Alert_Strings);

class Test_TLS_Policy_Text : public Test
   {
   public:
      std::vector<Test::Result> run() override
         {
         Test::Result result("TLS Policy");

         const std::vector<std::string> policies = { "default", "suiteb_128", "suiteb_192", "strict", "datagram", "bsi" };

         for(const std::string& policy : policies)
            {
            const std::string from_policy_obj = tls_policy_string(policy);
            std::string from_file =
#if defined(BOTAN_HAS_TLS_13)
               read_tls_policy(policy + (policy == "default" || policy == "strict" ? "_tls13" : ""));
#else
               read_tls_policy(policy);
#endif

            result.test_eq("Values for TLS " + policy + " policy", from_file, from_policy_obj);
            }

         return {result};
         }

   private:
      static std::string read_tls_policy(const std::string& policy_str)
         {
         const std::string fspath = Test::data_file("tls-policy/" + policy_str + ".txt");

         std::ifstream is(fspath.c_str());
         if(!is.good())
            {
            throw Test_Error("Missing policy file " + fspath);
            }

         Botan::TLS::Text_Policy policy(is);
         return policy.to_string();
         }

      static std::string tls_policy_string(const std::string& policy_str)
         {
         std::unique_ptr<Botan::TLS::Policy> policy;
         if(policy_str == "default")
            {
            policy.reset(new Botan::TLS::Policy);
            }
         else if(policy_str == "suiteb_128")
            {
            policy.reset(new Botan::TLS::NSA_Suite_B_128);
            }
         else if(policy_str == "suiteb_192")
            {
            policy.reset(new Botan::TLS::NSA_Suite_B_192);
            }
         else if(policy_str == "bsi")
            {
            policy.reset(new Botan::TLS::BSI_TR_02102_2);
            }
         else if(policy_str == "strict")
            {
            policy.reset(new Botan::TLS::Strict_Policy);
            }
         else if(policy_str == "datagram")
            {
            policy.reset(new Botan::TLS::Datagram_Policy);
            }
         else
            {
            throw Test_Error("Unknown TLS policy type '" + policy_str + "'");
            }

         return policy->to_string();
         }
   };

BOTAN_REGISTER_TEST("tls", "tls_policy_text", Test_TLS_Policy_Text);

class Test_TLS_Ciphersuites : public Test
   {
   public:
      std::vector<Test::Result> run() override
         {
         Test::Result result("TLS::Ciphersuite");

         for(size_t csuite_id = 0; csuite_id <= 0xFFFF; ++csuite_id)
            {
            const uint16_t csuite_id16 = static_cast<uint16_t>(csuite_id);
            auto ciphersuite = Botan::TLS::Ciphersuite::by_id(csuite_id16);

            if(ciphersuite && ciphersuite->valid())
               {
               result.test_eq("Valid Ciphersuite is not SCSV", Botan::TLS::Ciphersuite::is_scsv(csuite_id16), false);

               if(ciphersuite->cbc_ciphersuite() == false)
                  {
                  result.test_eq("Expected MAC name for AEAD ciphersuites", ciphersuite->mac_algo(), "AEAD");
                  }
               else
                  {
                  result.test_eq("MAC algo and PRF algo same for CBC suites", ciphersuite->prf_algo(), ciphersuite->mac_algo());
                  }

               // TODO more tests here
               }
            }

         return {result};
         }
   };

BOTAN_REGISTER_TEST("tls", "tls_ciphersuites", Test_TLS_Ciphersuites);

class Test_TLS_Algo_Strings : public Test
   {
   public:

      std::vector<Test::Result> run() override
         {
         std::vector<Test::Result> results;

         results.push_back(test_auth_method_strings());
         results.push_back(test_kex_algo_strings());
         results.push_back(test_tls_sig_method_strings());

         return results;
         }

   private:
      static Test::Result test_tls_sig_method_strings()
         {
         Test::Result result("TLS::Signature_Scheme");

         std::vector<Botan::TLS::Signature_Scheme> schemes = Botan::TLS::Signature_Scheme::all_available_schemes();

         std::set<std::string> scheme_strs;
         for(auto scheme : schemes)
            {
            std::string scheme_str = scheme.to_string();

            result.test_eq("Scheme strings unique", scheme_strs.count(scheme_str), 0);

            scheme_strs.insert(scheme_str);
            }

         return result;
         }

      static Test::Result test_auth_method_strings()
         {
         Test::Result result("TLS::Auth_Method");

         const std::vector<Botan::TLS::Auth_Method> auth_methods({
            Botan::TLS::Auth_Method::RSA,
            Botan::TLS::Auth_Method::ECDSA,
            Botan::TLS::Auth_Method::IMPLICIT,
            });

         for(Botan::TLS::Auth_Method meth : auth_methods)
            {
            std::string meth_str = Botan::TLS::auth_method_to_string(meth);
            result.test_ne("Method string is not empty", meth_str, "");
            Botan::TLS::Auth_Method meth2 = Botan::TLS::auth_method_from_string(meth_str);
            result.confirm("Decoded method matches", meth == meth2);
            }

         return result;
         }

      static Test::Result test_kex_algo_strings()
         {
         Test::Result result("TLS::Kex_Algo");

         const std::vector<Botan::TLS::Kex_Algo> kex_algos({
            Botan::TLS::Kex_Algo::STATIC_RSA,
            Botan::TLS::Kex_Algo::DH,
            Botan::TLS::Kex_Algo::ECDH,
            Botan::TLS::Kex_Algo::CECPQ1,
            Botan::TLS::Kex_Algo::PSK,
            Botan::TLS::Kex_Algo::ECDHE_PSK
            });

         for(Botan::TLS::Kex_Algo meth : kex_algos)
            {
            std::string meth_str = Botan::TLS::kex_method_to_string(meth);
            result.test_ne("Method string is not empty", meth_str, "");
            Botan::TLS::Kex_Algo meth2 = Botan::TLS::kex_method_from_string(meth_str);
            result.confirm("Decoded method matches", meth == meth2);
            }

         return result;
         }

   };

BOTAN_REGISTER_TEST("tls", "tls_algo_strings", Test_TLS_Algo_Strings);

#endif

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Article ID="FOQ-F-I-80-34" NumMAJ="50" Numero="I-80-34" Theme1="responsabilite_societale_des_organisations" Theme2="strategie_gouvernance" Theme3="developpement_durable" dateCreation="2014-07-04" dateMAJ="2014-07-04" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ofmArticles.xsd">
	<Titre>Check-list  ISO 26000 : identifier des pistes de dialogue avec ses parties prenantes</Titre>
	<Auteurs>
		<Auteur ID="coulletdemaizierecorinne-00675">
			<Nom>COULLET-DEMAIZIÈRE</Nom>
			<Prenom>Corinne</Prenom>
			<Biographie>Journaliste/Auteure et Consultante/Formatrice spécialisée développement durable et responsabilité sociétale (ISO 26000), qualité, management, économie, société. Diplômée de l'IEP (Sciences Po 1985), journaliste depuis plus de 25 ans (radio, presse écrite, web), elle a notamment collaboré à la revue « Qualité en mouvement » (créé par le MFQ), pendant 12 ans. Elle pige en particulier pour le magazine « Enjeux » (AFNOR) et le « Journal des entreprises ». En 2012, elle signe « ISO 26000 en action – Résultats et retours d'expérience », suite logique d'un premier ouvrage intitulé « Au-delà de l'écologie – Développement durable », sorti en 2010 (AFNOR Éditions).</Biographie>
		</Auteur>
	</Auteurs>
	<Niveau1>
		<Titre>Fichier modèle</Titre>
	</Niveau1>
</Article>


text:
<?php

namespace App\Entity;

use Illuminate\Database\Eloquent\Model;

class Opportunity extends Model
{
    public $timestamps = false;
    protected $table = 'opportunity';
    protected $fillable = ['left_quantity','order_item_id'];

}


text:
require 'honeybadger'

module ActionRescuing
  extend ActiveSupport::Concern

  included do
    rescue_from ActiveRecord::RecordNotFound, with: :not_found
    rescue_from ActiveRecord::RecordInvalid, with: :bad_request
    rescue_from ActiveRecord::RecordNotUnique, with: :conflict
    rescue_from ActiveRecord::UnknownAttributeError, with: :unprocessable
    rescue_from ActiveRecord::RecordNotDestroyed, with: :unauthorized

    rescue_from ActionController::UnpermittedParameters, with: :unprocessable
    rescue_from ActionController::RoutingError, with: :not_found
    rescue_from ActionController::ParameterMissing, with: :unprocessable

    rescue_from JSON::Schema::ValidationError, with: :unprocessable

    rescue_from Pundit::AuthorizationNotPerformedError, with: :not_implemented
    rescue_from Pundit::PolicyScopingNotPerformedError, with: :not_implemented
    rescue_from Pundit::NotDefinedError, with: :not_implemented
    rescue_from Pundit::NotAuthorizedError, with: :unauthorized

    rescue_from RangeError, with: :bad_request
    rescue_from RestPack::Serializer::InvalidInclude, with: :bad_request

    rescue_from TalkService::ParameterError, with: :unprocessable
    rescue_from Talk::InvalidParameterError, with: :unprocessable
    rescue_from Talk::BannedUserError, with: :forbidden
    rescue_from Talk::BlockedUserError, with: :forbidden
    rescue_from Talk::UserBlockedError, with: :forbidden
    rescue_from OauthAccessToken::ExpiredError, with: :unauthorized
    rescue_from OauthAccessToken::RevokedError, with: :unauthorized
  end

  module ClassMethods
    def disallow(*methods)
      methods.each do |method|
        define_method method do
          not_allowed StandardError.new('Method Not Allowed')
        end
      end
    end
  end

  def require_user!
    raise Pundit::NotAuthorizedError.new('not logged in') unless current_user
  end

  def required_param(name)
    raise ActionController::ParameterMissing.new(name) unless params[name]
    params[name]
  end

  def unauthorized(exception)
    render_exception :unauthorized, exception
  end

  def forbidden(exception)
    render_exception :forbidden, exception
  end

  def not_found(exception)
    render_exception :not_found, exception
  end

  def not_allowed(exception)
    render_exception :method_not_allowed, exception
  end

  def bad_request(exception)
    render_exception :bad_request, exception
  end

  def unprocessable(exception)
    render_exception :unprocessable_entity, exception
  end

  def not_implemented(exception)
    render_exception :not_implemented, exception
  end

  def conflict(exception)
    render_exception :conflict, exception
  end

  def render_exception(status, exception)
    self.response_body = nil
    render status: status, json: { error: exception.message }
  end
end


text:
namespace blink {

class CORE_EXPORT TestInterfaceEventInit : public EventInit {
    DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public:
    TestInterfaceEventInit();
    virtual ~TestInterfaceEventInit();

    bool hasStringMember() const { return !m_stringMember.isNull(); }
    String stringMember() const { return m_stringMember; }
    void setStringMember(String value) { m_stringMember = value; }

    v8::Local<v8::Value> toV8Impl(v8::Local<v8::Object>, v8::Isolate*) const override;
    DECLARE_VIRTUAL_TRACE();

private:
    String m_stringMember;

    friend class V8TestInterfaceEventInit;
};

} // namespace blink

#endif // TestInterfaceEventInit_h


text:
// Type definitions for normalplaytime 1.0
// Project: https://github.com/eteubert/normalplaytime
// Definitions by: Mimiste <https://github.com/Mimiste>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * Takes a string in Normal Play Time (RFC 2326) format and convert it to milliseconds.
 * Will return null for wrong input format.
 */
export function parse(npt: string): number | null;

export as namespace normalplaytime;


text:
import Dispatcher from '../dispatcher/dispatcher';
import ActionType from '../constants/action_type';
import Service from '../services/service';

class Action {
	load() {
		Service.load()
			.done((data) => {
				Dispatcher.dispatch({
					actionType: ActionType.LOAD,
					data: data
				});
			})
			.fail(() => this.error({error: true, message: "Can't load data"}));
	}

	getItemById(id) {
		Service.getItemById(id)
			.done((data) => {
				Dispatcher.dispatch({
					actionType: ActionType.LOAD_BY_ID,
					data: data
				});
			})
			.fail(() => this.error({error: true, message: "Can't load data"}));
	}

	error(error) {
		error = error ? error : {};
		Dispatcher.dispatch({
			actionType: ActionType.ERROR,
			error: error
		});
	}
}

const AppAction = new Action();
export default AppAction;


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

import java.util.Collection;
import java.util.function.Supplier;

/**
 * Returns the maximum value in a collection. In case the collection is empty it
 * returns 0.0 (double).
 *
 * @param <T> numeric type
 * @since 0.2
 */
public class Max<T extends Number & Comparable<T>> implements Supplier<Double> {

	/**
	 * Collection.
	 */
    private final Collection<T> col;
    /**
     * Whether use the absolute value of elements or not.
     */
    private final boolean abs;

    /**
     * Constructor with arguments.
     *
     * @param col a collection
     * @param abs whether to use absolute values or not
     */
    public Max(Collection<T> col, boolean abs) {
        this.col = col;
        this.abs = abs;
    }

    /*
     * (non-Javadoc)
     * @see java.util.function.Supplier#get()
     */
    public Double get() {
        double out = 0.0;
        double max = 0.0;
        boolean first = true;
        for (T elem : col) {
            final double value;
            if (abs) {
                value = Math.abs(elem.doubleValue());
            } else {
                value = elem.doubleValue();
            }
            if (first || value > max) {
                max = value;
                out = elem.doubleValue();
                first = false;
            }
        }
        return out;
    }

    /**
     * Returns the maximum value found in a collection.
     *
     * @param col a collection
     * @param abs whether to use absolute values or not
     * @return maximum value
     */
    public static <T extends Number & Comparable<T>> double of(Collection<T> col, boolean abs) {
        return new Max<T>(col, abs).get();
    }

}


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using XSerializer.Encryption;

namespace XSerializer.Rock.StaticDependencyInjection
{
    internal partial class CompositionRoot : CompositionRootBase
    {
        public override void Bootstrap()
        {
            ImportSingle<IEncryptionMechanism, IEncryptionMechanismFactory>(
                mechanism => EncryptionMechanism.Current = mechanism,
                factory => factory.GetEncryptionMechanism());
        }

        /// <summary>
        /// Gets a value indicating whether static dependency injection is enabled.
        /// </summary>
        public override bool IsEnabled
        {
            get
            {
                const string key = "XSerializer.StaticDependencyInjection.Enabled";
                var enabledValue = ConfigurationManager.AppSettings.Get(key) ?? "true";
                return enabledValue.ToLower() != "false";
            }
        }

        /// <summary>
        /// Return a collection of metadata objects that describe the export operations for a type.
        /// </summary>
        /// <param name="type">The type to get export metadata.</param>
        /// <returns>A collection of metadata objects that describe export operations.</returns>
        protected override IEnumerable<ExportInfo> GetExportInfos(Type type)
        {
            var attributes = Attribute.GetCustomAttributes(type, typeof(EncryptionMechanismAttribute));

            if (attributes.Length == 0)
            {
                return base.GetExportInfos(type);
            }

            return
                attributes.Cast<EncryptionMechanismAttribute>()
                .Select(attribute =>
                    new ExportInfo(type, attribute.Priority)
                    {
                        Disabled = attribute.Disabled
                    });
        }
    }
}


text:
FROM node:0.10-onbuild
MAINTAINER Facundo Cabrera "cabrerafacundo@gmail.com"

# environment variables
ENV TARGET_DIR /opt/backstopjs

# prevent problems with blocked ssh connections
RUN git config --global url."https://".insteadOf git://

# copy bower configurations
COPY .bowerrc /
COPY .npmrc /
COPY .sample.backstop.json /backstop.json

# Everything should be executed on the root directory
WORKDIR /

# ubuntu packages (mainly dependencies)
RUN apt-get -yqq update
RUN apt-get -yqq install aptitude g++ flex bison gperf ruby perl \
                         libsqlite3-dev libfontconfig1-dev libicu-dev \
                         libfreetype6 libssl-dev libpng-dev libjpeg-dev

# bower
RUN npm install -g bower

# backstopjs
RUN bower install --allow-root backstopjs

# phantomjs
RUN npm install -g phantomjs

# gulp
RUN npm install -g gulp

# casperjs
RUN npm install -g casperjs

# backstopjs dependencies installation
WORKDIR $TARGET_DIR
RUN npm install

# backstopjs dependencies installation (web deps)
WORKDIR $TARGET_DIR/compare
RUN bower install --allow-root

# leave you at useful location
WORKDIR $TARGET_DIR

# expose port for web tool
EXPOSE 3001


text:
package org.rlcommunity.rlglue.codec.taskspec;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author btanner
 */
public class TaskSpecVRLGLUE3_BackwardsV2CompatTest {

    public TaskSpecVRLGLUE3_BackwardsV2CompatTest() {
    }

    @Test
    public void OldUNSPECTest() {
        int taskSpecVersion = 2;
        String theTaskSpecString = taskSpecVersion + ":e:10_[f,f,f,f,f,i,i,i,i,i]_[,.6]_[-.07,]_[,]_[]_[ ,  ]_[,6]_[-7,]_[,]_[]_[ ,  ]:10_[f,f,f,f,f,i,i,i,i,i]_[,.6]_[-.07,]_[,]_[]_[ ,  ]_[,6]_[-7,]_[,]_[]_[ ,  ]:[-1,0]";
        TaskSpec theTSO = new TaskSpec(theTaskSpecString);
        //Make sure that if we parse the output of  theTSO and then convert back to a string, we get the same string as theTSO generates
        assertEquals(new TaskSpec(theTSO.getStringRepresentation()).getStringRepresentation(), theTSO.getStringRepresentation());
        assertEquals(theTSO.getNumDiscreteObsDims(), 5);
        assertEquals(theTSO.getNumContinuousObsDims(), 5);

        assertTrue(theTSO.getContinuousObservationRange(0).getMinUnspecified());
        assertEquals(theTSO.getContinuousObservationRange(0).getMax(), .6d);

        assertEquals(theTSO.getContinuousObservationRange(1).getMin(), -.07d);
        assertTrue(theTSO.getContinuousObservationRange(1).getMaxUnspecified());

        assertTrue(theTSO.getContinuousObservationRange(2).getMinUnspecified());
        assertTrue(theTSO.getContinuousObservationRange(2).getMaxUnspecified());

        assertTrue(theTSO.getContinuousObservationRange(3).getMinUnspecified());
        assertTrue(theTSO.getContinuousObservationRange(3).getMaxUnspecified());

        assertTrue(theTSO.getContinuousObservationRange(4).getMinUnspecified());
        assertTrue(theTSO.getContinuousObservationRange(4).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteObservationRange(0).getMinUnspecified());
        assertEquals(theTSO.getDiscreteObservationRange(0).getMax(), 6);

        assertEquals(theTSO.getDiscreteObservationRange(1).getMin(), -7);
        assertTrue(theTSO.getDiscreteObservationRange(1).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteObservationRange(2).getMinUnspecified());
        assertTrue(theTSO.getDiscreteObservationRange(2).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteObservationRange(3).getMinUnspecified());
        assertTrue(theTSO.getDiscreteObservationRange(3).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteObservationRange(4).getMinUnspecified());
        assertTrue(theTSO.getDiscreteObservationRange(4).getMaxUnspecified());

        //ACtions
        assertEquals(theTSO.getNumDiscreteActionDims(), 5);
        assertEquals(theTSO.getNumContinuousActionDims(), 5);

        assertTrue(theTSO.getContinuousActionRange(0).getMinUnspecified());
        assertEquals(theTSO.getContinuousActionRange(0).getMax(), .6d);

        assertEquals(theTSO.getContinuousActionRange(1).getMin(), -.07d);
        assertTrue(theTSO.getContinuousActionRange(1).getMaxUnspecified());

        assertTrue(theTSO.getContinuousActionRange(2).getMinUnspecified());
        assertTrue(theTSO.getContinuousActionRange(2).getMaxUnspecified());

        assertTrue(theTSO.getContinuousActionRange(3).getMinUnspecified());
        assertTrue(theTSO.getContinuousActionRange(3).getMaxUnspecified());

        assertTrue(theTSO.getContinuousActionRange(4).getMinUnspecified());
        assertTrue(theTSO.getContinuousActionRange(4).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteActionRange(0).getMinUnspecified());
        assertEquals(theTSO.getDiscreteActionRange(0).getMax(), 6);

        assertEquals(theTSO.getDiscreteActionRange(1).getMin(), -7);
        assertTrue(theTSO.getDiscreteActionRange(1).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteActionRange(2).getMinUnspecified());
        assertTrue(theTSO.getDiscreteActionRange(2).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteActionRange(3).getMinUnspecified());
        assertTrue(theTSO.getDiscreteActionRange(3).getMaxUnspecified());

        assertTrue(theTSO.getDiscreteActionRange(4).getMinUnspecified());
        assertTrue(theTSO.getDiscreteActionRange(4).getMaxUnspecified());

    }

    @Test
    public void OldInfest() {
        int taskSpecVersion = 2;
        String theTaskSpecString = taskSpecVersion + ":e:5_[f,f,f,f,f,,]_[-inf,.6]_[-.07,inf]_[-inf,]_[,inf]_[-inf,inf]:5_[f,f,f,f,f,,]_[-inf,.6]_[-.07,inf]_[-inf,]_[,inf]_[-inf,inf]:[-1,0]";
        TaskSpec theTSO = new TaskSpec(theTaskSpecString);
        //Make sure that if we parse the output of  theTSO and then convert back to a string, we get the same string as theTSO generates
        assertEquals(new TaskSpec(theTSO.getStringRepresentation()).getStringRepresentation(), theTSO.getStringRepresentation());
        assertEquals(theTSO.getNumDiscreteObsDims(), 0);
        assertEquals(theTSO.getNumContinuousObsDims(), 5);

        assertTrue(theTSO.getContinuousObservationRange(0).getMinNegInf());
        assertEquals(theTSO.getContinuousObservationRange(0).getMax(), .6d);

        assertEquals(theTSO.getContinuousObservationRange(1).getMin(), -.07d);
        assertTrue(theTSO.getContinuousObservationRange(1).getMaxInf());

        assertTrue(theTSO.getContinuousObservationRange(2).getMinNegInf());
        assertTrue(theTSO.getContinuousObservationRange(2).getMaxUnspecified());

        assertTrue(theTSO.getContinuousObservationRange(3).getMinUnspecified());
        assertTrue(theTSO.getContinuousObservationRange(3).getMaxInf());

        assertTrue(theTSO.getContinuousObservationRange(4).getMinNegInf());
        assertTrue(theTSO.getContinuousObservationRange(4).getMaxInf());

        assertEquals(theTSO.getNumDiscreteActionDims(), 0);
        assertEquals(theTSO.getNumContinuousActionDims(), 5);

        assertTrue(theTSO.getContinuousActionRange(0).getMinNegInf());
        assertEquals(theTSO.getContinuousActionRange(0).getMax(), .6d);

        assertEquals(theTSO.getContinuousActionRange(1).getMin(), -.07d);
        assertTrue(theTSO.getContinuousActionRange(1).getMaxInf());

        assertTrue(theTSO.getContinuousActionRange(2).getMinNegInf());
        assertTrue(theTSO.getContinuousActionRange(2).getMaxUnspecified());

        assertTrue(theTSO.getContinuousActionRange(3).getMinUnspecified());
        assertTrue(theTSO.getContinuousActionRange(3).getMaxInf());

        assertTrue(theTSO.getContinuousActionRange(4).getMinNegInf());
        assertTrue(theTSO.getContinuousActionRange(4).getMaxInf());

    }

    @Test
    public void MountainCarV2Spec() {
        int taskSpecVersion = 2;
        String theTaskSpecString = taskSpecVersion + ":e:2_[f,f]_[-1.2,.6]_[-.07,.07]:1_[i]_[0,2]:[-1,0]";
        TaskSpec theTSO = new TaskSpec(theTaskSpecString);
        //Make sure that if we parse the output of  theTSO and then convert back to a string, we get the same string as theTSO generates
        assertEquals(new TaskSpec(theTSO.getStringRepresentation()).getStringRepresentation(), theTSO.getStringRepresentation());
        assertEquals(theTSO.getProblemType(), "episodic");
        assertEquals(theTSO.getNumDiscreteObsDims(), 0);
        assertEquals(theTSO.getNumContinuousObsDims(), 2);

        assertEquals(theTSO.getContinuousObservationRange(0).getMin(), -1.2d);
        assertEquals(theTSO.getContinuousObservationRange(0).getMax(), .6d);
        assertEquals(theTSO.getContinuousObservationRange(1).getMin(), -.07d);
        assertEquals(theTSO.getContinuousObservationRange(1).getMax(), .07d);
        assertEquals(theTSO.getNumContinuousActionDims(), 0);
        assertEquals(theTSO.getNumDiscreteActionDims(), 1);
        assertEquals(theTSO.getDiscreteActionRange(0).getMin(), 0);
        assertEquals(theTSO.getDiscreteActionRange(0).getMax(), 2);
        assertEquals(theTSO.getRewardRange().getMin(), -1d);
        assertEquals(theTSO.getRewardRange().getMax(), 0d);
        assertEquals(theTSO.getExtraString(), "");
    }

    @Test
    public void MountainCarV3Spec() {
        int taskSpecVersion = 3;
        String theTaskSpecString = taskSpecVersion + ":e:2_[f,f]_[-1.2,.6]_[-.07,.07]:1_[i]_[0,2]:[-1,0]:Extra text here";
        TaskSpec theTSO = new TaskSpec(theTaskSpecString);
        //Make sure that if we parse the output of  theTSO and then convert back to a string, we get the same string as theTSO generates
        assertEquals(new TaskSpec(theTSO.getStringRepresentation()).getStringRepresentation(), theTSO.getStringRepresentation());
        assertEquals(theTSO.getProblemType(), "episodic");
        assertEquals(theTSO.getNumDiscreteObsDims(), 0);
        assertEquals(theTSO.getNumContinuousObsDims(), 2);

        assertEquals(theTSO.getContinuousObservationRange(0).getMin(), -1.2d);
        assertEquals(theTSO.getContinuousObservationRange(0).getMax(), .6d);
        assertEquals(theTSO.getContinuousObservationRange(1).getMin(), -.07d);
        assertEquals(theTSO.getContinuousObservationRange(1).getMax(), .07d);
        assertEquals(theTSO.getNumContinuousActionDims(), 0);
        assertEquals(theTSO.getNumDiscreteActionDims(), 1);
        assertEquals(theTSO.getDiscreteActionRange(0).getMin(), 0);
        assertEquals(theTSO.getDiscreteActionRange(0).getMax(), 2);
        assertEquals(theTSO.getRewardRange().getMin(), -1d);
        assertEquals(theTSO.getRewardRange().getMax(), 0d);
        assertEquals(theTSO.getExtraString(), "Extra text here");
    }

}