text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
    internal sealed partial class AnonymousTypeManager
    {
        /// <summary>
        /// Represents an anonymous type 'public' symbol which is used in binding and lowering.
        /// In emit phase it is being substituted with implementation symbol.
        /// </summary>
        private sealed class AnonymousTypePublicSymbol : NamedTypeSymbol
        {
            private readonly ImmutableArray<Symbol> _members;

            /// <summary> Properties defined in the type </summary>
            internal readonly ImmutableArray<AnonymousTypePropertySymbol> Properties;

            /// <summary> Maps member names to symbol(s) </summary>
            private readonly MultiDictionary<string, Symbol> _nameToSymbols = new MultiDictionary<string, Symbol>();

            /// <summary> Anonymous type manager owning this template </summary>
            internal readonly AnonymousTypeManager Manager;

            /// <summary> Anonymous type descriptor </summary>
            internal readonly AnonymousTypeDescriptor TypeDescriptor;

            internal AnonymousTypePublicSymbol(AnonymousTypeManager manager, AnonymousTypeDescriptor typeDescr)
            {
                typeDescr.AssertIsGood();

                this.Manager = manager;
                this.TypeDescriptor = typeDescr;

                var fields = typeDescr.Fields;
                var properties = fields.SelectAsArray((field, i, type) => new AnonymousTypePropertySymbol(type, field, i), this);

                //  members
                int membersCount = fields.Length * 2 + 1;
                var members = ArrayBuilder<Symbol>.GetInstance(membersCount);

                foreach (var property in properties)
                {
                    // Property related symbols
                    members.Add(property);
                    members.Add(property.GetMethod);
                }

                this.Properties = properties;

                // Add a constructor
                members.Add(new AnonymousTypeConstructorSymbol(this, properties));
                _members = members.ToImmutableAndFree();
                Debug.Assert(membersCount == _members.Length);

                //  fill nameToSymbols map
                foreach (var symbol in _members)
                {
                    _nameToSymbols.Add(symbol.Name, symbol);
                }
            }

            public override ImmutableArray<Symbol> GetMembers()
            {
                return _members;
            }

            internal override IEnumerable<FieldSymbol> GetFieldsToEmit()
            {
                throw ExceptionUtilities.Unreachable;
            }

            internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
            {
                get { return ImmutableArray<TypeWithAnnotations>.Empty; }
            }

            internal override bool HasCodeAnalysisEmbeddedAttribute => false;

            public override ImmutableArray<Symbol> GetMembers(string name)
            {
                var symbols = _nameToSymbols[name];
                var builder = ArrayBuilder<Symbol>.GetInstance(symbols.Count);
                foreach (var symbol in symbols)
                {
                    builder.Add(symbol);
                }

                return builder.ToImmutableAndFree();
            }

            internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers()
            {
                return this.GetMembersUnordered();
            }

            internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name)
            {
                return this.GetMembers(name);
            }

            public override IEnumerable<string> MemberNames
            {
                get { return _nameToSymbols.Keys; }
            }

            public override Symbol ContainingSymbol
            {
                get { return this.Manager.Compilation.SourceModule.GlobalNamespace; }
            }

            public override string Name
            {
                get { return string.Empty; }
            }

            public override string MetadataName
            {
                get { return string.Empty; }
            }

            internal override bool MangleName
            {
                get { return false; }
            }

            public override int Arity
            {
                get { return 0; }
            }

            public override bool IsImplicitlyDeclared
            {
                get { return false; }
            }

            public override ImmutableArray<TypeParameterSymbol> TypeParameters
            {
                get { return ImmutableArray<TypeParameterSymbol>.Empty; }
            }

            public override bool IsAbstract
            {
                get { return false; }
            }

            public sealed override bool IsRefLikeType
            {
                get { return false; }
            }

            internal sealed override bool IsReadOnly
            {
                get { return false; }
            }

            public override bool IsSealed
            {
                get { return true; }
            }

            public override bool MightContainExtensionMethods
            {
                get { return false; }
            }

            internal override bool HasSpecialName
            {
                get { return false; }
            }

            public override ImmutableArray<NamedTypeSymbol> GetTypeMembers()
            {
                return ImmutableArray<NamedTypeSymbol>.Empty;
            }

            public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(string name)
            {
                return ImmutableArray<NamedTypeSymbol>.Empty;
            }

            public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(string name, int arity)
            {
                return ImmutableArray<NamedTypeSymbol>.Empty;
            }

            public override Accessibility DeclaredAccessibility
            {
                get { return Accessibility.Internal; }
            }

            internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved)
            {
                return ImmutableArray<NamedTypeSymbol>.Empty;
            }

            internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit()
            {
                throw ExceptionUtilities.Unreachable;
            }

            internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => this.Manager.System_Object;

            public override TypeKind TypeKind
            {
                get { return TypeKind.Class; }
            }

            internal override bool IsInterface
            {
                get { return false; }
            }

            public override ImmutableArray<Location> Locations
            {
                get { return ImmutableArray.Create<Location>(this.TypeDescriptor.Location); }
            }

            public override ImmutableArray<SyntaxReference> DeclaringSyntaxReferences
            {
                get
                {
                    return GetDeclaringSyntaxReferenceHelper<AnonymousObjectCreationExpressionSyntax>(this.Locations);
                }
            }

            public override bool IsStatic
            {
                get { return false; }
            }

            public override bool IsAnonymousType
            {
                get { return true; }
            }

            public override NamedTypeSymbol ConstructedFrom
            {
                get { return this; }
            }

            internal override bool ShouldAddWinRTMembers
            {
                get { return false; }
            }

            internal override bool IsWindowsRuntimeImport
            {
                get { return false; }
            }

            internal override bool IsComImport
            {
                get { return false; }
            }

            internal sealed override ObsoleteAttributeData ObsoleteAttributeData
            {
                get { return null; }
            }

            internal override TypeLayout Layout
            {
                get { return default(TypeLayout); }
            }

            internal override CharSet MarshallingCharSet
            {
                get { return DefaultMarshallingCharSet; }
            }

            public override bool IsSerializable
            {
                get { return false; }
            }

            internal override bool HasDeclarativeSecurity
            {
                get { return false; }
            }

            internal override IEnumerable<Microsoft.Cci.SecurityAttribute> GetSecurityInformation()
            {
                throw ExceptionUtilities.Unreachable;
            }

            internal override ImmutableArray<string> GetAppliedConditionalSymbols()
            {
                return ImmutableArray<string>.Empty;
            }

            internal override AttributeUsageInfo GetAttributeUsageInfo()
            {
                return AttributeUsageInfo.Null;
            }

            internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved)
            {
                return this.Manager.System_Object;
            }

            internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved)
            {
                return ImmutableArray<NamedTypeSymbol>.Empty;
            }

            internal override bool Equals(TypeSymbol t2, TypeCompareKind comparison)
            {
                if (ReferenceEquals(this, t2))
                {
                    return true;
                }

                var other = t2 as AnonymousTypePublicSymbol;
                return (object)other != null && this.TypeDescriptor.Equals(other.TypeDescriptor, comparison);
            }

            public override int GetHashCode()
            {
                return this.TypeDescriptor.GetHashCode();
            }
        }
    }
}


text:
var $ = require('jquery');

$(document).ready(function() {
    $('#javascript-area').text("Hello from javascript!")
});

redpajama_set_name: RedPajamaGithub


text:
from .responses import TimestreamWriteResponse

url_bases = [
    r"https?://ingest\.timestream\.(.+)\.amazonaws\.com",
    r"https?://ingest\.timestream\.(.+)\.amazonaws\.com/",
]

response = TimestreamWriteResponse()

# Boto3 sends a request to 'https://ingest.timestream.amazonaws.com'
# Which means we need two url_paths - one without slash (for boto3), and one with (for other SDK's/API's)
url_paths = {"{0}$": response.dispatch, "{0}/$": response.dispatch}


text:
package com.malpeza.solid.isp

class CustomerValidationResponse(val valid: Boolean) {
}

object CustomerValidationResponse {
  def apply(valid: Boolean) = new CustomerValidationResponse(valid)
}


text:
#include <aws/emr-containers/model/ListVirtualClustersRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::EMRContainers::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;

ListVirtualClustersRequest::ListVirtualClustersRequest() :
    m_containerProviderIdHasBeenSet(false),
    m_containerProviderType(ContainerProviderType::NOT_SET),
    m_containerProviderTypeHasBeenSet(false),
    m_createdAfterHasBeenSet(false),
    m_createdBeforeHasBeenSet(false),
    m_statesHasBeenSet(false),
    m_maxResults(0),
    m_maxResultsHasBeenSet(false),
    m_nextTokenHasBeenSet(false)
{
}

Aws::String ListVirtualClustersRequest::SerializePayload() const
{
  return {};
}

void ListVirtualClustersRequest::AddQueryStringParameters(URI& uri) const
{
    Aws::StringStream ss;
    if(m_containerProviderIdHasBeenSet)
    {
      ss << m_containerProviderId;
      uri.AddQueryStringParameter("containerProviderId", ss.str());
      ss.str("");
    }

    if(m_containerProviderTypeHasBeenSet)
    {
      ss << ContainerProviderTypeMapper::GetNameForContainerProviderType(m_containerProviderType);
      uri.AddQueryStringParameter("containerProviderType", ss.str());
      ss.str("");
    }

    if(m_createdAfterHasBeenSet)
    {
      ss << m_createdAfter.ToGmtString(Aws::Utils::DateFormat::ISO_8601);
      uri.AddQueryStringParameter("createdAfter", ss.str());
      ss.str("");
    }

    if(m_createdBeforeHasBeenSet)
    {
      ss << m_createdBefore.ToGmtString(Aws::Utils::DateFormat::ISO_8601);
      uri.AddQueryStringParameter("createdBefore", ss.str());
      ss.str("");
    }

    if(m_statesHasBeenSet)
    {
      for(const auto& item : m_states)
      {
        ss << VirtualClusterStateMapper::GetNameForVirtualClusterState(item);
        uri.AddQueryStringParameter("states", ss.str());
        ss.str("");
      }
    }

    if(m_maxResultsHasBeenSet)
    {
      ss << m_maxResults;
      uri.AddQueryStringParameter("maxResults", ss.str());
      ss.str("");
    }

    if(m_nextTokenHasBeenSet)
    {
      ss << m_nextToken;
      uri.AddQueryStringParameter("nextToken", ss.str());
      ss.str("");
    }

}


text:
//-------------------------------------------------------------------------------
// <copyright file="DefaultConversionCallback.cs" company="Appccelerate">
//   Copyright (c) 2008-2015
//
//   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.
// </copyright>
//-------------------------------------------------------------------------------

namespace Appccelerate.Bootstrapper.Configuration.Internals
{
    using System.Globalization;
    using System.Reflection;

    /// <summary>
    /// Default conversion callback which uses System.Convert and invariant culture to convert to the target property type.
    /// </summary>
    public class DefaultConversionCallback : IConversionCallback
    {
        /// <inheritdoc />
        public object Convert(string value, PropertyInfo targetProperty)
        {
            Ensure.ArgumentNotNull(targetProperty, "targetProperty");

            return System.Convert.ChangeType(value, targetProperty.PropertyType, CultureInfo.InvariantCulture);
        }
    }
}


text:
require 'ansible/ruby/modules/base'

module Ansible
  module Ruby
    module Modules
      # Add or remove domains or subdomains on a Webfaction host. Further documentation at https://github.com/quentinsf/ansible-webfaction.
      class Webfaction_domain < Base
        # @return [String] The name of the domain
        attribute :name
        validates :name, presence: true, type: String

        # @return [:present, :absent, nil] Whether the domain should exist
        attribute :state
        validates :state, expression_inclusion: {:in=>[:present, :absent], :message=>"%{value} needs to be :present, :absent"}, allow_nil: true

        # @return [Object, nil] Any subdomains to create.
        attribute :subdomains

        # @return [String] The webfaction account to use
        attribute :login_name
        validates :login_name, presence: true, type: String

        # @return [String] The webfaction password to use
        attribute :login_password
        validates :login_password, presence: true, type: String
      end
    end
  end
end


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\Select2;

/**
 * @var yii\web\View $this
 * @var amnah\yii2\user\Module $module
 * @var amnah\yii2\user\models\User $user
 * @var amnah\yii2\user\models\Profile $profile
 * @var amnah\yii2\user\models\Role $role
 * @var $authAssignment \app\models\AuthAssignment
 */
/* @var yii\widgets\ActiveForm $form*/
/* @var $permissoes array */
$module = $this->context->module;
$this->context->module;
$role = $module->model("Role");

?>

        <?php $form = ActiveForm::begin(); ?>

        <?= $form->field($user, 'email')->textInput(['maxlength' => 255,
        'placeholder'=>'Digite o email do usuário']) ?>

        <?= $form->field($user, 'username')->textInput(['maxlength' => 255,
            'placeholder'=>'Digite o usuário']) ?>

        <?= $form->field($user, 'newPassword')->passwordInput([
            'placeholder'=>'Digite a senha do usuário']) ?>

        <?= $form->field($profile, 'full_name')->textInput([
            'placeholder'=>'Digite o nome completo do usuário']); ?>

        <?= $form->field($authAssignment, 'item_name')->widget(Select2::classname(), [

            'data' => $permissoes,
            'options'=>[
                'id'=>'permissoes',
                'prompt'=>'Selecione a(s) permissão(ões)',

            ],
            'toggleAllSettings' => [
                'selectLabel' => ' Selecionar todos',
                'unselectLabel' => ' Desmarcar todos',
                'selectOptions' => ['class' => 'text-success'],
                'unselectOptions' => ['class' => 'text-danger'],
            ],
            'pluginOptions' => [

                'allowClear' => true,
                'multiple' => true,

            ],

        ]); ?>

        <?php
            $this->registerJsFile(\Yii::getAlias('@web') . "/js/user_form.js", ['depends' => [\yii\web\JqueryAsset::className()]]);
        ?>

            <?= Html::submitButton($user->isNewRecord ? Yii::t('user', 'Create') : Yii::t('user', 'Update'),
                ['class' => $user->isNewRecord ? 'btn btn-success' : 'btn btn-primary',
                    'title'=>$user->isNewRecord ? 'Clique para cadastrar um novo Usuário':
                        'Clique para salvar os dados do Usuário']) ?>

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

<?php

if (isset($mensagem) && !empty($mensagem)) {
    ?>

    <?php
}
?>


text:
file(REMOVE_RECURSE
  "CMakeFiles/stdvector_overload_5.dir/stdvector_overload.cpp.o"
  "stdvector_overload_5.pdb"
  "stdvector_overload_5"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/stdvector_overload_5.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()


text:
require "rubygems"
require "gentlerest/templates/presenter"

# This variable stores a list of all paths to search for when locating a
# named template.
$TEMPLATE_PATH = ["."]

module GentleREST
  class Template
    # Registers a template type.  Takes a symbol naming the type, and a block
    # which takes a String as input and an Object to use as the execution
    # context and returns the rendered template output as a String.
    # The block should ensure that all necessary libraries are loaded.
    def self.register_type(type, &block)
      if !defined?(@type_map) || @type_map == nil
        @type_map = {}
      end

      # Normalize to symbol
      type = type.to_s.to_sym
      @type_map[type] = block
      return nil
    end

    # Returns a list of registered template types.
    def self.types
      if !defined?(@type_map) || @type_map == nil
        @type_map = {}
      end
      return @type_map.keys
    end

    # Returns the processor Proc for the specified type.
    #
    # Raises an ArgumentError if the type is invalid.
    def self.processor(type)
      if !defined?(@type_map) || @type_map == nil
        @type_map = {}
      end

      # Normalize to symbol
      type = type.to_s.to_sym

      if !self.types.include?(type)
        raise ArgumentError,
          "Unrecognized template type: #{type.inspect}\n" +
          "Valid types: " +
          "#{(self.class.types.map {|t| t.inspect}).join(", ")}"
      end

      return @type_map[type]
    end

    # Renders a template.  Takes a Symbol identifying the type, and
    # optionally take a Presenter, which is used as the execution context
    # for the Template.
    #
    # Raises an ArgumentError if the type is invalid.
    def self.render(name, presenter=GentleREST::Presenter.new, options={})
      if !presenter.kind_of?(GentleREST::Presenter)
        raise TypeError,
          "Expected object of type GentleREST::Presenter, " +
          "got #{presenter.class.name}."
      end

      # Locate the template.
      path = nil
      for load_path in $TEMPLATE_PATH
        full_name = File.expand_path(File.join(load_path, name))

        # Check to make sure the requested template is within the load path
        # to avoid inadvertent rendering of say, /etc/passwd
        next if full_name.index(File.expand_path(load_path)) != 0

        templates = Dir.glob(full_name + "*")
        if templates.include?(full_name)
          # Use an exact match if we can.
          template = full_name
        else
          # Otherwise, select the first template matched.
          template = templates.first
        end
        if template != nil
          path = template
          break
        end
      end

      if path == nil
        raise GentleREST::ResourceNotFoundError,
          "Template not found: #{name.inspect}"
      elsif File.directory?(path)
        raise GentleREST::ResourceNotFoundError,
          "Template not found: #{name.inspect}"
      end

      # Normalize to symbol
      type = File.extname(path).gsub(/^\./, "").to_s
      if type != "" && !self.types.include?(type.to_sym)
        raise ArgumentError,
          "Unrecognized template type: #{type.inspect}\n" +
          "Valid types: " +
          "#{(self.class.types.map {|t| t.inspect}).join(", ")}"
      end
      raw_content = File.open(path, "r") do |file|
        file.read
      end

      # Assign layout information to the presenter object.
      presenter.inner_template = options[:inner_template]
      presenter.inner_presenter = options[:inner_presenter]

      begin
        return self.processor(type).call(raw_content, presenter)
      rescue Exception => e
        e.message << "\nError occurred while rendering '#{name}'"
        raise e
      end
    end
  end
end

require "haml"
GentleREST::Template.register_type(:haml) do |input, context|
  Haml::Engine.new(
    input, {
      :attr_wrapper => "\""
    }
  ).render(context)
end

require "sass"
GentleREST::Template.register_type(:sass) do |input, context|
  Sass::Engine.new(
    input, {
      :style => :expanded,
      :load_paths => $TEMPLATE_PATH
    }
  ).render
end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.admiralFedora.n_body.MyGLSurfaceView
        android:id="@+id/myGLSurfaceView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>


text:
package com.fedevela.asic.util;

/**
 * Created by fvelazquez on 9/04/14.
 */
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class FechasUtil {

    public Date StringToDate(String fecha) {

        SimpleDateFormat formatoDelTexto = new SimpleDateFormat("dd/MM/yyyy");

        Date date = null;

        try {
            formatoDelTexto.setLenient(false);
            date = formatoDelTexto.parse(fecha);
        } catch (ParseException ex) {
            ex.printStackTrace();
        }

        return date;
    }

    public static int restarFechas(Calendar fechaInicio, Calendar fechaFin) {
        int diasDiferencia = 0;

        //Las fehas son del mismo año
        if (fechaInicio.get(Calendar.YEAR) == fechaFin.get(Calendar.YEAR)) {
            diasDiferencia = fechaFin.get(Calendar.DAY_OF_YEAR) - fechaInicio.get(Calendar.DAY_OF_YEAR);
        } //Las fehas son de años diferentes
        else {

            long diferencia = fechaFin.getTimeInMillis() - fechaInicio.getTimeInMillis();
            try {
                diasDiferencia = (int) (diferencia / (1000 * 60 * 60 * 24));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        return diasDiferencia;
    }

    /**
     * Le da formato a un Date segun el formato pasado como parametro
     * ejem. "yyyy-MM-dd"
     * @param date
     * @param formato
     * @return
     */
    public static String formatDate(Date date, String formato) {
        SimpleDateFormat formateador = new SimpleDateFormat(formato);

        return formateador.format(date);
    }

    /**
     * agrega el número de días a la fecha de entrada
     *
     * @param fecha actual
     * @param dias a agregar
     * @return fecha más los días agregados
     */
    public static Date agregarDias(Date fecha, int dias) {
        Calendar c = Calendar.getInstance();
        c.setTime(fecha);
        c.add(Calendar.DATE, dias);

        return c.getTime();
    }
}


text:
package de.mca.ui;
import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import de.mca.interfaces.Callback;

@SuppressWarnings("serial")
public class Window extends JFrame {
	private int border = 5;
	private JPanel content;
	private Window instance;
	private JPanel body;

	public Window(String string) {
		super(string);

		body		= new JPanel();
		instance	= this;

		// Content Panel
		content = new JPanel() {
			public JPanel init() {
				setLayout(new BorderLayout());
				setOpaque(false);
				return this;
			}

			@Override
			protected void paintComponent(Graphics g) {
				super.paintComponent(g);

				Graphics2D g2d = (Graphics2D) g.create();

				// Draw Shadow
				g2d.setColor(Color.BLACK);
				for(int i = 0; i < border; i++) {
					g2d.setComposite(AlphaComposite.SrcOver.derive(0.1f));
					g2d.fillRect(i, i, getWidth() - (2 * i), getHeight() - (2 * i));
				}

				// Draw Background
				g2d.setComposite(AlphaComposite.SrcOver.derive(1f));
				g2d.setColor(Color.WHITE);
				g2d.fillRect(border - 2, border - 2, getWidth() - (2 * border - 4), getHeight() - (2 * border - 4));
				g2d.dispose();
			}
		}.init();

		// Topbar
		content.add(BorderLayout.NORTH, new JPanel() {
			private Point initialClick;

			public JPanel init() {
				setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
				setBorder(new EmptyBorder(3, 0, 0, 3));
			    setOpaque(false);

				// Button: Minimize
				add(new Button(new Callback() {
					@Override
					public void run(Button b) {
						b.updateIcons("/de/mca/resources/window_minimize_normal.png", "/de/mca/resources/window_minimize_hover.png");
					}
				}, null, new Callback() {
					@Override
					public void run(Button b) {
						instance.setExtendedState(JFrame.ICONIFIED);
						instance.setLocationRelativeTo(null);
					}
				}));

				// Button: Maximize / Restore
				add(new Button(new Callback() {
					@Override
					public void run(Button b) {
						b.updateIcons("/de/mca/resources/window_maximize_normal.png", "/de/mca/resources/window_maximize_hover.png");
					}
				}, new Callback() {
					@Override
					public void run(Button b) {
						if((instance.getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH) {
							b.updateIcons("/de/mca/resources/window_restore_normal.png", "/de/mca/resources/window_restore_hover.png");
						} else {
							b.updateIcons("/de/mca/resources/window_maximize_normal.png", "/de/mca/resources/window_maximize_hover.png");
						}
					}
				}, new Callback() {
					@Override
					public void run(Button b) {
						instance.setExtendedState((instance.getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH ? JFrame.NORMAL : JFrame.MAXIMIZED_BOTH);
						instance.setLocationRelativeTo(null);
					}
				}, instance));

				// Button: Close
				add(new Button(new Callback() {
					@Override
					public void run(Button b) {
						b.updateIcons("/de/mca/resources/window_close_normal.png", "/de/mca/resources/window_close_hover.png");
					}
				}, null, new Callback() {
					@Override
					public void run(Button b) {
						instance.close();
					}
				}));

				setOpaque(false);

				addMouseListener(new MouseAdapter() {
					public void mousePressed(MouseEvent e) {
						if(e.getClickCount() == 2) {
							instance.setExtendedState((instance.getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH ? JFrame.NORMAL : JFrame.MAXIMIZED_BOTH);
							instance.setLocationRelativeTo(null);
						} else {
							if((instance.getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH) {
								return;
							}

							initialClick = e.getPoint();

							getComponentAt(initialClick);
						}
					}
				});

				addMouseMotionListener(new MouseMotionAdapter() {
					public void mouseDragged(MouseEvent e) {
						if(initialClick == null || (instance.getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH) {
							return;
						}

						int thisX	= instance.getLocation().x;
						int thisY	= instance.getLocation().y;
						int xMoved	= (thisX + e.getX()) - (thisX + initialClick.x);
						int yMoved	= (thisY + e.getY()) - (thisY + initialClick.y);
						int X		= thisX + xMoved;
						int Y		= thisY + yMoved;

						instance.setLocation(X, Y);
					}
				});

				return this;
			}
		}.init());

		// Body
		body.setOpaque(false);
		body.setBackground(Color.YELLOW);
		body.setLayout(new BorderLayout());

		content.setOpaque(false);
		content.add(BorderLayout.CENTER, body);

		addWindowListener(new WindowAdapter() {
		    @Override
		    public void windowClosing(WindowEvent windowEvent) {
		    	instance.close();
		    }
		});

		// Defaults
		setLayout(new BorderLayout());
		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		add(content);
		setUndecorated(true);
		setBackground(new Color(0, 0, 0, 0));
		setSize(800, 600);
		getRootPane().setOpaque(false);
		setLocationRelativeTo(null);
		setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/de/mca/resources/logo.png")));
	}

	public Window() {
		this("");
	}

	public void open() {
		setVisible(true);
	}

	public void close() {
		setVisible(false);
	}

	public void setOverlay(JComponent c) {
		if(getGlassPane().isVisible()) {
			return;
		}

		setGlassPane(c);

		for(MouseListener a : content.getMouseListeners()) {
			c.addMouseListener(a);
		}

		c.setVisible(true);
	}

	@Override
	public Component add(Component c) {
		if(content.equals(c)) {
			super.add(c);
		} else {
			if(c instanceof JComponent) {
				((JComponent) c).setOpaque(false);
			}

			body.add(c);
		}

		return c;
	}
}


text:
import { CryptoProxy, PrivateKeyReference, PublicKeyReference, WorkerDecryptionResult } from '@proton/crypto';
import { arrayToBinaryString, encodeBase64 } from '@proton/crypto/lib/utils';
import { createDraft, updateDraft } from '@proton/shared/lib/api/messages';
import { Api } from '@proton/shared/lib/interfaces';
import { Attachment, Message } from '@proton/shared/lib/interfaces/mail/Message';
import { CREATE_DRAFT_MESSAGE_ACTION } from '@proton/shared/lib/interfaces/message';
import { getAttachments, isPlainText } from '@proton/shared/lib/mail/messages';
import { getSessionKey } from '@proton/shared/lib/mail/send/attachments';

import { MESSAGE_ACTIONS } from '../../constants';
import { GetMessageKeys } from '../../hooks/message/useGetMessageKeys';
import { MessageKeys, MessageState, MessageStateWithData, PublicPrivateKey } from '../../logic/messages/messagesTypes';
import { combineHeaders, splitMail } from '../mail';
import { constructMimeFromSource } from '../send/sendMimeBuilder';
import { getDocumentContent, getPlainTextContent } from './messageContent';
import { insertActualEmbeddedImages } from './messageEmbeddeds';
import { restoreAllPrefixedAttributes } from './messageImages';

const removePasswordFromRequests: Pick<Message, 'Password' | 'PasswordHint'> = {
    Password: undefined,
    PasswordHint: undefined,
};

const restorePasswordFromResults = (
    resultMessage: Message,
    originalMessage: Pick<Message, 'Password' | 'PasswordHint'>
): Message => ({
    ...resultMessage,
    Password: originalMessage.Password,
    PasswordHint: originalMessage.PasswordHint,
});

export const prepareExport = (message: MessageState) => {
    if (!message.messageDocument?.document) {
        return '';
    }

    const document = message.messageDocument.document.cloneNode(true) as Element;

    // Embedded images
    insertActualEmbeddedImages(document);

    let content = getDocumentContent(document);

    // Remote images
    content = restoreAllPrefixedAttributes(content);

    return content;
};

const encryptBody = async (content: string, messageKeys: PublicPrivateKey) => {
    const publicKeys = messageKeys.publicKeys.slice(0, 1);
    const privateKeys = messageKeys.privateKeys.slice(0, 1);

    const { message: data } = await CryptoProxy.encryptMessage({
        textData: content,
        stripTrailingSpaces: true,
        encryptionKeys: publicKeys,
        signingKeys: privateKeys,
    });

    return data;
};

export const prepareAndEncryptBody = async (message: MessageState, messageKeys: MessageKeys) => {
    const plainText = isPlainText(message.data);
    const content = plainText ? getPlainTextContent(message) : prepareExport(message);
    return encryptBody(content, messageKeys as PublicPrivateKey);
};

export const encryptAttachmentKeyPackets = async (
    attachments: Attachment[],
    previousAddressPrivateKeys: PrivateKeyReference[] = [],
    newAddressPublicKeys: PublicKeyReference[] = []
) => {
    return Object.fromEntries(
        await Promise.all(
            attachments
                .filter(({ ID = '' }) => ID.indexOf('PGPAttachment'))
                .map(async (attachment) => {
                    const sessionKey = await getSessionKey(attachment, previousAddressPrivateKeys);
                    const encryptedSessionKey = await CryptoProxy.encryptSessionKey({
                        data: sessionKey.data,
                        algorithm: sessionKey.algorithm,
                        encryptionKeys: newAddressPublicKeys,
                        format: 'binary',
                    });
                    return [attachment.ID || '', encodeBase64(arrayToBinaryString(encryptedSessionKey))];
                })
        )
    );
};

export const createMessage = async (
    message: MessageStateWithData,
    api: Api,
    getMessageKeys: GetMessageKeys
): Promise<Message> => {
    const messageKeys = await getMessageKeys(message.data);
    const Body = await prepareAndEncryptBody(message, messageKeys);
    const attachments = getAttachments(message.data);

    let AttachmentKeyPackets;
    if (attachments?.length) {
        const originalMessageKeys = await getMessageKeys({
            AddressID: message.draftFlags?.originalAddressID || message.data?.AddressID,
        });
        AttachmentKeyPackets = await encryptAttachmentKeyPackets(
            attachments,
            originalMessageKeys.privateKeys,
            messageKeys.publicKeys
        );
    }

    const getMessageAction = (action: MESSAGE_ACTIONS | undefined): CREATE_DRAFT_MESSAGE_ACTION | undefined => {
        if (action !== MESSAGE_ACTIONS.NEW && action !== undefined) {
            return action as unknown as CREATE_DRAFT_MESSAGE_ACTION;
        }

        return undefined;
    };

    const { Message: updatedMessage } = await api(
        createDraft({
            Action: getMessageAction(message.draftFlags?.action),
            Message: { ...message.data, Body, ...removePasswordFromRequests },
            ParentID: message.draftFlags?.ParentID,
            AttachmentKeyPackets,
        })
    );
    return restorePasswordFromResults(updatedMessage, message.data);
};

/**
 * Update an already existing message by encrypting it then send the API request to the API
 * @param message The message to update containing the right keys related to the address
 * @param senderHasChanged Things are different if the sender has changed since the last version
 * @param previousAddressPrivateKeys Only needed if senderHasChanged to decrypt attachments sessionKeys and re-encrypt with the new address key
 * @param api Api handler to use
 */
export const updateMessage = async (
    message: MessageStateWithData,
    previousAddressID: string,
    api: Api,
    getMessageKeys: GetMessageKeys
): Promise<Message> => {
    const messageKeys = await getMessageKeys(message.data);
    const Body = await prepareAndEncryptBody(message, messageKeys);
    const attachments = getAttachments(message.data);
    let AttachmentKeyPackets;
    if (attachments?.length && previousAddressID !== message.data.AddressID) {
        const previousMessageKeys = await getMessageKeys({ AddressID: previousAddressID });
        AttachmentKeyPackets = await encryptAttachmentKeyPackets(
            attachments,
            previousMessageKeys.privateKeys,
            messageKeys.publicKeys
        );
    }
    const { Message: updatedMessage } = await api({
        ...updateDraft(message.data?.ID, {
            Message: { ...message.data, Body, ...removePasswordFromRequests },
            AttachmentKeyPackets,
        }),
        silence: true,
    });

    return restorePasswordFromResults(updatedMessage, message.data);
};

/**
 * Prepare a message a blob to download
 * Use mime format, don't encrypt,
 */
export const exportBlob = async (
    message: MessageState,
    messageKeys: MessageKeys,
    getAttachment: (ID: string) => WorkerDecryptionResult<Uint8Array> | undefined,
    onUpdateAttachment: (ID: string, attachment: WorkerDecryptionResult<Uint8Array>) => void,
    api: Api
) => {
    const mimeMessage = await constructMimeFromSource(message, messageKeys, getAttachment, onUpdateAttachment, api);
    const { body, headers: mimeHeaders } = splitMail(mimeMessage);
    const headers = await combineHeaders(message.data?.Header || '', mimeHeaders);

    return new Blob([`${headers}\r\n${body}`], {
        type: 'data:text/plain;charset=utf-8;',
    });
};


text:
function createTable(){
var databaseUrl = "mongodb://admin:admin@ds033069.mongolab.com:33069/heroku_app22105721";

var collections = ["tresfit", "arrgym"];
var db = require("mongojs").connect(databaseUrl, collections);
document.write(
test
);
db.tresfit.find().toArray(function(err, items) {
        {{#each items}}
 		 document.write(
test
);
  		{{/each}}
    });
}


text:
package models

import (
	"fmt"

	"gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"
)

func JoinGame(db *mgo.Database, gameID string, accountID string, buyinAmount int) (Game, error) {
	games := db.C("games")
	g := Game{}
	query := bson.M{"gameID": gameID}
	if err := games.Find(query).One(&g); err != nil {
		return Game{}, err
	}
	for i := range g.Players {
		if g.Players[i].AccountID == accountID {
			return g, nil
		}
	}

	//subtract buyin amount from account
	if buyinAmount <= 0 {
		return g, fmt.Errorf("buyin must be >0")
	}
	account, err := LoadAccountByID(db, accountID)
	if err != nil {
		return g, fmt.Errorf("failed to load account")
	}
	if account.Balance-buyinAmount < 0 {
		return g, fmt.Errorf("not enough funds to buy in")
	}
	account.Balance -= buyinAmount
	if err := account.Update(db); err != nil {
		return g, fmt.Errorf("failed to update account balance")
	}

	gp := GamePlayer{AccountID: account.AccountID, Name: account.Username, Chips: buyinAmount}
	g.Players = append(g.Players, gp)
	if err := games.Update(query, g); err != nil {
		return Game{}, err
	}
	return g, nil
}

func LeaveGame(db *mgo.Database, gameID string, accountID string) (Game, error) {
	games := db.C("games")
	g := Game{}
	query := bson.M{"gameID": gameID}
	if err := games.Find(query).One(&g); err != nil {
		return Game{}, err
	}
	for i := range g.Players {
		if g.Players[i].AccountID != accountID {
			continue
		}

		if g.GameType == "highcard" {
			if err := highCardFoldOutOfTurn(gameID, accountID); err != nil {
				return Game{}, fmt.Errorf("failed to fold highcard out of turn: %+v", err)
			}
		} else {
			return Game{}, fmt.Errorf("game %s fold out of turn not implemented.")
		}

		chips := g.Players[i].Chips
		g.Players = append(g.Players[0:i], g.Players[i+1:]...)
		if err := games.Update(query, g); err != nil {
			return Game{}, err
		}

		account, err := LoadAccountByID(db, accountID)
		if err != nil {
			return g, fmt.Errorf("failed to load account")
		}
		account.Balance += chips
		if err := account.Update(db); err != nil {
			return g, fmt.Errorf("failed to update account balance")
		}

		break

	}
	return g, nil
}

func RemovePlayerFromGames(db *mgo.Database, accountID string) error {
	gamesDB := db.C("games")
	games := []Game{}
	query := bson.M{}
	if err := gamesDB.Find(query).All(&games); err != nil {
		return err
	}

	for _, game := range games {
		for i := range game.Players {
			if game.Players[i].AccountID == accountID {
				game.Players = append(game.Players[0:i], game.Players[i+1:]...)
				if err := gamesDB.Update(bson.M{"gameID": game.ID}, game); err != nil {
					return err
				}
				break
			}
		}

	}
	return nil
}


text:
Shellmap is a tiny *pseudo-xargs* script that helps to chain or sequence variants of a shell command using placeholders.

### Usage

```
$ python shellmap.py "<base command with N placeholders>" "<placeholder 1>"
                                    "<placeholder 2>" ... "<placeholder N>" [--print|--run]
$ python shellmap.py --help
usage: shellmap.py [-h] [--print] [--run] N [N ...]

Chain/sequence shell scripts.

positional arguments:
  N           Command string with placeholders, followed by arguments.

optional arguments:
  -h, --help  show this help message and exit
  --print     Print the output commands
  --run       Run the output commands
$ python shellmap.py "echo \$1@ \$2@ \$1@" "%ls" "is,is not" --print
echo LICENSE is LICENSE
echo LICENSE is not LICENSE
echo README.md is README.md
echo README.md is not README.md
echo shellmap.py is shellmap.py
echo shellmap.py is not shellmap.py
$ python shellmap.py "echo \$1@ \$2@ \$1@" "%ls" "is,is not" --run
LICENSE is LICENSE
LICENSE is not LICENSE
README.md is README.md
README.md is not README.md
shellmap.py is shellmap.py
shellmap.py is not shellmap.py
```

### Example

Say we have the following directory structure:

```
month_reports/
    date_reports/
        15.csv
        16.csv
        17.csv
    Jan_2015.txt
    Feb_2015.txt
```

We wish to create a new directory *final_reports*, and make new files for each permutation of the dates, months and one of *pre*, *curr*, and *post*, in the format DD_MMM_YYYY_[pre|curr|post].txt. The final directory structure needs to be like this:

```
month_reports/
    final_reports/
        15_Jan_2015_pre.txt
        15_Jan_2015_curr.txt
        15_Jan_2015_post.txt
        16_Jan_2015_pre.txt
        16_Jan_2015_curr.txt
        16_Jan_2015_post.txt
        17_Jan_2015_pre.txt
        17_Jan_2015_curr.txt
        17_Jan_2015_post.txt
        15_Feb_2015_pre.txt
        15_Feb_2015_curr.txt
        15_Feb_2015_post.txt
        16_Feb_2015_pre.txt
        16_Feb_2015_curr.txt
        16_Feb_2015_post.txt
        17_Feb_2015_pre.txt
        17_Feb_2015_curr.txt
        17_Feb_2015_post.txt
    date_reports/
        15.csv
        16.csv
        17.csv
    Jan_2015.txt
    Feb_2015.txt
```

We have three positional arguments, one for the date, one for the month_year, and one for [pre|curr|post]. First we'd like to check the output commands to see what's going to run. So here's what we do, using the format `\$N@` for positional arguments:

```
$ mkdir final_reports && cd $_
$ shellmap "touch \$1@_\$2@_\$3@.txt" "15,16,17" "Jan_2015,Feb_2015" "pre,curr,post" --print
touch 15_Jan_2015_pre.txt
touch 15_Jan_2015_curr.txt
touch 15_Jan_2015_post.txt
touch 15_Feb_2015_pre.txt
touch 15_Feb_2015_curr.txt
touch 15_Feb_2015_post.txt
touch 16_Jan_2015_pre.txt
touch 16_Jan_2015_curr.txt
touch 16_Jan_2015_post.txt
touch 16_Feb_2015_pre.txt
touch 16_Feb_2015_curr.txt
touch 16_Feb_2015_post.txt
touch 17_Jan_2015_pre.txt
touch 17_Jan_2015_curr.txt
touch 17_Jan_2015_post.txt
touch 17_Feb_2015_pre.txt
touch 17_Feb_2015_curr.txt
touch 17_Feb_2015_post.txt
```

Great! The commands look valid. Time to run them.

```
$ shellmap "touch \$1@_\$2@_\$3@.txt" "15,16,17" "Jan_2015,Feb_2015" "pre,curr,post" --run
$ ls
15_Feb_2015_curr.txt  15_Jan_2015_curr.txt  16_Feb_2015_curr.txt  16_Jan_2015_curr.txt  17_Feb_2015_curr.txt  17_Jan_2015_curr.txt
15_Feb_2015_post.txt  15_Jan_2015_post.txt  16_Feb_2015_post.txt  16_Jan_2015_post.txt  17_Feb_2015_post.txt  17_Jan_2015_post.txt
15_Feb_2015_pre.txt   15_Jan_2015_pre.txt   16_Feb_2015_pre.txt   16_Jan_2015_pre.txt   17_Feb_2015_pre.txt   17_Jan_2015_pre.txt
```

Suh-weet! That worked. But wait, what if we have 31 date files in *date_reports* instead of 2? Do we have to type them all out in a comma-separated list? Why can't we just take the output of some shell command that will give us a list of those files? Like `ls`?

#### Shell commands within placeholders

Prefacing an argument list with `%` substitutes the list with the output of the command after the `%`. For instance, typing `"%ls date_reports/"` in our case would run `ls date_reports/`, take the output list, and place it there. Let's try that:

```
 $ python shellmap.py "touch \$1@_\$2@_\$3@.txt" "%ls ../date_reports/" "Jan_2015,Feb_2015" "pre,curr,post" --print
touch 15.csv_Jan_2015_pre.txt
touch 15.csv_Jan_2015_curr.txt
touch 15.csv_Jan_2015_post.txt
touch 15.csv_Feb_2015_pre.txt
touch 15.csv_Feb_2015_curr.txt
touch 15.csv_Feb_2015_post.txt
touch 16.csv_Jan_2015_pre.txt
touch 16.csv_Jan_2015_curr.txt
touch 16.csv_Jan_2015_post.txt
touch 16.csv_Feb_2015_pre.txt
touch 16.csv_Feb_2015_curr.txt
touch 16.csv_Feb_2015_post.txt
touch 17.csv_Jan_2015_pre.txt
touch 17.csv_Jan_2015_curr.txt
touch 17.csv_Jan_2015_post.txt
touch 17.csv_Feb_2015_pre.txt
touch 17.csv_Feb_2015_curr.txt
touch 17.csv_Feb_2015_post.txt
```

Seems to work, but there's that pesky *.csv* in that `ls` output. That's fine and dandy, we just have to use `sed` to get rid of that cruft. So here's the newer version:

```
$ python shellmap.py "touch \$1@_\$2@_\$3@.txt" "%ls -1 month_reports/date_reports/ | sed -e 's/\..*$//'" "Jan_2015,Feb_2015" "pre,curr,post" --print
touch 15_Jan_2015_pre.txt
touch 15_Jan_2015_curr.txt
touch 15_Jan_2015_post.txt
touch 15_Feb_2015_pre.txt
touch 15_Feb_2015_curr.txt
touch 15_Feb_2015_post.txt
touch 16_Jan_2015_pre.txt
touch 16_Jan_2015_curr.txt
touch 16_Jan_2015_post.txt
touch 16_Feb_2015_pre.txt
touch 16_Feb_2015_curr.txt
touch 16_Feb_2015_post.txt
touch 17_Jan_2015_pre.txt
touch 17_Jan_2015_curr.txt
touch 17_Jan_2015_post.txt
touch 17_Feb_2015_pre.txt
touch 17_Feb_2015_curr.txt
touch 17_Feb_2015_post.txt
```

And there we go!

### Downloading

```
$ git clone https://github.com/pranavrc/shellmap.git
$ cd shellmap/
$ python shellmap.py --help
usage: shellmap.py [-h] [--print] [--run] N [N ...]

Chain/sequence shell scripts.

positional arguments:
  N           Command string with placeholders, followed by arguments.

optional arguments:
  -h, --help  show this help message and exit
  --print     Print the output commands
  --run       Run the output commands
```

To be globally executable, the script needs to be in the `$PATH`.


text:
	dofile("testfx.lua")

--
-- Some helper functions
--

	test.createsolution = function()
		local sln = solution "MySolution"
		configurations { "Debug", "Release" }

		local prj = project "MyProject"
		language "C++"
		kind "ConsoleApp"

		return sln, prj
	end

	test.createproject = function(sln)
		local n = #sln.projects + 1
		if n == 1 then n = "" end

		local prj = project ("MyProject" .. n)
		language "C++"
		kind "ConsoleApp"
		return prj
	end

--
-- The test suites
--

	dofile("test_dofile.lua")
	dofile("test_string.lua")
	dofile("test_premake.lua")
	dofile("test_project.lua")
	dofile("test_platforms.lua")
	dofile("test_targets.lua")
	dofile("test_keywords.lua")
	dofile("test_gcc.lua")
	dofile("test_gmake_cpp.lua")
	dofile("test_gmake_cs.lua")
	dofile("base/test_api.lua")
	dofile("base/test_action.lua")
	dofile("base/test_baking.lua")
	dofile("base/test_config.lua")
	dofile("base/test_os.lua")
	dofile("base/test_path.lua")
	dofile("base/test_table.lua")
	dofile("base/test_tree.lua")

	-- Clean tests
	dofile("actions/test_clean.lua")

	-- Visual Studio tests
	dofile("test_vs2002_sln.lua")
	dofile("test_vs2003_sln.lua")
	dofile("test_vs2005_sln.lua")
	dofile("test_vs2008_sln.lua")
	dofile("test_vs2010_sln.lua")
	dofile("actions/vstudio/test_vs2005_csproj.lua")
	dofile("actions/vstudio/test_vs200x_vcproj.lua")
	dofile("actions/vstudio/test_vs200x_vcproj_linker.lua")
	dofile("actions/vstudio/test_vs2010_vcxproj.lua")
	dofile("actions/vstudio/test_vs2010_flags.lua")
	dofile("actions/vstudio/test_vs2010_links.lua")
	dofile("actions/vstudio/test_vs2010_filters.lua")
	dofile("actions/vstudio/test_vs2010_project_kinds.lua")

	-- Makefile tests
	dofile("actions/make/test_make_escaping.lua")
	dofile("actions/make/test_make_pch.lua")

	-- Xcode tests
	dofile("actions/xcode/test_xcode_common.lua")
	dofile("actions/xcode/test_xcode_project.lua")
	dofile("actions/xcode/test_xcode_dependencies.lua")

--
-- Register a test action
--

	newaction {
		trigger     = "test",
		description = "Run the automated test suite",

		execute = function ()
			passed, failed = test.runall()
			msg = string.format("%d tests passed, %d failed", passed, failed)
			if (failed > 0) then
				error(msg, 0)
			else
				print(msg)
			end
		end
	}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Folia Geobot. Phytotax. 3:407. 1968

#### Original name
null

### Remarks
null


text:
#include "cppgen/generator_preferences.h"

#include <algorithm>

#include "cppgen/naming_convention.h"
#include "utils/safeformat.h"
#include "utils/string_utils.h"

using typesafe_format::format;

namespace codegen {

TypePreferences::TypePreferences(int minimum_interger_size,
                                 bool avoid_unsigned,
                                 bool generate_json)
    : minimum_interger_size(minimum_interger_size),
      avoid_unsigned(avoid_unsigned),
      generate_json(generate_json) {
}

Preferences::Preferences(int minimum_interger_size,
                         bool avoid_unsigned,
                         bool generate_json,
                         const std::set<std::string>& requested_interfaces)
    : type_preferences(minimum_interger_size, avoid_unsigned,
                       generate_json),
      requested_interfaces(requested_interfaces) {
}

namespace func_names {
const char* kAdditionalValidation = "Validate";
}

}  // namespace codegen


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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.

/**
 * LineItemCreativeAssociationServiceInterface.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.admanager.axis.v202205;

public interface LineItemCreativeAssociationServiceInterface extends java.rmi.Remote {

    /**
     * Creates new {@link LineItemCreativeAssociation} objects
     */
    public com.google.api.ads.admanager.axis.v202205.LineItemCreativeAssociation[] createLineItemCreativeAssociations(com.google.api.ads.admanager.axis.v202205.LineItemCreativeAssociation[] lineItemCreativeAssociations) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;

    /**
     * Gets a {@link LineItemCreativeAssociationPage} of
     *         {@link LineItemCreativeAssociation} objects that satisfy the
     * given
     *         {@link Statement#query}. The following fields are supported
     * for filtering:
     *
     *

     *

     *         PQL Property	 Object Property
     *

     *

     *         {@code creativeId}
     *         {@link LineItemCreativeAssociation#creativeId}
     *

     *

     *         {@code manualCreativeRotationWeight}
     *         {@link LineItemCreativeAssociation#manualCreativeRotationWeight}
     *

     *

     *         {@code destinationUrl}
     *         {@link LineItemCreativeAssociation#destinationUrl}
     *

     *

     *         {@code lineItemId}
     *         {@link LineItemCreativeAssociation#lineItemId}
     *

     *

     *         {@code status}
     *         {@link LineItemCreativeAssociation#status}
     *

     *

     *         {@code lastModifiedDateTime}
     *         {@link LineItemCreativeAssociation#lastModifiedDateTime}
     *

     *

     */
    public com.google.api.ads.admanager.axis.v202205.LineItemCreativeAssociationPage getLineItemCreativeAssociationsByStatement(com.google.api.ads.admanager.axis.v202205.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;

    /**
     * Returns an insite preview URL that references the specified
     * site URL with
     *         the specified creative from the association served to it.
     * For Creative Set
     *         previewing you may specify the master creative Id.
     */
    public java.lang.String getPreviewUrl(java.lang.Long lineItemId, java.lang.Long creativeId, java.lang.String siteUrl) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;

    /**
     * Returns a list of URLs that reference the specified site URL
     * with the specified creative from
     *         the association served to it. For Creative Set previewing
     * you may specify the master creative
     *         Id. Each URL corresponds to one available native style for
     * previewing the specified creative.
     */
    public com.google.api.ads.admanager.axis.v202205.CreativeNativeStylePreview[] getPreviewUrlsForNativeStyles(java.lang.Long lineItemId, java.lang.Long creativeId, java.lang.String siteUrl) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;

    /**
     * Performs actions on {@link LineItemCreativeAssociation} objects
     * that match
     *         the given {@link Statement#query}.
     */
    public com.google.api.ads.admanager.axis.v202205.UpdateResult performLineItemCreativeAssociationAction(com.google.api.ads.admanager.axis.v202205.LineItemCreativeAssociationAction lineItemCreativeAssociationAction, com.google.api.ads.admanager.axis.v202205.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;

    /**
     * Pushes a creative to devices that that satisfy the given {@link
     * Statement#query}. *
     */
    public com.google.api.ads.admanager.axis.v202205.UpdateResult pushCreativeToDevices(com.google.api.ads.admanager.axis.v202205.Statement filterStatement, com.google.api.ads.admanager.axis.v202205.CreativePushOptions options) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;

    /**
     * Updates the specified {@link LineItemCreativeAssociation} objects
     */
    public com.google.api.ads.admanager.axis.v202205.LineItemCreativeAssociation[] updateLineItemCreativeAssociations(com.google.api.ads.admanager.axis.v202205.LineItemCreativeAssociation[] lineItemCreativeAssociations) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202205.ApiException;
}


text:
package io.druid.query.aggregation;

import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import io.druid.segment.ObjectColumnSelector;

import java.util.Map;

public class JavaScriptAggregatorBenchmark extends SimpleBenchmark
{

  protected static final Map<String, String> scriptDoubleSum = Maps.newHashMap();
  static {
    scriptDoubleSum.put("fnAggregate", "function aggregate(current, a) { return current + a }");
    scriptDoubleSum.put("fnReset", "function reset() { return 0 }");
    scriptDoubleSum.put("fnCombine", "function combine(a,b) { return a + b }");
  }

  private static void aggregate(TestFloatColumnSelector selector, Aggregator agg)
  {
    agg.aggregate();
    selector.increment();
  }

  private JavaScriptAggregator jsAggregator;
  private DoubleSumAggregator doubleAgg;
  final LoopingFloatColumnSelector selector = new LoopingFloatColumnSelector(new float[]{42.12f, 9f});

  @Override
  protected void setUp() throws Exception
  {
    Map<String, String> script = scriptDoubleSum;

    jsAggregator = new JavaScriptAggregator(
        Lists.asList(MetricSelectorUtils.wrap(selector), new ObjectColumnSelector[]{}),
        JavaScriptAggregatorFactory.compileScript(
            script.get("fnAggregate"),
            script.get("fnReset"),
            script.get("fnCombine")
        )
    );

    doubleAgg = new DoubleSumAggregator(selector);
  }

  public double timeJavaScriptDoubleSum(int reps)
  {
    double val = 0;
    for(int i = 0; i < reps; ++i) {
      aggregate(selector, jsAggregator);
    }
    return val;
  }

  public double timeNativeDoubleSum(int reps)
  {
    double val = 0;
    for(int i = 0; i < reps; ++i) {
      aggregate(selector, doubleAgg);
    }
    return val;
  }

  public static void main(String[] args) throws Exception
  {
    Runner.main(JavaScriptAggregatorBenchmark.class, args);
  }

  protected static class LoopingFloatColumnSelector extends TestFloatColumnSelector
  {
    private final float[] floats;
    private long index = 0;

    public LoopingFloatColumnSelector(float[] floats)
    {
      super(floats);
      this.floats = floats;
    }

    @Override
    public float get()
    {
      return floats[(int) (index % floats.length)];
    }

    public void increment()
    {
      ++index;
      if (index < 0) {
        index = 0;
      }
    }
  }
}


text:
//
// NonBlockingConsole.cs
//
// Author:
//       Tobias Schulz <tobiasschulz.code@outlook.de>
//
// Copyright (c) 2015 Tobias Schulz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Core.Common;
using Core.IO.Terminal;
using Core.IO.Streams;

namespace Core.IO
{
	public class NonBlockingConsole : ITerminalStream
	{
		public static NonBlockingConsole Instance = new NonBlockingConsole ();

		readonly BlockingCollection<string> queueOutput = new BlockingCollection<string> ();
		readonly BlockingCollection<ConsoleKeyInfo> queueInput = new BlockingCollection<ConsoleKeyInfo> ();

		const int InputInterval = 50;

		bool running;
		readonly Thread threadOutput;
		readonly Thread threadInput;
		readonly Thread threadInputProcessing;
		readonly object lockObject = new object ();
		bool runningOutput;
		bool runningInput;
		bool runningInputProcessing;

		public bool IsInputOpen { get; private set; } = false;

		NonBlockingConsole ()
		{
			// unit tests
			if (Core.Portable.PlatformInfo.System.IsRunningFromNUnit) {
				running = false;
				IsInputOpen = false;
			}
			// normal program
			else {
				running = true;
				threadOutput = new Thread (
					() => {
						runningOutput = true;
						string item;
						while (running) {
							if (queueOutput.TryTake (out item, InputInterval)) {
								lock (lockObject) {
									Console.Write (item);
								}
							}
						}
						runningOutput = false;
					});
				threadOutput.IsBackground = true;
				threadOutput.Start ();

				threadInput = new Thread (
					() => {
						runningInput = true;
						while (running) {
							while (Console.KeyAvailable) {
								lock (lockObject) {
									queueInput.Add (Console.ReadKey (true));
								}
							}
							Thread.Sleep (InputInterval);
						}
						runningInput = false;
					});
				threadInput.IsBackground = true;
				threadInput.Start ();

				threadInputProcessing = new Thread (
					() => {
						runningInputProcessing = true;
						ConsoleKeyInfo item;
						ITerminalInputStream self = this;
						while (running) {
							if (queueInput.TryTake (out item, InputInterval)) {
								//Log.Debug ("before input process");
								self.ReadHandler (new PortableConsoleKeyInfo {
									Modifiers = (Core.IO.Terminal.ConsoleModifiers)item.Modifiers,
									Key = (Core.IO.Terminal.ConsoleKey)item.Key,
									KeyChar = item.KeyChar,
								}).Wait ();
								//Log.Debug ("after input process");
							}
						}
						runningInputProcessing = false;
					});
				threadInputProcessing.IsBackground = true;
				threadInputProcessing.Start ();

				IsInputOpen = Core.Portable.PlatformInfo.System.IsInteractive;
			}
		}

		public void Finish ()
		{
			// unit tests
			if (Core.Portable.PlatformInfo.System.IsRunningFromNUnit) {
				running = false;
				IsInputOpen = false;
			}
			// normal program
			else {

				running = false;
				for (int i = 10; i >= 0 && (runningInput || runningOutput || runningInputProcessing); i--) {
					Thread.Sleep (30);
				}
				IsInputOpen = false;

				threadOutput.Abort ();
				while (queueOutput.Count > 0) {
					Console.WriteLine (queueOutput.Take ());
				}
				threadInput.Abort ();
			}
		}

		public void Write (string value)
		{
			queueOutput.Add (value);
		}

		public void WriteLine (string value)
		{
			queueOutput.Add (value + "\n");
		}

		public Task WriteAsync (string value)
		{
			Write (value);
			return TaskHelper.Completed;
		}

		public Task WriteLineAsync (string value)
		{
			WriteLine (value);
			return TaskHelper.Completed;
		}

		#region IConsoleInput implementation

		ConsoleReadHandler ITerminalInputStream.ReadHandler { get; set; } = Actions.EmptyAsync;

		bool ITerminalInputStream.IsOpen { get { return IsInputOpen; } }

		#endregion

		#region IFlexibleStream implementation

		// Analysis disable once MemberHidesStaticFromOuterClass
		async Task IFlexibleOutputStream.WriteAsync (string str)
		{
			await NonBlockingConsole.Instance.WriteAsync (str);
		}

		Task IFlexibleOutputStream.TryClose ()
		{
			return Actions.EmptyAsync ();
		}

		#endregion
	}
	/*
		public static bool TryReadKey (out ConsoleKeyInfo result, CancellationToken cancelToken)
		{
			while (IsInputOpen) {
				if (cancelToken.IsCancellationRequested) {
					break;
				}
				if (queueInput.TryTake (out result, 50)) {
					return true;
				}
			}
			result = default(ConsoleKeyInfo);
			return false;
		}

		public class ReadLine : IHistoryReadLine
		{
			public CancellationToken CancelToken { get; set; } = CancellationToken.None;

			public bool IsOpen { get { return NonBlockingConsole.IsInputOpen; } }

			public Task<bool> IsOpenAsync { get { return Task.FromResult (IsOpen); } }

			public string Line { get; private set; }

			public SpecialCommands SpecialCommand { get; private set; }

			public InputHistory History { get; set; }

			public ReadLine (InputHistory history)
			{
				History = history;
			}

			public bool TryReadLine ()
			{
				// reset state
				Line = null;
				SpecialCommand = SpecialCommands.None;

				var buf = new StringBuilder ();
				while (NonBlockingConsole.IsInputOpen) {
					if (CancelToken.IsCancellationRequested) {
						break;
					}

					ConsoleKeyInfo key;
					if (NonBlockingConsole.TryReadKey (result: out key, cancelToken: CancelToken)) {

						//Console.WriteLine (key.Key + " " + key.Modifiers);

						//Log.Debug ("Index: ", history.Index, ", History: ", history.History.Select (l => "\"" + l + "\"").Join (", "));

						// Ctrl-D
						if (key.Key == ConsoleKey.D && key.Modifiers == ConsoleModifiers.Control) {
							SpecialCommand = SpecialCommands.CloseStream;
							return true;
						}
						// F4 ? WTF ?
						else if (key.Key == ConsoleKey.F4) {
							SpecialCommand = SpecialCommands.CloseStream;
							return true;
						}
						// Arrow Keys
						else if (key.Key == ConsoleKey.UpArrow || key.Key == ConsoleKey.DownArrow || key.Key == ConsoleKey.LeftArrow || key.Key == ConsoleKey.RightArrow) {

							// save at current history position
							//history.Edit (buf.ToString ());

							// remove all current chars
							while (buf.Length > 0) {
								buf.Remove (buf.Length - 1, 1);
								System.Console.Write ("\b \b");
							}

							if (History != null) {
								// move inside the history
								if (key.Key == ConsoleKey.UpArrow)
									History.Up ();
								else if (key.Key == ConsoleKey.DownArrow)
									History.Down ();

								// load the current history position
								buf.Append (History.Current);
								System.Console.Write (buf);
							}
						}
						// Enter
						else if (key.Key == ConsoleKey.Enter) {
							if (History != null) {
								History.Add (buf.ToString ());
							}
							Line = buf.ToString ();
							System.Console.WriteLine ();
							return true;
						}
						// Backspace
						else if (key.Key == ConsoleKey.Backspace) {
							if (buf.Length > 0) {
								buf.Remove (buf.Length - 1, 1);
								System.Console.Write ("\b \b");
							}
						}
						// normal character
						else if (key.KeyChar != 0) {
							buf.Append (key.KeyChar);
							System.Console.Write (key.KeyChar);
						}
					}
				}

				Line = buf.ToString ();
				return !string.IsNullOrEmpty (Line);
			}

			public Task<bool> TryReadLineAsync ()
			{
				return Task.FromResult (TryReadLine ());
			}
		}
	}*/
}


text:
package com.sequenceiq.cloudbreak.service.upgrade.sync.operationresult;

import java.util.Set;

import com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct;
import com.sequenceiq.cloudbreak.cluster.model.ParcelInfo;

public class CmParcelSyncOperationResult {

    private final Set<ParcelInfo> activeParcels;

    private final Set<ClouderaManagerProduct> foundCmProducts;

    public CmParcelSyncOperationResult(Set<ParcelInfo> activeParcels, Set<ClouderaManagerProduct> foundCmProducts) {
        this.activeParcels = activeParcels;
        this.foundCmProducts = foundCmProducts;
    }

    public Set<ParcelInfo> getActiveParcels() {
        return activeParcels;
    }

    public Set<ClouderaManagerProduct> getFoundCmProducts() {
        return foundCmProducts;
    }

    public boolean isEmpty() {
        return activeParcels.isEmpty();
    }

    @Override
    public String toString() {
        return "CmParcelSyncOperationResult{" +
                "activeParcels=" + activeParcels +
                ", foundCmProducts=" + foundCmProducts +
                '}';
    }
}


text:
$:.insert(0, File.join([File.dirname(__FILE__), "..", "lib"]))

require 'rubygems'
require 'rspec'
require 'mocha'
require 'hiera'
require 'tmpdir'

RSpec.configure do |config|
  config.mock_with :mocha
end

# In ruby 1.8.5 Dir does not have mktmpdir defined, so this monkey patches
# Dir to include the 1.8.7 definition of that method if it isn't already defined.
# Method definition borrowed from ruby-1.8.7-p357/lib/ruby/1.8/tmpdir.rb
unless Dir.respond_to?(:mktmpdir)
  def Dir.mktmpdir(prefix_suffix=nil, tmpdir=nil)
    case prefix_suffix
    when nil
      prefix = "d"
      suffix = ""
    when String
      prefix = prefix_suffix
      suffix = ""
    when Array
      prefix = prefix_suffix[0]
      suffix = prefix_suffix[1]
    else
      raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
    end
    tmpdir ||= Dir.tmpdir
    t = Time.now.strftime("%Y%m%d")
    n = nil
    begin
      path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
      path << "-#{n}" if n
      path << suffix
      Dir.mkdir(path, 0700)
    rescue Errno::EEXIST
      n ||= 0
      n += 1
      retry
    end

    if block_given?
      begin
        yield path
      ensure
        FileUtils.remove_entry_secure path
      end
    else
      path
    end
  end
end


text:
<!-- "Fetch external resource" "true" -->

<jsp:root version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:a4j="https://ajax4<caret>jsf.dev.java.net/ajax"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk">


text:
expiring-cache-map
==================

A general purpose simple shared state cache map with automatic expiration of
values for caching the results of accessing a resource (such as reading a file),
with variations for Ord and Hashable keys.


text:
module Game.MetaGame
       ( module X
       ) where

import           Game.MetaGame.Types as X
import           Game.MetaGame.Helper as X
import           Game.MetaGame.Ask as X
import           Game.MetaGame.Play as X


text:
var webpack = require('webpack');
var umdConfig = require('./webpack.umd.config');

// setting environment
process.env.NODE_ENV = 'production';

umdConfig.output.filename = '[name].min.js';
umdConfig.devtool = null;
umdConfig.plugins = [
  new webpack.optimize.OccurrenceOrderPlugin(),
  new webpack.optimize.UglifyJsPlugin()
];

module.exports = umdConfig;


text:
'use strict';
if(typeof window !== 'undefined' && typeof GA_TRACKING_CODE !== 'undefined') {
  (function(window, document, script, url, r, tag, firstScriptTag) {
    window['GoogleAnalyticsObject']=r;
    window[r] = window[r] || function() {
      (window[r].q = window[r].q || []).push(arguments)
    };
    window[r].l = 1*new Date();
    tag = document.createElement(script),
    firstScriptTag = document.getElementsByTagName(script)[0];
    tag.async = 1;
    tag.src = url;
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  })(
    window,
    document,
    'script',
    '//www.google-analytics.com/analytics.js',
    'ga'
  );

  var ga = window.ga;

  ga('create', GA_TRACKING_CODE, 'auto');

  module.exports = function() {
    return window.ga.apply(window.ga, arguments);
  };
} else {
  module.exports = function() {console.log(arguments)};
}


text:
package org.apache.flink.table.planner.plan.batch.table.validation

import org.apache.flink.api.scala._
import org.apache.flink.table.api._
import org.apache.flink.table.api.internal.TableEnvironmentImpl
import org.apache.flink.table.planner.runtime.utils.CollectionBatchExecTable
import org.apache.flink.table.planner.runtime.utils.JavaUserDefinedScalarFunctions.PythonScalarFunction
import org.apache.flink.table.planner.utils.TableTestBase

import org.junit._

class JoinValidationTest extends TableTestBase {

  @Test(expected = classOf[ValidationException])
  def testJoinNonExistingKey(): Unit = {
    val util = batchTestUtil()
    val ds1 = util.addTableSource[(Int, Long, String)]("Table3",'a, 'b, 'c)
    val ds2 = util.addTableSource[(Int, Long, Int, String, Long)]("Table5", 'd, 'e, 'f, 'g, 'h)

    ds1.join(ds2)
      // must fail. Field 'foo does not exist
      .where('foo === 'e)
      .select('c, 'g)
  }

  @Test(expected = classOf[ValidationException])
  def testJoinWithNonMatchingKeyTypes(): Unit = {
    val util = batchTestUtil()
    val ds1 = util.addTableSource[(Int, Long, String)]("Table3",'a, 'b, 'c)
    val ds2 = util.addTableSource[(Int, Long, Int, String, Long)]("Table5", 'd, 'e, 'f, 'g, 'h)

    ds1.join(ds2)
      // must fail. Field 'a is Int, and 'g is String
      .where('a === 'g)
      .select('c, 'g)

  }

  @Test(expected = classOf[ValidationException])
  def testJoinWithAmbiguousFields(): Unit = {
    val util = batchTestUtil()
    val ds1 = util.addTableSource[(Int, Long, String)]("Table3",'a, 'b, 'c)
    val ds2 = util.addTableSource[(Int, Long, Int, String, Long)]("Table5", 'd, 'e, 'f, 'g, 'c)

    ds1.join(ds2)
      // must fail. Both inputs share the same field 'c
      .where('a === 'd)
      .select('c, 'g)
  }

  @Test(expected = classOf[ValidationException])
  def testLeftJoinNoEquiJoinPredicate(): Unit = {
    val util = batchTestUtil()
    val ds1 = util.addTableSource[(Int, Long, String)]("Table3",'a, 'b, 'c)
    val ds2 = util.addTableSource[(Int, Long, Int, String, Long)]("Table5", 'd, 'e, 'f, 'g, 'h)

    ds2.leftOuterJoin(ds1, 'b < 'd).select('c, 'g)
  }

  @Test(expected = classOf[ValidationException])
  def testRightJoinNoEquiJoinPredicate(): Unit = {
    val util = batchTestUtil()
    val ds1 = util.addTableSource[(Int, Long, String)]("Table3",'a, 'b, 'c)
    val ds2 = util.addTableSource[(Int, Long, Int, String, Long)]("Table5", 'd, 'e, 'f, 'g, 'h)

    ds2.rightOuterJoin(ds1, 'b < 'd).select('c, 'g)
  }

  @Test(expected = classOf[ValidationException])
  def testFullJoinNoEquiJoinPredicate(): Unit = {
    val util = batchTestUtil()
    val ds1 = util.addTableSource[(Int, Long, String)]("Table3",'a, 'b, 'c)
    val ds2 = util.addTableSource[(Int, Long, Int, String, Long)]("Table5", 'd, 'e, 'f, 'g, 'h)

    ds2.fullOuterJoin(ds1, 'b < 'd).select('c, 'g)
  }

  @Test(expected = classOf[ValidationException])
  def testJoinTablesFromDifferentEnvs(): Unit = {
    val settings = EnvironmentSettings.newInstance().inBatchMode().build()
    val tEnv1 = TableEnvironmentImpl.create(settings)
    val tEnv2 = TableEnvironmentImpl.create(settings)
    val ds1 = CollectionBatchExecTable.getSmall3TupleDataSet(tEnv1, "a, b, c")
    val ds2 = CollectionBatchExecTable.get5TupleDataSet(tEnv2, "d, e, f, g, c")

    // Must fail. Tables are bound to different TableEnvironments.
    ds1.join(ds2).where('b === 'e).select('c, 'g)
  }

  @Test(expected = classOf[ValidationException])
  def testJoinTablesFromDifferentEnvsJava() {
    val settings = EnvironmentSettings.newInstance().inBatchMode().build()
    val tEnv1 = TableEnvironmentImpl.create(settings)
    val tEnv2 = TableEnvironmentImpl.create(settings)
    val ds1 = CollectionBatchExecTable.getSmall3TupleDataSet(tEnv1, "a, b, c")
    val ds2 = CollectionBatchExecTable.get5TupleDataSet(tEnv2, "d, e, f, g, c")
    // Must fail. Tables are bound to different TableEnvironments.
    ds1.join(ds2).where($"a" === $"d").select($"g".count)
  }

  @Test(expected = classOf[TableException])
  def testOuterJoinWithPythonFunctionInCondition(): Unit = {
    val util = batchTestUtil()
    val left = util.addTableSource[(Int, Long, String)]("left",'a, 'b, 'c)
    val right = util.addTableSource[(Int, Long, String)]("right",'d, 'e, 'f)
    val pyFunc = new PythonScalarFunction("pyFunc")
    val result = left.leftOuterJoin(right, 'a === 'd && pyFunc('a, 'd) === 'a + 'd)
    util.verifyPlan(result)
  }
}


text:
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/firebase-element/firebase.html">
<link rel="import" href="codemirror-import.html">
<link rel="import" href="firepad-import.html">
<dom-module id="x-firepad">

  <template>

      Rich-text editing with
        Firepad!

      <my-custom-element>A custom element</my-custom-element>

Supports Inner HTML:

  </template>
</dom-module>


text:
This is just an adaptation of [React tutorial]() and [react-hot-boilerplate](https://github.com/gaearon/react-hot-boilerplate)
to show how the workflow of building a React app with Fable would be.

> Remember to run `npm install` before the first compilation!

## Server

An [express](http://expressjs.com) server is available to interact with the app. When debugging,
a webpack dev server will also be launched to rebuild the app bundle on
changes and allow HMR (see below). Check `server.fs`.

## Client

The same F# project includes the code for client-side making it easier to
share code like business models (see `public/models.fs`). The project includes
a ReactHelper API with a DSL to make it easier to build React components from F#.
Check `public/components.fs`.

> The React DSL (`Fable.ReactHelper.fs`) is still subject to changes.
After stabilization, it will be distributed through npm.

## Hot Module Reloading
The app uses [webpack](https://webpack.github.io) and a variation of [react-hot-loader](https://www.npmjs.com/package/react-hot-loader)
to allow HMR and improve the debug process. The necessary configuration is already defined
in `fableconfig.json` and `webpack.config.js`, so you just need to build the
project with the `debug` target (`fable -d` for short) and wait a few seconds until
the server launches. Visit `http://localhost:8080/` and then try modifying the `render`
function of one of the components in `public/components.fs`. See how the page loads
new code **without refreshing** on file saving. It's magic!

> Give also a try to [React Developer Tools](https://github.com/facebook/react-devtools)!


text:
<?php

namespace Da\ApiServerBundle\Tests\Fixtures\Model\Decorator;

use Da\ApiServerBundle\Model\AbstractQueryBuilderDecorator;

class DecoratorB extends AbstractQueryBuilderDecorator
{
	public function b()
    {
        return 'b';
    }

	/**
     * {@inheritdoc}
     */
    protected function handle($operation)
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    protected function check(array $arguments)
    {
        return $arguments;
    }

    /**
     * {@inheritdoc}
     */
    protected function translate(array $arguments, $field)
    {
        return $arguments;
    }

    /**
     * {@inheritdoc}
     */
    protected function interpret(array $arguments, $association)
    {
        return array();
    }

    /**
     * {@inheritdoc}
     */
    protected function assemble(array $chunks, $field, $association)
    {
    }

    /**
     * {@inheritdoc}
     */
    protected function checkChunk($chunk)
    {
    }
}


text:
package org.apache.solr.handler.dataimport;

import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVERE;
import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.regex.Pattern;

import org.apache.solr.util.DateMathParser;

/**
 *

 * Pluggable functions for resolving variables
 *

 *

 * Implementations of this abstract class must provide a public no-arg constructor.
 *

 *

 * Refer to http://wiki.apache.org/solr/DataImportHandler
 * for more details.
 *

 * This API is experimental and may change in the future.
 *
 * @since solr 1.3
 */
public abstract class Evaluator {

  /**
   * Return a String after processing an expression and a {@link VariableResolver}
   *
   * @see VariableResolver
   * @param expression string to be evaluated
   * @param context instance
   * @return the value of the given expression evaluated using the resolver
   */
  public abstract String evaluate(String expression, Context context);

  /**
   * Parses a string of expression into separate params. The values are separated by commas. each value will be
   * translated into one of the following:
   * <ol>
   * <li>If it is in single quotes the value will be translated to a String</li>
   * <li>If is is not in quotes and is a number a it will be translated into a Double</li>
   * <li>else it is a variable which can be resolved and it will be put in as an instance of VariableWrapper</li>
   * </ol>
   *
   * @param expression the expression to be parsed
   * @param vr the VariableResolver instance for resolving variables
   *
   * @return a List of objects which can either be a string, number or a variable wrapper
   */
  protected List<Object> parseParams(String expression, VariableResolver vr) {
    List<Object> result = new ArrayList<>();
    expression = expression.trim();
    String[] ss = expression.split(",");
    for (int i = 0; i < ss.length; i++) {
      ss[i] = ss[i].trim();
      if (ss[i].startsWith("'")) {//a string param has started
        StringBuilder sb = new StringBuilder();
        while (true) {
          sb.append(ss[i]);
          if (ss[i].endsWith("'")) break;
          i++;
          if (i >= ss.length)
            throw new DataImportHandlerException(SEVERE, "invalid string at " + ss[i - 1] + " in function params: " + expression);
          sb.append(",");
        }
        String s = sb.substring(1, sb.length() - 1);
        s = s.replaceAll("\\\\'", "'");
        result.add(s);
      } else {
        if (Character.isDigit(ss[i].charAt(0))) {
          try {
            Double doub = Double.parseDouble(ss[i]);
            result.add(doub);
          } catch (NumberFormatException e) {
            if (vr.resolve(ss[i]) == null) {
              wrapAndThrow(
                      SEVERE, e, "Invalid number :" + ss[i] +
                              "in parameters  " + expression);
            }
          }
        } else {
          result.add(getVariableWrapper(ss[i], vr));
        }
      }
    }
    return result;
  }

  protected VariableWrapper getVariableWrapper(String s, VariableResolver vr) {
    return new VariableWrapper(s,vr);
  }

  static protected class VariableWrapper {
    public final String varName;
    public final VariableResolver vr;

    public VariableWrapper(String s, VariableResolver vr) {
      this.varName = s;
      this.vr = vr;
    }

    public Object resolve() {
      return vr.resolve(varName);
    }

    @Override
    public String toString() {
      Object o = vr.resolve(varName);
      return o == null ? null : o.toString();
    }
  }

  static Pattern IN_SINGLE_QUOTES = Pattern.compile("^'(.*?)'$");

  public static final String DATE_FORMAT_EVALUATOR = "formatDate";

  public static final String URL_ENCODE_EVALUATOR = "encodeUrl";

  public static final String ESCAPE_SOLR_QUERY_CHARS = "escapeQueryChars";

  public static final String SQL_ESCAPE_EVALUATOR = "escapeSql";
}


text:
class Repo < Formula
  desc "Repository tool for Android development"
  homepage "https://source.android.com/source/developing.html"
  url "https://raw.githubusercontent.com/android/tools_repo/v1.12.21/repo"
  version "1.21"
  sha1 "9421408dba2d80e3c73910567f70f2e0c91dab2f"
  revision 1

  def install
    bin.install "repo"
  end
end


text:
"""
.. module: security_monkey.auditors.s3
    :platform: Unix

.. version:: $$VERSION$$
.. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity

"""

from security_monkey.auditor import Auditor
from security_monkey.watchers.s3 import S3
from security_monkey.datastore import Account

import re

class S3Auditor(Auditor):
    index = S3.index
    i_am_singular = S3.i_am_singular
    i_am_plural = S3.i_am_plural

    def __init__(self, accounts=None, debug=False):
        super(S3Auditor, self).__init__(accounts=accounts, debug=debug)

    def check_acl(self, s3_item):
        accounts = Account.query.all()
        S3_ACCOUNT_NAMES = [account.s3_name.lower() for account in accounts if not account.third_party and account.s3_name]
        S3_THIRD_PARTY_ACCOUNTS = [account.s3_name.lower() for account in accounts if account.third_party and account.s3_name]

        acl = s3_item.config.get('grants', {})
        for user in acl.keys():
            if user == 'http://acs.amazonaws.com/groups/global/AuthenticatedUsers':
                message = "ACL - AuthenticatedUsers USED. "
                notes = "{}".format(",".join(acl[user]))
                self.add_issue(10, message, s3_item, notes=notes)
            elif user == 'http://acs.amazonaws.com/groups/global/AllUsers':
                message = "ACL - AllUsers USED."
                notes = "{}".format(",".join(acl[user]))
                self.add_issue(10, message, s3_item, notes=notes)
            elif user == 'http://acs.amazonaws.com/groups/s3/LogDelivery':
                message = "ACL - LogDelivery USED."
                notes = "{}".format(",".join(acl[user]))
                self.add_issue(0, message, s3_item, notes=notes)
            elif user.lower() in S3_ACCOUNT_NAMES:
                message = "ACL - Friendly Account Access."
                notes = "{} {}".format(",".join(acl[user]), user)
                self.add_issue(0, message, s3_item, notes=notes)
            elif user.lower() in S3_THIRD_PARTY_ACCOUNTS:
                message = "ACL - Friendly Third Party Access."
                notes = "{} {}".format(",".join(acl[user]), user)
                self.add_issue(0, message, s3_item, notes=notes)
            else:
                message = "ACL - Unknown Cross Account Access."
                notes = "{} {}".format(",".join(acl[user]), user)
                self.add_issue(10, message, s3_item, notes=notes)

    def check_policy(self, s3_item):
        policy = s3_item.config.get('policy', {})
        if not policy:
            message = "POLICY - No Policy."
            self.add_issue(0, message, s3_item)

        statements = policy.get('Statement', {})
        complained = []
        for statement in statements:
            self.inspect_policy_allow_all(statement, s3_item)
            self.inspect_policy_cross_account(statement, s3_item, complained)
            self.inspect_policy_conditionals(statement, s3_item)

    def inspect_policy_allow_all(self, statement, s3_item):
        if statement['Effect'] == "Allow":
            if statement['Principal'] == "*":
                message = "POLICY - This Policy Allows Access From Anyone."
                self.add_issue(10, message, s3_item)
                return

            if 'AWS' in statement['Principal']:
                if statement['Principal']['AWS'] == "*":
                    message = "POLICY - This Policy Allows Access From Anyone."
                    self.add_issue(10, message, s3_item)
                    return

    def inspect_policy_cross_account(self, statement, s3_item, complained):
        try:
            if 'Effect' in statement:
                effect = statement['Effect']
                if effect == 'Allow':
                    if 'Principal' in statement:
                        principal = statement["Principal"]
                        if type(principal) is dict and 'AWS' in principal:
                            aws_entries = principal["AWS"]
                            if type(aws_entries) is str or type(aws_entries) is unicode:
                                if aws_entries[0:26] not in complained:
                                    self.processCrossAccount(aws_entries, s3_item)
                                    complained.append(aws_entries[0:26])
                            else:
                                for aws_entry in aws_entries:
                                    if aws_entry[0:26] not in complained:
                                        self.processCrossAccount(aws_entry, s3_item)
                                        complained.append(aws_entry[0:26])
        except Exception, e:
            print "Exception in cross_account. {} {}".format(Exception, e)
            import traceback
            print traceback.print_exc()

    def processCrossAccount(self, arn, s3_item):
        m = re.match(r'arn:aws:iam::([0-9*]+):', arn)

        # BAD POLICY - Cross Account Access: Bad ARN: *
        # "Bad ARN: {}".format(arn)
        if not m:
            if not '*' == arn:
                message = "POLICY - Bad ARN"
                notes = "{}".format(arn)
                self.add_issue(3, message, s3_item, notes=notes)
            return

        # 'WILDCARD ARN: *'
        # This is caught by check_policy_allow_all(), so ignore here.
        if '*' == m.group(1):
            print "This is an odd arn: {}".format(arn)
            return

        account = Account.query.filter(Account.number==m.group(1)).first()
        if account:
            # Friendly Account.
            if not account.third_party:
                message = "POLICY - Friendly Account Access."
                notes = "{}".format(account.name)
                self.add_issue(0, message, s3_item, notes=notes)
                return
            # Friendly Third Party
            else:
                message = "POLICY - Friendly Third Party Account Access."
                notes = "{}".format(account.name)
                self.add_issue(0, message, s3_item, notes=notes)
                return

        # Foreign Unknown Account
        message = "POLICY - Unknown Cross Account Access."
        notes = "Account ID: {} ARN: {}".format(m.group(1), arn)
        self.add_issue(10, message, s3_item, notes=notes)
        return

    def inspect_policy_conditionals(self, statement, s3_item):
        if 'Condition' in statement:
            message = "POLICY - This policy has conditions."
            self.add_issue(3, message, s3_item)


text:
#include "QStdAfx.h"
#include "util/Preprocessor.h"
#include "video/Uber_Shader.h"
#include "system/System.h"
#include "video/Renderer.h"

using namespace q;
using namespace video;

Uber_Shader::Uber_Shader()
{

}
Uber_Shader::Uber_Shader(Uber_Shader&& other)
	: m_root_path(std::move(other.m_root_path))
	, m_vertex_src(std::move(other.m_vertex_src))
	, m_fragment_src(std::move(other.m_fragment_src))
	, m_uniforms(std::move(other.m_uniforms))
	, m_samplers(std::move(other.m_samplers))
	, m_attributes(std::move(other.m_attributes))
	, m_shaders(std::move(other.m_shaders))
	, m_base(std::move(other.m_base))
{
}
void Uber_Shader::set_root_path(Path const& path)
{
	m_root_path = path;
}
Path const& Uber_Shader::get_root_path() const
{
	return m_root_path;
}

void Uber_Shader::set_source(std::string const& vs, std::string const& fs)
{
	util::Preprocessor pp(System::inst().get_file_system(), get_root_path());
	m_vertex_src = Shader_Source(pp.preprocess(vs));
	m_fragment_src = Shader_Source(pp.preprocess(fs));
}

void Uber_Shader::compile(
	std::vector<Uniform_Def>& uniforms,
	std::vector<Sampler_Def>& samplers,
	std::vector<Attribute_Def>& attributes)
{
	m_uniforms = &uniforms;
	m_samplers = &samplers;
	m_attributes = &attributes;
 	m_base = Shader::create(Shader::Type::NORMAL, m_vertex_src, m_fragment_src);
 	m_base->compile(uniforms, samplers, attributes);
}

//////////////////////////////////////////////////////////////////////////

uint64_t Uber_Shader::compute_key(Material const& /*material*/, Shader::Type type) const
{
	return ((uint64_t)type) << 56;
}

//////////////////////////////////////////////////////////////////////////

Shader_ptr const& Uber_Shader::get_shader(Material const& material, Shader::Type type) const
{
	uint64_t key = compute_key(material, type);
	if (key == 0)
	{
		return m_base;
	}
	else
	{
		//QASSERT(0);
		//return m_base;
		{
			auto it = m_shaders.find(key);
			if (it != m_shaders.end())
			{
				return it->second;
			}
		}

		auto shader = Shader::create(type, m_vertex_src, m_fragment_src);
		shader->compile(*m_uniforms, *m_samplers, *m_attributes);
		auto it = m_shaders.insert(std::make_pair(key, shader));
		return it.first->second;
	}
}

//////////////////////////////////////////////////////////////////////////


text:
FOUNDATION_EXPORT double VpadnSDKAdKitVersionNumber;

//! Project version string for VpadnSDKAdKit.
FOUNDATION_EXPORT const unsigned char VpadnSDKAdKitVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <VpadnSDKAdKit/PublicHeader.h>

#import <VpadnSDKAdKit/VpadnBanner.h>
#import <VpadnSDKAdKit/VpadnInterstitial.h>
#import <VpadnSDKAdKit/VpadnNativeAd.h>
#import <VpadnSDKAdKit/VpadnNativeAdsManager.h>
#import <VpadnSDKAdKit/VpadnNativeAdTableViewAdProvider.h>


text:
define(['Global', 'Job'], function(G, Job){
	return Backbone.Collection.extend({
		model: Job,
		localStorage: new Backbone.LocalStorage(G.storage.jobs),
	});
});


text:
The OpenWeave source tree includes a set of build and configuration files that make it easy to incorporate OpenWeave as a library in an ESP32 application.  These files are structured as an ESP-IDF compatible "component", making possible to drop OpenWeave into a new or existing or project and immediately begin coding.

tl;dr? Jump to [How to incorporate OpenWeave into an ESP32 project](#how-to-incorporate-openweave-into-an-esp32-project)

Or take a look at the [OpenWeave ESP32 demo project](https://github.com/openweave/openweave-esp32-demo).

## How OpenWeave gets built for the ESP32

OpenWeave provides its own build system based on GNU autotools.  The OpenWeave build system is quite flexible, and can be configured to build OpenWeave for a large range of target environments.

For the ESP32, OpenWeave provides a wrapper makefile (build/esp32/components/openweave/component.mk) that allows OpenWeave to be incorporated as an external component in an ESP32 application.  The OpenWeave component.mk file works by calling out to the native OpenWeave build system as part of the standard ESP-IDF build process.  The wrapper takes care of all the necessary steps to build OpenWeave, including invoking the OpenWeave configure script and passing the correct cross-compilation arguments.  Dependencies are passed through, meaning that OpenWeave sources will only  be rebuilt when header / configuration file change in the base project (or if you make changes to OpenWeave itself).

The end result of the build is a set of libraries (.a files) containing the OpenWeave code compiled for ESP32. These libraries are automatically supplied to the linker when linking the target ESP32 application.

## Dependence on openweave-esp32-lwip

OpenWeave relies on an enhanced version of the open source Lightweight IP (LwIP) stack.  These enhancements provide support some of the unique features of OpenWeave, including the Weave IPv6 addressing architecture and Weave IP tunnels.

To make life easier for ESP32 developers, the OpenWeave team has published a version of the LwIP library that is pre-patched with the necessary OpenWeave enhancements.  This version incorporates all of Espressif's own LwIP enhancements as well as the OpenWeave patches.  The openweave-esp32-lwip component can be incorporated into an ESP32 project by placing it in the project components directory.

The openweave-esp32-lwip repo is available [here](https://github.com/openweave/openweave-esp32-lwip).

## Configuring OpenWeave

OpenWeave supports a large collection of configurable options which allow its functionality to be precisely tuned for a given application and target environment.  To make these options easier to use on the ESP32, OpenWeave provides an ESP-IDF compatible configuration database (build/esp32/components/openweave/Kconfig) that makes many of the options controllable via the standard ESP-IDF make menuconfig tool.

Two component configuration sections are defined:

  * __Component Config > OpenWeave Core__ -- Provides options that control or tune core Weave functionality
  * __Component Config > OpenWeave Device Layer__ -- Provides options specific to the ESP32 adaptation of OpenWeave

Help text is provided for each of the options explaining their use.

## How to incorporate OpenWeave into an ESP32 project

The easiest way to incorporate OpenWeave into an ESP32 project is to add the OpenWeave source repo as a git submodule within your ESP32 application repo.  As described above, OpenWeave depends on an enhanced version of the Espressif LwIP component.  This can also be incorporated as a submodule.

* At the top-level of your project directory, add the openweave-core repository as a submodule in the components directory.

        % git submodule add https://github.com/openweave/openweave-core.git components/openweave-core

* Add the openweave-esp32-lwip repository as a submodule.  Note that the local component directory must be named "lwip" so that is supersedes the default version of LwIP suppled by ESP-IDF.

        % git submodule add https://github.com/openweave/openweave-esp32-lwip.git components/lwip

* In the top level project Makefile, add the following line:

        EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/components/openweave-core/build/esp32/components

* Enable / Disable Bluetooth support

   By default, OpenWeave builds with support for the Weave-over-BLE (WoBLE) protocol.  This requires Bluetooth support to be enabled on the ESP32.  To enable Bluetooth support for your project, do the following:

  * Run make menuconfig
  * Select (enable) the option __Component Config > Bluetooth > Bluetooth__

   Alternatively, one can disable WoBLE support in OpenWeave, which avoids the need to enable Bluetooth in ESP-IDF.

  * Run make menuconfig
  * Deselect (disable) the option __Component Config >  OpenWeave Device Layer > BLE Options > Enable Weave-over-BLE (WoBLE) Support__


text:
package com.zhb.jaxb;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import java.io.File;

/**
 * Created by zouhuibo on 2017/9/26.
 */
public class JAXBMarshallExample {
    public static void main(String[] args) {
        Customer customer = new Customer();
        customer.setId(1000);
        customer.setName("moon");
        customer.setAge(18);

        try {
            File file = new File("H:\\file.xml");
            JAXBContext jaxbContext = JAXBContext.newInstance(Customer.class);
            Marshaller jaxbMarshaller = jaxbContext.createMarshaller();

            // output pretty printed
            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

            jaxbMarshaller.marshal(customer, file);
            jaxbMarshaller.marshal(customer, System.out);
        } catch (JAXBException e) {
            e.printStackTrace();
        }
    }
}