text:
package cn.felord.wepay.ali.sdk.api.domain;

import cn.felord.wepay.ali.sdk.api.AlipayObject;
import cn.felord.wepay.ali.sdk.api.internal.mapping.ApiField;

/**
 * 云验收单品列表查询
 *
 * @author auto create
 * @version $Id: $Id
 */
public class KoubeiQualityTestCloudacptBatchQueryModel extends AlipayObject {

	private static final long serialVersionUID = 3134737217466818652L;

	/**
	 * 活动id
	 */
	@ApiField("activity_id")
	private String activityId;

	/**
	 * partener id
	 */
	@ApiField("pid")
	private String pid;

	/**
	 * user id
	 */
	@ApiField("uid")
	private String uid;

	/**
	 *
Getter for the field activityId.

	 *
	 * @return a {@link java.lang.String} object.
	 */
	public String getActivityId() {
		return this.activityId;
	}
	/**
	 *
Setter for the field activityId.

	 *
	 * @param activityId a {@link java.lang.String} object.
	 */
	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}

	/**
	 *
Getter for the field pid.

	 *
	 * @return a {@link java.lang.String} object.
	 */
	public String getPid() {
		return this.pid;
	}
	/**
	 *
Setter for the field pid.

	 *
	 * @param pid a {@link java.lang.String} object.
	 */
	public void setPid(String pid) {
		this.pid = pid;
	}

	/**
	 *
Getter for the field uid.

	 *
	 * @return a {@link java.lang.String} object.
	 */
	public String getUid() {
		return this.uid;
	}
	/**
	 *
Setter for the field uid.

	 *
	 * @param uid a {@link java.lang.String} object.
	 */
	public void setUid(String uid) {
		this.uid = uid;
	}

}


text:
package it.angelic.soulissclient.drawer;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import it.angelic.soulissclient.R;
import it.angelic.soulissclient.util.FontAwesomeUtil;

public class NavDrawerAdapter extends ArrayAdapter<INavDrawerItem> {

    private final int activeSection;
    private final Activity context;
    private LayoutInflater inflater;

    public NavDrawerAdapter(Activity context, int textViewResourceId, INavDrawerItem[] objects, int mode) {

        super(context, textViewResourceId, objects);
        this.inflater = LayoutInflater.from(context);
        this.activeSection = mode;
        this.context = context;
    }

    public View getItemView(ViewGroup parentView, INavDrawerItem navDrawerItem) {

        NavMenuItem menuItem = (NavMenuItem) navDrawerItem;
        NavMenuItemHolder navMenuItemHolder = null;

        // if (convertView == null) {
        View convertView;
        if (menuItem.getId() < 0)
            convertView = inflater.inflate(R.layout.drawer_list_item, parentView, false);
        else
            convertView = inflater.inflate(R.layout.drawer_list_item_son, parentView, false);

        TextView labelView = convertView
                .findViewById(R.id.dtitle);
        TextView iconView = convertView
                .findViewById(R.id.dicon);

        navMenuItemHolder = new NavMenuItemHolder();
        navMenuItemHolder.labelView = labelView;
        navMenuItemHolder.iconView = iconView;
        if (menuItem.getId() == activeSection)
            convertView.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.grey_alpha));

        convertView.setTag(navMenuItemHolder);

        navMenuItemHolder.labelView.setText(menuItem.getLabel());
        FontAwesomeUtil.prepareMenuFontAweTextView(context, navMenuItemHolder.iconView, menuItem.getIcon());

        return convertView;
    }

    @Override
    public int getItemViewType(int position) {
        return this.getItem(position).getType();
    }

    public View getSectionView(View convertView, ViewGroup parentView,
                               INavDrawerItem navDrawerItem) {

        NavMenuSection menuSection = (NavMenuSection) navDrawerItem;
        NavMenuSectionHolder navMenuItemHolder = null;

        if (convertView == null) {
            convertView = inflater.inflate(R.layout.drawer_section, parentView, false);
            TextView labelView = convertView
                    .findViewById(R.id.navmenusection_label);

            navMenuItemHolder = new NavMenuSectionHolder();
            navMenuItemHolder.labelView = labelView;
            convertView.setTag(navMenuItemHolder);
        }

        if (navMenuItemHolder == null) {
            navMenuItemHolder = (NavMenuSectionHolder) convertView.getTag();
        }

        navMenuItemHolder.labelView.setText(menuSection.getLabel());

        return convertView;
    }

    @Override
    public
    @NonNull
    View getView(int position, View convertView, @NonNull ViewGroup parent) {
        View view = null;
        INavDrawerItem menuItem = this.getItem(position);
        if (menuItem.getType() == NavMenuItem.ITEM_TYPE) {
            view = getItemView(parent, menuItem);
        } else {
            view = getSectionView(convertView, parent, menuItem);
        }
        return view;
    }

    @Override
    public int getViewTypeCount() {
        return 2;
    }

    @Override
    public boolean isEnabled(int position) {
        return getItem(position).isEnabled();
    }

    private static class NavMenuItemHolder {
        private TextView iconView;
        private TextView labelView;
    }

    private static class NavMenuSectionHolder {
        private TextView labelView;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

defined('_JEXEC') or die;

$class = ' first';
JHtml::_('bootstrap.tooltip');
$lang	= JFactory::getLanguage();

if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) :
?>
	<?php foreach($this->items[$this->parent->id] as $id => $item) : ?>
		<?php
		if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) :
		if (!isset($this->items[$this->parent->id][$id + 1]))
		{
			$class = ' last';
		}
		?>
		<div class="category-item<?php echo $class; ?>">
		<?php $class = ''; ?>

				<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id));?>">
				<?php echo $this->escape($item->title); ?>
				<?php if ($this->params->get('show_cat_num_articles_cat') == 1) :?>
					<span class="badge badge-info tip hasTooltip" title="<?php echo T3J::tooltipText('COM_CONTENT_NUM_ITEMS'); ?>">
						<?php echo $item->numitems; ?>

				<?php endif; ?>
				<?php if (count($item->getChildren()) > 0) : ?>
					<a href="#category-<?php echo $item->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right">

				<?php endif;?>

			<?php if ($this->params->get('show_description_image') && $item->getParams()->get('image')) : ?>
				<img src="<?php echo $item->getParams()->get('image'); ?>"/>
			<?php endif; ?>
			<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
				<?php if ($item->description) : ?>

						<?php echo JHtml::_('content.prepare', $item->description, '', 'com_content.categories'); ?>

				<?php endif; ?>
			<?php endif; ?>

			<?php if (count($item->getChildren()) > 0) :?>
				<div class="collapse fade" id="category-<?php echo $item->id;?>">
				<?php
				$this->items[$item->id] = $item->getChildren();
				$this->parent = $item;
				$this->maxLevelcat--;
				echo $this->loadTemplate('items');
				$this->parent = $item->getParent();
				$this->maxLevelcat++;
				?>

			<?php endif; ?>

		<?php endif; ?>
	<?php endforeach; ?>
<?php endif; ?>


text:
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ui;

import com.intellij.openapi.util.ModificationTracker;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;

public interface UpdatableIcon extends Icon, ModificationTracker {
  /** Notify about painting was done on the c component*/
  void notifyPaint(@NotNull Component c, int x, int y);
}


text:
#import "VCInstructionBranchOnEqualDelegate.h"

#import "VCInstruction.h"
#import "VCMemory.h"
#import "VCRegisters.h"

@implementation VCInstructionBranchOnEqualDelegate

-(int8_t)instructionOperationCode {
	return 28;
}

-(NSString*)instructionTextualCode {
	return @"BEQ";
}

-(void)runWithInstruction:(VCInstruction*)instruction {

	VCRegisters *registers = instruction.registerTable;
	VCMemory *memory = instruction.memoryTable;

	int fieldZero = instruction.fieldZero;
	int fieldOne = instruction.fieldOne;

	// Remember we go and grab the next memory address as we take up two blocks for this instruction
	int fieldTwo = [memory valueOfMemoryAddress:(registers.programCounter + 1) % [memory lengthOfAddressSpace]];

	int valueZero = [registers valueOfRegister:fieldZero];
	int valueOne = [registers valueOfRegister:fieldOne];

	if (valueZero == valueOne) {
		// Branch to the place we need to
		registers.programCounter = fieldTwo;
	} else {
		// Advance the program counter to take us past our 2nd block of memory
		[registers advanceProgramCounter];
		[registers advanceProgramCounter];
	}
}

@end


text:
package com.GuoGuo.JuicyChat.server.network.http;

import org.apache.http.conn.ssl.SSLSocketFactory;

import java.io.IOException;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

/**
 * This file is introduced to fix HTTPS Post bug on API < ICS see
 * http://code.google.com/p/android/issues/detail?id=13117#c14
 */
public class MySSLSocketFactory extends SSLSocketFactory {
	SSLContext sslContext = SSLContext.getInstance("TLS");

	public MySSLSocketFactory(KeyStore truststore)
			throws NoSuchAlgorithmException, KeyManagementException,
			KeyStoreException, UnrecoverableKeyException {
		super(truststore);

		TrustManager tm = new X509TrustManager() {
			public java.security.cert.X509Certificate[] getAcceptedIssuers() {
				return null;
			}

			@Override
			public void checkClientTrusted(
					java.security.cert.X509Certificate[] chain, String authType)
					throws java.security.cert.CertificateException {
			}

			@Override
			public void checkServerTrusted(
					java.security.cert.X509Certificate[] chain, String authType)
					throws java.security.cert.CertificateException {
			}
		};
		sslContext.init(null, new TrustManager[]{tm}, null);
	}

	@Override
	public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException {
		return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
	}

	@Override
	public Socket createSocket() throws IOException {
		return sslContext.getSocketFactory().createSocket();
	}

	public static KeyStore getKeystore() {
		KeyStore trustStore = null;
		try {
			trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
			trustStore.load(null, null);
		} catch (Throwable t) {
			t.printStackTrace();
		}
		return trustStore;
	}

	public static SSLSocketFactory getFixedSocketFactory() {
		SSLSocketFactory socketFactory;
		try {
			socketFactory = new MySSLSocketFactory(getKeystore());
			socketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
		} catch (Throwable t) {
			t.printStackTrace();
			socketFactory = SSLSocketFactory.getSocketFactory();
		}
		return socketFactory;
	}

}


text:
The files in this folder are organized as follows:

    General
        clean.sh : remove some useless files.
        compile_and_run_mkldnn.sh : compile MKL-DNN code and run it.
        configure.h: define some configuration constants.

    Tiramisu Wrapper
        end_to_end_vgg19_tiramisu_wrapper.cpp: wrapper file that calls the blocks generated by Tiramisu.
        tiramisu_creation_macros.h : block creation macros for Tiramisu parts.

    Intel MKL-DNN
        end_to_end_vgg19_wrapper.cpp : code that calls Intel MKL-DNN VGG block.
        mkldnn_creation_macros.h : creation macros for MKL-DNN parts.

To run this benchmark:
    I. GENERATE THE TIRAMISU BLOCKS USING
        If you want to autotune the blocks (takes a huge a mount of time 2h30 to 3hours) :
            ./generate_and_tune_tiramisu_blocks.sh
        If you want to run using the recommended optimization parameters values :
            ./generate_tiramisu_blocks.sh

    II. GENERATE THE EXECUTABLE :
        At the directory build/benchmarks/DNN/end_to_end_architectures/End_To_End_VGG19/ execute
	         make

    wrapper_end_to_end_vgg19_tiramisu executable will be created in the current directory.

    III. EXECUTE THE GENERATED EXECUTABLE
        To compare the result of tiramisu with MKL-DNN execute :
            ./compile_and_run_mkldnn.sh
        then
            ./wrapper_end_to_end_vgg19_tiramisu

        Execution results can be found in the text files :
            mkl_result.txt (Intel MKL-DNN)
            tiramisu_result.txt (Tiramisu)

You can adjust the number of executions in the configure.h file (to get a more precise median executions time)


text:
namespace Dapr.WebStreams.Server
{
    using System;

    /// <summary>
    /// Defines a route to a method.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class RouteAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RouteAttribute"/> class.
        /// </summary>
        /// <param name="route">
        /// The route.
        /// </param>
        public RouteAttribute(string route)
        {
            this.Route = route;
        }

        /// <summary>
        /// Gets or sets the route.
        /// </summary>
        public string Route { get; set; }
    }
}


text:
package jj.server;

import static jj.application.AppLocation.AppBase;
import static org.junit.Assert.*;

import java.nio.file.Path;
import java.nio.file.Paths;

import jj.resource.MockAbstractResourceDependencies;
import jj.server.ModuleResource;

import org.junit.Ignore;
import org.junit.Test;

public class ModuleResourceTest {

	MockAbstractResourceDependencies dependencies;

	@Ignore
	@Test
	public void test() throws Exception {

		Path path = Paths.get("");

		new ModuleResource(dependencies = new MockAbstractResourceDependencies(ModuleResource.class, AppBase, "name"), path);
	}

}


text:
http://tsunami-udp.sourceforge.net/ go version

this code is only translate from c, with a little refactor. all copyright is belong to origin author.


text:
package pEight;

public interface Treeable<T extends Comparable<? super T>> {
	public Comparable<T> getValue();
	public Treeable<T> getLeft();
	public Treeable<T> getRight();
	public void setValue(Comparable<T> value);
	public void setLeft(Treeable<T> left);
	public void setRight(Treeable<T> right);
}


text:
package common.base.utils;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.WorkerThread;

import java.util.concurrent.ExecutorService;

import common.base.WeakHandler;
import common.base.interfaces.IDoTaskCallback;

/**
 * ******************(^_^)***********************

 * User: fee(QQ/WeiXin:1176610771)

 * Date: 2018/11/30

 * Time: 19:38

 *
DESC:
 * 抽象的可持续执行任务(工作线程中执行)的任务Handler
 * 注:适合使用线程池来运行此类
 *

 * ******************(^_^)***********************
 */
public class AbsTaskHandlerRunner implements WeakHandler.Handleable,Runnable{
    protected final String TAG = getClass().getSimpleName();

    protected static final int MSG_WHAT_DO_TASK = 0x11;
    /**
     * 任务的优先级
     */
    protected int taskPriority;

    /**
     * 是否需要初始化工作在主线程上的Handler
     */
    protected boolean needMainThreadHandler;

    protected Looper mLooper;
    private volatile int mTid = -1;
    protected WeakHandler taskDispatchHandler;

    protected WeakHandler mHandler4MainThread;
    protected String theTaskName = "";

    private volatile boolean isQuit;

    protected IDoTaskCallback doTaskCallback;

    public I withTaskCallback(IDoTaskCallback taskCallback) {
        this.doTaskCallback = taskCallback;
        return self();
    }

    public I withTaskPriority(int taskPriority) {
        this.taskPriority = taskPriority;
        return self();
    }
    public I withNeedMainThreadHandler(boolean need) {
        this.needMainThreadHandler = need;
        return self();
    }
    public I prepare(@NonNull String taskName) {
        if (null == taskName || "".equals(taskName.trim())) {
            taskName = TAG;
        }
        theTaskName = taskName;
        if (needMainThreadHandler) {
            mHandler4MainThread = new WeakHandler<>(this, Looper.getMainLooper());
        }
        return self();
    }

    public I prepare() {
        return prepare(TAG);
    }

    public void start(ExecutorService executorService) {
        if (mLooper != null) {
            return;
        }
        if (executorService != null) {
            executorService.execute(this);
        }
    }
    /**
     * Call back method that can be explicitly overridden if needed to execute some
     * setup before Looper loops.
     */
    @WorkerThread
    protected void onLooperPrepared() {
    }

    @Override
    public final void run() {
        if (isQuit) {
            return;
        }
        Thread.currentThread().setName(theTaskName);
        mTid = Process.myTid();
        Looper.prepare();
        if (isQuit) {
            return;
        }
        synchronized (this) {
            mLooper = Looper.myLooper();
            notifyAll();
        }
        Process.setThreadPriority(taskPriority);
        taskDispatchHandler = new WeakHandler<>(this, mLooper);
        onLooperPrepared();
        Looper.loop();
        mTid = -1;
    }
//    /**
//     * This method returns the Looper associated with this thread. If this thread not been started
//     * or for any reason isAlive() returns false, this method will return null. If this thread
//     * has been started, this method will block until the looper has been initialized.
//     * @return The looper.
//     */
//    public Looper getLooper() {
//        if (!isAlive()) {
//            return null;
//        }
//
//        // If the thread has been started, wait until the looper has been created.
//        synchronized (this) {
//            while (isAlive() && mLooper == null) {
//                try {
//                    wait();
//                } catch (InterruptedException e) {
//                }
//            }
//        }
//        return mLooper;
//    }
    /**
     * 处理消息
     *
     * @param msg
     * @return 被处理了的MessageId
     */
    @Override
    public final int handleMessage(Message msg) {
        if (msg != null) {
            Handler handlerInMsg = msg.getTarget();
            if (handlerInMsg== taskDispatchHandler) {
                handleTask(msg);
                if (isQuit) {
                    if (mLooper != null) {
                        mLooper.quit();
                    }
                }
            }
            else if (handlerInMsg == mHandler4MainThread) {
                handleMsgOnMainThread(msg);
            }
        }
        return 0;
    }

    /**
     * 在这里来处理任务
     * 注:在工作线程中
     * @param msg 任务消息
     * @return true:处理完了
     */
    @WorkerThread
    protected boolean handleTask(Message msg){
        if (msg != null) {
            onDoTask(msg.what, msg.obj);
        }
        return false;
    }

    /**
     * 主线程处理消息
     * @param msg 消息(可能为在工作任务中执行结束的任务结果)
     * @return true:处理了
     */
    @MainThread
    protected boolean handleMsgOnMainThread(Message msg){
        if (msg != null) {
            onTaskResult(msg.what,msg.obj);
        }
        return false;
    }

    public boolean doTask(int whatTask, Object taskObj) {
        return doTask(whatTask, taskObj, false);
    }

    public boolean doTask(int whatTask, Object taskObj, boolean needRemoveLast) {
        boolean sendSuc = false;
        WeakHandler theHandler = taskDispatchHandler;
        if (theHandler != null) {
            if (needRemoveLast) {
                theHandler.removeMessages(whatTask);
            }
            boolean canSend = mTid != -1;//防止线程已经退出了,报sending message to a Handler on a dead thread
            if (canSend) {
                Message taskMessage = Message.obtain(theHandler, whatTask);
                taskMessage.obj = taskObj;
                sendSuc = theHandler.sendMessage(taskMessage);
            }
        }
        else{//task Handler还没初始化好
            sendSuc = doTaskUseOtherHandler(whatTask, taskObj, false, 2000);
        }
        return sendSuc;
    }

    public boolean doTask(Object taskOjb) {
        return doTask(MSG_WHAT_DO_TASK, taskOjb);
    }

    public boolean doTaskUseOtherHandler(int whatTask, Object taskObj, boolean needRemoveLastOne, long delaySendTimeMills) {
        WeakHandler theHandler = mHandler4MainThread;
        boolean sendSuc = false;
        if (theHandler != null) {
            if (needRemoveLastOne) {
                theHandler.removeMessages(whatTask);
            }
            Message msg = Message.obtain(theHandler, whatTask);
            msg.obj = taskObj;
            sendSuc = theHandler.sendMessageDelayed(msg, delaySendTimeMills);
        }
        return sendSuc;
    }
    protected I self() {
        return (I) this;
    }
    public void workOver() {
        isQuit = true;
        doTaskCallback = null;
        if (taskDispatchHandler != null) {
            taskDispatchHandler.release();
        }
        taskDispatchHandler = null;
        if (mLooper != null) {
            mLooper.quit();//则线程在run()方法中会执行完成
        }
        mLooper = null;
        if (mHandler4MainThread != null) {
            mHandler4MainThread.release();
        }
        mHandler4MainThread = null;
    }

    protected boolean onDoTask(int whatTask, Object taskObj) {
        if (doTaskCallback != null) {
            return doTaskCallback.onDoTask(whatTask, taskObj);
        }
        return false;
    }

    protected void onTaskResult(int whatTask, Object taskResult) {
        if (doTaskCallback != null) {
            doTaskCallback.onDoTaskResult(whatTask, taskResult);
        }
    }
    /**
     * Returns the identifier of this thread. See Process.myTid().
     */
    public int getThreadId() {
        return mTid;
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GenerateJWT async="false" continueOnError="false" enabled="true" name="Generate-JWT-1">
    <Algorithm>RS256</Algorithm>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    <PrivateKey>
        <Value ref="private.gkey"/>
    </PrivateKey>
    <Subject>GCP_SVC_EMAIL</Subject>
    <Issuer>GCP_SVC_EMAIL</Issuer>
    <Audience>https://www.googleapis.com/oauth2/v4/token</Audience>
    <ExpiresIn>60m</ExpiresIn>
    <Id/>
    <AdditionalClaims>
        <Claim name="scope">https://www.googleapis.com/auth/datastore</Claim>
    </AdditionalClaims>
    <OutputVariable>google-jwt</OutputVariable>
</GenerateJWT>


text:
<?php

namespace Anper\Tinkoff\Test;

use PHPUnit\Framework\TestCase;
use Anper\Tinkoff\Exception;
use Anper\Tinkoff\Paygate;

class PaygateTest extends TestCase
{
    protected $input = [
        'TerminalKey' => '123',
        'Status' => 'AUTORIZED',
        'OrderId' => 1,
        'Token' => '7410cf9c57ac6803e811656ea63b919c949b8c0da10d3fb7081aaeaaeb910b3f',
    ];

    protected $terminals = [
        '123' => '456'
    ];

    public function testValidTerminal()
    {
        $gate = new Paygate($this->terminals, $this->input);

        $key = $gate->getTerminalKey();

        $this->assertSame($key, '123');
    }

    public function testInvalidTerminal()
    {
        $gate = new Paygate([], $this->input);

        $this->expectException(Exception\InvalidTerminal::class);

        $gate->getTerminalKey();
    }

    public function testValidInput()
    {
        $gate = new Paygate([], $this->input);

        $key = $gate->getInput('Status');

        $this->assertSame($key, 'AUTORIZED');
    }

    public function testInvalidInput()
    {
        $gate = new Paygate([], $this->input);

        $this->expectException(Exception\InvalidRequest::class);

        $gate->getInput('test');
    }

    public function testValidToken()
    {
        $gate = new Paygate($this->terminals, $this->input);

        $this->assertSame(true, $gate->validate());
    }

    public function testInvalidToken()
    {
        $input = $this->input;

        $input['Token'] = 'abc';

        $gate = new Paygate($this->terminals, $input);

        $this->expectException(Exception\InvalidToken::class);

        $gate->validate();
    }

    public function testValidStatusHandler()
    {
        $gate = new Paygate($this->terminals, $this->input);

        $gate->onAutorized(function() {
            return true;
        });

        $this->assertSame(true, $gate->handle());
    }

    public function testInvalidStatusHandler()
    {
        $gate = new Paygate($this->terminals, $this->input);

        $this->expectException(\Exception::class);

        $gate->onAutorized(function() {
            throw new \Exception("Exception");
        });

        $this->assertSame(true, $gate->handle());
    }

    public function testValidValidate()
    {
        $gate = new Paygate($this->terminals, $this->input);

        $gate->addValidate(function($input) {
            return true;
        });

        $this->assertSame(true, $gate->validate());
    }

    public function testInvalidValidate()
    {
        $gate = new Paygate($this->terminals, $this->input);

        $this->expectException(\Exception::class);

        $gate->addValidate(function() {
            throw new \Exception("Exception");
        });

        $this->assertSame(true, $gate->validate());
    }
}


text:
//
//  Copyright 2014 Gustavo J Knuppe (https://github.com/knuppe)
//
//   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.
//
//   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//   - May you do good and not evil.                                         -
//   - May you find forgiveness for yourself and forgive others.             -
//   - May you share freely, never taking more than you give.                -
//   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//

using System.IO;
#if ZIPLIB
using ICSharpCode.SharpZipLib.GZip;
#else
using System.IO.Compression;
#endif
using SharpNL.ML.Model;

namespace SharpNL.ML.Perceptron.IO {
    /// <summary>
    /// A writer for perceptron models which inspects the filename and invokes the
    /// appropriate <see cref="PerceptronModelWriter"/> depending on the filename's suffixes.
    /// </summary>
    /// <remarks>
    ///<para>
    /// The following assumption are made about suffixes:
    ///
    ///  .gz  - file is GZipped (must be last suffix)
    ///  .bin - file is binary
    ///  .txt - file is plain text (default)
    ///
    /// </para>
    /// </remarks>
    public class SuffixSensitivePerceptronModelWriter : PerceptronModelWriter {
        private readonly AbstractModelWriter suffixAppropriateWriter;

        public SuffixSensitivePerceptronModelWriter(AbstractModel model, string fileName) : base(model) {
            string file;
            Stream output;
            if (fileName.EndsWith(".gz")) {
                #if ZIPLIB
                    output = new GZipOutputStream(new FileStream(fileName, FileMode.Create));
                #else
                    output = new GZipStream(new FileStream(fileName, FileMode.Create), CompressionMode.Compress);
                #endif
                file = fileName.Substring(0, fileName.Length - 3);
            } else {
                file = fileName;
                output = new FileStream(fileName, FileMode.Create);
            }

            if (file.EndsWith(".bin")) {
                suffixAppropriateWriter = new BinaryPerceptronModelWriter(model, output);
            } else {
                // default is ".txt"
                suffixAppropriateWriter = new PlainTextPerceptronModelWriter(model, output);
            }
        }

        public override void Close() {
            suffixAppropriateWriter.Close();
        }

        public override void Write(int value) {
            suffixAppropriateWriter.Write(value);
        }

        public override void Write(string value) {
            suffixAppropriateWriter.Write(value);
        }

        public override void Write(double value) {
            suffixAppropriateWriter.Write(value);
        }
    }
}


text:
<?php
	/**
	 *
	 * @author    Annemarie Tannengrund <annemarie.tannengrund@gmail.com>
	 * @license   Beerlicense
	 * Messages block wich creates the final output for all messages
	 */
	class Annemarietannengrund_Noty_Block_Messages extends Mage_Core_Block_Messages
	{

		public function __construct()
		{
			parent::__construct();
		}

		/**
		 * Retrieve messages in HTML format grouped by type
		 *
		 * @param   string $type
		 * @return  string
		 */
		public function getGroupedHtml()
		{
			if(!Mage::getStoreConfig('noty/general/enabled') || Mage::app()->getStore()->isAdmin()){
				return parent::getGroupedHtml();
			}

			$types = array(
				Mage_Core_Model_Message::ERROR,
				Mage_Core_Model_Message::WARNING,
				Mage_Core_Model_Message::NOTICE,
				Mage_Core_Model_Message::SUCCESS
			);
			$html = '';
			foreach ($types as $type) {
				if ( $messages = $this->getMessages($type) ) {
					foreach ( $messages as $message ) {
						$html .= "generate('". $type . "', '" . $message->getText() . "');";
					}
				}
			}
			return '<script type="text/javascript">// <![CDATA[' . "\n" . $html . "\n" . '// ]]></script>';
		}
	}


text:
package com.alibaba.json.bvt.parser;

import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class UTF8ByteArrayParseTest extends TestCase {

    public void test_utf8() throws Exception {
        byte[] bytes = "{'name':'xxx', age:3, birthday:\"2009-09-05\"}".getBytes("UTF-8");

        JSON.parseObject(bytes, JSONObject.class);
    }
}


text:
namespace Microsoft.Azure.Management.CustomerInsights.Models
{
    using Azure;
    using Management;
    using CustomerInsights;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// The definition of suggested relationship for the type.
    /// </summary>
    public partial class RelationshipsLookup
    {
        /// <summary>
        /// Initializes a new instance of the RelationshipsLookup class.
        /// </summary>
        public RelationshipsLookup() { }

        /// <summary>
        /// Initializes a new instance of the RelationshipsLookup class.
        /// </summary>
        /// <param name="profileName">The relationship profile.</param>
        /// <param name="profilePropertyReferences">The property references for
        /// the profile type.</param>
        /// <param name="relatedProfileName">The related profile.</param>
        /// <param name="relatedProfilePropertyReferences">The property
        /// references for the related profile type.</param>
        /// <param name="existingRelationshipName">The name of existing
        /// Relationship.</param>
        public RelationshipsLookup(string profileName = default(string), IList<ParticipantPropertyReference> profilePropertyReferences = default(IList<ParticipantPropertyReference>), string relatedProfileName = default(string), IList<ParticipantPropertyReference> relatedProfilePropertyReferences = default(IList<ParticipantPropertyReference>), string existingRelationshipName = default(string))
        {
            ProfileName = profileName;
            ProfilePropertyReferences = profilePropertyReferences;
            RelatedProfileName = relatedProfileName;
            RelatedProfilePropertyReferences = relatedProfilePropertyReferences;
            ExistingRelationshipName = existingRelationshipName;
        }

        /// <summary>
        /// Gets the relationship profile.
        /// </summary>
        [JsonProperty(PropertyName = "profileName")]
        public string ProfileName { get; protected set; }

        /// <summary>
        /// Gets the property references for the profile type.
        /// </summary>
        [JsonProperty(PropertyName = "profilePropertyReferences")]
        public IList<ParticipantPropertyReference> ProfilePropertyReferences { get; protected set; }

        /// <summary>
        /// Gets the related profile.
        /// </summary>
        [JsonProperty(PropertyName = "relatedProfileName")]
        public string RelatedProfileName { get; protected set; }

        /// <summary>
        /// Gets the property references for the related profile type.
        /// </summary>
        [JsonProperty(PropertyName = "relatedProfilePropertyReferences")]
        public IList<ParticipantPropertyReference> RelatedProfilePropertyReferences { get; protected set; }

        /// <summary>
        /// Gets the name of existing Relationship.
        /// </summary>
        [JsonProperty(PropertyName = "existingRelationshipName")]
        public string ExistingRelationshipName { get; protected set; }

    }
}


text:
RoboClone |buildstatus| |pypiversion|
=========================================================================================================================================
A neat little script for cloning git repositories containing FRC robot projects
and configuring them for use with Eclipse.

Install Instructions
--------------------
Open a terminal and run::

   pip install roboclone

If you want the very latest version pushed to git then run::

   pip install git+https://github.com/simon-andrews/roboclone.git

Usage
-----
Now that you have RoboClone installed, it's time to use it! Open a terminal and type `roboclone`. Something like this
should show up::

   $ roboclone
   usage: roboclone [-h] [--gitargs args] [--force [FORCE]]
                    remote_url destination
   roboclone: error: the following arguments are required: remote_url, destination

Add the `-h` switch to show a help message::

   $ roboclone -h
   usage: roboclone [-h] [--gitargs args] [--force [FORCE]]
                    remote_url destination

   positional arguments:
     remote_url       url of the remote git repository (https or ssh)
     destination      directory to clone repository to

   optional arguments:
     -h, --help       show this help message and exit
     --gitargs args   extra arguments for git
     --force [FORCE]  write metadata files even if they already exist in the repo

Clone a repository::

   $ roboclone https://github.com/Team4761/2015-Robot-Code.git 2015-Robot-Code
   100%

.. |buildstatus| image:: https://img.shields.io/travis/simon-andrews/roboclone.svg
    :target: https://travis-ci.org/simon-andrews/roboclone

.. |pypiversion| image:: https://img.shields.io/pypi/v/roboclone.svg
    :target: https://pypi.python.org/pypi/roboclone/


text:
package org.pentaho.big.data.impl.cluster;

import org.apache.commons.io.FileUtils;
import org.apache.commons.vfs2.VFS;
import org.apache.commons.vfs2.impl.StandardFileSystemManager;
import org.apache.commons.vfs2.provider.UriParser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import org.pentaho.di.core.encryption.Encr;
import org.pentaho.di.core.encryption.TwoWayPasswordEncoderPluginType;
import org.pentaho.di.core.exception.KettleValueException;
import org.pentaho.di.core.osgi.api.NamedClusterSiteFile;
import org.pentaho.di.core.osgi.impl.NamedClusterSiteFileImpl;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.hadoop.shim.api.cluster.NamedCluster;
import org.pentaho.metastore.api.IMetaStore;
import org.pentaho.metastore.api.security.Base64TwoWayPasswordEncoder;
import org.pentaho.metastore.api.security.ITwoWayPasswordEncoder;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.util.Map;

import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanEqualsFor;
import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.AdditionalMatchers.or;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.validateMockitoUsage;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
 * Created by bryan on 7/14/15.
 */
@RunWith( MockitoJUnitRunner.class )
public class NamedClusterImplTest {
  private static final String HDFS_PREFIX = "hdfs";

  private VariableSpace variableSpace;
  private NamedClusterImpl namedCluster;

  private String namedClusterName;
  private String namedClusterHdfsHost;
  private String namedClusterHdfsPort;
  private String namedClusterHdfsUsername;
  private String namedClusterHdfsPassword;
  private String namedClusterJobTrackerPort;
  private String namedClusterJobTrackerHost;
  private String namedClusterZookeeperHost;
  private String namedClusterZookeeperPort;
  private String namedClusterOozieUrl;
  private String namedClusterStorageScheme;
  private String namedClusterKafkaBootstrapServers;
  private boolean isMapr;
  private IMetaStore metaStore;
  private StandardFileSystemManager fsm;
  private String fileContents1;
  private String fileContents2;
  private MockedStatic<VFS> vfsMockedStatic;
  private MockedStatic<UriParser> uriParserMockedStatic;

  @Before
  public void setup() throws Exception {
    PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() );
    PluginRegistry.init( false );
    Encr.init( "Kettle" );
    vfsMockedStatic = Mockito.mockStatic( VFS.class );
    uriParserMockedStatic = Mockito.mockStatic( UriParser.class );
    uriParserMockedStatic.when( () -> UriParser.encode( anyString(), any( char[].class ) ) ).thenCallRealMethod();
    uriParserMockedStatic.when( () -> UriParser.decode( anyString() ) ).thenCallRealMethod();
    uriParserMockedStatic.when( () -> UriParser.appendEncoded( any( StringBuilder.class ), anyString(), any( char[].class ) ) ).thenCallRealMethod();

    metaStore = mock( IMetaStore.class );
    variableSpace = mock( VariableSpace.class );
    namedCluster = new NamedClusterImpl();
    namedCluster.shareVariablesWith( variableSpace );
    namedClusterName = "namedClusterName";
    namedClusterHdfsHost = "namedClusterHdfsHost";
    namedClusterHdfsPort = "12345";
    namedClusterHdfsUsername = "namedClusterHdfsUsername";
    namedClusterHdfsPassword = "namedClusterHdfsPassword";
    namedClusterJobTrackerHost = "namedClusterJobTrackerHost";
    namedClusterJobTrackerPort = "namedClusterJobTrackerPort";
    namedClusterZookeeperHost = "namedClusterZookeeperHost";
    namedClusterZookeeperPort = "namedClusterZookeeperPort";
    namedClusterOozieUrl = "namedClusterOozieUrl";
    namedClusterStorageScheme = "hdfs";
    namedClusterKafkaBootstrapServers = "kafkaBootstrapServers";
    isMapr = true;
    fileContents1 =
      FileUtils.readFileToString( new File( getClass().getResource( "/core-site.xml" ).getFile() ), "UTF-8" );
    fileContents2 = "some printable contents";

    namedCluster.setName( namedClusterName );
    namedCluster.setHdfsHost( namedClusterHdfsHost );
    namedCluster.setHdfsPort( namedClusterHdfsPort );
    namedCluster.setHdfsUsername( namedClusterHdfsUsername );
    namedCluster.setHdfsPassword( namedCluster.encodePassword( namedClusterHdfsPassword ) );
    namedCluster.setJobTrackerHost( namedClusterJobTrackerHost );
    namedCluster.setJobTrackerPort( namedClusterJobTrackerPort );
    namedCluster.setZooKeeperHost( namedClusterZookeeperHost );
    namedCluster.setZooKeeperPort( namedClusterZookeeperPort );
    namedCluster.setOozieUrl( namedClusterOozieUrl );
    namedCluster.setMapr( isMapr );
    namedCluster.setStorageScheme( namedClusterStorageScheme );
    namedCluster.setKafkaBootstrapServers( namedClusterKafkaBootstrapServers );
    namedCluster.addSiteFile( "core-site.xml", fileContents1 );
    namedCluster.addSiteFile( new NamedClusterSiteFileImpl( "hbase-site.xml", 11111L, fileContents2 ) );

    fsm = mock( StandardFileSystemManager.class );
    vfsMockedStatic.when( VFS::getManager ).thenReturn( fsm );
  }

  @After
  public void cleanupMocks() {
    vfsMockedStatic.close();
    uriParserMockedStatic.close();
    validateMockitoUsage();
  }

  @Test
  public void testBean() {
    assertThat( NamedClusterImpl.class, hasValidBeanConstructor() );
    assertThat( NamedClusterImpl.class, hasValidGettersAndSetters() );
    assertThat( NamedClusterImpl.class, hasValidBeanEqualsFor( "name" ) );
  }

  @Test
  public void testClone() {
    long before = System.currentTimeMillis();
    NamedClusterImpl newNamedCluster = namedCluster.clone();
    assertEquals( namedClusterStorageScheme, newNamedCluster.getStorageScheme() );
    assertEquals( namedClusterName, newNamedCluster.getName() );
    assertEquals( namedClusterHdfsHost, newNamedCluster.getHdfsHost() );
    assertEquals( namedClusterHdfsPort, newNamedCluster.getHdfsPort() );
    assertEquals( namedClusterHdfsUsername, newNamedCluster.getHdfsUsername() );
    assertEquals( namedClusterHdfsPassword, newNamedCluster.decodePassword( newNamedCluster.getHdfsPassword() ) );
    assertEquals( namedClusterJobTrackerHost, newNamedCluster.getJobTrackerHost() );
    assertEquals( namedClusterJobTrackerPort, newNamedCluster.getJobTrackerPort() );
    assertEquals( namedClusterZookeeperHost, newNamedCluster.getZooKeeperHost() );
    assertEquals( namedClusterZookeeperPort, newNamedCluster.getZooKeeperPort() );
    assertEquals( namedClusterOozieUrl, newNamedCluster.getOozieUrl() );
    assertEquals( namedClusterKafkaBootstrapServers, newNamedCluster.getKafkaBootstrapServers() );
    assertTrue( before <= newNamedCluster.getLastModifiedDate() );
    assertTrue( newNamedCluster.getLastModifiedDate() <= System.currentTimeMillis() );
  }

  @Test
  public void testCopyVariablesFrom() {
    VariableSpace from = mock( VariableSpace.class );
    namedCluster.copyVariablesFrom( from );
    verify( variableSpace ).copyVariablesFrom( from );
  }

  @Test
  public void testEnvironmentSubstitute() {
    String testVar = "testVar";
    String testVal = "testVal";
    when( variableSpace.environmentSubstitute( testVar ) ).thenReturn( testVal );
    assertEquals( testVal, namedCluster.environmentSubstitute( testVar ) );
  }

  @Test
  public void testArrayEnvironmentSubstitute() {
    String[] testVars = { "testVar" };
    String[] testVals = { "testVal" };
    Mockito.when( variableSpace.environmentSubstitute( testVars ) ).thenReturn( testVals );
    assertArrayEquals( testVals, namedCluster.environmentSubstitute( testVars ) );
  }

  @Test
  public void testFieldSubstitute() throws KettleValueException {
    String testString = "testString";
    RowMetaInterface rowMetaInterface = mock( RowMetaInterface.class );
    Object[] rowData = new Object[] {};
    String testVal = "testVal";
    when( variableSpace.fieldSubstitute( testString, rowMetaInterface, rowData ) ).thenReturn( testVal );
    assertEquals( testVal, namedCluster.fieldSubstitute( testString, rowMetaInterface, rowData ) );
  }

  @Test
  public void testGetVariableDefault() {
    String name = "name";
    String defaultValue = "default";
    String val = "val";
    when( variableSpace.getVariable( name, defaultValue ) ).thenReturn( val );
    assertEquals( val, namedCluster.getVariable( name, defaultValue ) );
  }

  @Test
  public void testGetVariable() {
    String name = "name";
    String val = "val";
    when( variableSpace.getVariable( name ) ).thenReturn( val );
    assertEquals( val, namedCluster.getVariable( name ) );
  }

  @Test
  public void testGetBooleanValueOfVariable() {
    String var = "var";
    String val1 = "Y";
    String val2 = "N";

    assertTrue( namedCluster.getBooleanValueOfVariable( null, true ) );
    assertFalse( namedCluster.getBooleanValueOfVariable( null, false ) );

    when( variableSpace.environmentSubstitute( var ) ).thenReturn( val1 ).thenReturn( val2 ).thenReturn( null );
    assertTrue( namedCluster.getBooleanValueOfVariable( var, false ) );
    assertFalse( namedCluster.getBooleanValueOfVariable( var, true ) );
    assertTrue( namedCluster.getBooleanValueOfVariable( var, true ) );
    assertFalse( namedCluster.getBooleanValueOfVariable( var, false ) );
  }

  @Test
  public void testListVariables() {
    String[] vars = new String[] { "vars" };
    when( variableSpace.listVariables() ).thenReturn( vars );
    assertArrayEquals( vars, namedCluster.listVariables() );
  }

  @Test
  public void testSetVariable() {
    String var = "var";
    String val = "val";
    namedCluster.setVariable( var, val );
    verify( variableSpace ).setVariable( var, val );
  }

  @Test
  @SuppressWarnings( "unchecked" )
  public void testInjectVariables() {
    Map<String, String> prop = mock( Map.class );
    namedCluster.injectVariables( prop );
    verify( variableSpace ).injectVariables( prop );
  }

  @Test
  public void testComparator() {
    NamedClusterImpl other = new NamedClusterImpl();
    other.setName( "a" );
    assertTrue( NamedClusterImpl.comparator.compare( namedCluster, other ) > 0 );
    other.setName( "z" );
    assertTrue( NamedClusterImpl.comparator.compare( namedCluster, other ) < 0 );
    other.setName( namedClusterName );
    assertTrue( NamedClusterImpl.comparator.compare( namedCluster, other ) == 0 );
  }

  @Test
  public void testToString() {
    NamedClusterImpl other = new NamedClusterImpl();
    assertEquals( "Named cluster: null", other.toString() );
    other.setName( "a" );
    assertEquals( "Named cluster: a", other.toString() );
  }

  @Test
  public void testGenerateURLNullParameters() {
    namedCluster.setName( null );
    String scheme = "testScheme";
    buildAppendEncodedUserPassMocks( namedClusterHdfsUsername, namedClusterHdfsPassword );
    assertEquals(
      scheme + "://" + namedClusterHdfsUsername + ":" + namedClusterHdfsPassword + "@" + namedClusterHdfsHost + ":"
        + namedClusterHdfsPort,
      namedCluster.generateURL( "testScheme", metaStore, null ) );
    assertNull( namedCluster.generateURL( null, metaStore, null ) );
    assertEquals(
      scheme + "://" + namedClusterHdfsUsername + ":" + namedClusterHdfsPassword + "@" + namedClusterHdfsHost + ":"
        + namedClusterHdfsPort,
      namedCluster.generateURL( "testScheme", null, null ) );
  }

  @Test
  public void testGenerateURLHDFS() {
    String scheme = "hdfs";
    String testHost = "testHost";
    String testPort = "9333";
    String testUsername = "testUsername";
    String testPassword = "testPassword";
    namedCluster.setHdfsHost( " " + testHost + " " );
    namedCluster.setHdfsPort( " " + testPort + " " );
    namedCluster.setHdfsUsername( " " + testUsername + " " );
    namedCluster.setHdfsPassword( namedCluster.encodePassword( testPassword ) );
    buildAppendEncodedUserPassMocks( testUsername, namedCluster.encodePassword( testPassword ) );
    assertEquals( scheme + "://" + testUsername + ":" + testPassword + "@" + testHost + ":" + testPort,
      namedCluster.generateURL( scheme, metaStore, null ) );
  }

  @Test
  public void testGenerateURLHDFSPort() {
    String scheme = "hdfs";
    String testHost = "testHost";
    String testPort = "9333";
    namedCluster.setHdfsHost( " " + testHost + " " );
    namedCluster.setHdfsPort( " " + testPort + " " );
    namedCluster.setHdfsUsername( null );
    namedCluster.setHdfsPassword( null );
    assertEquals( scheme + "://" + testHost + ":" + testPort,
      namedCluster.generateURL( scheme, metaStore, null ) );
  }

  @Test
  public void testCheckHdfsNameEmpty() {
    String testHost = "";
    namedCluster.setHdfsHost( " " + testHost + " " );
    assertEquals( true, namedCluster.isHdfsHostEmpty( null ) );
  }

  @Test
  public void testGetHdfsNameParsed() {
    String testHost = "test";
    namedCluster.setHdfsHost( " " + testHost + " " );
    assertEquals( "test", namedCluster.getHostNameParsed( null ) );
  }

  @Test
  public void testGetHdfsNameParsedFromVariable() {
    String testHost = "${hdfsHost}";
    namedCluster.setHdfsHost( " " + testHost + " " );
    when( variableSpace.getVariable( "hdfsHost" ) ).thenReturn( "test" );
    assertEquals( "test", namedCluster.getHostNameParsed( variableSpace ) );
  }

  @Test
  public void testGetHdfsNameParsedFromVariableNoVariableInSpace() {
    String testHost = "${hdfsHost}";
    namedCluster.setHdfsHost( " " + testHost + " " );
    assertEquals( null, namedCluster.getHostNameParsed( variableSpace ) );
  }

  @Test
  public void testCheckHdfsNameNotEmpty() {
    String testHost = "test";
    namedCluster.setHdfsHost( " " + testHost + " " );
    assertEquals( false, namedCluster.isHdfsHostEmpty( null ) );
  }

  @Test
  public void testCheckHdfsNameNull() {
    namedCluster.setHdfsHost( null );
    assertEquals( true, namedCluster.isHdfsHostEmpty( null ) );
  }

  @Test
  public void testCheckHdfsNameVariableNull() {
    namedCluster.setHdfsHost( "${hdfsHost}" );
    assertEquals( true, namedCluster.isHdfsHostEmpty( null ) );
  }

  @Test
  public void testCheckHdfsNameVariableNotNull() {
    namedCluster.setHdfsHost( "${hdfsHost}" );
    when( variableSpace.getVariable( "hdfsHost" ) ).thenReturn( "test" );
    assertEquals( false, namedCluster.isHdfsHostEmpty( variableSpace ) );
  }

  @Test
  public void testProcessURLHostEmpty() {
    namedCluster.setHdfsHost( null );
    namedCluster.setStorageScheme( "hdfs" );
    String incomingURL = "${hdfsUrl}/test";
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, null ) );
  }

  @Test
  public void testProcessURLhdfsFullSubstitution() {
    String pathBase = "//namedClusterHdfsUsername:namedClusterHdfsPassword@hostname:12340";
    String filePathInFileSystem = "/tmp/hdsfDemo.txt";
    namedCluster.setHdfsHost( "hostname" );
    namedCluster.setHdfsPort( "12340" );
    namedCluster.setStorageScheme( HDFS_PREFIX );
    String incomingURL = HDFS_PREFIX + ":" + pathBase + filePathInFileSystem;
    buildExtractSchemeMocks( HDFS_PREFIX, incomingURL, pathBase + filePathInFileSystem );
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, null ) );
  }

  @Test
  public void testProcessURLSubstitution_Gateway() {
    namedCluster.setUseGateway( true );
    String incomingURL = "/path";
    String expected = "hc://" + namedCluster.getName() + incomingURL;
    String actual = namedCluster.processURLsubstitution( incomingURL, metaStore, null );
    assertTrue( "Expected " + expected + " actual " + actual, expected.equalsIgnoreCase( actual ) );
  }

  @Test
  public void testProcessURLWASBFullSubstitution() {
    String prefix = "wasb";
    String pathBase = "//namedClusterHdfsUsername:namedClusterHdfsPassword@hostname:12340";
    String filePathInFileSystem = "/tmp/hdsfDemo.txt";
    namedCluster.setHdfsHost( "hostname" );
    namedCluster.setHdfsPort( "12340" );
    namedCluster.setStorageScheme( prefix );
    String incomingURL = prefix + ":" + pathBase + filePathInFileSystem;
    buildAppendEncodedUserPassMocks( namedClusterHdfsUsername, namedClusterHdfsPassword );
    buildExtractSchemeMocks( prefix, incomingURL, pathBase + filePathInFileSystem );
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, null ) );
  }

  @Test
  public void testProcessURLHostVariableNull() {
    namedCluster.setHdfsHost( "${hostUrl}" );
    namedCluster.setStorageScheme( "hdfs" );
    String incomingURL = "${hdfsUrl}/test";
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, null ) );
  }

  @Test
  public void testProcessURLHostVariableNotNull() {
    namedCluster.setHdfsHost( "${hostUrl}" );
    namedCluster.setStorageScheme( HDFS_PREFIX );
    String hostPort = "1000";
    namedCluster.setHdfsPort( hostPort );
    namedCluster.setHdfsUsername( "" );
    namedCluster.setHdfsPassword( "" );
    String incomingURL = "${hdfsUrl}/test";
    String hostName = "test";
    when( variableSpace.getVariable( "hostUrl" ) ).thenReturn( hostName );
    when( variableSpace.environmentSubstitute( namedCluster.getHdfsHost() ) ).thenReturn( hostName );
    when( variableSpace.environmentSubstitute( incomingURL ) ).thenReturn( hostName + "/test" );
    String pathWithoutPrefix = "//" + hostName + ":" + hostPort + "//hdfsUrl//test";
    String pathWithPrefix = HDFS_PREFIX + ":" + pathWithoutPrefix;
    buildExtractSchemeMocks( HDFS_PREFIX, pathWithPrefix, pathWithoutPrefix );
    assertEquals( "hdfs://" + hostName + ":" + hostPort + incomingURL,
      namedCluster.processURLsubstitution( incomingURL, metaStore, variableSpace ) );
  }

  @Test
  public void testProcessCompleteClusterVariableReplacement() {
    String hostname = "hostname";
    String hostPort = "1000";
    String variableName = "hdfsUrl";
    // special case to allow legacy fully qualified urls to work
    namedCluster.setHdfsHost( hostname );
    namedCluster.setStorageScheme( HDFS_PREFIX );
    namedCluster.setHdfsPort( hostPort );
    namedCluster.setHdfsUsername( "" );
    namedCluster.setHdfsPassword( "" );
    String incomingURL = "${" + variableName + "}/test";
    String pathWithoutPrefix = "//" + hostname + ":" + hostPort + "//" + variableName + "//test";
    String pathWithPrefix = HDFS_PREFIX + ":" + pathWithoutPrefix;
    when( variableSpace.environmentSubstitute( incomingURL ) ).thenReturn( "hdfs://FullyQualifiedPath/test" );
    buildExtractSchemeMocks( HDFS_PREFIX, pathWithPrefix, pathWithoutPrefix );
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, variableSpace ) );
  }

  @Test
  public void testProcessURLsubstitutionMaprFS_startsWithMaprfs() {
    String incomingURL = "maprfs";
    namedCluster.setMapr( true );
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, null ) );
  }

  @Test
  public void testProcessURLsubstitutionMaprFS_startsWithNoMaprfs() {
    String incomingURL = "path";
    namedCluster.setMapr( true );
    assertEquals( "maprfs://" + incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, null ) );
  }

  @Test
  public void testProcessURLsubstitutionNC() {
    String prefix = "hc";
    String pathWithoutPrefix = "//cluster/input/file.txt";
    String pathWithPrefix = prefix + ":" + pathWithoutPrefix;
    buildAppendEncodedUserPassMocks( namedClusterHdfsUsername, namedClusterHdfsPassword );
    buildExtractSchemeMocks( prefix, pathWithPrefix, pathWithoutPrefix );
    assertEquals( "hdfs://namedClusterHdfsUsername:namedClusterHdfsPassword@namedClusterHdfsHost:12345/input/file.txt",
      namedCluster.processURLsubstitution( "hc://cluster/input/file.txt", metaStore, null ) );
  }

  @Test
  public void testProcessURLSubstitutionNC_variable() {
    String pathWithoutPrefix = "//" + namedClusterHdfsUsername + ":" + namedClusterHdfsPassword + "@"
      + namedClusterHdfsHost + ":" + namedClusterHdfsPort + "//ncUrl//test";
    String pathWithPrefix = HDFS_PREFIX + ":" + pathWithoutPrefix;
    String incomingURL = "${ncUrl}/test";
    when( variableSpace.environmentSubstitute( incomingURL ) ).thenReturn( "hc://cluster/test" );
    buildAppendEncodedUserPassMocks( namedClusterHdfsUsername, namedClusterHdfsPassword );
    buildExtractSchemeMocks( HDFS_PREFIX, pathWithPrefix, pathWithoutPrefix );
    assertEquals( incomingURL, namedCluster.processURLsubstitution( incomingURL, metaStore, variableSpace ) );
  }

  @Test
  public void testGenerateURLHDFSNoPort() {
    String scheme = "hdfs";
    String testHost = "testHost";
    namedCluster.setHdfsHost( " " + testHost + " " );
    namedCluster.setHdfsPort( null );
    namedCluster.setHdfsUsername( null );
    namedCluster.setHdfsPassword( null );
    assertEquals( scheme + "://" + testHost, namedCluster.generateURL( scheme, metaStore, null ) );
  }

  @Test
  public void testGenerateURLHDFSVariableSpace() {
    String schemeVar = "schemeVar";
    String testScheme = "hdfs";
    String hostVar = "hostVar";
    String testHost = "testHost";
    String portVar = "portVar";
    String testPort = "9333";
    String usernameVar = "usernameVar";
    String testUsername = "testUsername";
    String passwordVar = "passwordVar";
    String testPassword = "testPassword";
    namedCluster.setStorageScheme( "${" + schemeVar + "}" );
    namedCluster.setHdfsHost( "${" + hostVar + "}" );
    namedCluster.setHdfsPort( "${" + portVar + "}" );
    namedCluster.setHdfsUsername( "${" + usernameVar + "}" );
    namedCluster.setHdfsPassword( "${" + passwordVar + "}" );
    when( variableSpace.getVariable( schemeVar ) ).thenReturn( testScheme );
    when( variableSpace.getVariable( hostVar ) ).thenReturn( testHost );
    when( variableSpace.getVariable( portVar ) ).thenReturn( testPort );
    when( variableSpace.getVariable( usernameVar ) ).thenReturn( testUsername );
    when( variableSpace.getVariable( passwordVar ) ).thenReturn( testPassword );
    when( variableSpace.environmentSubstitute( namedCluster.getStorageScheme() ) ).thenReturn( testScheme );
    when( variableSpace.environmentSubstitute( namedCluster.getHdfsHost() ) ).thenReturn( testHost );
    when( variableSpace.environmentSubstitute( namedCluster.getHdfsPort() ) ).thenReturn( testPort );
    when( variableSpace.environmentSubstitute( namedCluster.getHdfsUsername() ) ).thenReturn( testUsername );
    when( variableSpace.environmentSubstitute( namedCluster.getHdfsPassword() ) ).thenReturn( testPassword );
    buildAppendEncodedUserPassMocks( testUsername, testPassword );
    assertEquals( testScheme + "://" + testUsername + ":" + testPassword + "@" + testHost + ":" + testPort,
      namedCluster.generateURL( "${" + schemeVar + "}", metaStore, variableSpace ) );
  }

  @Test
  public void testGenerateURLHDFSVariableSpace_noVariable() {
    String scheme = "hdfs";
    String hostVar = "hostVar";
    String portVar = "portVar";
    String usernameVar = "usernameVar";
    String passwordVar = "passwordVar";
    namedCluster.setStorageScheme( "${" + scheme + "}" );
    namedCluster.setHdfsHost( "${" + hostVar + "}" );
    namedCluster.setHdfsPort( "${" + portVar + "}" );
    namedCluster.setHdfsUsername( "${" + usernameVar + "}" );
    namedCluster.setHdfsPassword( "${" + passwordVar + "}" );
    assertEquals( scheme + ":", namedCluster.generateURL( scheme, metaStore, variableSpace ) );
  }

  @Test
  public void testXMLEmbedding() throws Exception {
    Element node = createNodeFromNamedCluster();

    NamedCluster nc = new NamedClusterImpl();
    nc = nc.fromXmlForEmbed( node );

    assertNamedClusterEquality( nc );
  }

  @Test
  public void testLegacyXMLEmbedding() throws Exception {
    Element node = createNodeFromNamedCluster();

    XPath xPath = XPathFactory.newInstance().newXPath();
    //Find the node containing the hdfsPassword
    Node n = ( (Node) xPath.evaluate( "/NamedCluster/child/id[text()='hdfsPassword']", node, XPathConstants.NODE ) )
      .getNextSibling();
    //Set the password value to what it would be if we were still encoding the legacy way
    ITwoWayPasswordEncoder passwordEncoder = new Base64TwoWayPasswordEncoder();
    n.setTextContent( passwordEncoder.encode( namedCluster.getHdfsPassword() ) );

    //Now check that we can still decode it
    NamedCluster nc = new NamedClusterImpl();
    nc = nc.fromXmlForEmbed( node );

    assertNamedClusterEquality( nc );
  }

  private Element createNodeFromNamedCluster() throws Exception {
    String clusterXml = namedCluster.toXmlForEmbed( "NamedCluster" );
    System.out.println( clusterXml );

    return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
        new ByteArrayInputStream( clusterXml.getBytes() ) )
        .getDocumentElement();
  }

  private void assertNamedClusterEquality( NamedCluster nc ) {

    assertEquals( namedCluster.getHdfsHost(), nc.getHdfsHost() );
    assertEquals( namedCluster.getHdfsPort(), nc.getHdfsPort() );
    assertEquals( namedCluster.getHdfsUsername(), nc.getHdfsUsername() );
    assertEquals( namedCluster.getHdfsPassword(), nc.getHdfsPassword() );
    assertEquals( namedCluster.getName(), nc.getName() );
    assertEquals( namedCluster.getShimIdentifier(), nc.getShimIdentifier() );
    assertEquals( namedCluster.getStorageScheme(), nc.getStorageScheme() );
    assertEquals( namedCluster.getJobTrackerHost(), nc.getJobTrackerHost() );
    assertEquals( namedCluster.getJobTrackerPort(), nc.getJobTrackerPort() );
    assertEquals( namedCluster.getZooKeeperHost(), nc.getZooKeeperHost() );
    assertEquals( namedCluster.getZooKeeperPort(), nc.getZooKeeperPort() );
    assertEquals( namedCluster.getOozieUrl(), nc.getOozieUrl() );
    assertEquals( namedCluster.getKafkaBootstrapServers(), nc.getKafkaBootstrapServers() );
    assertEquals( namedCluster.getLastModifiedDate(), nc.getLastModifiedDate() );
    assertEquals( namedCluster.getSiteFiles().size(), nc.getSiteFiles().size() );
    for ( NamedClusterSiteFile siteFile : namedCluster.getSiteFiles() ) {
      String contents = getSiteFileContents( nc, siteFile.getSiteFileName() );
      assertEquals( siteFile.getSiteFileContents(), contents );
      if ( "hbase-site.xml".equals( siteFile.getSiteFileName() ) ) {
        assertEquals( 11111L, siteFile.getSourceFileModificationTime() );
      }
    }
  }

  private Answer buildSchemeAnswer( String prefix, String buildPath ) {
    return invocation -> {
      Object[] args = invocation.getArguments();
      ( (StringBuilder) args[2] ).append( buildPath );
      return prefix;
    };
  }

  private Answer buildUrlEncodeAnswer( String value ) {
    return invocation -> {
      Object[] args = invocation.getArguments();
      ( (StringBuilder) args[0] ).append( (String) args[1] );
      return null;
    };
  }

  private void buildExtractSchemeMocks( String prefix, String fullPath, String pathWithoutPrefix ) {
    String[] schemes = { "hc", "hdfs", "maprfs", "wasb" };
    when( fsm.getSchemes() ).thenReturn( schemes );
    uriParserMockedStatic.when( () -> UriParser.extractScheme( eq( schemes ), eq( fullPath ), or( isNull(), any( StringBuilder.class ) ) ) )
      .thenAnswer( buildSchemeAnswer( prefix, pathWithoutPrefix ) );
  }

  private void buildAppendEncodedUserPassMocks( String username, String password ) {
    uriParserMockedStatic.when( () -> UriParser.appendEncoded( or( isNull(), any( StringBuilder.class ) ), eq( username ), any( char[].class ) ) )
        .thenAnswer( buildUrlEncodeAnswer( username ) );
    uriParserMockedStatic.when( () -> UriParser.appendEncoded( or( isNull(), any( StringBuilder.class ) ), eq( password ), any( char[].class ) ) )
      .thenAnswer( buildUrlEncodeAnswer( password ) );
  }

  private String getSiteFileContents( NamedCluster nc, String siteFileName ) {
    NamedClusterSiteFile n = nc.getSiteFiles().stream().filter( sf -> sf.getSiteFileName().equals( siteFileName ) )
      .findFirst().orElse( null );
    return n == null ? null : n.getSiteFileContents();
  }
}


text:
using System.IO;
using OpenSage.Data.Ini;
using OpenSage.FileFormats;

namespace OpenSage.Logic.Object
{
    public sealed class ProjectileStreamUpdate : UpdateModule
    {
        internal override void Load(BinaryReader reader)
        {
            var version = reader.ReadVersion();
            if (version != 1)
            {
                throw new InvalidDataException();
            }

            base.Load(reader);

            // TODO
        }
    }

    /// <summary>
    /// Allows the object to behave as a stream like water or other liquid ordinance.
    /// </summary>
    public sealed class ProjectileStreamUpdateModuleData : UpdateModuleData
    {
        internal static ProjectileStreamUpdateModuleData Parse(IniParser parser) => parser.ParseBlock(FieldParseTable);

        private static readonly IniParseTable<ProjectileStreamUpdateModuleData> FieldParseTable = new IniParseTable<ProjectileStreamUpdateModuleData>();

        internal override BehaviorModule CreateModule(GameObject gameObject, GameContext context)
        {
            return new ProjectileStreamUpdate();
        }
    }
}


text:
Easy web app builder.

## Installation
1. Install meteor : https://www.meteor.com/

2. Download the files

3. Install the npm packages with `meteor npm install`

4. Run the application with `meteor run`

To access the application type `localhost:3000\login` in your browser


text:
<?
class MailCache {

    function __construct($imap, $db){
    	$this->IMAP = $imap;
        $this->DB = $db;
    }

    function save($message){
		$main = array();
        $meta = array();
        if(!$message->ID) return false;

        $people = array();
        foreach($message->people as $k=>$v)
            foreach($v as $k2=>$v2)
                $people[$k][] = $k2;
        $people['from'] = $people['from'][0];
        $people['replyTo'] = $people['reply_to'][0];
        unset($people['reply_to']);
        if($people['from']==$people['replyTo']) unset($people['replyTo']);

        $main = $this->copyArrayPart('time,subject,size,files,plainText,htmlSize', $message); // ,plainText,htmlText
        $main['people'] = $people;
        $main['flags'] = array();
        if(!$message->flags->seen) $main['flags'][] = 'unread';
        if($message->flags->star) $main['flags'][] = 'star';
        $main['folder'] = $message->ID->folderName;

        $meta = $this->copyArrayPart('ID,people,processingTime,parts', $message);

        $save = array(
        	'serverID'		=> $message->ID->serverID,
        	'inReplyToID'	=> $message->ID->inReplyToID,
        	'day'			=> date('Y-m-d', strtotime($main['time'])),
        	'message'		=> json_encode($main),
            'meta'			=> json_encode($meta)
        );
        $this->DB->insert('messages', $save);
//        print_r($db->errorInfo());
		$messageID = $this->DB->lastInsertId()*1;

        foreach($message->people as $k=>$v)
            foreach($v as $k2=>$v2)
            	$this->addEmail($k2, $v2, $k, $message->time, $messageID);

        $this->findThread($message->ID->serverID);
        return $save;
    }

    function copyArrayPart($keys, $array){
        $array = (array) $array;
        $keys = explode(',',$keys);
        $return = array();
        foreach($keys as $key)
            $return[$key] = $array[$key];
        return $return;
    }

    function addEmail($address, $name, $direction, $time, $messageID){
        if($direction == 'reply_to') return;
        if($direction != 'from') $direction = 'to';
        $entry = $this->DB->firstRow("SELECT * FROM emails WHERE address='$address'");
        $save = json_decode($entry['contact'],1);

        $save['address'] = $address;
        if(!$save['name']) $save['name'] = $name;
        $save[$direction]++;

        $y = date('Y', strtotime($time));
        $m = date('m', strtotime($time));
        if( $save['messages'][$y][$m]  &&  in_array($messageID, $save['messages'][$y][$m]) ) return;
        $save['messages'][$y][$m][] = $messageID;

    //    print_r($save);
        if($entry['address'])
            $this->DB->update('emails', array('address'=>$address, 'contact'=>json_encode($save)), array('address'=>$address) );
        else
            $this->DB->insert('emails', array('address'=>$address, 'contact'=>json_encode($save)) );
    //    print_r($this->DB->errorInfo());
    }

    function findThread($serverID){
        $current = $this->DB->firstRow("SELECT * FROM messages WHERE serverID='$serverID'");
        $parent = $this->DB->firstRow("SELECT * FROM messages WHERE serverID='$parentID'");
        $child = $this->DB->firstRow("SELECT * FROM messages WHERE inReplyToID='$serverID'");

        if(!$current['threadID']) $this->DB->update('messages', array('threadID'=>$current['messageID']), array('serverID'=>$current['serverID']) );
        if($parent) 	$this->DB->update('messages', array('threadID'=>$parent['threadID']), array('serverID'=>$current['serverID']) );
        if($child) 		$this->DB->update('messages', array('threadID'=>$current['messageID']), array('serverID'=>$child['serverID']) );

        if($child) echo "CHILD: $ID\n\n";
        print_r($child);
    }

    function findAllThreads(){
        $all = $this->DB->all("SELECT * FROM messages WHERE inReplyToID != ''");
        foreach($all as $msg){
        	$meta = json_decode($msg['meta']);
            $refs = $meta->ID->references;
            $refString = implode("','",$refs);
            $thread = $this->DB->all("SELECT * FROM messages WHERE serverID IN ('$refString','{$msg['serverID']}') ORDER BY day, messageID DESC");
            $threadID = $thread[0]['messageID'];
            echo "THREAD-ID: $threadID - ".count($thread)."\n\n";
            print_r($thread);
            foreach($thread as $m)
            	$this->DB->update("messages", array('threadID'=>$threadID), array('messageID'=>$m['messageID']) );
        }
    }

}

?>


text:
package com.consol.citrus.dsl.design;

import com.consol.citrus.TestCase;
import com.consol.citrus.dsl.UnitTestSupport;
import com.consol.citrus.zookeeper.actions.ZooExecuteAction;
import com.consol.citrus.zookeeper.command.AbstractZooCommand;
import com.consol.citrus.zookeeper.command.Create;
import com.consol.citrus.zookeeper.command.Delete;
import com.consol.citrus.zookeeper.command.Exists;
import com.consol.citrus.zookeeper.command.GetChildren;
import com.consol.citrus.zookeeper.command.GetData;
import com.consol.citrus.zookeeper.command.SetData;
import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * @author Martin Maher
 * @since 2.5
 */
public class ZooTestDesignerTest extends UnitTestSupport {

    @Test
    public void testZooBuilder() {
        final String actionName = "zookeeper-execute";
        final String path = "my-node";
        final String data = "my-data";
        final String mode = "custom-mode";
        final String acl = "custom-acl";
        final int version = 10;

        MockTestDesigner builder = new MockTestDesigner(context) {
            @Override
            public void configure() {
                zookeeper().info().validateCommandResult((result, context) -> Assert.assertNotNull(result));

                zookeeper().create(path, data);
                zookeeper().create(path, data).mode(mode).acl(acl);
                zookeeper().delete(path);
                zookeeper().delete(path).version(version);
                zookeeper().exists(path);
                zookeeper().children(path);
                zookeeper().set(path, data);
                zookeeper().get(path);
            }
        };

        builder.configure();

        TestCase test = builder.getTestCase();
        Assert.assertEquals(test.getActionCount(), 9);
        Assert.assertEquals(test.getActions().get(0).getClass(), ZooExecuteAction.class);

        ZooExecuteAction action = (ZooExecuteAction) test.getActions().get(0);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), com.consol.citrus.zookeeper.command.Info.class);
        Assert.assertNotNull(action.getCommand().getResultCallback());

        action = (ZooExecuteAction) test.getActions().get(1);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), Create.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.DATA), data);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.ACL), ZooExecuteAction.Builder.DEFAULT_ACL);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.MODE), ZooExecuteAction.Builder.DEFAULT_MODE);

        action = (ZooExecuteAction) test.getActions().get(2);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), Create.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.DATA), data);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.ACL), acl);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.MODE), mode);

        action = (ZooExecuteAction) test.getActions().get(3);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), Delete.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.VERSION), ZooExecuteAction.Builder.DEFAULT_VERSION);

        action = (ZooExecuteAction) test.getActions().get(4);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), Delete.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.VERSION), version);

        action = (ZooExecuteAction) test.getActions().get(5);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), Exists.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);

        action = (ZooExecuteAction) test.getActions().get(6);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), GetChildren.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);

        action = (ZooExecuteAction) test.getActions().get(7);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), SetData.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.DATA), data);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.VERSION), ZooExecuteAction.Builder.DEFAULT_VERSION);

        action = (ZooExecuteAction) test.getActions().get(8);
        Assert.assertEquals(action.getName(), actionName);
        Assert.assertEquals(action.getCommand().getClass(), GetData.class);
        Assert.assertEquals(action.getCommand().getParameters().get(AbstractZooCommand.PATH), path);
    }
}


text:
#region Licence

// The MIT License
//
// Copyright (c) 2011 Julien Blin, julien.blin@gmail.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#endregion

using NUnit.Framework;
using Remora.Configuration.Impl;
using Remora.Core.Impl;
using Remora.Pipeline;

namespace Remora.Tests.Pipeline
{
    [TestFixture]
    public class AbstractPipelineComponentTest : BaseTest
    {
        public class ApcTest : AbstractPipelineComponent
        {
        }

        [Test]
        public void It_should_call_callback_on_EndAsyncProcess()
        {
            var apc = new ApcTest();
            var wasCalled = false;
            apc.EndAsyncProcess(new RemoraOperation(), new ComponentDefinition(), () => { wasCalled = true; });
            Assert.That(wasCalled);
        }

        [Test]
        public void It_should_call_callback_with_true_on_BeginAsyncProcess()
        {
            var apc = new ApcTest();
            var wasCalled = false;
            apc.BeginAsyncProcess(new RemoraOperation(), new ComponentDefinition(), (b) =>
                                                                                {
                                                                                Assert.That(b);
                                                                                wasCalled = true;
                                                                                });
            Assert.That(wasCalled);
        }
    }
}


text:
"""Fichier contenant le contexte "personnage:creation:choix_race"""

from primaires.interpreteur.contexte import Contexte
from primaires.format.fonctions import *

class ChoixRace(Contexte):
    """Contexte demandant au client de choisir la race de son personnage.

    Le client peut également demander de l'aide sur chaque race.

    """

    nom = "personnage:creation:choix_race"

    def __init__(self, pere):
        """Constructeur du contexte"""
        Contexte.__init__(self, pere)
        self.opts.rci_ctx_prec = "personnage:creation:langue_cmd"

    def accueil(self):
        """Message d'accueil du contexte"""
        races = type(self).importeur.perso.races
        noms_races = [race.nom for race in races]
        return \
            "\n|tit|-------= Choix de la race =--------|ff|\n" \
            "Pour choisir la race de votre nouveau personnage, entrez " \
            "l'une des |ent|races|ff|\nproposées ci-après ou " \
            "|cmd|info <nom de la race>|ff| pour" \
            "obtenir\nplus d'informations sur la race (par exemple, " \
            "|cmd|info humain|ff|).\n\n" \
            "Races disponibles :\n\n" \
            "  " + "\n  ".join(noms_races)

    def get_prompt(self):
        """Message de prompt"""
        return "Entrez le nom de la race : "

    def interpreter(self, msg):
        """Méthode d'interprétation"""
        msg = supprimer_accents(msg).lower()
        info = False
        if msg == "":
            return self.pere.envoyer(self.accueil())

        if msg.startswith("info "):
            msg = msg[5:]
            info = True

        race = None
        for t_race in type(self).importeur.perso.races:
            if contient(t_race.nom, msg):
                race = t_race
                break

        if not race:
            self.pere << "|err|Cette race n'est pas disponible.|ff|"
        else:
            if not info:
                self.pere.joueur.race = race
                if race.genres and len(race.genres) > 1:
                    importeur.joueur.migrer_ctx_creation(self)
                else:
                    if race.genres and len(race.genres) == 1:
                        self.pere.joueur.genre = race.genres.liste_genres[0]
                    if self.pere.joueur not in self.pere.compte.joueurs:
                        self.pere.compte.ajouter_joueur(self.pere.joueur)

                    self.pere.joueur.pre_connecter()
            else:
                # On crée une barre de titre ajustée
                nb_tirets = int((36 - (len(race.nom) + 10)) / 2) - 1
                titre = "-" * (nb_tirets) + "=" + \
                        " Etre un {} ".format(race.nom) + \
                        "=" + "-" * (nb_tirets)
                if len(race.nom) % 2 != 0:
                    titre += "-"
                self.pere << "|tit|{}|ff|\n{}\n|att|Appuyez sur " \
                        "|ent|ENTRÉE|att| pour voir de nouveau la " \
                        "liste des races.|ff|".format(titre, race.description)


text:
import json
import sys
import six
import types as vtypes

from twisted.python import log
from twisted.internet.defer import inlineCallbacks, returnValue

from autobahn import util
from autobahn.wamp import auth
from autobahn.wamp import types
from autobahn.wamp.interfaces import IRouter
from autobahn.twisted.wamp import Router
from autobahn.twisted.wamp import RouterSession
from twisted.internet import defer
from autobahn.twisted.wamp import ApplicationSession

class AuthorizeSession(ApplicationSession):
    def ret_func(self, *args, **kwargs):
        log.msg("in ret_func {} {}".format(args,kwargs))
        if not 'router' in self.svar:
            log.msg("router not set in ret_funcs svar")
            raise Exception("PreAuthRouter doesn't have the router set!")
        log.msg("calling function")
        self.svar['app_session'] = self

        fnc = self.svar['router'] (*args, **dict(self.svar.items() + kwargs.items()))

        log.msg("returning that new class")

        return fnc

    def __init__(self, *args, **kwargs):
        self.svar = {}

        log.msg("AuthorizeSession __init__ {},{}".format(args,kwargs))

        # reap init variables meant only for us
        for i in ( 'topic_base', 'app_session', 'debug', 'db', 'router',  ):
            if i in kwargs:
                if kwargs[i] is not None:
                    self.svar[i] = kwargs[i]
                del kwargs[i]

        if 'debug' in self.svar:
            self.debug = self.svar['debug']
            if self.debug:
                log.startLogging(sys.stdout)

        log.msg("PreAuthRouter is ready {},{}".format(args,kwargs))

        ApplicationSession.__init__(self,*args, **kwargs)

        return

class AuthorizeRouter(Router):
    def __init__(self, *args, **kwargs):
        self.svar = {}

        # reap init variables meant only for us
        for i in ( 'topic_base', 'app_session', 'debug', 'db', 'router', ):
            if i in kwargs:
                if kwargs[i] is not None:
                    self.svar[i] = kwargs[i]
                del kwargs[i]

        if 'debug' in self.svar:
            self.debug = self.svar['debug']
            if self.debug:
                log.startLogging(sys.stdout)

        if 'db' in self.svar:
            self.sessiondb = self.svar['db']

        if 'app_session' in self.svar:
            self.app_session = self.svar['app_session']

        log.msg("sending to super.init args {}, kwargs {}".format(args,kwargs))

        if 'topic_base' in self.svar:
            self.topic_base = self.svar['topic_base']
            self.query = self.topic_base + '.query'
            self.operation = self.topic_base + '.operation'
            self.watch = self.topic_base + '.watch'

        Router.__init__(self, *args, **kwargs)

        return

    #
    # authid = integer, from auto.role.id (the id associated with the users login)
    # uri = topic, like com.db.query
    # action = subscribe,publish,etc, from the auto.activity_type.id column
    #
    # we search 'down' the topic '.' (dot) separated list, first hit is our permission to use
    # for example:
    # com.db.query.
    # first we look for permissions with our user with 'com', then 'com.db', then 'com.db.query'.
    # if no permissions exist for all three then the user doesn't have permission.
    # if we get a hit, the first hit is the permission to use. we get the 'allow' column from
    # the topicrole permission table and return that.  using that means that permissions can be
    # allowed (True), or revoked (False).
    #
    @inlineCallbacks
    def check_permission(self, authid, uri, action):
        log.msg("AuthorizeRouter.check_permission: {} {} {}".format(authid, uri, action))
        look = []
        pieces = uri.split('.')
        accum = ''
        extra = ''
        for p in pieces:
            accum = accum + extra + p
            extra = '.'
            look.append(accum)

        query = """
        select t.name, length(t.name) as topic_length, tr.allow
          from topic as t,
               topicrole as tr,
               loginrole as lr
         where
            t.name in %(topiclist)s
           and
            t.id = tr.topic_id
           and
            tr.role_id = lr.role_id
           and
            tr.type_id = %(action)s
           and
            lr.login_id = %(authid)s
      order by
            topic_length"""
        log.msg("AuthorizeRouter.check_permission: query: {}".format(query))
        args = { 'topiclist': tuple(look), 'authid': authid, 'action': action }
        log.msg("AuthorizeRouter.check_permission: args: {}".format(args))

        rv = yield self.app_session.call(self.query, query, args, options = types.CallOptions(timeout=2000,discloseMe=True))

        log.msg("AuthorizeRouter.check_permission: rv: {}".format(rv))

        perm = False
        if len(rv) > 0:
            perm = rv[0]['allow']
            if not isinstance(perm, vtypes.BooleanType):
                log.msg("perm is NOT boolean {}", perm)
                if perm == 't':
                    perm = True
                else:
                    perm = False
            log.msg("perm is {}".format(perm))

        returnValue(perm)

        return

    @inlineCallbacks
    def authorize(self, session, uri, action):
        authid = session._authid
        if authid is None:
            authid = 1
        log.msg("AuthorizeRouter.authorize: {} {} {} {} {}".format(authid,
            session._session_id, uri, IRouter.ACTION_TO_STRING[action], action))
        if authid != 1:
            rv = yield self.check_permission(authid, uri, IRouter.ACTION_TO_STRING[action])
        else:
            rv = yield True

        log.msg("AuthorizeRouter.authorize: rv is {}".format(rv))

        if not uri.startswith(self.svar['topic_base']):
            self.sessiondb.activity(session._session_id, uri, IRouter.ACTION_TO_STRING[action], rv)

        returnValue(rv)

        return


text:
package org.nd4j.linalg.shape.concat;

import lombok.extern.slf4j.Slf4j;
import org.nd4j.linalg.primitives.Pair;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.nd4j.linalg.BaseNd4jTest;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.checkutil.NDArrayCreationUtil;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.factory.Nd4jBackend;
import org.nd4j.linalg.indexing.INDArrayIndex;
import org.nd4j.linalg.indexing.NDArrayIndex;

import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * @author Adam Gibson
 */
@Slf4j
@RunWith(Parameterized.class)
public class ConcatTests extends BaseNd4jTest {

    public ConcatTests(Nd4jBackend backend) {
        super(backend);
    }

    @Test
    public void testConcat() {
        INDArray A = Nd4j.linspace(1, 8, 8).reshape(2, 2, 2);
        INDArray B = Nd4j.linspace(1, 12, 12).reshape(3, 2, 2);
        INDArray concat = Nd4j.concat(0, A, B);
        assertTrue(Arrays.equals(new int[] {5, 2, 2}, concat.shape()));

    }

    @Test
    public void testConcatHorizontally() {
        INDArray rowVector = Nd4j.ones(5);
        INDArray other = Nd4j.ones(5);
        INDArray concat = Nd4j.hstack(other, rowVector);
        assertEquals(rowVector.rows(), concat.rows());
        assertEquals(rowVector.columns() * 2, concat.columns());

    }

    @Test
    public void testVStackColumn() {
        INDArray linspaced = Nd4j.linspace(1, 3, 3).reshape(3, 1);
        INDArray stacked = linspaced.dup();
        INDArray assertion = Nd4j.create(new double[] {1, 2, 3, 1, 2, 3}, new int[] {6, 1});
        INDArray test = Nd4j.vstack(linspaced, stacked);
        assertEquals(assertion, test);
    }

    @Test
    public void testConcatScalars() {
        INDArray first = Nd4j.arange(0, 1).reshape(1, 1);
        INDArray second = Nd4j.arange(0, 1).reshape(1, 1);
        INDArray firstRet = Nd4j.concat(0, first, second);
        assertTrue(firstRet.isColumnVector());
        INDArray secondRet = Nd4j.concat(1, first, second);
        assertTrue(secondRet.isRowVector());

    }

    @Test
    public void testConcatMatrices() {
        INDArray a = Nd4j.linspace(1, 4, 4).reshape(2, 2);
        INDArray b = a.dup();

        INDArray concat1 = Nd4j.concat(1, a, b);
        INDArray oneAssertion = Nd4j.create(new double[][] {{1, 3, 1, 3}, {2, 4, 2, 4}});
        assertEquals(oneAssertion, concat1);

        INDArray concat = Nd4j.concat(0, a, b);
        INDArray zeroAssertion = Nd4j.create(new double[][] {{1, 3}, {2, 4}, {1, 3}, {2, 4}});
        assertEquals(zeroAssertion, concat);
    }

    @Test
    public void testConcatRowVectors() {
        INDArray rowVector = Nd4j.create(new double[] {1, 2, 3, 4, 5, 6}, new int[] {1, 6});
        INDArray matrix = Nd4j.create(new double[] {7, 8, 9, 10, 11, 12}, new int[] {1, 6});

        INDArray assertion1 = Nd4j.create(new double[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, new int[] {1, 12});
        INDArray assertion0 = Nd4j.create(new double[][] {{1, 2, 3, 4, 5, 6}, {7, 8, 9, 10, 11, 12}});

        //      INDArray concat1 = Nd4j.hstack(rowVector, matrix);
        INDArray concat0 = Nd4j.vstack(rowVector, matrix);
        //        assertEquals(assertion1, concat1);
        assertEquals(assertion0, concat0);
    }

    @Test
    public void testConcat3d() {
        INDArray first = Nd4j.linspace(1, 24, 24).reshape('c', 2, 3, 4);
        INDArray second = Nd4j.linspace(24, 36, 12).reshape('c', 1, 3, 4);
        INDArray third = Nd4j.linspace(36, 48, 12).reshape('c', 1, 3, 4);

        //Concat, dim 0
        INDArray exp = Nd4j.create(2 + 1 + 1, 3, 4);
        exp.put(new INDArrayIndex[] {NDArrayIndex.interval(0, 2), NDArrayIndex.all(), NDArrayIndex.all()}, first);
        exp.put(new INDArrayIndex[] {NDArrayIndex.point(2), NDArrayIndex.all(), NDArrayIndex.all()}, second);
        exp.put(new INDArrayIndex[] {NDArrayIndex.point(3), NDArrayIndex.all(), NDArrayIndex.all()}, third);

        INDArray concat0 = Nd4j.concat(0, first, second, third);

        assertEquals(exp, concat0);

        System.out.println("1------------------------");

        //Concat, dim 1
        second = Nd4j.linspace(24, 32, 8).reshape('c', 2, 1, 4);
        third = Nd4j.linspace(32, 48, 16).reshape('c', 2, 2, 4);
        exp = Nd4j.create(2, 3 + 1 + 2, 4);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.interval(0, 3), NDArrayIndex.all()}, first);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.point(3), NDArrayIndex.all()}, second);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.interval(4, 6), NDArrayIndex.all()}, third);

        System.out.println("2------------------------");

        INDArray concat1 = Nd4j.concat(1, first, second, third);

        assertEquals(exp, concat1);

        //Concat, dim 2
        second = Nd4j.linspace(24, 36, 12).reshape('c', 2, 3, 2);
        third = Nd4j.linspace(36, 42, 6).reshape('c', 2, 3, 1);
        exp = Nd4j.create(2, 3, 4 + 2 + 1);

        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.interval(0, 4)}, first);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.interval(4, 6)}, second);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.point(6)}, third);

        INDArray concat2 = Nd4j.concat(2, first, second, third);

        assertEquals(exp, concat2);
    }

    @Test
    @Ignore
    public void testConcat3dv2() {

        INDArray first = Nd4j.linspace(1, 24, 24).reshape('c', 2, 3, 4);
        INDArray second = Nd4j.linspace(24, 35, 12).reshape('c', 1, 3, 4);
        INDArray third = Nd4j.linspace(36, 47, 12).reshape('c', 1, 3, 4);

        //Concat, dim 0
        INDArray exp = Nd4j.create(2 + 1 + 1, 3, 4);
        exp.put(new INDArrayIndex[] {NDArrayIndex.interval(0, 2), NDArrayIndex.all(), NDArrayIndex.all()}, first);
        exp.put(new INDArrayIndex[] {NDArrayIndex.point(2), NDArrayIndex.all(), NDArrayIndex.all()}, second);
        exp.put(new INDArrayIndex[] {NDArrayIndex.point(3), NDArrayIndex.all(), NDArrayIndex.all()}, third);

        List<Pair<INDArray, String>> firsts = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 3, 4);
        List<Pair<INDArray, String>> seconds = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 1, 3, 4);
        List<Pair<INDArray, String>> thirds = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 1, 3, 4);
        for (Pair<INDArray, String> f : firsts) {
            for (Pair<INDArray, String> s : seconds) {
                for (Pair<INDArray, String> t : thirds) {
                    INDArray f2 = f.getFirst().assign(first);
                    INDArray s2 = s.getFirst().assign(second);
                    INDArray t2 = t.getFirst().assign(third);

                    System.out.println("-------------------------------------------");
                    INDArray concat0 = Nd4j.concat(0, f2, s2, t2);

                    assertEquals(exp, concat0);
                }
            }
        }

        //Concat, dim 1
        second = Nd4j.linspace(24, 31, 8).reshape('c', 2, 1, 4);
        third = Nd4j.linspace(32, 47, 16).reshape('c', 2, 2, 4);
        exp = Nd4j.create(2, 3 + 1 + 2, 4);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.interval(0, 3), NDArrayIndex.all()}, first);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.point(3), NDArrayIndex.all()}, second);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.interval(4, 6), NDArrayIndex.all()}, third);

        firsts = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 3, 4);
        seconds = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 1, 4);
        thirds = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 2, 4);
        for (Pair<INDArray, String> f : firsts) {
            for (Pair<INDArray, String> s : seconds) {
                for (Pair<INDArray, String> t : thirds) {
                    INDArray f2 = f.getFirst().assign(first);
                    INDArray s2 = s.getFirst().assign(second);
                    INDArray t2 = t.getFirst().assign(third);

                    INDArray concat1 = Nd4j.concat(1, f2, s2, t2);

                    assertEquals(exp, concat1);
                }
            }
        }

        //Concat, dim 2
        second = Nd4j.linspace(24, 35, 12).reshape('c', 2, 3, 2);
        third = Nd4j.linspace(36, 41, 6).reshape('c', 2, 3, 1);
        exp = Nd4j.create(2, 3, 4 + 2 + 1);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.interval(0, 4)}, first);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.interval(4, 6)}, second);
        exp.put(new INDArrayIndex[] {NDArrayIndex.all(), NDArrayIndex.all(), NDArrayIndex.point(6)}, third);

        firsts = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 3, 4);
        seconds = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 3, 2);
        thirds = NDArrayCreationUtil.getAll3dTestArraysWithShape(12345, 2, 3, 1);
        for (Pair<INDArray, String> f : firsts) {
            for (Pair<INDArray, String> s : seconds) {
                for (Pair<INDArray, String> t : thirds) {
                    INDArray f2 = f.getFirst().assign(first);
                    INDArray s2 = s.getFirst().assign(second);
                    INDArray t2 = t.getFirst().assign(third);

                    INDArray concat2 = Nd4j.concat(2, f2, s2, t2);

                    assertEquals(exp, concat2);
                }
            }
        }
    }

    @Override
    public char ordering() {
        return 'f';
    }
}


text:
#ifndef __HelloCpp__RootWindow__
#define __HelloCpp__RootWindow__

#include <iostream>
#include "CrossApp.h"

USING_NS_CC;

class RootWindow: public CAWindow
{
public:

    static RootWindow* getInstance();

    RootWindow();

    virtual ~RootWindow();

    virtual bool init();

    CC_SYNTHESIZE_READONLY(CANavigationController*, m_pRootNavigationController, RootNavigationController);

    CC_SYNTHESIZE_READONLY(CADrawerController*, m_pRootDrawerController, DrawerController);
};

#endif /* defined(__HelloCpp__ViewController__) */