text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using Errlock.Lib;
using Errlock.Lib.AppConfig;
using Errlock.Lib.Helpers;
using Errlock.Lib.Repository;
using Errlock.Lib.Logger;
using Errlock.Lib.Modules;
using Errlock.Lib.Modules.ConfigurationTestModule;
using Errlock.Lib.Modules.PasswordCrackerModule;
using Errlock.Lib.Modules.PublicFinderModule;
using Errlock.Lib.Modules.XssScannerModule;
using Errlock.Lib.RequestWrapper;
using Errlock.Lib.Sessions;

namespace Errlock.Console
{
    /// <summary>
    /// Логгер для консольного приложения
    /// </summary>
    public class ConsoleLogger : ILogger
    {
        public void Log(string message, LoggerMessageType messsageType)
        {
            System.Console.WriteLine("[{0}] {1}", messsageType, message);
        }
    }

    /// <summary>
    /// Основной класс консольного приложения Errlock
    /// </summary>
    public class Application
    {
        /// <summary>
        /// Конфигурация приложения
        /// </summary>
        private static readonly AppConfig ErrlockConfig =
            new AppConfig(ErrlockConfigModel.Defaults);

        /// <summary>
        /// Настройки подключения
        /// </summary>
        private readonly ConnectionConfiguration _connectionConfig =
            ErrlockConfig.Model.ConnectionConfiguration;

        /// <summary>
        /// Консольный логгер
        /// </summary>
        private readonly ILogger _consoleLogger = new ConsoleLogger();

        /// <summary>
        /// Репозиторий сессий
        /// </summary>
        private readonly IRepository<Session> _repository =
            new SessionLiteDbRepository();

        /// <summary>
        /// Запускает консольное приложение
        /// </summary>
        public static void Run()
        {
            var app = new Application();
            app.MainLoop();
        }

        /// <summary>
        /// Запрашивает информацию о сессии и добавляет её в репозиторий
        /// </summary>
        /// <returns>Добавленная сессия</returns>
        private void AddSession()
        {
            var s = new Session();
            var urlReq = new ConsoleRequester<string>();
            urlReq.AddPredicate(u => ! WebHelpers.IsValidUrl(u), "Неверный URL");
            s.Url = urlReq
                .RequestValue("Введите URL включая протокол");
            s.Options.RecursionDepth = ConsoleRequester
                .RequestInt("Введите макс. глубину рекурсии", 3);
            s.Options.FetchPerPage = ConsoleRequester
                .RequestInt("Максимальное количество ссылок с одной страницы", 20);
            s.Options.IngoreAnchors = ConsoleRequester
                .RequestBool("Игнорировать якоря", true);
            s.Options.UseRandomLinks = ConsoleRequester
                .RequestBool("Собирать случайные ссылки", true);
            s.Options.MaxLinks = ConsoleRequester
                .RequestInt("Глобальное ограничение на количество ссылок", 100);
            this._repository.InsertOrUpdate(s);
        }

        private void RemoveSession()
        {
            var sessions = this._repository.EnumerateAll();
            const string title = "Укажите сессию, которую необходимо удалить";
            var session = ConsoleRequester.RequestListItem(sessions, s => s.Url, title);
            this._repository.Delete(session);
        }

        private XssScanner CreateXssScannerInstance()
        {
            var config = new XssScannerConfig();
            return new XssScanner(config, _connectionConfig);
        }

        private PublicFinder CreatePublicFinderInstance()
        {
            var config = new PublicFinderConfig {
                DetectSuspicious = ConsoleRequester
                    .RequestBool("Обнаруживать подозрительные страинцы", true),
                UseGetRequests = ConsoleRequester
                    .RequestBool("Использовать GET-запросы вместо HEAD", false),
                UsePermutations = ConsoleRequester
                    .RequestBool("Использовать перестановки", true)
            };
            return new PublicFinder(config, _connectionConfig);
        }

        private PasswordCracker CreatePasswordCrackerInstance()
        {
            var config = new PasswordCrackerConfig {
                Login = ConsoleRequester
                    .RequestString("Логин", "admin"),
                RequestParameters = ConsoleRequester
                    .RequestString("Параметры запроса", "login={{login}}&password={{password}}"),
                RequestUrl = ConsoleRequester
                    .RequestString("URL запроса без адреса ресурса", "login"),
                PasswordsCount = ConsoleRequester
                    .RequestInt("Количество паролей", 100),
                UseHeuristic = ConsoleRequester
                    .RequestBool("Использовать эвристику", true),
                StopAfterFirstMatch = ConsoleRequester
                    .RequestBool("Останавливать после первого совпадения", true)
            };
            return new PasswordCracker(config, _connectionConfig);
        }

        private ConfigurationTest CreateConfigurationTestInstance()
        {
            var config = new ConfigurationTestConfig();
            return new ConfigurationTest(config, _connectionConfig);
        }

        /// <summary>
        /// Выводит список сессий на экран и возвращает выбранную сессию
        /// </summary>
        /// <returns></returns>
        private Session GetSession()
        {
            var sessionList = this._repository.EnumerateAll();
            const string title = "Cессия, для которой необходимо запустить модуль";
            return ConsoleRequester.RequestListItem(sessionList, s => s.Url, title);
        }

        private IModule GetModule()
        {
            var modList = new Dictionary<string, Func<IModule>> {
                { "Поиск доступных директории", CreatePublicFinderInstance },
                { "Подбор пароля к ресурсу", CreatePasswordCrackerInstance },
                { "Поиск XSS-уязвимостей", CreateXssScannerInstance },
                { "Проверка конфигурации", CreateConfigurationTestInstance }
            };
            const string title = "Необходимый модуль";
            var item = ConsoleRequester.RequestListItem(modList, i => i.Key, title);
            return item.Value.Invoke();
        }

        private void DisplaySessionInformation(Session session)
        {
            var sb = new StringBuilder();
            sb.AppendFormatLine("Адрес ресурса: {0}", session.Url);
            sb.AppendFormatLine("--- Конфигурация ---");
            sb.AppendFormatLine("Количество ссылок, собираемых со страницы: {0}",
                session.Options.FetchPerPage);
            sb.AppendFormatLine("Глобальное ограничение на количество ссылок: {0}",
                session.Options.MaxLinks);
            sb.AppendFormatLine("Максимальная глубина рекурсии: {0}",
                session.Options.RecursionDepth);
            sb.AppendFormatLine("Игнорировать якори в адресах: {0}",
                session.Options.IngoreAnchors);
            sb.AppendFormatLine("Использовать случайные ссылки: {0}",
                session.Options.UseRandomLinks);
            string message = sb.ToString();
            ConsoleHelpers.WriteColor(message, ConsoleColor.DarkGray);
        }

        /// <summary>
        /// Подготавливает сообщение у уязвимости для вывода на экран
        /// </summary>
        /// <param name="source">Экземпля класса ModuleNotice</param>
        /// <returns>Строка, содержащая сообщение о уязвимости</returns>
        private string PrepareNoticeMessage(ModuleNotice source)
        {
            var sb = new StringBuilder();
            sb.AppendFormatLine("Важность: {0}", source.Priority.GetDescription());
            sb.AppendFormatLine("Сообщение: {0}", source.Text);
            sb.AppendFormatLine("URL: {0}", source.LinkedUrl);
            return sb.ToString();
        }

        private void StartModule(IModule module, Session session)
        {
            module.SetLogger(this._consoleLogger);
            module.Completed += (sender, args) => {
                var result = args.ScanResult;
                foreach (string message in result.Notices.Select(PrepareNoticeMessage)) {
                    ConsoleHelpers.WriteColorLine(message, ConsoleColor.DarkRed);
                }
            };
            module.Start(session);
        }

        /// <summary>
        /// Парсит и выполняет указанную команду
        /// </summary>
        /// <param name="command"></param>
        private void ProcessCommand(string command)
        {
            // удаление пробелов и преобразование в низний регистр
            command = command.Trim().ToLower(CultureInfo.InvariantCulture);
            switch (command) {
                // Добавление сессии
                case "add":
                    this.AddSession();
                    break;
                // Удаление сессии
                case "remove":
                    this.RemoveSession();
                    break;
                // Выбор сессии и запуск модуля
                case "go":
                    if(! _repository.EnumerateAll().Any()) {
                        ConsoleHelpers.ShowError("Сначала добавьте хотя бы одну сессию");
                        return;
                    }
                    var module = this.GetModule();
                    var session = this.GetSession();
                    this.StartModule(module, session);
                    break;
                case "info":
                    this.DisplaySessionInformation(this.GetSession());
                    break;
                // Информацию о программе
                case "about":
                    this.ShowAboutMessage();
                    break;
                // Отображение справки
                case "help":
                    this.DisplayHelp();
                    break;
                default:
                    const string msg = "Неизвестная команда. Для отображения списка доступых " +
                                       "комманд введите help";
                    ConsoleHelpers.ShowError(msg);
                    break;
            }
        }

        /// <summary>
        /// Отображает справку по командам программы
        /// </summary>
        private void DisplayHelp()
        {
            System.Console.WriteLine();
            ConsoleHelpers.WriteColorLine("СПРАВКА ПО КОМАНДАМ", ConsoleColor.Yellow);
            System.Console.WriteLine();

            ConsoleHelpers.WriteColor("add", ConsoleColor.Magenta);
            const string addHelp = " - запрашивает информацию и добавляет сессию в репозиторий";
            System.Console.WriteLine(addHelp);

            ConsoleHelpers.WriteColor("remove", ConsoleColor.Magenta);
            const string removeHelp = " - запрашивает сессию и удаляет её";
            System.Console.WriteLine(removeHelp);

            ConsoleHelpers.WriteColor("go", ConsoleColor.Magenta);
            const string goHelp = " - отображает диалоги выбора модуля и сессии " +
                                  "после чего запускает тестирование";
            System.Console.WriteLine(goHelp);

            ConsoleHelpers.WriteColor("info", ConsoleColor.Magenta);
            const string infoHelp = " - отображает информацию по существующей сессии";
            System.Console.WriteLine(infoHelp);

            ConsoleHelpers.WriteColor("about", ConsoleColor.Magenta);
            const string aboutHelp = " - отображает информацию о программе";
            System.Console.WriteLine(aboutHelp);

            ConsoleHelpers.WriteColor("help", ConsoleColor.Magenta);
            const string helpHelp = " - отображает эту справку";
            System.Console.WriteLine(helpHelp);
        }

        /// <summary>
        /// Выводит приветствие на экран
        /// </summary>
        private void ShowAboutMessage()
        {
            const string message = @"
 ___  __   __        __   __           __   __        __   __        ___
|__  |__) |__) |    /  \ /  ` |__/    /  ` /  \ |\ | /__` /  \ |    |__
|___ |  \ |  \ |___ \__/ \__, |  \    \__, \__/ | \| .__/ \__/ |___ |___
                                                                          ";
            ConsoleHelpers.WriteColorLine(message, ConsoleColor.DarkYellow);
            string appVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            var sb = new StringBuilder();
            sb.AppendFormatLine("Версия программы: {0}", appVersion);
            sb.AppendLine("Распространяется по лицензии MIT");
            sb.AppendLine("Для получения информации по командам введите help");
            sb.AppendLine();
            ConsoleHelpers.WriteColor(sb.ToString(), ConsoleColor.DarkGray);
        }

        /// <summary>
        /// Основной цикл работы приложения, выход из приложение осуществляется вводом
        /// команды exit
        /// </summary>
        private void MainLoop()
        {
            ShowAboutMessage();
            var commandRequester = new ConsoleRequester<string>();
            commandRequester.AddPredicate(string.IsNullOrWhiteSpace, "Команда не должа быть пустой");
            string command = String.Empty;
            while (command != "exit") {
                command = commandRequester.RequestValue(color: ConsoleColor.Cyan);
                ProcessCommand(command);
                System.Console.WriteLine();
            }
        }
    }
}


text:
<?php

namespace Ekyna\Component\Commerce\Bridge\Payum\Offline\Action;

use Ekyna\Component\Commerce\Bridge\Payum\Offline\Constants;
use Ekyna\Component\Commerce\Bridge\Payum\Request\Hang;
use Payum\Core\Action\ActionInterface;
use Payum\Core\Bridge\Spl\ArrayObject;
use Payum\Core\Exception\RequestNotSupportedException;

/**
 * Class HangAction
 * @package Ekyna\Component\Commerce\Bridge\Payum\Offline\Action
 * @author  Etienne Dauvergne <contact@ekyna.com>
 */
class HangAction implements ActionInterface
{
    /**
     * {@inheritDoc}
     *
     * @param Hang $request
     */
    public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $model = ArrayObject::ensureArrayObject($request->getModel());

        $model[Constants::FIELD_STATUS] = Constants::STATUS_PENDING;
    }

    /**
     * {@inheritDoc}
     */
    public function supports($request)
    {
        return $request instanceof Hang
            && $request->getModel() instanceof \ArrayAccess;
    }
}

redpajama_set_name: RedPajamaGithub


text:
**This package has been moved to the [main Onsen UI repository](https://github.com/OnsenUI/OnsenUI/tree/master/bindings/react).**

[![npm version](https://badge.fury.io/js/react-onsenui.svg)](https://badge.fury.io/js/react-onsenui)

# Onsen UI - React Components for Cordova/PhoneGap hybrid apps

**Make beautiful high performance hybrid mobile apps using HTML5, CSS and JavaScript. Includes Material Design for Android and flat design for iOS.**

[Onsen UI](https://onsen.io/2/) is a UI component library for hybrid mobile apps. It provides components for navigation, forms, tabs, Material Design, infinite lists and much more.

It can be used to build hybrid apps with [Cordova](https://cordova.apache.org/) and [PhoneGap](http://phonegap.com/) but can also run in the browser.

We have build a [Tutorial Website](http://tutorial.onsen.io/?framework=react&category=Getting%20started&module=Using%20the%20components) where you can see live examples of OnsenUI without installing it. If you find any issues, feel free to report at [our OpenSource Repository](https://github.com/OnsenUI/tutorial). Also pull requests are welcome.

To learn how to use these components, please refer to [the documentation](https://onsen.io/v2/docs/guide/react/index.html). You can also check out our [kitchensink example](https://github.com/OnsenUI/react-onsenui-kitchensink) to learn how to use this or you can [click here](http://onsenui.github.io/react-onsenui-kitchensink/demo.html) for a quick demo.

We also have a highly engaged [community](https://community.onsen.io/) that will be available to answer your questions.

The main [Onsen UI repo](https://github.com/OnsenUI/OnsenUI) contains the CSS and core JS library for these components. Please star it if you like it!

## Using Onsen UI with npm

The easiest way to use these components is by installing them through npm and using a CommonJS module system such as browserify and webpack (the kitchensink example above is using browserify).

You need to install `react`, `react-dom`, `onsenui` and `react-onsenui`. You probably also need to add [Babel](https://babeljs.io/) with the `react` preset.

Now you can import the necessary libraries in your code:

```jsx
var React = require('react');
var ReactDOM = require('react-dom');

require('onsenui'); // This needs to be imported to bootstrap the components.
var Ons = require('react-onsenui');

var MyPage = React.createClass({
  renderToolbar: function() {
    return (
      <Ons.Toolbar>
        <div className='center'>Onsen UI</div>
      </Ons.Toolbar>
    );
  }

  render: function() {
    return (
      <Ons.Page renderToolbar={this.renderToolbar}>
        <p>This is Onsen UI!</p>
      </Ons.Page>
    );
  }
});

ReactDOM.render(<MyPage />, document.getElementById('app'));
```

Take a look at the kitchensink example for more complex code.

**Make beautiful high performance hybrid mobile apps using HTML5, CSS and JavaScript. Includes Material Design for Android and flat design for iOS.**

[Onsen UI](https://onsen.io/2/) is a UI component library for hybrid mobile apps. It provides components for navigation, forms, tabs, Material Design, infinite lists and much more.

It can be used to build hybrid apps with [Cordova](https://cordova.apache.org/) and [PhoneGap](http://phonegap.com/) but can also run in the browser.

To learn how to use these components, please refer to [the documentation](https://onsen.io/v2/docs/guide/react/index.html). You can also check out our [kitchensink example](https://github.com/OnsenUI/react-onsenui-kitchensink) to learn how to use this or you can [click here](http://onsenui.github.io/react-onsenui-kitchensink/demo.html) for a quick demo.

The main [Onsen UI repo](https://github.com/OnsenUI/OnsenUI) contains the CSS and core JS library for these components. Please star it if you like it!

# Contribution

We always welcome contributions by either opening an issue or doing a pull request.

To test this repo in the current state of master, one needs to first clone this repo recursivly (it binds onsenui in a specific version) and run `npm install` in both the main folder and OnsenUI folder and finally build OnsenUI.

```bash
$ git clone --recursive git@github.com:OnsenUI/react-onsenui.git
$ npm install
$ cd OnsenUI; npm install
$ npm install -g gulp # install gulp if not already installed
$ gulp build
```

After these changes one can run our demo examples with `npm run dev` and open a brower at port 9000.


text:
import {totalsComponent} from '../components/totalsComponent';
import {todoStateTemplate} from '../components/todoStateTemplate';
// Display number of active todos:
//================================
export function renderActiveTodos(data) {
  let active
  if (data.length) {
    active = data.filter(function(item) {
      return item.state === 'active';
    })
  }

  function renderActiveNumber(number, active) {
    totalsComponent.setTemplate(todoStateTemplate[number]);
    totalsComponent.render(active);
  }
  active = active.length || 0;
  if (!active ) {
    renderActiveNumber(1, 0);
  } else if (active === 1) {
    renderActiveNumber(0, active);
  } else if (active > 1) {
    renderActiveNumber(1, active);
  }
}


text:
using System;
using Conveyor;
using System.Collections.Generic;
using System.Reflection;
using Nustache.Core;

namespace Voyage
{
    public abstract class VoyageApp
    {
        delegate Response Handler(Request request);

        protected VoyageApp()
        {
            var methods = this.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
            foreach (MethodInfo method in methods)
            {
                var _resources = method.GetCustomAttributes(typeof(ResourceAttribute), true);
                var resources = (ResourceAttribute[])_resources;

                if (resources != null && resources.Length > 0)
                {
                    Handler del = (Handler)Delegate.CreateDelegate(typeof(Handler), this, method);

                    foreach (var res in resources)
                    {
                        Resources.Add(res, del);
                    }
                }
            }
        }

        readonly Dictionary<ResourceAttribute, Handler> Resources = new Dictionary<ResourceAttribute, Handler>();

        public Response HandleRequest(Request request)
        {
            foreach (var kvp in Resources)
            {
                var res = kvp.Key;
                if (res.Path == request.Path)
                {
                    return kvp.Value(request);
                }
            }

            return new Response(404);
        }

        protected string RenderTemplate(string filename, object data)
        {
            return Render.FileToString(filename, data);
        }

        public void Run(int port=8080)
        {
            using (var server = new Server(port, this.HandleRequest))
            {
                server.ListenerThread.Thread.Join();
            }
        }
    }
}


text:
<?php /* Smarty version Smarty-3.1.8, created on 2013-02-08 21:26:51
         compiled from "/homez.151/thenailk/www/administrator/themes/default/template/controllers/products/combinations.tpl" */ ?>
<?php /*%%SmartyHeaderCode:22608755451155f8b023899-80511563%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' =>
  array (
    '68678b7064c176861c9649d692d5897f855e24ae' =>
    array (
      0 => '/homez.151/thenailk/www/administrator/themes/default/template/controllers/products/combinations.tpl',
      1 => 1360316268,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '22608755451155f8b023899-80511563',
  'function' =>
  array (
  ),
  'variables' =>
  array (
    'product' => 0,
    'attributeJs' => 0,
    'idgrp' => 0,
    'group' => 0,
    'idattr' => 0,
    'attrname' => 0,
    'token_generator' => 0,
    'combination_exists' => 0,
    'display_multishop_checkboxes' => 0,
    'attributes_groups' => 0,
    'attribute_group' => 0,
    'currency' => 0,
    'country_display_tax_label' => 0,
    'tax_exclude_option' => 0,
    'ps_weight_unit' => 0,
    'field_value_unity' => 0,
    'ps_use_ecotax' => 0,
    'minimal_quantity' => 0,
    'available_date' => 0,
    'images' => 0,
    'imageWidth' => 0,
    'image' => 0,
    'list' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_51155f8b77e198_57994248',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_51155f8b77e198_57994248')) {function content_51155f8b77e198_57994248($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_escape')) include '/homez.151/thenailk/www/tools/smarty/plugins/modifier.escape.php';
?>

<?php if (isset($_smarty_tpl->tpl_vars['product']->value->id)&&!$_smarty_tpl->tpl_vars['product']->value->is_virtual){?>
	<input type="hidden" name="submitted_tabs[]" value="Combinations" />

<?php echo smartyTranslate(array('s'=>'Add or modify combinations for this product'),$_smarty_tpl);?>

 <?php echo smartyTranslate(array('s'=>'or use the'),$_smarty_tpl);?>

		 <a class="button bt-icon confirm_leave" href="index.php?tab=AdminAttributeGenerator&id_product=<?php echo $_smarty_tpl->tpl_vars['product']->value->id;?>
&attributegenerator&token=<?php echo $_smarty_tpl->tpl_vars['token_generator']->value;?>
"><img src="../img/admin/appearance.gif" alt="combinations_generator" class="middle" title="<?php echo smartyTranslate(array('s'=>'Product combinations generator'),$_smarty_tpl);?>
" /><?php echo smartyTranslate(array('s'=>'Product combinations generator'),$_smarty_tpl);?>

		<?php echo smartyTranslate(array('s'=>'in order to create automatically a set of combinations'),$_smarty_tpl);?>

	<?php if ($_smarty_tpl->tpl_vars['combination_exists']->value){?>

<?php echo smartyTranslate(array('s'=>'Some combinations already exist. If you want to generate some new combinations, the quantities for the actual combinations will be lost.'),$_smarty_tpl);?>

<?php echo smartyTranslate(array('s'=>'You still can add a combination by clicking the link "Add new combination" on the toolbar.'),$_smarty_tpl);?>

	<?php }?>
	<?php if (isset($_smarty_tpl->tpl_vars['display_multishop_checkboxes']->value)&&$_smarty_tpl->tpl_vars['display_multishop_checkboxes']->value){?>

		<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/check_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('product_tab'=>"Combinations"), 0);?>

	<?php }?>

					<?php echo smartyTranslate(array('s'=>'Attribute:'),$_smarty_tpl);?>

					<select name="attribute_group" id="attribute_group" style="width: 200px;" onchange="populate_attrs();">
						<?php if (isset($_smarty_tpl->tpl_vars['attributes_groups']->value)){?>
							<?php  $_smarty_tpl->tpl_vars['attribute_group'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['attribute_group']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['attributes_groups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['attribute_group']->key => $_smarty_tpl->tpl_vars['attribute_group']->value){
$_smarty_tpl->tpl_vars['attribute_group']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['attribute_group']->key;
?>
								<option value="<?php echo $_smarty_tpl->tpl_vars['attribute_group']->value['id_attribute_group'];?>
"><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['attribute_group']->value['name'], 'htmlall', 'UTF-8');?>
  </option>
							<?php } ?>
						<?php }?>
					</select>

					<?php echo smartyTranslate(array('s'=>'Value:'),$_smarty_tpl);?>

					<select name="attribute" id="attribute" style="width: 200px;">
						<option value="0">---</option>
					</select>

				<input style="width: 140px; margin-bottom: 10px;" type="button" value="<?php echo smartyTranslate(array('s'=>'Add'),$_smarty_tpl);?>
" class="button" onclick="add_attr();"/>

				<input style="width: 140px;" type="button" value="<?php echo smartyTranslate(array('s'=>'Delete'),$_smarty_tpl);?>
" class="button" onclick="del_attr()"/>

					<select id="product_att_list" name="attribute_combination_list[]" multiple="multiple" size="4" style="width: 320px;"></select>

				<?php echo smartyTranslate(array('s'=>'Reference:'),$_smarty_tpl);?>

					<input size="55" type="text" id="attribute_reference" name="attribute_reference" value="" style="width: 130px; margin-right: 44px;" />
					<?php echo smartyTranslate(array('s'=>'EAN13:'),$_smarty_tpl);?>
<input size="55" maxlength="13" type="text" id="attribute_ean13" name="attribute_ean13" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
					<?php echo smartyTranslate(array('s'=>'UPC:'),$_smarty_tpl);?>
<input size="55" maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
					<?php echo smartyTranslate(array('s'=>'Special characters allowed:'),$_smarty_tpl);?>
 .-_#

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_wholesale_price",'type'=>"default"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Wholesale price:'),$_smarty_tpl);?>

					<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2!=0){?><?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
<?php }?>
					<input type="text" size="6"  name="attribute_wholesale_price" id="attribute_wholesale_price" value="" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
					<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2==0){?> <?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
 <?php }?>(<?php echo smartyTranslate(array('s'=>'leave blank if the price does not change'),$_smarty_tpl);?>
)
					(<?php echo smartyTranslate(array('s'=>'Overrides wholesale price on "Information" tab'),$_smarty_tpl);?>
)

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_price_impact",'type'=>"attribute_price_impact"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Impact on price:'),$_smarty_tpl);?>

					<select name="attribute_price_impact" id="attribute_price_impact" style="width: 140px;" onchange="check_impact(); calcImpactPriceTI();">
						<option value="0"><?php echo smartyTranslate(array('s'=>'None'),$_smarty_tpl);?>
</option>
						<option value="1"><?php echo smartyTranslate(array('s'=>'Increase'),$_smarty_tpl);?>
</option>
						<option value="-1"><?php echo smartyTranslate(array('s'=>'Reduction'),$_smarty_tpl);?>
</option>
					</select>
					  <?php echo smartyTranslate(array('s'=>'of'),$_smarty_tpl);?>
  <?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2!=0){?><?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
 <?php }?>
						<input type="hidden"  id="attribute_priceTEReal" name="attribute_price" value="0.00" />
						<input type="text" size="6" id="attribute_price" value="0.00" onkeyup="$('#attribute_priceTEReal').val(this.value.replace(/,/g, '.')); if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTI();"/><?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2==0){?> <?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
<?php }?>
						<?php if ($_smarty_tpl->tpl_vars['country_display_tax_label']->value){?>
							<?php echo smartyTranslate(array('s'=>'(tax excl.)'),$_smarty_tpl);?>

							<span <?php if ($_smarty_tpl->tpl_vars['tax_exclude_option']->value){?>style="display:none"<?php }?>> <?php echo smartyTranslate(array('s'=>'or'),$_smarty_tpl);?>

							<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2!=0){?><?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
 <?php }?>
							<input type="text" size="6" name="attribute_priceTI" id="attribute_priceTI" value="0.00" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTE();"/>
							<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2==0){?> <?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
<?php }?> <?php echo smartyTranslate(array('s'=>'(tax incl.)'),$_smarty_tpl);?>

							 <?php echo smartyTranslate(array('s'=>'final product price will be set to'),$_smarty_tpl);?>

							<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2!=0){?><?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
 <?php }?>
							0.00
							<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2==0){?><?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
 <?php }?>
						<?php }?>

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_weight_impact",'type'=>"attribute_weight_impact"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Impact on weight:'),$_smarty_tpl);?>

					<select name="attribute_weight_impact" id="attribute_weight_impact" style="width: 140px;" onchange="check_weight_impact();">
						<option value="0"><?php echo smartyTranslate(array('s'=>'None'),$_smarty_tpl);?>
</option>
						<option value="1"><?php echo smartyTranslate(array('s'=>'Increase'),$_smarty_tpl);?>
</option>
						<option value="-1"><?php echo smartyTranslate(array('s'=>'Reduction'),$_smarty_tpl);?>
</option>
					</select>
					  <?php echo smartyTranslate(array('s'=>'of'),$_smarty_tpl);?>

						<input type="text" size="6" name="attribute_weight" id="attribute_weight" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
						<?php echo $_smarty_tpl->tpl_vars['ps_weight_unit']->value;?>

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_unit_impact",'type'=>"attribute_unit_impact"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Impact on unit price :'),$_smarty_tpl);?>

					<select name="attribute_unit_impact" id="attribute_unit_impact" style="width: 140px;" onchange="check_unit_impact();">
						<option value="0"><?php echo smartyTranslate(array('s'=>'None'),$_smarty_tpl);?>
</option>
						<option value="1"><?php echo smartyTranslate(array('s'=>'Increase'),$_smarty_tpl);?>
</option>
						<option value="-1"><?php echo smartyTranslate(array('s'=>'Reduction'),$_smarty_tpl);?>
</option>
					</select>
					  <?php echo smartyTranslate(array('s'=>'of'),$_smarty_tpl);?>

						<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2!=0){?> <?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
 <?php }?>
						<input type="text" size="6" name="attribute_unity" id="attribute_unity" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" /><?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2==0){?> <?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
<?php }?> / <?php echo $_smarty_tpl->tpl_vars['field_value_unity']->value;?>

			<?php if ($_smarty_tpl->tpl_vars['ps_use_ecotax']->value){?>

						<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_ecotax",'type'=>"default"), 0);?>

						<?php echo smartyTranslate(array('s'=>'Eco-tax (tax excl.):'),$_smarty_tpl);?>

					<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2!=0){?><?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
<?php }?>
						<input type="text" size="3" name="attribute_ecotax" id="attribute_ecotax" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
						<?php if ($_smarty_tpl->tpl_vars['currency']->value->format%2==0){?> <?php echo $_smarty_tpl->tpl_vars['currency']->value->sign;?>
<?php }?>
						(<?php echo smartyTranslate(array('s'=>'overrides Eco-tax on "Information" tab'),$_smarty_tpl);?>
)

			<?php }?>

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_minimal_quantity",'type'=>"default"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Minimum quantity:'),$_smarty_tpl);?>

					<input size="3" maxlength="6" name="attribute_minimal_quantity" id="attribute_minimal_quantity" type="text" value="<?php echo $_smarty_tpl->tpl_vars['minimal_quantity']->value;?>
" />

<?php echo smartyTranslate(array('s'=>'The minimum quantity to buy this product (set to 1 to disable this feature)'),$_smarty_tpl);?>

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"available_date_attribute",'type'=>"default"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Available date:'),$_smarty_tpl);?>

					<input class="datepicker" id="available_date_attribute" name="available_date_attribute" value="<?php echo $_smarty_tpl->tpl_vars['available_date']->value;?>
" style="text-align: center;" type="text" />

<?php echo smartyTranslate(array('s'=>'The available date when this product is out of stock'),$_smarty_tpl);?>

				<?php echo smartyTranslate(array('s'=>'Image:'),$_smarty_tpl);?>

						<?php  $_smarty_tpl->tpl_vars['image'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['image']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['images']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['image']->key => $_smarty_tpl->tpl_vars['image']->value){
$_smarty_tpl->tpl_vars['image']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['image']->key;
?>
							<li style="float: left; width: <?php echo $_smarty_tpl->tpl_vars['imageWidth']->value;?>
px;">
								<input type="checkbox" name="id_image_attr[]" value="<?php echo $_smarty_tpl->tpl_vars['image']->value['id_image'];?>
" id="id_image_attr_<?php echo $_smarty_tpl->tpl_vars['image']->value['id_image'];?>
" />
								<label for="id_image_attr_<?php echo $_smarty_tpl->tpl_vars['image']->value['id_image'];?>
" style="float: none;">
									<img src="<?php echo @_THEME_PROD_DIR_;?>
<?php echo $_smarty_tpl->tpl_vars['image']->value['obj']->getExistingImgPath();?>
-small_default.jpg" alt="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['image']->value['legend'], 'htmlall', 'UTF-8');?>
" title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['image']->value['legend'], 'htmlall', 'UTF-8');?>
" />

						<?php } ?>

					<?php echo $_smarty_tpl->getSubTemplate ("controllers/products/multishop/checkbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('field'=>"attribute_default",'type'=>"attribute_default"), 0);?>

					<?php echo smartyTranslate(array('s'=>'Default:'),$_smarty_tpl);?>

					<input type="checkbox" name="attribute_default" id="attribute_default" value="1" />
					 <?php echo smartyTranslate(array('s'=>'Make this the default combination for this product'),$_smarty_tpl);?>

						<input type="reset" name="ResetBtn" id="ResetBtn" onclick="getE('id_product_attribute').value = 0;" class="button" value="<?php echo smartyTranslate(array('s'=>'Cancel modification'),$_smarty_tpl);?>
" />

	<?php echo $_smarty_tpl->tpl_vars['list']->value;?>

<?php }?>
<?php }} ?>


text:
require 'sinatra'
require 'json'
require 'rack/cors'

use Rack::Cors do |config|
  config.allow do |allow|
    allow.origins '*'
    allow.resource '*',
      methods: [:get, :post, :put, :delete],
      headers: :any,
      max_age: 0
  end
end

RESOURCES = %w( trails trailheads trailsegments stewards notifications photos ).freeze

RESOURCES.each do |resource|
  get "/#{resource}.json" do
    content_type :json
    File.read( File.expand_path("../data/#{resource}.json", __FILE__) )
  end
end

get "/" do
  "Available Resources: #{ RESOURCES.join(", ") }"
end


text:
#include <aws/mediaconvert/model/MxfAfdSignaling.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace MediaConvert
  {
    namespace Model
    {
      namespace MxfAfdSignalingMapper
      {

        static const int NO_COPY_HASH = HashingUtils::HashString("NO_COPY");
        static const int COPY_FROM_VIDEO_HASH = HashingUtils::HashString("COPY_FROM_VIDEO");

        MxfAfdSignaling GetMxfAfdSignalingForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == NO_COPY_HASH)
          {
            return MxfAfdSignaling::NO_COPY;
          }
          else if (hashCode == COPY_FROM_VIDEO_HASH)
          {
            return MxfAfdSignaling::COPY_FROM_VIDEO;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<MxfAfdSignaling>(hashCode);
          }

          return MxfAfdSignaling::NOT_SET;
        }

        Aws::String GetNameForMxfAfdSignaling(MxfAfdSignaling enumValue)
        {
          switch(enumValue)
          {
          case MxfAfdSignaling::NO_COPY:
            return "NO_COPY";
          case MxfAfdSignaling::COPY_FROM_VIDEO:
            return "COPY_FROM_VIDEO";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace MxfAfdSignalingMapper
    } // namespace Model
  } // namespace MediaConvert
} // namespace Aws


text:
package com.mcms.study.spring.batch.job.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

@Component
public class SimpleProcessor implements ItemProcessor<String, String> {

    private static final Logger log = LoggerFactory.getLogger(SimpleProcessor.class);

    public String process(String item) throws Exception {
        log.info("Processing Begin: " + item);
        if (CustomException.getErrorItem().contains(item)) {
            throw new CustomException();
        }
        log.info("Processing Done: " + item);
        return item;
    }

}


text:
<?php defined('BX_DOL') or die('hack attempt');

class BxDevTemplate extends BxDolModuleTemplate
{
    function __construct(&$oConfig, &$oDb)
    {
        parent::__construct($oConfig, $oDb);

        $this->addStudioCss(['main.css']);
    }

    function displayPageSettings($sPage, $oContent, $sGetPageCodeMethod = 'getPageCode')
    {
        $this->addStudioCss($oContent->getCss(), false, false);
        $this->addStudioJs($oContent->getJs(), false, false);

        $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-single');
        return $oContent->getCode();
    }

    function displayPageContent($sPage, $oContent, $sGetPageCodeMethod = 'getPageCode')
    {
        $this->addStudioCss($oContent->getPageCss(), false, false);
        $this->addStudioJs($oContent->getPageJs(), false, false);

        $sMenu = $oContent->getPageMenu();
        $sContent = $oContent->getPageJsCode() . $oContent->$sGetPageCodeMethod();
        if(empty($sMenu)) {
            $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-single');
            return $sContent;
        }

        $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-columns');
        return $this->parseHtmlByName('page_content.html', [
            'page_menu_code' => $sMenu,
            'page_main_code' => $sContent
        ]);
    }
}

/** @} */


text:
<?php
function ninja_forms_sidebar_display_fields($slug){
	global $ninja_forms_fields, $current_tab;
	if(is_array($ninja_forms_fields) AND isset($_REQUEST['form_id'])){
		foreach($ninja_forms_fields as $field_slug => $field){
			if($field['sidebar'] == $slug){
				if(isset($field['limit'])){
					$limit = $field['limit'];
				}else{
					$limit = '';
				}
				?>

					<a class="button-secondary ninja-forms-new-field" id="<?php _e($field_slug, 'ninja-forms');?>" name="_<?php echo $limit;?>"  href="#"><?php _e($field['name'], 'ninja-forms');?>

				<?php
			}
		}
	}
}


text:
#pragma once

#include <matazure/point.hpp>
#include <matazure/execution.hpp>
#include <matazure/type_traits.hpp>

#define MATAZURE_STRINGIFY(a) #a

#if defined(_MSC_VER)
	#define MATAZURE_AUTO_VECTORISED __pragma(loop(ivdep))
#elif defined(__GNUC__)
	///@todo: auto vectorized does not support gcc now, to fix it
	#define MATAZURE_AUTO_VECTORISED /*_Pragma("ivdep")*/
#else
	#define MATAZURE_AUTO_VECTORISED _Pragma("ivdep")
#endif

#ifdef MATAZURE_OPENMP
	#if defined(_MSC_VER)
		#define MATAZURE_OPENMP_PARALLEL_FOR(n) __pragma(omp parallel for)
	#else
		#if _OPENMP >= 200805
			// #define PRIVATE_MATAZURE_PARALLEL_FOR(n) "omp parallel for schedule(dynamic, 1) collapse(" #n ")"
		 	#define MATAZURE_OPENMP_PARALLEL_FOR(n) _Pragma(MATAZURE_STRINGIFY(omp parallel for schedule(dynamic, 1) collapse(n)))
		#else
		 	#define MATAZURE_OPENMP_PARALLEL_FOR(n) _Pragma("omp parallel for")
		#endif
	#endif

	#if defined(_MSC_VER)
		#define MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(n) \
		 	__pragma(omp parallel for)
	#else
		 #if _OPENMP >= 200805
		 	#define MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(n) _Pragma(MATAZURE_STRINGIFY(omp parallel for schedule(dynamic, 1) collapse(n)))
		 #else
		 	#define MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(n) _Pragma("omp parallel for simd")
		#endif
	#endif
#endif

namespace matazure {

/// special is_linear_array for point
template <typename _Type, int_t _Rank>
struct _Is_linear_array<point<_Type, _Rank>>: bool_constant<true> {};

/**
* @brief for each linear index, apply fun by the sequence policy
* @param first the first index
* @param last the last index
* @param fun the functor,  int_t -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_policy, int_t first, int_t last, _Func fun) {
	for (int_t i = first; i < last; ++i) {
		fun(i);
	}
}

/**
* @brief for each linear index, apply fun by the sequence vectorized policy
* @param first the first index
* @param last the last index
* @param fun the functor,  int_t -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_vectorized_policy policy, int_t first, int_t last, _Func fun) {
	MATAZURE_AUTO_VECTORISED
	for (int_t i = first; i < last; ++i) {
		fun(i);
	}
}

#ifdef MATAZURE_OPENMP

/**
* @brief for each linear index, apply fun by the openmp parallel policy
* @param first the first index
* @param last the last index
* @param fun the functor,  int_t -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_policy policy, int_t first, int_t last, _Func fun){
	MATAZURE_OPENMP_PARALLEL_FOR(1)
	for (int_t i = first; i < last; ++i) {
		fun(i);
	}
}

/**
* @brief for each linear index, apply fun by the openmp parallel vectorized policy
* @param first the first index
* @param last the last index
* @param fun the functor,  int_t -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_vectorized_policy policy, int_t first, int_t last, _Func fun){
	#pragma omp parallel for
	for (int_t i = first; i < last; ++i) {
		fun(i);
	}
}

#endif

/**
* @brief for each linear index, apply fun by the sequence policy
* @param first the first index
* @param last the last index
* @param fun the functor,  int_t -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(int_t first, int_t last, _Func fun) {
	sequence_vectorized_policy seq{};
	for_index(seq, first, last, fun);
}

/**

*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(int_t last, _Func fun){
	for_index(0, last, fun);
}

/**
* @brief for each 1-dim array index, apply fun by the sequence policy
* @param origin the origin index of the 1-dim range
* @param end the end index
* @param fun the functor,  pointi<1> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_policy, pointi<1> origin, pointi<1> end, _Func fun) {
	for (int_t i = origin[0]; i < end[0]; ++i) {
		fun(pointi<1>{ { i } });
	}
}

/**
* @brief for each 2-dim array index, apply fun by the sequence policy
* @param origin the origin index of the 2-dim range
* @param end the end index
* @param fun the functor,  pointi<2> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_policy, pointi<2> origin, pointi<2> end, _Func fun) {
	for (int_t j = origin[1]; j < end[1]; ++j) {
		for (int_t i = origin[0]; i < end[0]; ++i) {
			fun(pointi<2>{ { i, j } });
		}
	}
}

/**
* @brief for each 3-dim array index, apply fun by the sequence policy
* @param origin the origin index of the 3-dim range
* @param end the end index
* @param fun the functor,  pointi<3> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_policy, pointi<3> origin, pointi<3> end, _Func fun) {
	for (int_t k = origin[2]; k < end[2]; ++k) {
		for (int_t j = origin[1]; j < end[1]; ++j) {
			for (int_t i = origin[0]; i < end[0]; ++i) {
				fun(pointi<3>{ { i, j, k } });
			}
		}
	}
}

/**
* @brief for each 4-dim array index, apply fun by the sequence policy
* @param origin the origin index of the 4-dim range
* @param end the end index
* @param fun the functor,  pointi<4> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_policy, pointi<4> origin, pointi<4> end, _Func fun) {
	for (int_t l = origin[3]; l < end[3]; ++l) {
		for (int_t k = origin[2]; k < end[2]; ++k) {
			for (int_t j = origin[1]; j < end[1]; ++j) {
				for (int_t i = origin[0]; i < end[0]; ++i) {
					fun(pointi<4>{ {i, j, k, l} });
				}
			}
		}
	}
}

/**
* @brief for each 1-dim array index, apply fun by the sequence vectorized policy
* @param origin the origin index of the 1-dim range
* @param end the end index
* @param fun the functor,  pointi<1> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_vectorized_policy, pointi<1> origin, pointi<1> end, _Func fun) {
	MATAZURE_AUTO_VECTORISED
	for (int_t i = origin[0]; i < end[0]; ++i) {
		fun(pointi<1>{ { i } });
	}
}

/**
* @brief for each 2-dim array index, apply fun by the sequence vectorized policy
* @param origin the origin index of the 2-dim range
* @param end the end index
* @param fun the functor,  pointi<2> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_vectorized_policy, pointi<2> origin, pointi<2> end, _Func fun) {
	for (int_t j = origin[1]; j < end[1]; ++j) {
		MATAZURE_AUTO_VECTORISED
		for (int_t i = origin[0]; i < end[0]; ++i) {
			fun(pointi<2>{ { i, j } });
		}
	}
}

/**
* @brief for each 3-dim array index, apply fun by the sequence vectorized policy
* @param origin the origin index of the 3-dim range
* @param end the end index
* @param fun the functor,  pointi<3> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_vectorized_policy, pointi<3> origin, pointi<3> end, _Func fun) {
	for (int_t k = origin[2]; k < end[2]; ++k) {
		for (int_t j = origin[1]; j < end[1]; ++j) {
			MATAZURE_AUTO_VECTORISED
			for (int_t i = origin[0]; i < end[0]; ++i) {
				fun(pointi<3>{ { i, j, k } });
			}
		}
	}
}

/**
* @brief for each 4-dim array index, apply fun by the sequence vectorized policy
* @param origin the origin index of the 4-dim range
* @param end the end index
* @param fun the functor,  pointi<4> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(sequence_vectorized_policy, pointi<4> origin, pointi<4> end, _Func fun) {
	for (int_t l = origin[3]; l < end[3]; ++l) {
		for (int_t k = origin[2]; k < end[2]; ++k) {
			for (int_t j = origin[1]; j < end[1]; ++j) {
				MATAZURE_AUTO_VECTORISED
				for (int_t i = origin[0]; i < end[0]; ++i) {
					fun(pointi<4>{ {i, j, k, l} });
				}
			}
		}
	}
}

#ifdef _OPENMP

/**
* @brief for each 1-dim array index, apply fun by the openmp parallel policy
* @param origin the origin index of the 1-dim range
* @param end the end index
* @param fun the functor,  pointi<1> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_policy, pointi<1> origin, pointi<1> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR(1)
	for (int_t i = origin[0]; i < end[0]; ++i) {
		fun(pointi<1>{ { i } });
	}
}

/**
* @brief for each 2-dim array index, apply fun by the openmp parallel policy
* @param origin the origin index of the 2-dim range
* @param end the end index
* @param fun the functor,  pointi<2> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_policy, pointi<2> origin, pointi<2> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR(2)
	for (int_t j = origin[1]; j < end[1]; ++j) {
		for (int_t i = origin[0]; i < end[0]; ++i) {
			fun(pointi<2>{ { i, j } });
		}
	}
}

/**
* @brief for each 3-dim array index, apply fun by the openmp parallel policy
* @param origin the origin index of the 3-dim range
* @param end the end index
* @param fun the functor,  pointi<3> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_policy, pointi<3> origin, pointi<3> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR(3)
	for (int_t k = origin[2]; k < end[2]; ++k) {
		for (int_t j = origin[1]; j < end[1]; ++j) {
			for (int_t i = origin[0]; i < end[0]; ++i) {
				fun(pointi<3>{ { i, j, k } });
			}
		}
	}
}

/**
* @brief for each 4-dim array index, apply fun by the openmp parallel policy
* @param origin the origin index of the 4-dim range
* @param end the end index
* @param fun the functor,  pointi<4> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_policy, pointi<4> origin, pointi<4> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR(4)
	for (int_t l = origin[3]; l < end[3]; ++l) {
		for (int_t k = origin[2]; k < end[2]; ++k) {
			for (int_t j = origin[1]; j < end[1]; ++j) {
				for (int_t i = origin[0]; i < end[0]; ++i) {
					fun(pointi<4>{ {i, j, k, l} });
				}
			}
		}
	}
}

/**
* @brief for each 1-dim array index, apply fun by the openmp parallel vectorized policy
* @param origin the origin index of the 1-dim range
* @param end the end index
* @param fun the functor,  pointi<1> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_vectorized_policy, pointi<1> origin, pointi<1> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(1)
	for (int_t i = origin[0]; i < end[0]; ++i) {
		fun(pointi<1>{ { i } });
	}
}

/**
* @brief for each 2-dim array index, apply fun by the openmp parallel vectorized policy
* @param origin the origin index of the 2-dim range
* @param end the end index
* @param fun the functor,  pointi<2> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_vectorized_policy, pointi<2> origin, pointi<2> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(2)
	for (int_t j = origin[1]; j < end[1]; ++j) {
		for (int_t i = origin[0]; i < end[0]; ++i) {
			fun(pointi<2>{ { i, j } });
		}
	}
}

/**
* @brief for each 3-dim array index, apply fun by the openmp parallel vectorized policy
* @param origin the origin index of the 3-dim range
* @param end the end index
* @param fun the functor,  pointi<3> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_vectorized_policy, pointi<3> origin, pointi<3> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(3)
	for (int_t k = origin[2]; k < end[2]; ++k) {
		for (int_t j = origin[1]; j < end[1]; ++j) {
			for (int_t i = origin[0]; i < end[0]; ++i) {
				fun(pointi<3>{ { i, j, k } });
			}
		}
	}
}

/**
* @brief for each 4-dim array index, apply fun by the openmp parallel vectorized policy
* @param origin the origin index of the 4-dim range
* @param end the end index
* @param fun the functor,  pointi<4> -> value pattern.
*/
template <typename _Func>
inline MATAZURE_GENERAL void for_index(omp_vectorized_policy, pointi<4> origin, pointi<4> end, _Func fun) {
	MATAZURE_OPENMP_PARALLEL_FOR_VECTORISED(4)
	for (int_t l = origin[3]; l < end[3]; ++l) {
		for (int_t k = origin[2]; k < end[2]; ++k) {
			for (int_t j = origin[1]; j < end[1]; ++j) {
				for (int_t i = origin[0]; i < end[0]; ++i) {
					fun(pointi<4>{ {i, j, k, l} });
				}
			}
		}
	}
}

#endif

/**
* @brief for each array index, apply fun by the sequence policy
* @param origin the origin index of the range
* @param end the end index
* @param fun the functor,  pointi -> value pattern.
*/
template <typename _Func, int_t _Rank>
inline MATAZURE_GENERAL void for_index(pointi<_Rank> origin, pointi<_Rank> end, _Func fun) {
	sequence_vectorized_policy policy{};
	for_index(policy, origin, end, fun);
}

template <typename _Func, int_t _Rank>
inline MATAZURE_GENERAL void for_index(pointi<_Rank> end, _Func fun){
	for_index(zero<pointi<_Rank>>::value(), end, fun);
}

/**
* @brief for each element of a linear indexing tensor, apply fun
* @param policy the execution policy
* @param ts the source tensor
* @param fun the functor, (element &) -> none pattern
*/
template <typename _ExectutionPolicy, typename _Tensor, typename _Fun>
inline MATAZURE_GENERAL void for_each(_ExectutionPolicy policy, _Tensor &&ts, _Fun fun, enable_if_t<are_linear_access<decay_t<_Tensor>>::value && none_device_memory<decay_t<_Tensor>>::value>* = 0) {
	for_index(policy, 0, ts.size(), [&](int_t i) {
		fun(ts[i]);
	});
}

/**
* @brief for each element of an array indexing tensor, apply fun
* @param policy the execution policy
* @param ts the source tensor
* @param fun the functor, (element &) -> none pattern
*/
template <typename _ExectutionPolicy, typename _Tensor, typename _Fun>
inline MATAZURE_GENERAL void for_each(_ExectutionPolicy policy, _Tensor &&ts, _Fun fun, enable_if_t<!are_linear_access<decay_t<_Tensor>>::value && none_device_memory<decay_t<_Tensor>>::value>* = 0) {
	for_index(policy, pointi<decay_t<_Tensor>::rank>::zeros(), ts.shape(), [&](pointi<decay_t<_Tensor>::rank> idx) {
		fun(ts[idx]);
	});
}

/**
* @brief for each element of a tensor, apply fun by the sequence policy
* @param ts the source tensor
* @param fun the functor, (element &) -> none pattern
*/
template <typename _Tensor, typename _Fun>
inline MATAZURE_GENERAL void for_each(_Tensor &&ts, _Fun fun,
	enable_if_t<
		none_device_memory<
			enable_if_t<
				is_linear_array<decay_t<_Tensor>>::value,
				decay_t<_Tensor>
			>
		>::value
	>* = 0)
{
	sequence_vectorized_policy policy{};
	for_each(policy, std::forward<_Tensor>(ts), fun);
}

/**
* @brief fill a tensor value elementwise
* @param policy the execution policy
* @param ts the source tensor
* @param v the filled value
*/
template <typename _ExectutionPolicy, typename _Tensor>
inline MATAZURE_GENERAL void fill(_ExectutionPolicy policy, _Tensor &&ts, typename decay_t<_Tensor>::value_type v, enable_if_t<none_device_memory<decay_t<_Tensor>>::value>* = 0) {
	for_each(policy, std::forward<_Tensor>(ts), [v](typename decay_t<_Tensor>::value_type &x) { x = v;});
}

/**
* @brief fill a tensor value elementwise by the sequence policy
* @param ts the source tensor
* @param v the filled value
*/
template <typename _Tensor>
inline MATAZURE_GENERAL void fill(_Tensor &&ts, typename decay_t<_Tensor>::value_type v, enable_if_t<
		none_device_memory<
			enable_if_t<
				is_linear_array<decay_t<_Tensor>>::value,
				decay_t<_Tensor>
			>
		>::value
	>* = 0) {
	sequence_vectorized_policy policy{};
	fill(policy, std::forward<_Tensor>(ts), v);
}

/**
* @brief elementwisely copy a linear indexing tensor to another one
* @param policy the execution policy
* @param ts_src the source tensor
* @param ts_dst the dest tensor
*/
template <typename _ExectutionPolicy, typename _TensorSrc, typename _TensorDst>
inline MATAZURE_GENERAL void copy(_ExectutionPolicy policy, const _TensorSrc &ts_src, _TensorDst &&ts_dst, enable_if_t<are_linear_access<decay_t<_TensorSrc>, decay_t<_TensorDst>>::value && none_device_memory<decay_t<_TensorSrc>, decay_t<_TensorDst>>::value>* = 0) {
	for_index(policy, 0, ts_src.size(), [&] (int_t i) {
		ts_dst[i] = ts_src[i];
	});
}

/**
* @brief elementwisely copy a array indexing tensor to another one
* @param policy the execution policy
* @param ts_src the source tensor
* @param ts_dst the dest tensor
*/
template <typename _ExectutionPolicy, typename _TensorSrc, typename _TensorDst>
inline MATAZURE_GENERAL void copy(_ExectutionPolicy policy, const _TensorSrc &ts_src, _TensorDst &&ts_dst, enable_if_t<!are_linear_access<decay_t<_TensorSrc>, decay_t<_TensorDst>>::value && none_device_memory<decay_t<_TensorSrc>, decay_t<_TensorDst>>::value>* = 0) {
	for_index(policy, pointi<_TensorSrc::rank>::zeros(), ts_src.shape(), [&] (pointi<_TensorSrc::rank> idx) {
		ts_dst[idx] = ts_src[idx];
	});
}

/**
* @brief elementwisely copy a tensor to another one by the sequence policy
* @param ts_src the source tensor
* @param ts_dst the dest tensor
*/
template <typename _TensorSrc, typename _TensorDst>
inline MATAZURE_GENERAL void copy(const _TensorSrc &ts_src, _TensorDst &&ts_dst, enable_if_t<none_device_memory<enable_if_t<is_linear_array<decay_t<_TensorSrc>>::value, decay_t<_TensorSrc>>, decay_t<_TensorDst>>::value>* = 0) {
	sequence_vectorized_policy policy;
	copy(policy, ts_src, std::forward<_TensorDst>(ts_dst));
}

/**
* @brief transform a linear indexing tensor to another by the fun
* @param policy the execution policy
* @param ts_src the source tensor
* @param ts_dst the destination tensor
* @param fun the functor, (e_src) -> e_dst pattern
*/
template <typename _ExectutionPolicy, typename _TensorSrc, typename _TensorDst, typename _Fun>
inline MATAZURE_GENERAL void transform(_ExectutionPolicy policy, const _TensorSrc &ts_src, _TensorDst &&ts_dst, _Fun fun, enable_if_t<are_linear_access<decay_t<_TensorSrc>, decay_t<_TensorDst>>::value && none_device_memory<decay_t<_TensorSrc>, decay_t<_TensorDst>>::value>* = 0) {
	for_index(policy, 0, ts_src.size(), [&](int_t i) {
		ts_dst[i] = fun(ts_src[i]);
	});
}

/**
* @brief transform a array indexing tensor to another by the fun
* @param policy the execution policy
* @param ts_src the source tensor
* @param ts_dst the destination tensor
* @param fun the functor, (e_src) -> e_dst pattern
*/
template <typename _ExectutionPolicy, typename _TensorSrc, typename _TensorDst, typename _Fun>
inline MATAZURE_GENERAL void transform(_ExectutionPolicy policy, const _TensorSrc &ts_src, _TensorDst &&ts_dst, _Fun fun, enable_if_t<!are_linear_access<decay_t<_TensorSrc>>::value && none_device_memory<decay_t<_TensorSrc>>::value>* = 0) {
	for_index(policy, pointi<_TensorSrc::rank>::zeros(), ts_src.shape(), [&] (pointi<_TensorSrc::rank> idx) {
		ts_dst[idx] = fun(ts_src[idx]);
	});
}

/**
* @brief transform a tensor to another by the fun
* @param ts_src the source tensor
* @param ts_dst the destination tensor
* @param fun the functor, (e_src) -> e_dst pattern
*/
template <typename _TensorSrc, typename _TensorDst, typename _Fun>
inline MATAZURE_GENERAL void transform(const _TensorSrc &ts_src, _TensorDst &&ts_dst, _Fun fun, enable_if_t<none_device_memory<enable_if_t<is_linear_array<decay_t<_TensorSrc>>::value, decay_t<_TensorSrc>>, decay_t<_TensorDst>>::value>* = 0)
{
	sequence_vectorized_policy policy{};
	transform(policy, ts_src, std::forward<_TensorDst>(ts_dst), fun);
}

/**
* @brief reduce the elements of a tensor
* @param the execution policy
* @param ts the source tensor
* @param init the initial value
* @param binary_fun the reduce functor, must be (element, element)-> value pattern
*/
///@todo
// template <typename _ExectutionPolicy, typename _Tensor, typename _VT, typename _BinaryFunc>
// inline MATAZURE_GENERAL _VT reduce(_ExectutionPolicy policy, _Tensor ts, _VT init, _BinaryFunc binary_fun, enable_if_t<none_device_memory<decay_t<_Tensor>>::value>* = 0) {
// 	auto re = init;
// 	for_each(policy, ts, [&re, binary_fun](decltype(ts[0]) x) {
// 		re = binary_fun(re, x);
// 	});
//
// 	return re;
// }

/**
* @brief reduce the elements of a tensor by the sequence policy
* @param ts the source tensor
* @param init the initial value
* @param binary_fun the reduce functor, must be (element, element)-> value pattern
*/
template <typename _Tensor, typename _VT, typename _BinaryFunc>
inline MATAZURE_GENERAL _VT reduce(const _Tensor &ts, _VT init, _BinaryFunc binary_fun) {
	sequence_policy policy{};
	auto re = init;
	for_each(policy, ts, [&re, binary_fun] (decltype(ts[0]) x) {
		re = binary_fun(re, x);
	});

	return re;
}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>net.viservice.editor</groupId>
	<artifactId>ueditor-extend</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<packaging>pom</packaging>

	<name>ueditor-extend</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>

		<spring.version>[4.3.17,)</spring.version>
		<aspectjweaver.version>1.7.4</aspectjweaver.version>
		<aspectjrt.version>1.7.4</aspectjrt.version>
		<asm.version>3.3.1</asm.version>
		<cglib.version>2.2</cglib.version>

		<slf4j.version>1.7.5</slf4j.version>
		<log4j.version>1.2.17</log4j.version>
		<junit.version>4.12</junit.version>

		<jsp-api.version>2.0</jsp-api.version>
		<servlet-api.version>3.0.1</servlet-api.version>
		<freemarker.version>2.3.28</freemarker.version>

		<bcprov.version>1.46</bcprov.version>
		<google-guava.version>23.0</google-guava.version>
		<commons-io.version>2.4</commons-io.version>
		<commons-collections.version>3.2</commons-collections.version>
		<commons-beanutils.version>1.8.3</commons-beanutils.version>
		<commons-lang3.version>3.8.1</commons-lang3.version>
		<common-fileupload.version>1.2.2</common-fileupload.version>
		<commons-codec.version>1.10</commons-codec.version>

		<fastjson.version>[1.2.31,)</fastjson.version>

		<dom4j.version>1.6</dom4j.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<!-- Spring -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-core</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-beans</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context-support</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-expression</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-aop</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-jdbc</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-tx</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-web</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-webmvc</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<!-- aspectj -->
			<dependency>
				<groupId>org.aspectj</groupId>
				<artifactId>aspectjweaver</artifactId>
				<version>${aspectjweaver.version}</version>
			</dependency>
			<dependency>
				<groupId>org.aspectj</groupId>
				<artifactId>aspectjrt</artifactId>
				<version>${aspectjrt.version}</version>
			</dependency>
			<dependency>
				<groupId>cglib</groupId>
				<artifactId>cglib-nodep</artifactId>
				<version>${cglib.version}</version>
			</dependency>
			<dependency>
				<groupId>asm</groupId>
				<artifactId>asm-all</artifactId>
				<version>${asm.version}</version>
			</dependency>
			<!-- fastjson -->
			<dependency>
				<groupId>com.alibaba</groupId>
				<artifactId>fastjson</artifactId>
				<version>${fastjson.version}</version>
			</dependency>
			<!-- Tools -->
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>${commons-lang3.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-collections</groupId>
				<artifactId>commons-collections</artifactId>
				<version>${commons-collections.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>${commons-io.version}</version>
			</dependency>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${google-guava.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-beanutils</groupId>
				<artifactId>commons-beanutils</artifactId>
				<version>${commons-beanutils.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-fileupload</groupId>
				<artifactId>commons-fileupload</artifactId>
				<version>${common-fileupload.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
				<version>${commons-codec.version}</version>
			</dependency>
			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcprov-jdk16</artifactId>
				<version>${bcprov.version}</version>
			</dependency>
			<dependency>
				<groupId>dom4j</groupId>
				<artifactId>dom4j</artifactId>
				<version>${dom4j.version}</version>
			</dependency>
			<!-- freemarker -->
			<dependency>
				<groupId>org.freemarker</groupId>
				<artifactId>freemarker</artifactId>
				<version>${freemarker.version}</version>
			</dependency>
			<!-- j2ee web spec -->
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>jsp-api</artifactId>
				<version>${jsp-api.version}</version>
			</dependency>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>javax.servlet-api</artifactId>
				<version>${servlet-api.version}</version>
				<scope>provided</scope>
			</dependency>
			<!-- Logging -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-log4j12</artifactId>
				<version>${slf4j.version}</version>
				<scope>runtime</scope>
			</dependency>
			<dependency>
				<groupId>log4j</groupId>
				<artifactId>log4j</artifactId>
				<version>${log4j.version}</version>
			</dependency>
			<!-- Test -->
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${junit.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-test</artifactId>
				<version>${spring.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<modules>
		<module>ueditor-extend-core</module>
		<module>ueditor-extend-demo</module>
	</modules>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>


text:
<resources>
    <string name="app_name">Ijk</string>
</resources>


text:
package org.reclipse.structure.inference.ui.matching.util;

import org.eclipse.emf.ecore.EObject;
import org.reclipse.structure.inference.annotations.ASGAnnotation;
import org.reclipse.structure.inference.evaluation.SimilarityEvaluator;
import org.reclipse.structure.inference.ui.matching.Constants;
import org.reclipse.structure.specification.PSAnnotation;
import org.reclipse.structure.specification.PSAttributeConstraint;
import org.reclipse.structure.specification.PSCombinedFragment;
import org.reclipse.structure.specification.PSFuzzyMetricConstraint;
import org.reclipse.structure.specification.PSFuzzySetRatingConstraint;
import org.reclipse.structure.specification.PSMetricConstraint;
import org.reclipse.structure.specification.PSObject;
import org.reclipse.structure.specification.PSPatternSpecification;
import org.reclipse.structure.specification.PSSpecificationConstraint;
import org.reclipse.structure.specification.util.ModelHelper;

public class SatisfactionUtil
{

   private static SimilarityEvaluator evaluator = new SimilarityEvaluator();

   public static String extend(String weightText, String text)
   {
      StringBuffer buf = new StringBuffer(weightText);

      if (buf.length() > 0)
      {
         buf.append("\n");
      }

      buf.append(text);

      return buf.toString();
   }

   private static String getSatisfaction(double rank)
   {
      if (rank == 0)
      {
         return Constants.UNSATISFIED_TEXT;
      }
      else if (rank == 1)
      {
         return Constants.SATISFIED_TEXT;
      }
      else
      {
         return Constants.SATISFACTION_PREFIX + roundedSatisfaction(rank);
      }
   }

   public static String getSatisfaction(PSAnnotation psAnnotation,
         ASGAnnotation annotation)
   {
      double rank;
      if (!ModelHelper.isCreate(psAnnotation))
      {
         rank = evaluator.rank(psAnnotation, annotation);
      }
      else
      {
         rank = evaluator.rank(psAnnotation.getType(), annotation);
      }

      return getSatisfaction(rank);
   }

   public static String getSatisfaction(PSAttributeConstraint attrExprPair,
         ASGAnnotation annotation)
   {
      String key = attrExprPair.getNode().getName();
      if (annotation.getBoundObjects().containsKey(key))
      {
         for (EObject element : annotation.getBoundObjects().get(key))
         {
            double rank = evaluator.rank(attrExprPair, element, annotation);
            return getSatisfaction(rank);
         }
      }

      return Constants.UNSATISFIED_TEXT;
   }

   public static String getSatisfaction(PSCombinedFragment fragment,
         ASGAnnotation annotation)
   {
      double rank = evaluator.rank(fragment, annotation);
      return getSatisfaction(rank);
   }

   public static String getSatisfaction(PSFuzzyMetricConstraint fuzzyExpr,
         ASGAnnotation annotation)
   {
      double rank = evaluator.rank(fuzzyExpr, annotation);
      return getSatisfaction(rank);
   }

   public static String getSatisfaction(PSFuzzySetRatingConstraint fuzzyExpr,
         ASGAnnotation annotation)
   {
      // TODO: missing method to rank fuzzy set rating constraints
      // double rank = evaluator.rank(fuzzyExpr, annotation);
      return getSatisfaction(0);
   }

   public static String getSatisfaction(PSMetricConstraint metricExpr,
         ASGAnnotation annotation)
   {
      double rank = evaluator.rank(metricExpr, annotation);
      return getSatisfaction(rank);
   }

   public static String getSatisfaction(PSObject psObject,
         ASGAnnotation annotation)
   {
      double rank = evaluator.rank(psObject, annotation);
      return getSatisfaction(rank);
   }

   public static String getSatisfaction(PSSpecificationConstraint constraint,
         ASGAnnotation annotation)
   {
      double rank = evaluator.rank(constraint, annotation);
      return getSatisfaction(rank);
   }

   public static String getWeight(PSAnnotation psAnnotation)
   {
      double weight = evaluator.weight(psAnnotation);
      return Double.toString(weight);
   }

   public static String getWeight(PSPatternSpecification diagram)
   {
      double weight = evaluator.weight(diagram);
      return Double.toString(weight);
   }

   private static String roundedSatisfaction(double value)
   {
      return String.format("%1$#.2f", value);
   }
}


text:
win:
	java -jar \c-cpp\packr\packr.jar win-config.json
	cp -r android/assets/* out-packr-win


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace CommonTools.Lib.ns11.ExceptionTools
{
    public class RecordNotFoundException : Exception
    {
        private RecordNotFoundException(string message) : base(message)
        {
        }

        public static RecordNotFoundException For<T>(string field, object value)
            => new RecordNotFoundException(
                $"‹{typeof(T).Name}› not found whose "{field}" is [{value}].");
    }
}


text:
package com.hileone.restretrofit.http;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/** Make a POST request. */
@Documented
@Target(METHOD)
@Retention(RUNTIME)
public @interface POST {
  /**
   * this is resolved against a base URL to create the full endpoint URL.
   */
  String value() default "";
}


text:
package com.example.thinkpad.cool.gson;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Thinkpad on 2017/6/8.
 */

public class Forecast {

    public String date;

    @SerializedName("tmp")
    public Temperature temperature;

    @SerializedName("cond")
    public More more;

    public class Temperature{
        public String max;
        public String min;
    }

    public class More{
        @SerializedName("txt_d")
        public String info;
    }
}


text:
from setuptools import setup

setup(
    name="ExampleGame",
    packages=["examplegame",
              "examplegame.test",
              "imaginary.plugins"],
    version="0.0.0",
)


text:
using System;
using System.Runtime.InteropServices;

namespace ManagedBass.DShow
{
	/// <summary>
	/// Used with <see cref="BassDShow.ChannelGetStream(int,int)" /> to retrieve information of a stream.
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	public struct BassDShowStreams
	{
		/// <summary>
		/// 0: unknown, 1: video , 2: audio , 3: subtitle
		/// </summary>
		int format;

		IntPtr name;

		/// <summary>
		/// The format name.
		/// </summary>
		public string Name => name == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(name);

        /// <summary>
        /// The stream index. Use this index to enable or disable it.
        /// </summary>
        public int Index;

		/// <summary>
		/// Is this stream enabled?
		/// </summary>
		public bool Enabled;

		/// <summary>
		/// Returns if the stream is a subtitle format.
		/// </summary>
		public bool IsSubtitle => format == 3;

		/// <summary>
		/// Returns if the stream is an audio format.
		/// </summary>
		public bool IsAudio => format == 2;

		/// <summary>
		/// Returns if the stream is a video format.
		/// </summary>
		public bool IsVideo => format == 1;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AssemblyToProcess
{
	public class SampleExplicitExposer : ISample
	{
		private ISample innerSample;

		public SampleExplicitExposer(ISample sample)
		{
			this.innerSample = sample;
		}

		double ISample.ReadWriteValue
		{
			get
			{
				return innerSample.ReadWriteValue;
			}
			set
			{
				innerSample.ReadWriteValue = value;
			}
		}

		double ISample.this[double key]
		{
			get
			{
				return innerSample[key];
			}
			set
			{
				innerSample[key] = value;
			}
		}

		double ISample.Func(double x, double y)
		{
			return innerSample.Func(x, y);
		}
	}
}


text:
package com.google.javascript.jscomp.newtypes;

/**
 *
 * @author blickly@google.com (Ben Lickly)
 * @author dimvar@google.com (Dimitris Vardoulakis)
 */
public final class NamespaceLit extends Namespace {
  public NamespaceLit(String name) {
    this.name = name;
  }

  @Override
  protected JSType computeJSType(JSTypes commonTypes) {
    ObjectType obj = ObjectType.makeObjectType(
        null, otherProps, null, false, ObjectKind.UNRESTRICTED);
    return withNamedTypes(commonTypes, obj);
  }
}


text:
static const uint count = 1000000;

int main() {
    test_start("Preallocated List");
    list_t* list = list_pcreate(count);
    list->free_values = false;

    list_for_each(node, list) {
        node->value = "Hello World";
    }

    test_assert(
        list->size == count,
        "List size is not equal to what we requested."
    );

    list_for_each(node, list) {
        test_assert(
            strcmp(node->value, "Hello World") == 0,
            "Stored value is not equal to the value we got back."
        );
    }

    list_for_each(node, list) {
        list_remove(node);
    }

    list_free(list);
    test_end();
    return 0;
}


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

import de.gracefulsoft.sonar.rules.NoObjectWaitRule;
import org.junit.Test;
import org.sonar.java.checks.verifier.JavaCheckVerifier;

public class NoObjectWaitRuleDefinitionTest
{

    @Test
    public void noObjectWaitTest()
    {
        JavaCheckVerifier.verify("src/test/files/NoObjectWaitTemplate.java", new NoObjectWaitRule());
    }

}


text:
package org.waveprotocol.wave.model.operation.wave;

import org.waveprotocol.wave.model.wave.data.WaveletData;

/**
 * Operation class for a no-op.
 */
public final class NoOp extends WaveletOperation {

  /**
   * The singleton instance.
   */
  public static final NoOp INSTANCE = new NoOp();

  private NoOp() {}

  /**
   * Does nothing.
   */
  @Override
  protected void doApply(WaveletData target) {
    // do nothing.
  }

  @Override
  public WaveletOperation getInverse() {
    return this;
  }

  @Override
  public String toString() {
    return "NoOp()";
  }

}


text:
namespace webkit_glue {
struct FormData;
struct FormField;
}  // namespace webkit_glue

namespace WebKit {
class WebFormControlElement;
class WebFrame;
}  // namespace WebKit

namespace autofill {

// Manages the forms in a RenderView.
class FormManager {
 public:
  // A bit field mask for form requirements.
  enum RequirementsMask {
    REQUIRE_NONE         = 0,       // No requirements.
    REQUIRE_AUTOCOMPLETE = 1 << 0,  // Require that autocomplete != off.
    REQUIRE_ENABLED      = 1 << 1,  // Require that disabled attribute is off.
    REQUIRE_EMPTY        = 1 << 2,  // Require that the fields are empty.
  };

  // A bit field mask to extract data from WebFormControlElement.
  enum ExtractMask {
    EXTRACT_NONE        = 0,
    EXTRACT_VALUE       = 1 << 0,  // Extract value from WebFormControlElement.
    EXTRACT_OPTION_TEXT = 1 << 1,  // Extract option text from
                                   // WebFormSelectElement. Only valid when
                                   // |EXTRACT_VALUE| is set.
                                   // This is used for form submission where
                                   // human readable value is captured.
    EXTRACT_OPTIONS     = 1 << 2,  // Extract options from
                                   // WebFormControlElement.
  };

  FormManager();
  virtual ~FormManager();

  // Fills out a FormField object from a given WebFormControlElement.
  // |extract_mask|: See the enum ExtractMask above for details.
  static void WebFormControlElementToFormField(
      const WebKit::WebFormControlElement& element,
      ExtractMask extract_mask,
      webkit_glue::FormField* field);

  // Returns the corresponding label for |element|.  WARNING: This method can
  // potentially be very slow.  Do not use during any code paths where the page
  // is loading.
  static string16 LabelForElement(const WebKit::WebFormControlElement& element);

  // Fills out a FormData object from a given WebFormElement. If |get_values|
  // is true, the fields in |form| will have the values filled out. If
  // |get_options| is true, the fields in |form will have select options filled
  // out. Returns true if |form| is filled out; it's possible that |element|
  // won't meet the requirements in |requirements|. This also returns false if
  // there are no fields in |form|.
  // TODO(jhawkins): Remove the user of this in RenderView and move this to
  // private.
  static bool WebFormElementToFormData(const WebKit::WebFormElement& element,
                                       RequirementsMask requirements,
                                       ExtractMask extract_mask,
                                       webkit_glue::FormData* form);

  // Scans the DOM in |frame| extracting and storing forms.
  void ExtractForms(const WebKit::WebFrame* frame);

  // Returns a vector of forms in |frame| that match |requirements|.
  void GetFormsInFrame(const WebKit::WebFrame* frame,
                       RequirementsMask requirements,
                       std::vector<webkit_glue::FormData>* forms);

  // Finds the form that contains |element| and returns it in |form|. Returns
  // false if the form is not found.
  bool FindFormWithFormControlElement(
      const WebKit::WebFormControlElement& element,
      RequirementsMask requirements,
      webkit_glue::FormData* form);

  // Fills the form represented by |form|. |node| is the input element that
  // initiated the auto-fill process.
  bool FillForm(const webkit_glue::FormData& form, const WebKit::WebNode& node);

  // Previews the form represented by |form|. |node| is the input element that
  // initiated the preview process.
  bool PreviewForm(const webkit_glue::FormData& form,
                   const WebKit::WebNode &node);

  // Clears the values of all input elements in the form that contains |node|.
  // Returns false if the form is not found.
  bool ClearFormWithNode(const WebKit::WebNode& node);

  // Clears the placeholder values and the auto-filled background for any fields
  // in the form containing |node| that have been previewed. Resets the
  // autofilled state of |node| to |was_autofilled|. Returns false if the form
  // is not found.
  bool ClearPreviewedFormWithNode(const WebKit::WebNode& node,
                                  bool was_autofilled);

  // Resets the stored set of forms.
  void Reset();

  // Resets the forms for the specified |frame|.
  void ResetFrame(const WebKit::WebFrame* frame);

  // Returns true if |form| has any auto-filled fields.
  bool FormWithNodeIsAutofilled(const WebKit::WebNode& node);

 private:
  // Stores the WebFormElement and the form control elements for a form.
  // Original form values are stored so when we clear a form we can reset
  // <select> elements to their original value.
  struct FormElement;

  // Type for cache of FormElement objects.
  typedef ScopedVector<FormElement> FormElementList;

  // The callback type used by ForEachMatchingFormField().
  typedef Callback3<WebKit::WebFormControlElement*,
                    const webkit_glue::FormField*,
                    bool>::Type Callback;

  // Finds the cached FormElement that contains |node|.
  bool FindCachedFormElementWithNode(const WebKit::WebNode& node,
                                     FormElement** form_element);

  // Uses the data in |form| to find the cached FormElement.
  bool FindCachedFormElement(const webkit_glue::FormData& form,
                             FormElement** form_element);

  // For each field in |data| that matches the corresponding field in |form|
  // and meets the |requirements|, |callback| is called with the actual
  // WebFormControlElement and the FormField data from |form|. The field that
  // matches |node| is not required to be empty if |requirements| includes
  // REQUIRE_EMPTY.  This method owns |callback|.
  void ForEachMatchingFormField(FormElement* form,
                                const WebKit::WebNode& node,
                                RequirementsMask requirements,
                                const webkit_glue::FormData& data,
                                Callback* callback);

  // A ForEachMatchingFormField() callback that sets |field|'s value using the
  // value in |data|.  This method also sets the autofill attribute, causing the
  // background to be yellow.
  void FillFormField(WebKit::WebFormControlElement* field,
                     const webkit_glue::FormField* data,
                     bool is_initiating_node);

  // A ForEachMatchingFormField() callback that sets |field|'s placeholder value
  // using the value in |data|, causing the test to be greyed-out.  This method
  // also sets the autofill attribute, causing the background to be yellow.
  void PreviewFormField(WebKit::WebFormControlElement* field,
                        const webkit_glue::FormField* data,
                        bool is_initiating_node);

  // The cached FormElement objects.
  FormElementList form_elements_;

  DISALLOW_COPY_AND_ASSIGN(FormManager);
};

}  // namespace autofill

#endif  // CHROME_RENDERER_AUTOFILL_FORM_MANAGER_H_


text:
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Layer, InputSpec, DepthwiseConv2D
from tensorflow.keras.layers import Conv2D, BatchNormalization, Add
from tensorflow.keras.layers import ReLU, LeakyReLU, ZeroPadding2D
from keras_contrib.layers import InstanceNormalization

def channel_shuffle_2(x):
    dyn_shape = tf.shape(x)
    h, w = dyn_shape[1], dyn_shape[2]
    c = x.shape[3]
    x = K.reshape(x, [-1, h, w, 2, c // 2])
    x = K.permute_dimensions(x, [0, 1, 2, 4, 3])
    x = K.reshape(x, [-1, h, w, c])
    return x

class ReflectionPadding2D(Layer):
    def __init__(self, padding=(1, 1), **kwargs):
        super(ReflectionPadding2D, self).__init__(**kwargs)
        padding = tuple(padding)
        self.padding = ((0, 0), padding, padding, (0, 0))
        self.input_spec = [InputSpec(ndim=4)]

    def compute_output_shape(self, s):
        """ If you are using "channels_last" configuration"""
        return s[0], s[1] + 2 * self.padding[0], s[2] + 2 * self.padding[1], s[3]

    def call(self, x):
        return tf.pad(x, self.padding, "REFLECT")

def get_padding(pad_type, padding):
    if pad_type == "reflect":
        return ReflectionPadding2D(padding)
    elif pad_type == "constant":
        return ZeroPadding2D(padding)
    else:
        raise ValueError(f"Unrecognized pad_type {pad_type}")

def get_norm(norm_type):
    if norm_type == "instance":
        return InstanceNormalization()
    elif norm_type == 'batch':
        return BatchNormalization()
    else:
        raise ValueError(f"Unrecognized norm_type {norm_type}")

class FlatConv(Model):
    def __init__(self,
                 filters,
                 kernel_size,
                 norm_type="instance",
                 pad_type="constant",
                 **kwargs):
        super(FlatConv, self).__init__(name="FlatConv")
        padding = (kernel_size - 1) // 2
        padding = (padding, padding)
        self.model = tf.keras.models.Sequential()
        self.model.add(get_padding(pad_type, padding))
        self.model.add(Conv2D(filters, kernel_size))
        self.model.add(get_norm(norm_type))
        self.model.add(ReLU())

    def build(self, input_shape):
        super(FlatConv, self).build(input_shape)

    def call(self, x, training=False):
        return self.model(x, training=training)

class BasicShuffleUnitV2(Model):
    def __init__(self,
                 filters,  # NOTE: will be filters // 2
                 norm_type="instance",
                 pad_type="constant",
                 **kwargs):
        super(BasicShuffleUnitV2, self).__init__(name="BasicShuffleUnitV2")
        filters //= 2
        self.model = tf.keras.models.Sequential([
            Conv2D(filters, 1, use_bias=False),
            get_norm(norm_type),
            ReLU(),
            DepthwiseConv2D(3, padding='same', use_bias=False),
            get_norm(norm_type),
            Conv2D(filters, 1, use_bias=False),
            get_norm(norm_type),
            ReLU(),
        ])

    def build(self, input_shape):
        super(BasicShuffleUnitV2, self).build(input_shape)

    def call(self, x, training=False):
        xl, xr = tf.split(x, 2, 3)
        x = tf.concat((xl, self.model(xr)), 3)
        return channel_shuffle_2(x)

class DownShuffleUnitV2(Model):
    def __init__(self,
                 filters,  # NOTE: will be filters // 2
                 norm_type="instance",
                 pad_type="constant",
                 **kwargs):
        super(DownShuffleUnitV2, self).__init__(name="DownShuffleUnitV2")
        filters //= 2
        self.r_model = tf.keras.models.Sequential([
            Conv2D(filters, 1, use_bias=False),
            get_norm(norm_type),
            ReLU(),
            DepthwiseConv2D(3, 2, 'same', use_bias=False),
            get_norm(norm_type),
            Conv2D(filters, 1, use_bias=False),
        ])
        self.l_model = tf.keras.models.Sequential([
            DepthwiseConv2D(3, 2, 'same', use_bias=False),
            get_norm(norm_type),
            Conv2D(filters, 1, use_bias=False),
        ])
        self.bn_act = tf.keras.models.Sequential([
            get_norm(norm_type),
            ReLU(),
        ])

    def build(self, input_shape):
        super(DownShuffleUnitV2, self).build(input_shape)

    def call(self, x, training=False):
        x = tf.concat((self.l_model(x), self.r_model(x)), 3)
        x = self.bn_act(x)
        return channel_shuffle_2(x)

class ConvBlock(Model):
    def __init__(self,
                 filters,
                 kernel_size,
                 stride=1,
                 norm_type="instance",
                 pad_type="constant",
                 **kwargs):
        super(ConvBlock, self).__init__(name="ConvBlock")
        padding = (kernel_size - 1) // 2
        padding = (padding, padding)

        self.model = tf.keras.models.Sequential()
        self.model.add(get_padding(pad_type, padding))
        self.model.add(Conv2D(filters, kernel_size, stride))
        self.model.add(get_padding(pad_type, padding))
        self.model.add(Conv2D(filters, kernel_size))
        self.model.add(get_norm(norm_type))
        self.model.add(ReLU())

    def build(self, input_shape):
        super(ConvBlock, self).build(input_shape)

    def call(self, x, training=False):
        return self.model(x, training=training)

class ResBlock(Model):
    def __init__(self,
                 filters,
                 kernel_size,
                 norm_type="instance",
                 pad_type="constant",
                 **kwargs):
        super(ResBlock, self).__init__(name="ResBlock")
        padding = (kernel_size - 1) // 2
        padding = (padding, padding)
        self.model = tf.keras.models.Sequential()
        self.model.add(get_padding(pad_type, padding))
        self.model.add(Conv2D(filters, kernel_size))
        self.model.add(get_norm(norm_type))
        self.model.add(ReLU())
        self.model.add(get_padding(pad_type, padding))
        self.model.add(Conv2D(filters, kernel_size))
        self.model.add(get_norm(norm_type))
        self.add = Add()

    def build(self, input_shape):
        super(ResBlock, self).build(input_shape)

    def call(self, x, training=False):
        return self.add([self.model(x, training=training), x])

class UpSampleConv(Model):
    def __init__(self,
                 filters,
                 kernel_size,
                 norm_type="instance",
                 pad_type="constant",
                 light=False,
                 **kwargs):
        super(UpSampleConv, self).__init__(name="UpSampleConv")
        if light:
            self.model = tf.keras.models.Sequential([
                Conv2D(filters, 1),
                BasicShuffleUnitV2(filters, norm_type, pad_type)
            ])
        else:
            self.model = ConvBlock(
                filters, kernel_size, 1, norm_type, pad_type)

    def build(self, input_shape):
        super(UpSampleConv, self).build(input_shape)

    def call(self, x, training=False):
        x = tf.keras.backend.resize_images(x, 2, 2, "channels_last", 'bilinear')
        return self.model(x, training=training)

class StridedConv(Model):
    def __init__(self,
                 filters=64,
                 lrelu_alpha=0.2,
                 pad_type="constant",
                 norm_type="batch",
                 **kwargs):
        super(StridedConv, self).__init__(name="StridedConv")

        self.model = tf.keras.models.Sequential()
        self.model.add(get_padding(pad_type, (1, 1)))
        self.model.add(Conv2D(filters, 3, strides=(2, 2)))
        self.model.add(LeakyReLU(lrelu_alpha))
        self.model.add(get_padding(pad_type, (1, 1)))
        self.model.add(Conv2D(filters * 2, 3))
        self.model.add(get_norm(norm_type))
        self.model.add(LeakyReLU(lrelu_alpha))

    def build(self, input_shape):
        super(StridedConv, self).build(input_shape)

    def call(self, x, training=False):
        return self.model(x, training=training)


text:
for account in `cat /opt/zimbra/backup/users.list` ;
do
    echo "Processing ${account} …"
    /opt/zimbra/bin/zmmailbox -z -m $account postRestURL "/?fmt=tgz&resolve=modify" /opt/zimbra/backup/$account.tgz
done