text:
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use kartik\date\DatePicker;
use app\modules\admin\models\User;

/* @var $this yii\web\View */
/* @var $searchModel app\modules\admin\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('user', 'Users');
$this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'ADMIN'), 'url' => ['default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= Html::a(Yii::t('user', 'Create User'), ['create'], ['class' => 'btn btn-success']) ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            [
                'filter' => DatePicker::widget([
                    'model' => $searchModel,
                    'attribute' => 'date_from',
                    'attribute2' => 'date_to',
                    'type' => DatePicker::TYPE_RANGE,
                    'separator' => '-',
                    'pluginOptions' => ['format' => 'dd.mm.yyyy']
                ]),
                'attribute' => 'created_at',
                'format' => 'date',
            ],

            [
                'attribute' => 'username',
                'format' => 'raw',
                'value' => function ($model, $key, $index, $column) {
                    /** @var User $model */
                    return Html::a(Html::encode($model->username), ['view', 'id' => $model->id]);
                }
            ],

            'email:email',
            [
                'filter' => User::getStatusesArray(),
                'attribute' => 'status',
                'format' => 'raw',
                'value' => function ($model, $key, $index, $column) {
                    /** @var User $model */
                    /** @var \yii\grid\DataColumn $column */
                    $value = $model->{$column->attribute};
                    switch ($value) {
                        case User::STATUS_ACTIVE:
                            $class = 'success';
                            break;
                        case User::STATUS_WAIT:
                            $class = 'warning';
                            break;
                        case User::STATUS_BLOCKED:
                        default:
                            $class = 'default';
                    };
                    $html = Html::tag('span', Html::encode($model->getStatusName()), ['class' => 'label label-' . $class]);
                    return $value === null ? $column->grid->emptyCell : $html;
                }
            ],

            [
                'class' => 'yii\grid\ActionColumn',
                'contentOptions' => ['style' => 'white-space: nowrap; text-align: center; letter-spacing: 0.1em; max-width: 7em;'],
            ],
        ],
    ]); ?>


text:
<?php
// error_reporting(E_ALL);
// error_reporting(E_ERROR | E_WARNING & ~E_NOTICE);
/**
 * This function retrieves CLI arguments or server $_GETs
 * $_GET's key and value are merged, so
 * CLI argv -DATA:TEST is equivalent to $_GET's &-DATA=:TEST
 * First item of result always be the current file path.
 */

function get_command_args()
{
    global  $argv;
    $ar = array();
    if (PHP_SAPI === 'cli') {

        foreach($argv as $item)
        {
            $ar[] = $item;
        }
    }
    else
    {
        $ar[] = __FILE__;
        foreach($_GET as $key=>$item)
        {
            $ar[] = $key.''.urldecode($item);
        }
    }
    return $ar;
}
//  var_dump(get_command_args());

include_once(str_replace("\\", "/", dirname(dirname(__FILE__))."/cores/db.php"));
include_once(str_replace("\\", "/", dirname(dirname(__FILE__))."/cores/definition.php"));
include_once(str_replace("\\", "/", dirname(dirname(__FILE__))."/gammu/gammu-cores.php"));
include_once(str_replace("\\", "/", dirname(dirname(__FILE__))."/gammu/gammu-fetch-sms.php"));

// error_reporting(E_ALL ^ E_NOTICE);

if (!USE_GAMMU) {die('Not supported on this server. Gammu is not used.'); }

$app_name       = SP_APP_NAME_SHORT;
$app_version    = SP_APP_VERSION;
$gammu_id       = GAMMU_CREATOR_ID;
$_SMS_PROCESSOR_DAEMON_HOOKS = keyword_fetch_all();

/**
 * Include hook files:
 */

// $f = fopen('D:/testtt.txt','w');
foreach ($_SMS_PROCESSOR_DAEMON_HOOKS as $keyword)
{
    $keyword_file = str_replace("\\","/", dirname(dirname(__FILE__))).'/sms-daemon-hooks/'.basename($keyword['file_name']);
    // fputs($f, $keyword_file ."\n");
    if (file_exists($keyword_file))
    {
        include_once($keyword_file);
        // fputs($f, $keyword_file ."\n");
    }
}
// fclose($f);

$data_count_to_process  = get_system_config('sms_to_process_per_minute', 10); // execute 10 data every minute - as this task run
$nama_modem             = fetch_one_value("select coalesce((select nama_modem from modem_gateway order by id desc limit 0,1),'')");
$last_id                = fetch_one_value("select coalesce((select config_value from configs where config_name = '".LAST_ID_CONFIG_NAME."'),0)");
// create keyword state cache:
$keyword_states         = keyword_fetch_states_from_db();

$sms_query  =
    "select sv.id from sms_valid sv where sv.id > $last_id and sv.diproses = 'Ditunda'
    order by sv.waktu_terima asc, sv.id asc limit 0, $data_count_to_process";
$smses      = fetch_query($sms_query);

$last_processed_id = $last_id;
$all_ok = true;
$cnt = 0;

if (count($smses)==0)
{
    // No new message to process
    exit('No new message to process');
}
else
{
    echo 'Processing '.count($smses).' SMS(es) : ';
    foreach ($smses as $sms)
    {
        $last_processed_id = $sms['id'];
        $sms_item          = sms_fetch_item($last_processed_id);
        $sms_keyword       = strtoupper($sms_item['params'][0]);
        foreach ($_SMS_PROCESSOR_DAEMON_HOOKS as $keyword)
        {
            if ($sms_keyword == strtoupper($keyword['keyword']))
            {
                /*
                pre($keyword['active']);
                pre('Y');
                */
                if (strtoupper($keyword['active']) == 'Y')
                {
                    $result = call_user_func($keyword['function_name'], $keyword['keyword'], $sms_item);
                    /**
                     * If keyword hook returned true,
                     * mark it's status as 'Dibalas'
                     * and set it's ID as last processed SMS ID.
                     */
                    if ($result)
                    {
                        sms_status_dibalas($last_processed_id);
                        sms_set_last_processed_id($last_processed_id);
                        $cnt++;

                    }
                }
                else
                {
                    // keyword tidak aktif, langsung tangani:
                    // sms_status_dibalas($last_processed_id);
                    sms_status_diproses($last_processed_id);
                    sms_set_last_processed_id($last_processed_id);
                    $cnt++;
                }
            }
        }

    }
    echo $cnt.' of '. count($smses).' processed.';
}
unset($smses);

?>

redpajama_set_name: RedPajamaGithub


text:
package com.ivyis.di.trans.steps.git;

import org.pentaho.di.i18n.BaseMessages;

/**
 * Emun of Git commands allowed in PDI.
 *
 * @author Joel Latino
 * @since 1.0.0
 */
public enum GitCommandType {
  CURRENT_BRANCH("currentBranch", false), LIST_BRANCHS("listBranchs", false), LIST_TAGS(
      "listTags", false), LOG("log", false), INIT("init", true), ADD(
      "add", true), CLONE("clone", true), COMMIT("commit", true), PULL(
      "pull", true), PUSH("push", true), TAG("tag", true), CHECKOUT(
      "checkout", true);

  /** for i18n purposes. **/
  private static final Class<?> PKG = GitCommandType.class;
  private static final int INFO_COMMANDS_NUMBER = 4;
  private static final int OPERATION_COMMANDS_NUMBER = 8;

  private final String operationName;
  private final boolean operations;

  public String getOperationName() {
    return operationName;
  }

  public boolean isOperations() {
    return operations;
  }

  public String getOperationLabel() {
    return BaseMessages.getString(PKG, "Git." + operationName + ".Label");
  }

  private GitCommandType(String operationName, boolean operations) {
    this.operationName = operationName;
    this.operations = operations;
  }

  public static GitCommandType fromValue(final String value) {
    for (GitCommandType type : GitCommandType.values()) {
      if (type.getOperationName().equalsIgnoreCase(value)) {
        return type;
      }
    }
    return null;
  }

  public static GitCommandType fromLabel(final String label) {
    if (label == null) {
      return null;
    }
    for (GitCommandType type : GitCommandType.values()) {
      if (BaseMessages.getString(PKG,
          "Git." + type.getOperationName() + ".Label")
          .equalsIgnoreCase(label)) {
        return type;
      }
    }
    return null;
  }

  public static String[] getOperationTypesLabel() {
    int i = 0;
    final String[] gitOperationTypeLabels = new String[OPERATION_COMMANDS_NUMBER];
    for (GitCommandType type : GitCommandType.values()) {
      if (type.isOperations()) {
        gitOperationTypeLabels[i++] = BaseMessages.getString(PKG,
            "Git." + type.getOperationName() + ".Label");
      }
    }
    return gitOperationTypeLabels;
  }

  public static String[] getInfoTypesLabel() {
    int i = 0;
    final String[] gitOperationTypeLabels = new String[INFO_COMMANDS_NUMBER];
    for (GitCommandType type : GitCommandType.values()) {
      if (!type.isOperations()) {
        gitOperationTypeLabels[i++] = BaseMessages.getString(PKG,
            "Git." + type.getOperationName() + ".Label");
      }
    }
    return gitOperationTypeLabels;
  }
}


text:
using System;
using System.Collections;
using System.IO;
using System.Text;
using Vixen;

namespace MagicMirror
{
	/*!
	 * @class KinectAvatarScene
	 * Implements an animatable 3D avatar that you can dress in different outfits
	 * which tracks your body movements using the Kinect.
	 * Content files for the background, avatar, clothing and animations can be separately loaded.
	 * Events are produced when the user enters or leaves the area and when the user turns.
	 *
	 * @see AvatarScene KioskScene Avatar
	 */
	public class KinectAvatarScene : AvatarScene
	{
		protected float		blendtime = 1.0f;
		protected KinectTracker masterKinect = null;
		protected int		kinectUserID =-1;
		protected PoseMapper poseMapper = null;
		protected Shape		cameraOutput = null;
		protected bool		enableAnimation = false;
		protected Trigger	frontAnimTrigger = new Trigger();
		public KinectTracker Kinect { get { return masterKinect; } }

		#region BodyTrackEvents interface
		public delegate void OnSensorInitHandler(String s);
		public event OnSensorInitHandler SensorInitEvent;
		public delegate void OnNewUserHandler(String s, int userid);
		public event OnNewUserHandler NewUserEvent;
		public delegate void OnStartTrackHandler(String s, int userid);
		public event OnStartTrackHandler StartTrackEvent;
		public delegate void OnStopTrackHandler(String s, int userid);
		public event OnStopTrackHandler StopTrackEvent;
		public delegate void OnPauseTrackHandler(String s, int userid);
		public event OnPauseTrackHandler PauseTrackEvent;
		public delegate void OnUserTurnHandler(String s, int userid, Vec3 pos);
		public event OnUserTurnHandler UserTurnEvent;
		#endregion

		public KinectAvatarScene(System.String kinect_file)
			: base()
		{
			masterKinect = new KinectTracker();
			masterKinect.Active = false;
			if (!masterKinect.Configure(kinect_file))
				throw new FileNotFoundException(kinect_file + " cannot open Kinect data file");
		}

		public KinectAvatarScene()
			: base()
		{
		}

		protected override Engine MakeEngines()
		{
			Engine simroot = base.MakeEngines();
			if (masterKinect != null)
				simroot.Append(masterKinect);
			frontAnimTrigger.Name = "magicmirror.frontanim.trigger";
			frontAnimTrigger.Active = false;
			simroot.Append(frontAnimTrigger);
			return simRoot;
		}

		/*!
		 * @param ev	Vixen event to handle.
		 * @param world	current world
		 * Handles vixen events which come from the body tracker.
		 * This function also calls event handlers for BodyTrackEvents.
		 */
		public override void OnVixen(Event ev, SharedWorld world)
		{
			int code = ev.Code;

			if (code == Event.TRACK)
			{
				TrackEvent kev = (TrackEvent)ev;

				if (kev.Type == TrackEvent.NEW_USER)
					OnNewUser(kev.UserID);
				else if (kev.Type == TrackEvent.START_BODY_TRACK)
					OnStartTrack(kev.UserID);
				else if (kev.Type == TrackEvent.PAUSE_BODY_TRACK)
					OnPauseTrack(kev.UserID);
				else if (kev.Type == TrackEvent.STOP_BODY_TRACK)
					OnStopTrack(kev.UserID);
				else if (kev.Type == TrackEvent.INIT_DONE)
					OnSensorInit();
				else if (kev.Type == TrackEvent.USER_TURN)
					OnUserTurn(kev.UserID, kev.Position);
			}
			else if (code == Event.ENTER && enableAnimation)
				try
				{
					TriggerEvent te = ev as TriggerEvent;
					if (te.Sender .SameAs(frontAnimTrigger))
						RandomAnimation("front", blendtime);
				}
				catch (Exception) { }

			base.OnVixen(ev, world);
		}

		/*!
		 * Called when when the body tracking sensor has initialized.
		 * Invokes the SensorInitEvent handler.
		 */
		protected virtual void OnSensorInit()
		{
			Console.WriteLine("Sensor Initialized");
			if ((SensorInitEvent != null) && (masterKinect != null))
				SensorInitEvent(masterKinect.Name);
		}

		/*!
		 * @param userid	sensor ID of new user
		 * Called when the sensor detects a new user walking into the scene.
		 * Invokes the NewUserEvent handler.
		 */
		protected virtual void OnNewUser(int userid)
		{
			Console.WriteLine("New User " + userid);
			if ((NewUserEvent != null) && (masterKinect != null))
				NewUserEvent(masterKinect.Name, userid);
		}

		/*!
		 * @param userid	sensor ID of user
		 * Called when the sensor starts tracking a user.
		 * Invokes the StartTrackEvent handler.
		 */
		protected virtual void OnStartTrack(int userid)
		{
			Console.WriteLine("Start Track " + userid);
			kinectUserID = userid;
			currentAvatar.BodyPoser.Active = true;
			currentAvatar.Show();
			PauseAnimation(null);
			//cameraOutput.Active = false;
			if ((config.physics != null) &&
				(config.physics != "none") &&
				(config.physics != ""))
				physics.Active = true;
			if ((StartTrackEvent != null) && (masterKinect != null))
				StartTrackEvent(masterKinect.Name, userid);
		}

		/*!
		 * @param userid	sensor ID of user
		 * Called when the sensor pauses tracking the user.
		 * Invokes the PauseTrackEvent handler.
		 */
		protected virtual void OnPauseTrack(int userid)
		{
			Console.WriteLine("Pause Track " + userid);
			if (userid == kinectUserID)
			{
				kinectUserID = -1;
				currentAvatar.BodyPoser.Active = false;
				if (enableAnimation)
					RandomAnimation("idle", blendtime);
			}
			if ((PauseTrackEvent != null) && (masterKinect != null))
				PauseTrackEvent(masterKinect.Name, userid);
		}

		/*!
		 * @param userid	sensor ID of user
		 * Called when the sensor stops tracking a user.
		 * Invokes the StopTrackEvent handler.
		 */
		protected virtual void OnStopTrack(int userid)
		{
			Console.WriteLine("Stop Track " + userid);
			if (userid == kinectUserID)
			{
				kinectUserID = -1;
				currentAvatar.RestoreBindPose();
				if (poseMapper != null)
					poseMapper.Source.RestoreBindPose();
				if (enableAnimation)
					RandomAnimation("idle", blendtime);
			}
			if ((StopTrackEvent != null) && (masterKinect != null))
				StopTrackEvent(masterKinect.Name, userid);
		}

		/*!
		 * @param name		name of Vixen engine for sensor
		 * @param userid	sensor ID of user
		 * @param pos		position of users chest
		 * Called when the user turns away from the sensor.\
		 * Invokes the UserTurnEvent handler.
		 */
		protected virtual void OnUserTurn(int userid, Vec3 pos)
		{
			Console.WriteLine("User Turn " + userid);
			if ((UserTurnEvent != null) && (masterKinect != null) && enableAnimation)
				UserTurnEvent(masterKinect.Name, userid, pos);
		}

		protected override void OnStopAnim(SharedObj sender)
		{
			bool restart = (nowPlaying != null) && nowPlaying.SameAs(sender);
			base.OnStopAnim(sender);
			if (!restart)
				return;
			if (kinectUserID >= 0)
			{
				currentAvatar.BodyPoser.Active = true;
				return;
			}
			if (enableAnimation)
				RandomAnimation("idle", 0);
		}

		protected override void OnSceneChange(SharedWorld world, Scene scene)
		{
			bool firstTime = !sceneLoaded;
			base.OnSceneChange(world, scene);
			if (firstTime && (masterKinect != null))
			{
				masterKinect.SetFlags((uint)SharedObj.DOEVENTS);
				masterKinect.Options = (int) BodyTracker.TRACK_FRONT_ONLY | (int) BodyTracker.TRACK_SKELETON;
				world.Observe(Event.TRACK);
			}
		}

		protected override Skeleton ConnectAvatar(SharedWorld world, Scene scene)
		{
			Skeleton skeleton = base.ConnectAvatar(world, scene);
			dynamic anims = null;

			if (config != null)
				anims = config.animation;
			if (frontAnimTrigger != null)
				frontAnimTrigger.AddCollider(currentAvatar.Head);
			if (masterKinect == null)
				return skeleton;

			try
			{
				Box3 bodysize = new Box3();
				Camera cam = scene.Camera;

				poseMapper = masterKinect.PoseMapper;
				if (poseMapper != null)
				{
					Skeleton source = poseMapper.Source;
					string havokrig = "Proxy_Waist";
					string rig = "genesis";

					if ((config != null) && (config.havokrig != null))
						havokrig = config.havokrig;
					if ((config != null) && (config.rig != null))
						rig = config.rig;
					poseMapper.Target = skeleton;
					if (!skeleton.GetBoneName(0).Contains(havokrig))
						poseMapper.SelectBoneMap(rig);
					else
						poseMapper.SelectBoneMap("default");
					if (source != null)
					{
						Vec3 waistpos = source.Pose.GetWorldPosition(0);
						poseMapper.MapWorldToSource();
						poseMapper.Source.BindPose = source.Pose;
						masterKinect.WaistOffset = waistpos;
					}
					else
						SharedWorld.LogError("MagicMirror: PoseMapper does not have source skeleton");
				}
				masterKinect.Active = true;
			}
			catch (Exception ex)
			{
				SharedWorld.LogError("MagicMirror: problem connecting Kinect " + ex.Message);
			}
			return skeleton;
		}

		public override void OnSceneLoad(SharedWorld world, Scene scene, String scenefile)
		{
			if (!sceneLoaded &&
				(cameraOutput == null) &&
				(scenefile == interiorRoot.FileName))
			{
				if (masterKinect != null)
				{
					cameraOutput = MakeCameraOutputShape(scene.Camera, true);
					sceneRoot.Append(cameraOutput);
					cameraOutput.Active = true;
					SharedWorld.Trace("Scene: " + sceneRoot.Name + " -> child " + cameraOutput.Name + "\n");
				}
				if (frontAnimTrigger != null)
				{
					Box3 b = new Box3(-2.0f, 0.0f, -0.05f, 2.0f, 3.0f, 2.0f);

					frontAnimTrigger.SetGeoBox(b);
					frontAnimTrigger.Options = Trigger.BOX;
					frontAnimTrigger.SetFlags((uint)SharedObj.DOEVENTS);
					frontAnimTrigger.Active = true;
				}
			}
			base.OnSceneLoad(world, scene, scenefile);
		}

		/*
		 * Make the shape for the Kinect depth camera output
		 */
		protected Shape MakeCameraOutputShape(Camera cam, bool iscolor)
		{
			Shape shape = new Shape();
			Appearance app = new Appearance();
			PhongMaterial mtl = new PhongMaterial(new Col4(1.0f, 1.0f, 1.0f, 0.7f));
			Sampler sampler = new Sampler();
			TriMesh mesh = new TriMesh("position float 3, normal float 3, texcoord float 2");
			Vec2 videosize = new Vec2(640, 480);
			Vec2 texsize = new Vec2(1024, 512);
			Box3 vvol = cam.ViewVol;
			Vec3 campos = cam.Translation;
			float camdist = campos.Length;		// distance of camera from body
			float backdist = camdist + vvol.max.z / 6.0f;
			float h = backdist * vvol.Height / vvol.min.z;
			float w = h;

			backdist -= camdist;
			if (Kinect != null)
			{
				Texture tex = new Texture();
				sampler.Texture = tex;
				if (iscolor)
				{
					tex.Name = "magicmirror.kinect.colorimage";
					Kinect.ColorTexture = tex;
				}
				else
				{
					tex.Name = "magicmirror.kinect.depthimage";
					Kinect.DepthTexture = tex;
				}
			}
			sampler.Name = "diffuse";
			sampler.Set(Sampler.TEXTUREOP, Sampler.DIFFUSE);
			sampler.Set(Sampler.TEXCOORD, 0);
			app.Set(Appearance.CULLING, 1);
			app.Set(Appearance.LIGHTING, 1);
			app.Set(Appearance.TRANSPARENCY, 1);
			app.SetSampler(0, sampler);
			app.Material = mtl;
			app.Name = "cameraoutput";
			shape.Appearance = app;
			GeoUtil.Rect(mesh, h * videosize.x / videosize.y, h, videosize.x / texsize.x, videosize.y / texsize.y);
			shape.Geometry = mesh;
			shape.Name = "magicmirror.kinect.camerashape";
			shape.Translate(0, h / 2, -backdist);
			return shape;
		}

	}

}


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

<config xmlns="http://www.hybris.com/cockpit/config">
<context merge-by="module" parent="auto" component="explorer-tree">
		<explorer-tree:explorer-tree xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree">
			<explorer-tree:navigation-node id="hmc_treenode_system" merge-mode="append">
				<explorer-tree:navigation-node id="hmc.fredhoppersearch">
					<explorer-tree:type-node code="FredhopperIndexExportCronJob" id="hmc_type_tree_fredhoppercronjob"/>
					<explorer-tree:type-node code="FredhopperIndexConfig" id="hmc_type_tree_fredhopperconfig"/>
					<explorer-tree:type-node code="MetaAttribute" id="hmc_type_tree_metaattribute"/>
				</explorer-tree:navigation-node>
			</explorer-tree:navigation-node>
		</explorer-tree:explorer-tree>
	</context>

	<context merge-by="type" parent="GenericItem" type="FredhopperIndexConfig" component="listview">
		<list-view:list-view xmlns:list-view="http://www.hybris.com/cockpitng/component/listView">
			<list-view:column qualifier="code"/>
		</list-view:list-view>
	</context>
	<context merge-by="type" parent="GenericItem" type="MetaAttribute" component="listview">
		<list-view:list-view xmlns:list-view="http://www.hybris.com/cockpitng/component/listView">
			<list-view:column qualifier="attributeId"/>
			<list-view:column qualifier="baseType"/>
			<list-view:column qualifier="variantAttribute"/>
		</list-view:list-view>
	</context>

	<context merge-by="type" parent="GenericItem" type="FredhopperIndexConfig" component="base">
	    <y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
	        <y:labels>
	            <y:label>code</y:label>
	        </y:labels>
	    </y:base>
	</context>
	<context merge-by="type" parent="GenericItem" type="FredhopperIndexExportCronJob" component="base">
	    <y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
	        <y:labels>
	            <y:label>code</y:label>
	        </y:labels>
	    </y:base>
	</context>
	<context merge-by="type" parent="GenericItem" type="MetaAttribute" component="base">
	    <y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
	        <y:labels>
	            <y:label>attributeId + ' (' + baseType + ')'</y:label>
	        </y:labels>
	    </y:base>
	</context>

	<context merge-by="type" parent="GenericItem" type="FredhopperIndexConfig" component="editor-area">
        <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
        	<editorArea:tab xmlns="http://www.hybris.com/cockpitng/component/editorArea" name="fredhopper.indexconfig.properties">

        			<attribute qualifier="code"/>
        			<attribute qualifier="locales"/>

        			<attribute qualifier="metaAttributes"/>

			</editorArea:tab>
        </editorArea:editorArea>
    </context>
    <context merge-by="type" parent="CronJob" type="FredhopperIndexExportCronJob" component="editor-area">
        <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
            <editorArea:tab name="hmc.tab.common">
                <editorArea:section name="hmc.section.exportdata">
                    <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="indexConfig"/>
                    <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="upload"/>
                </editorArea:section>
            </editorArea:tab>
        </editorArea:editorArea>
    </context>
    <context merge-by="type" parent="GenericItem" type="MetaAttribute" component="editor-area">
        <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
        	<editorArea:tab xmlns="http://www.hybris.com/cockpitng/component/editorArea" name="fredhopper.metaattribute.properties">

        			<attribute qualifier="attributeId"/>
        			<attribute qualifier="baseType"/>
        			<attribute qualifier="name"/>
        			<attribute qualifier="variantAttribute"/>
        			<attribute qualifier="qualifier"/>
        			<attribute qualifier="classAttributeAssignment"/>
        			<attribute qualifier="provider"/>

        			<attribute qualifier="indexConfigurations"/>

			</editorArea:tab>
        </editorArea:editorArea>
    </context>

</config>


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Moonfish.Forms
{
    public partial class DataMapper : UserControl
    {
        public DataMapper()
        {
            InitializeComponent();
        }
    }
}


text:
package javaXCopied;

/**
 * A CompoundControl, such as a graphic equalizer, provides control
 * over two or more related properties, each of which is itself represented as
 * a Control.
 *
 * @author Kara Kytle
 * @since 1.3
 */
public abstract class CompoundControl extends Control {

    // TYPE DEFINES

    // INSTANCE VARIABLES

    /**
     * The set of member controls.
     */
    private Control[] controls;

    // CONSTRUCTORS

    /**
     * Constructs a new compound control object with the given parameters.
     *
     * @param type the type of control represented this compound control object
     * @param memberControls the set of member controls
     */
    protected CompoundControl(Type type, Control[] memberControls) {

        super(type);
        this.controls = memberControls;
    }

    // METHODS

    /**
     * Returns the set of member controls that comprise the compound control.
     * @return the set of member controls.
     */
    public Control[] getMemberControls() {

        Control[] localArray = new Control[controls.length];

        for (int i = 0; i < controls.length; i++) {
            localArray[i] = controls[i];
        }

        return localArray;
    }

    // ABSTRACT METHOD IMPLEMENTATIONS: CONTROL

    /**
     * Provides a string representation of the control
     * @return a string description
     */
    public String toString() {

        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < controls.length; i++) {
            if (i != 0) {
                buf.append(", ");
                if ((i + 1) == controls.length) {
                    buf.append("and ");
                }
            }
            buf.append(controls[i].getType());
        }

        return new String(getType() + " Control containing " + buf + " Controls.");
    }

    // INNER CLASSES

    /**
     * An instance of the CompoundControl.Type inner class identifies one kind of
     * compound control.  Static instances are provided for the
     * common types.
     *
     * @author Kara Kytle
     * @since 1.3
     */
    public static class Type extends Control.Type {

        // TYPE DEFINES

        // CONSTRUCTOR

        /**
         * Constructs a new compound control type.
         * @param name  the name of the new compound control type
         */
        protected Type(String name) {
            super(name);
        }
    } // class Type

} // class CompoundControl


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
	<persistence-unit name="HallePU">
		<!-- jndi-name -->
	    <jta-data-source>java:jboss/datasources/HalleDS</jta-data-source>
	    <properties>
	      <property name="hibernate.dialect"
	        value="org.hibernate.dialect.MySQLDialect"/>
	      <property name="hibernate.show_sql" value="false"/>
	      <property name="hibernate.hbm2ddl.auto" value="update"/>
	      <property name="hibernate.connection.charSet" value="UTF-8"/>
	    </properties>
    </persistence-unit>
</persistence>


text:
schema: default
title: >-
  Politician Data: Russia — Duma
organization: EveryPolitician
notes: >-
  Data on the people within the Duma legislature of Russia.
resources:
  - name: How To Use The Data
    url: 'http://docs.everypolitician.org/use_the_data.html'
    format: info
  - name: View on EveryPolitician
    url: 'http://everypolitician.org/russia/'
    format: info
  - name: All Data as Popolo JSON
    url: >-
      https://cdn.rawgit.com/everypolitician/everypolitician-data/00ad5ab8c60fa7859ddaf70ff0342b623a1b032d/data/Russia/Duma/ep-popolo-v1.0.json
    format: json
  - name: >-
      7th State Duma of the Russian Federation: From 2016-10-05
    url: >-
      https://cdn.rawgit.com/everypolitician/everypolitician-data/abf3c600f3ca92528b7fffd864c050b57ab8da0c/data/Russia/Duma/term-7.csv
    format: csv
  - name: >-
      6th State Duma of the Russian Federation: 2011-12-21 to 2016-10-05
    url: >-
      https://cdn.rawgit.com/everypolitician/everypolitician-data/abf3c600f3ca92528b7fffd864c050b57ab8da0c/data/Russia/Duma/term-6.csv
    format: csv
  - name: Python
    url: 'https://github.com/everypolitician/everypolitician-popolo-python'
    format: library
  - name: Ruby
    url: 'https://github.com/everypolitician/everypolitician-popolo'
    format: library
  - name: R
    url: 'https://github.com/ajparsons/everypoliticianR'
    format: library
last_modified: 2019-05-07T09:46:56
license: ''
category:
  - Russia
  - People
  - Groups & Bodies
maintainer: EveryPolitician
maintainer_email: team@everypolitician.org
more_info: http://docs.everypolitician.org
---


text:
<?php

namespace Ekyna\Bundle\MediaBundle\Controller\Admin;

use Ekyna\Bundle\AdminBundle\Controller\Resource\TinymceTrait;
use Ekyna\Bundle\AdminBundle\Controller\ResourceController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * Class MediaController
 * @package Ekyna\Bundle\MediaBundle\Controller\Admin
 * @author Étienne Dauvergne <contact@ekyna.com>
 */
class MediaController extends ResourceController
{
    use TinymceTrait;

    /**
     * {@inheritdoc}
     */
    public function listAction(Request $request)
    {
        $this->isGranted('VIEW');

        $context = $this->loadContext($request);

        $response = new Response();

        $format = 'html';
        if ($request->isXmlHttpRequest()) {
            $format = 'xml';
            $response->headers->add([
                'Content-Type' => 'application/xml; charset=' . strtolower($this->get('kernel')->getCharset())
            ]);
        }

        $response->setContent($this->renderView(
            $this->config->getTemplate('list.' . $format),
            $context->getTemplateVars()
        ));

        return $response;
    }
}


text:
importScripts('/bower_components/firebase/firebase-app.js');
importScripts('/bower_components/firebase/firebase-messaging.js');

// Initialize the Firebase app in the service worker by passing in the
// messagingSenderId.
firebase.initializeApp({
  'messagingSenderId': '531391633867'
});

// Retrieve an instance of Firebase Messaging so that it can handle background
// messages.
var messaging = firebase.messaging();

// If you would like to customize notifications that are received in the
// background (Web app is closed or not in browser focus) then you should
// implement this optional method.
// [START background_handler]
messaging.setBackgroundMessageHandler(function(payload) {
  console.log('[firebase-messaging-sw.js] Received background message ', payload);
  // Customize notification here
  var notificationTitle = payload.notification.title;
  var notificationOptions = {
    body: payload.notification.body
  };
  return self.registration.showNotification(notificationTitle,
      notificationOptions);
});
// [END background_handler]


text:
/*

Suga Slider

Usage ---------

$(window).load(function(){
  $('#logos').suga({
    'transitionSpeed': 2000,
    'snap': false
  });
});

The markup should resemble the markup here

*/

$.fn.suga = function(options) {
  var settings = $.extend({
      'transitionSpeed': 500,
      'snap': false
  }, options);

  var $this = $(this);

  // add plugin specific classes
  $this.addClass('suga-slider-wrap');
  $this.children('ul').addClass('suga-slider-group');
  $this.find('li').addClass('suga-slide');

  // caching $$$
  var $slide = $('.suga-slide'),
			$firstEl = $('.suga-slide:first'),
      $group = $('.suga-slider-group'),
      $wrap = $('.suga-slider-wrap');

  var slideWidth = $slide.outerWidth(),
  		slideHeight = $('.suga-slide').height(),
      slideCount = $slide.length,
      totalWidth = slideWidth * slideCount;

  // set width on group element
  $group.width(totalWidth);
  $wrap.height(slideHeight);
  $wrap.wrap('

');

  // add first class at start
  if (!$group.find($firstEl).hasClass("suga-first")) {
    $group.find($firstEl).addClass("suga-first");
  }

  // lets move baby
  var transitionSnap = function() {
    var $firstEl = $group.find('.suga-first').html();

    $group.find('.suga-first').animate({
      'margin-left': '-' + slideWidth + 'px'
    }, function(){
     $group.append('
' + $firstEl + '
');
     $(this).remove();
     $group.find('li:first').addClass("suga-first");

    });
  };

  var transitionScroll = function() {
     var $firstEl = $group.find('.suga-first').html();

    $group.find('.suga-first').animate({
      'margin-left': '-' + slideWidth + 'px'
    }, settings.transitionSpeed, 'linear', function(){
     $group.append('
' + $firstEl + '
');
     $(this).remove();
     $group.find('li:first').addClass("suga-first");
     transitionScroll();
    });
  };

  if (settings.snap) {
    window.setInterval(transitionSnap, settings.transitionSpeed);
  } else {
    transitionScroll();
  }
}

$(window).load(function(){
  $('#networks_slider').suga({
    'transitionSpeed': 2000,
    'snap': true
  });
});


text:
#ifndef __GST_QUARK_H__
#define __GST_QUARK_H__

#include <gst/gst.h>

#include <gst/video/video.h>
#include <gst/video/gstvideofilter.h>

G_BEGIN_DECLS

#define GST_TYPE_QUARKTV \
  (gst_quarktv_get_type())
#define GST_QUARKTV(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QUARKTV,GstQuarkTV))
#define GST_QUARKTV_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QUARKTV,GstQuarkTVClass))
#define GST_IS_QUARKTV(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUARKTV))
#define GST_IS_QUARKTV_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUARKTV))

typedef struct _GstQuarkTV GstQuarkTV;
typedef struct _GstQuarkTVClass GstQuarkTVClass;

struct _GstQuarkTV
{
  GstVideoFilter element;

  /* < private > */
  gint area;
  gint planes;
  gint current_plane;
  GstBuffer **planetable;
};

struct _GstQuarkTVClass
{
  GstVideoFilterClass parent_class;
};

GType gst_quarktv_get_type (void);

G_END_DECLS

#endif /* __GST_QUARK_H__ */


text:
<?php

namespace PHPCR\Shell\Transport;

class TransportRegistry implements TransportRegistryInterface
{
    protected $transports = array();

    public function register(TransportInterface $transport)
    {
        $this->transports[$transport->getname()] = $transport;
    }

    public function getTransportNames()
    {
        return array_keys($this->transports);
    }

    public function getTransport($name)
    {
        return $this->transports[$name];
    }
}


text:
Deface::Override.new(:virtual_path => "spree/shared/_order_details",
                 :name => "remove_order_details_price_header",
                 :remove => "th.price")


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SDialogRepBizPartnerAuxMoves.java
 *
 * Created on 25/01/2012
 */

package erp.mfin.form;

import erp.data.SDataConstants;
import erp.data.SDataConstantsSys;
import erp.data.SDataUtilities;
import erp.lib.SLibConstants;
import erp.lib.SLibTimeUtilities;
import erp.lib.SLibUtilities;
import erp.lib.form.SFormField;
import erp.lib.form.SFormUtilities;
import erp.lib.form.SFormValidation;
import erp.mbps.data.SDataBizPartner;
import erp.mfin.data.SDataAccount;
import erp.mod.bps.db.SBpsUtils;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
import java.awt.event.KeyEvent;
import java.sql.ResultSet;
import java.util.Map;
import java.util.Vector;
import javax.swing.AbstractAction;
import javax.swing.JCheckBox;
import javax.swing.JFormattedTextField;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JasperViewer;
import sa.gui.util.SUtilConsts;

/**
 *
 * @author Juan Barajas
 */
public class SDialogRepBizPartnerJournal extends javax.swing.JDialog implements erp.lib.form.SFormInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener  {

    private int mnFormResult;
    private int mnFormStatus;
    private boolean mbFirstTime;
    private boolean mbResetingForm;
    private java.util.Vector<erp.lib.form.SFormField> mvFields;
    private erp.client.SClientInterface miClient;

    private erp.lib.form.SFormField moFieldDateInitial;
    private erp.lib.form.SFormField moFieldDateEnd;
    private erp.lib.form.SFormField moFieldBizPartner;

    private int mnBizPartnerCategory;
    private int mnOptionPickerId;
    private String msBizPartnerKey;
    private String msBizPartnerCatSng;
    private String msBizPartnerCatPlr;
    private java.lang.String msCurrentFkAccountId;
    private int mnFidCtSysMov;
    private int mnFidTpSysMov;

    private erp.mfin.form.SPanelAccount moPanelFkAccountId;

    /** Creates new form SDialogRepBizPartnerAuxMoves */
    public SDialogRepBizPartnerJournal(erp.client.SClientInterface client, int idBizPartnerCategory) {
        super(client.getFrame(), true);
        miClient = client;
        mnBizPartnerCategory = idBizPartnerCategory;

        initComponents();
        initComponentsExtra();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jbPrint = new javax.swing.JButton();
        jbClose = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jpFilter = new javax.swing.JPanel();
        jpAccount = new javax.swing.JPanel();
        jlDummyAccount = new javax.swing.JLabel();
        jckIsAccount = new javax.swing.JCheckBox();
        jPanel6 = new javax.swing.JPanel();
        jlBizPartner = new javax.swing.JLabel();
        jcbBizPartner = new javax.swing.JComboBox();
        jbBizPartner = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jlDateInitial = new javax.swing.JLabel();
        jftDateInitial = new javax.swing.JFormattedTextField();
        jbDateInitial = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jlDateEnd = new javax.swing.JLabel();
        jftDateEnd = new javax.swing.JFormattedTextField();
        jbDateEnd = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
        });

        jPanel1.setPreferredSize(new java.awt.Dimension(392, 33));
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        jbPrint.setText("Imprimir");
        jbPrint.setToolTipText("[Ctrl + Enter]");
        jbPrint.setPreferredSize(new java.awt.Dimension(75, 23));
        jPanel1.add(jbPrint);

        jbClose.setText("Cerrar");
        jbClose.setToolTipText("[Escape]");
        jbClose.setPreferredSize(new java.awt.Dimension(75, 23));
        jPanel1.add(jbClose);

        getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Configuración del reporte:"));
        jPanel2.setLayout(new java.awt.BorderLayout());

        jpFilter.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros del reporte:"));
        jpFilter.setPreferredSize(new java.awt.Dimension(405, 170));
        jpFilter.setLayout(new java.awt.BorderLayout());

        jpAccount.setPreferredSize(new java.awt.Dimension(130, 80));
        jpAccount.setLayout(new java.awt.BorderLayout());

        jlDummyAccount.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jlDummyAccount.setText("[Panel cuenta contable]");
        jlDummyAccount.setPreferredSize(new java.awt.Dimension(130, 23));
        jpAccount.add(jlDummyAccount, java.awt.BorderLayout.CENTER);

        jckIsAccount.setText("Cta. contable");
        jckIsAccount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jpAccount.add(jckIsAccount, java.awt.BorderLayout.NORTH);

        jpFilter.add(jpAccount, java.awt.BorderLayout.NORTH);

        jPanel6.setPreferredSize(new java.awt.Dimension(135, 50));
        jPanel6.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 2, 2));

        jlBizPartner.setText("Asociado negocios: *");
        jlBizPartner.setPreferredSize(new java.awt.Dimension(150, 23));
        jPanel6.add(jlBizPartner);

        jcbBizPartner.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jcbBizPartner.setPreferredSize(new java.awt.Dimension(265, 23));
        jcbBizPartner.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jcbBizPartnerItemStateChanged(evt);
            }
        });
        jPanel6.add(jcbBizPartner);

        jbBizPartner.setText("jButton1");
        jbBizPartner.setToolTipText("Seleccionar asociado de negocios");
        jbBizPartner.setPreferredSize(new java.awt.Dimension(23, 23));
        jPanel6.add(jbBizPartner);

        jpFilter.add(jPanel6, java.awt.BorderLayout.CENTER);

        jPanel2.add(jpFilter, java.awt.BorderLayout.CENTER);

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Período:"));
        jPanel10.setPreferredSize(new java.awt.Dimension(100, 77));
        jPanel10.setLayout(new java.awt.GridLayout(2, 1, 0, 1));

        jPanel4.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 2, 0));

        jlDateInitial.setText("Fecha inicial: *");
        jlDateInitial.setPreferredSize(new java.awt.Dimension(100, 23));
        jPanel4.add(jlDateInitial);

        jftDateInitial.setText("dd/mm/yyyy");
        jftDateInitial.setPreferredSize(new java.awt.Dimension(75, 23));
        jPanel4.add(jftDateInitial);

        jbDateInitial.setIcon(new javax.swing.ImageIcon(getClass().getResource("/erp/img/cal_date_day.gif"))); // NOI18N
        jbDateInitial.setToolTipText("Seleccionar fecha inicial");
        jbDateInitial.setFocusable(false);
        jbDateInitial.setPreferredSize(new java.awt.Dimension(23, 23));
        jPanel4.add(jbDateInitial);

        jPanel10.add(jPanel4);

        jPanel5.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 2, 0));

        jlDateEnd.setText("Fecha final: *");
        jlDateEnd.setPreferredSize(new java.awt.Dimension(100, 23));
        jPanel5.add(jlDateEnd);

        jftDateEnd.setText("dd/mm/yyyy");
        jftDateEnd.setPreferredSize(new java.awt.Dimension(75, 23));
        jPanel5.add(jftDateEnd);

        jbDateEnd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/erp/img/cal_date_day.gif"))); // NOI18N
        jbDateEnd.setToolTipText("Seleccionar fecha final");
        jbDateEnd.setFocusable(false);
        jbDateEnd.setPreferredSize(new java.awt.Dimension(23, 23));
        jPanel5.add(jbDateEnd);

        jPanel10.add(jPanel5);

        jPanel2.add(jPanel10, java.awt.BorderLayout.NORTH);

        getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);

        setSize(new java.awt.Dimension(484, 333));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
        windowActivated();
    }//GEN-LAST:event_formWindowActivated

    private void jcbBizPartnerItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jcbBizPartnerItemStateChanged
        if (!mbResetingForm) {
        }
    }//GEN-LAST:event_jcbBizPartnerItemStateChanged

    @SuppressWarnings("unchecked")
    private void initComponentsExtra() {
        mvFields = new Vector<>();

        try {
            moPanelFkAccountId = new SPanelAccount(miClient, SDataConstants.FIN_ACC, false, false, false);
        }
        catch (Exception e) {
            SLibUtilities.renderException(this, e);
        }

        jpAccount.remove(jlDummyAccount);
        jpAccount.add(moPanelFkAccountId, BorderLayout.CENTER);

        msBizPartnerCatSng = SBpsUtils.getBizPartnerCategoryName(mnBizPartnerCategory, SUtilConsts.NUM_SNG);
        msBizPartnerCatPlr = SBpsUtils.getBizPartnerCategoryName(mnBizPartnerCategory, SUtilConsts.NUM_PLR);
        jlBizPartner.setText(msBizPartnerCatSng + ": *");
        setTitle("Reporte de auxiliares contables de " + msBizPartnerCatPlr.toLowerCase());

        switch(mnBizPartnerCategory) {
            case SDataConstantsSys.BPSS_CT_BP_CUS:
                mnFidCtSysMov = SDataConstantsSys.FINS_CT_SYS_MOV_BPS;
                mnFidTpSysMov = SDataConstantsSys.BPSS_CT_BP_CUS;
                SFormUtilities.populateComboBox(miClient, jcbBizPartner, mnOptionPickerId = SDataConstants.BPSX_BP_CUS);
                break;
            case SDataConstantsSys.BPSS_CT_BP_SUP:
                mnFidCtSysMov = SDataConstantsSys.FINS_CT_SYS_MOV_BPS;
                mnFidTpSysMov = SDataConstantsSys.BPSS_CT_BP_SUP;
                SFormUtilities.populateComboBox(miClient, jcbBizPartner, mnOptionPickerId = SDataConstants.BPSX_BP_SUP);
                break;
            case SDataConstantsSys.BPSS_CT_BP_DBR:
                mnFidCtSysMov = SDataConstantsSys.FINS_CT_SYS_MOV_BPS;
                mnFidTpSysMov = SDataConstantsSys.BPSS_CT_BP_DBR;
                SFormUtilities.populateComboBox(miClient, jcbBizPartner, mnOptionPickerId = SDataConstants.BPSX_BP_DBR);
                break;
            case SDataConstantsSys.BPSS_CT_BP_CDR:
                mnFidCtSysMov = SDataConstantsSys.FINS_CT_SYS_MOV_BPS;
                mnFidTpSysMov = SDataConstantsSys.BPSS_CT_BP_CDR;
                SFormUtilities.populateComboBox(miClient, jcbBizPartner, mnOptionPickerId = SDataConstants.BPSX_BP_CDR);
                break;
            default:
        }

        moFieldDateInitial = new SFormField(miClient, SLibConstants.DATA_TYPE_DATE, true, jftDateInitial, jlDateInitial);
        moFieldDateInitial.setPickerButton(jbDateInitial);
        moFieldDateEnd = new SFormField(miClient, SLibConstants.DATA_TYPE_DATE, true, jftDateEnd, jlDateEnd);
        moFieldDateEnd.setPickerButton(jbDateEnd);
        moFieldBizPartner = new SFormField(miClient, SLibConstants.DATA_TYPE_KEY, true, jcbBizPartner, jlBizPartner);
        moFieldBizPartner.setPickerButton(jbBizPartner);

        mvFields.add(moFieldDateInitial);
        mvFields.add(moFieldDateEnd);
        mvFields.add(moFieldBizPartner);

        jbPrint.addActionListener(this);
        jbClose.addActionListener(this);
        jbDateInitial.addActionListener(this);
        jbDateEnd.addActionListener(this);
        jbBizPartner.addActionListener(this);
        jckIsAccount.addItemListener(this);

        moPanelFkAccountId.getFieldAccount().getComponent().addFocusListener(this);

        AbstractAction actionOk = new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) { actionPrint(); }
        };

        SFormUtilities.putActionMap(getRootPane(), actionOk, "print", KeyEvent.VK_ENTER, KeyEvent.CTRL_DOWN_MASK);

        AbstractAction action = new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) { actionClose(); }
        };

        SFormUtilities.putActionMap(getRootPane(), action, "close", KeyEvent.VK_ESCAPE, 0);

        formReset();
        actionIsAccount();
        setModalityType(ModalityType.MODELESS);
    }

    private void windowActivated() {
        if (mbFirstTime) {
            mbFirstTime = false;
            jftDateInitial.requestFocus();
        }
    }

    private void actionPrint() {
        Cursor cursor = getCursor();
        SDataBizPartner bizPartner = null;
        SFormValidation validation = formValidate();
        Map<String, Object> map = null;
        JasperPrint jasperPrint = null;
        JasperViewer jasperViewer = null;

        if (validation.getIsError()) {
            if (validation.getComponent() != null) {
                validation.getComponent().requestFocus();
            }
            if (validation.getMessage().length() > 0) {
                miClient.showMsgBoxWarning(validation.getMessage());
            }
        }
        else {
            try {
                setCursor(new Cursor(Cursor.WAIT_CURSOR));

                bizPartner = (SDataBizPartner) SDataUtilities.readRegistry(miClient, SDataConstants.BPSU_BP, moFieldBizPartner.getKeyAsIntArray(), SLibConstants.EXEC_MODE_VERBOSE);

                switch(mnBizPartnerCategory) {
                    case SDataConstantsSys.BPSS_CT_BP_CUS:
                        msBizPartnerKey = bizPartner.getDbmsCategorySettingsCus().getKey();
                        break;
                     case SDataConstantsSys.BPSS_CT_BP_SUP:
                         msBizPartnerKey = bizPartner.getDbmsCategorySettingsSup().getKey();
                         break;
                     case SDataConstantsSys.BPSS_CT_BP_DBR:
                         msBizPartnerKey = bizPartner.getDbmsCategorySettingsDbr().getKey();
                         break;
                     case SDataConstantsSys.BPSS_CT_BP_CDR:
                         msBizPartnerKey = bizPartner.getDbmsCategorySettingsCdr().getKey();
                         break;

                     default:
                 }

                map = miClient.createReportParams();
                map.put("tDtInitial", moFieldDateInitial.getDate());
                map.put("tDtEnd", moFieldDateEnd.getDate());
                map.put("nFidCtSysMov", mnFidCtSysMov);
                map.put("nFidTpSysMov", mnFidTpSysMov);
                map.put("sAccountId", jckIsAccount.isSelected() ? moPanelFkAccountId.getFieldAccount().getString() : "(TODAS)");
                map.put("sWhereAccount", jckIsAccount.isSelected() ? "AND re.fid_acc = '" + moPanelFkAccountId.getFieldAccount().getString() + "' " : "");
                map.put("dOldBalance", readOldBalance(bizPartner.getPkBizPartnerId()));
                map.put("nBizPartnerId", bizPartner.getPkBizPartnerId());
                map.put("sBizPartner", bizPartner.getBizPartner());
                map.put("sBizPartnerKey", msBizPartnerKey);
                map.put("sBizPartnerCat", msBizPartnerCatSng.toUpperCase());
                map.put("sBizPartnerCatPlural", msBizPartnerCatPlr.toUpperCase());

                jasperPrint = SDataUtilities.fillReport(miClient, SDataConstantsSys.REP_FIN_AUX_MOV_BPS, map);
                jasperViewer = new JasperViewer(jasperPrint, false);
                jasperViewer.setTitle(getTitle());
                jasperViewer.setVisible(true);
            }
            catch(Exception e) {
                SLibUtilities.renderException(this, e);
            }
            finally {
                setCursor(cursor);
            }
        }
    }

    @SuppressWarnings("unchecked")
    private double readOldBalance(int nBizPartnerId) {
        double dOldBalance = 0;
        String sql = "";
        ResultSet resulSet = null;

        try {
            sql = "SELECT SUM(IF(r.dt < '" + miClient.getSessionXXX().getFormatters().getDbmsDatetimeFormat().format(moFieldDateInitial.getDate()) + "', re.debit - re.credit, 0)) AS gBalance " +
                    "FROM fin_rec AS r " +
                    "INNER JOIN fin_rec_ety AS re ON r.id_year = re.id_year AND r.id_per = re.id_per AND r.id_bkc = re.id_bkc " +
                    "AND r.id_tp_rec = re.id_tp_rec AND r.id_num = re.id_num AND " +
                    "r.id_year = YEAR('" + miClient.getSessionXXX().getFormatters().getDbmsDatetimeFormat().format(moFieldDateInitial.getDate()) + "') AND r.b_del = 0 AND re.b_del = 0 AND re.fid_bp_nr = " + nBizPartnerId +  " AND " +
                    "re.fid_ct_sys_mov_xxx = " + mnFidCtSysMov + " AND re.fid_tp_sys_mov_xxx = " + mnFidTpSysMov + (jckIsAccount.isSelected() ? " AND re.fid_acc = '" + moPanelFkAccountId.getFieldAccount().getString() + "'" : "");

            resulSet = miClient.getSession().getStatement().executeQuery(sql);
            while (resulSet.next()) {
                dOldBalance = resulSet.getDouble("gBalance");
            }
        }
        catch (Exception e) {
            SLibUtilities.renderException(this, e);
        }

        return dOldBalance;
    }

    private void actionClose() {
        mnFormResult = SLibConstants.FORM_RESULT_CANCEL;
        setVisible(false);
    }

    private void actionDateInitial() {
        miClient.getGuiDatePickerXXX().formReset();
        miClient.getGuiDatePickerXXX().setDate(moFieldDateInitial.getDate());
        miClient.getGuiDatePickerXXX().setVisible(true);

        if (miClient.getGuiDatePickerXXX().getFormResult() == SLibConstants.FORM_RESULT_OK) {
            moFieldDateInitial.setFieldValue(miClient.getGuiDatePickerXXX().getGuiDate());
            jftDateInitial.requestFocus();
        }
    }

    private void actionDateEnd() {
        miClient.getGuiDatePickerXXX().formReset();
        miClient.getGuiDatePickerXXX().setDate(moFieldDateEnd.getDate());
        miClient.getGuiDatePickerXXX().setVisible(true);

        if (miClient.getGuiDatePickerXXX().getFormResult() == SLibConstants.FORM_RESULT_OK) {
            moFieldDateEnd.setFieldValue(miClient.getGuiDatePickerXXX().getGuiDate());
            jftDateEnd.requestFocus();
        }
    }

    private void actionIsAccount() {
        if (jckIsAccount.isSelected()) {
            moPanelFkAccountId.enableFields(true);
            moPanelFkAccountId.resetPanel();
        }
        else {
            moPanelFkAccountId.enableFields(false);
            moPanelFkAccountId.resetPanel();
        }
    }

    private void renderAccountSettings() {
        SDataAccount oAccountMajor = null;

        if (!moPanelFkAccountId.isEmptyAccountId()) {
            oAccountMajor = moPanelFkAccountId.getDataAccountMajor();
        }
    }

    private void actionFkAccountIdFocusGained() {
        if (msCurrentFkAccountId.compareTo(moPanelFkAccountId.getFieldAccount().getString()) != 0) {
            renderAccountSettings();
        }

        msCurrentFkAccountId = moPanelFkAccountId.getFieldAccount().getString();
    }

    private void actionFkAccountIdFocusLost() {
        if (msCurrentFkAccountId.compareTo(moPanelFkAccountId.getFieldAccount().getString()) != 0) {
            renderAccountSettings();
        }
    }

    private void actionBizPartner() {
        miClient.pickOption(mnOptionPickerId, moFieldBizPartner, null);
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JButton jbBizPartner;
    private javax.swing.JButton jbClose;
    private javax.swing.JButton jbDateEnd;
    private javax.swing.JButton jbDateInitial;
    private javax.swing.JButton jbPrint;
    private javax.swing.JComboBox jcbBizPartner;
    private javax.swing.JCheckBox jckIsAccount;
    private javax.swing.JFormattedTextField jftDateEnd;
    private javax.swing.JFormattedTextField jftDateInitial;
    private javax.swing.JLabel jlBizPartner;
    private javax.swing.JLabel jlDateEnd;
    private javax.swing.JLabel jlDateInitial;
    private javax.swing.JLabel jlDummyAccount;
    private javax.swing.JPanel jpAccount;
    private javax.swing.JPanel jpFilter;
    // End of variables declaration//GEN-END:variables

    @Override
    public void formClearRegistry() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void formReset() {
        mnFormResult = SLibConstants.UNDEFINED;
        mnFormStatus = SLibConstants.UNDEFINED;
        mbFirstTime = true;

        for (int i = 0; i < mvFields.size(); i++) {
            ((erp.lib.form.SFormField) mvFields.get(i)).resetField();
        }

        moPanelFkAccountId.resetPanel();
        msCurrentFkAccountId = "";
        jckIsAccount.setSelected(false);

        moFieldDateInitial.setFieldValue(SLibTimeUtilities.getBeginOfMonth(miClient.getSessionXXX().getWorkingDate()));
        moFieldDateEnd.setFieldValue(SLibTimeUtilities.getEndOfMonth(miClient.getSessionXXX().getWorkingDate()));
        mbResetingForm = false;
    }

    @Override
    public void formRefreshCatalogues() {
        mbResetingForm = true;

    }

    @Override
    public erp.lib.form.SFormValidation formValidate() {
        String message = "";
        SFormValidation validation = new SFormValidation();

        for (int i = 0; i < mvFields.size(); i++) {
            if (!((erp.lib.form.SFormField) mvFields.get(i)).validateField()) {
                validation.setIsError(true);
                validation.setComponent(((erp.lib.form.SFormField) mvFields.get(i)).getComponent());
                break;
            }
        }

        if (!validation.getIsError()) {
            if (moFieldDateEnd.getDate().compareTo(moFieldDateInitial.getDate()) < 0) {
                validation.setMessage("La fecha final debe ser mayor o igual a la fecha inicial.");
                validation.setComponent(jftDateEnd);
            }
        }

        if (!validation.getIsError() && jckIsAccount.isSelected()) {
            message = SDataUtilities.validateAccount(miClient, moPanelFkAccountId.getCurrentInputAccount(), moFieldDateInitial.getDate());

            if (message.length() > 0) {
                validation.setMessage(message);
                validation.setComponent(moPanelFkAccountId.getFieldAccount().getComponent());
            }
        }

        return validation;
    }

    @Override
    public void setFormStatus(int status) {
        mnFormStatus = status;
    }

    @Override
    public void setFormVisible(boolean visible) {
        setVisible(visible);
    }

    @Override
    public int getFormStatus() {
        return mnFormStatus;
    }

    @Override
    public int getFormResult() {
        return mnFormResult;
    }

    @Override
    public void setRegistry(erp.lib.data.SDataRegistry registry) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public erp.lib.data.SDataRegistry getRegistry() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setValue(int type, java.lang.Object value) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public java.lang.Object getValue(int type) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public javax.swing.JLabel getTimeoutLabel() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void actionPerformed(java.awt.event.ActionEvent e) {
        if (e.getSource() instanceof javax.swing.JButton) {
            javax.swing.JButton button = (javax.swing.JButton) e.getSource();

            if (button == jbPrint) {
                actionPrint();
            }
            else if (button == jbClose) {
                actionClose();
            }
            else if (button == jbDateInitial) {
                actionDateInitial();
            }
            else if (button == jbDateEnd) {
                actionDateEnd();
            }
            else if (button == jbBizPartner) {
                actionBizPartner();
            }
        }
    }

    public void setBizPartnerCategory(int n) { mnBizPartnerCategory = n; }

    @Override
    public void focusGained(FocusEvent e) {
        if (e.getSource() instanceof javax.swing.JFormattedTextField) {
            JFormattedTextField formattedTextField = (JFormattedTextField) e.getSource();

            if (formattedTextField == moPanelFkAccountId.getFieldAccount().getComponent()) {
                actionFkAccountIdFocusGained();
            }
        }
    }

    @Override
    public void focusLost(FocusEvent e) {
        if (e.getSource() instanceof javax.swing.JFormattedTextField) {
            JFormattedTextField formattedTextField = (JFormattedTextField) e.getSource();

            if (formattedTextField == moPanelFkAccountId.getFieldAccount().getComponent()) {
                actionFkAccountIdFocusLost();
            }
        }
    }

    @Override
    public void itemStateChanged(ItemEvent e) {
        if (e.getSource() instanceof JCheckBox) {
            JCheckBox checkBox = (JCheckBox) e.getSource();

            if (checkBox == jckIsAccount) {
                actionIsAccount();
            }
        }
    }
}


text:
\newpage
\section{Установка}\label{section_install}

Если вы хотите только пользоваться библиотекой, то вам нужна из всего проекта только папки \textbf{\_library}, в которой располагается собранная библиотека и справка по ней, и папка \textbf{demo}, в которой находится программа с демонстрацией работы функций. Все остальные папки вам потребуются, если вы хотите добавлять новые функции.

\subsection{Общий алгоритм подключения}

\begin{itemize}
\item Скопируем себе папку \textbf{\_library} с готовой последней версией библиотеки на сайте проекта \href{https://github.com/Harrix/HarrixMathLibrary}{https://github.com/Harrix/HarrixMathLibrary}.

\item Скопируем файлы \textbf{HarrixMathLibrary.cpp}, \textbf{HarrixMathLibrary.h}, \textbf{mtrand.cpp}, \textbf{mtrand.h} в папку с Вашим проектом на C++.

\item Пропишем в проекте:
\begin{lstlisting}[label=install_01,caption=Подключение библиотеки]
#include "HarrixMathLibrary.h"
\end{lstlisting}

\item Если планируем использовать функции, использующие случайные числа (если не знаем, то тоже сделаем), то в начале программы вызовем:
\begin{lstlisting}[label=install_02,caption=Инициализация генератора случайных чисел]
HML_SeedRandom();//Инициализировали генератор случайных чисел
\end{lstlisting}

\item Теперь библиотека готова к работе, и можем ее использовать. Например:
\begin{lstlisting}[label=install_03,caption=Пример использования]
double x;
x=HML_RandomNumber();
double degree=HML_DegToRad(60);
\end{lstlisting}
\end{itemize}

\subsection{Подключение к Qt на примере Qt 5.4.0}

Рассматривается на примере создания Qt Gui Application в Qt 5.4.0 for Desktop (MinGW 4.91) с использованием Qt Creator 3.0.0.

\begin{itemize}
\item Скопируем себе папку \textbf{\_library} с готовой последней версией библиотеки на сайте проекта \href{https://github.com/Harrix/HarrixMathLibrary}{https://github.com/Harrix/HarrixMathLibrary}.

\item Скопируем файлы \textbf{HarrixMathLibrary.cpp}, \textbf{HarrixMathLibrary.h}, \textbf{mtrand.cpp}, \textbf{mtrand.h} в папку с Вашим проектом на C++ там, где находится файл проекта *.pro.

\item Добавим к проекту файлы \textbf{HarrixMathLibrary.cpp}, \textbf{HarrixMathLibrary.h}, \textbf{mtrand.cpp}, \textbf{mtrand.h}. Для этого по проекту в Qt Creator щелкнем правой кнопкой и вызовем команду \textbf{Add Existings Files...}, где выберем наши файлы.

\item Пропишем в главном файле исходников проекта \textbf{mainwindow.cpp}:
\begin{lstlisting}[label=install_01_qt,caption=Подключение библиотеки]
#include "HarrixMathLibrary.h"
\end{lstlisting}

\item Если планируем использовать функции, использующие случайные числа (если не знаем, то тоже сделаем), то в начале программы в конструкторе \textbf{MainWindow::MainWindow} вызовем:
\begin{lstlisting}[label=install_02_qt,caption=Инициализация генератора случайных чисел]
HML_SeedRandom();//Инициализировали генератор случайных чисел
\end{lstlisting}

То есть получится код:
\begin{lstlisting}[label=install_03_qt,caption=Пример файла mainwindow.cpp с подключенной библиотекой]
#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "HarrixMathLibrary.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    HML_SeedRandom();//Инициализировали генератор случайных чисел
}

MainWindow::~MainWindow()
{
    delete ui;
}
\end{lstlisting}

\item Теперь библиотека готова к работе, и можем ее использовать. Например, добавим textEdit, pushButton и напишем слот кнопки:
\begin{lstlisting}[label=install_04_qt,caption=Пример использования]
void MainWindow::on_pushButton_clicked()
{
    double x;
    x=HML_RandomNumber();
    double degree=HML_DegToRad(60);
}
\end{lstlisting}
\end{itemize}

\subsection{Подключение к C++ Builder на примере C++ Builder 6.0}
\begin{itemize}
\item Скопируем себе папку \textbf{\_library} с готовой последней версией библиотеки на сайте проекта \href{https://github.com/Harrix/HarrixMathLibrary}{https://github.com/Harrix/HarrixMathLibrary}.

\item Скопируем файлы \textbf{HarrixMathLibrary.cpp}, \textbf{HarrixMathLibrary.h}, \textbf{mtrand.cpp}, \textbf{mtrand.h} в папку с проектом на C++.

\item Пропишем проекте в файле \textbf{.cpp} главной формы (часто это \textbf{Unit1.cpp}) строчку \textbf{\#include "HarrixMathLibrary.h"}:
\begin{lstlisting}[label=install_code_01,caption=Подключение библиотеки]
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "HarrixMathLibrary.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
...
\end{lstlisting}

\item Добавим в проект файлы \textbf{HarrixMathLibrary.cpp} и \textbf{mtrand.cpp} через команду: \textbf{Project} $\rightarrow$ \textbf{Add to Project\dots}.

\item Если планируем использовать функции, использующие случайные числа (если не знаем, то тоже сделаем), то в конструкторе главной формы инициализируем генератор случайных чисел:
\begin{lstlisting}[label=install_code_02,caption=Инициализация генератора случайных чисел]
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
HML_SeedRandom();//Инициализировали генератор случайных чисел
...
}
//---------------------------------------------------------------------------
\end{lstlisting}

\item Теперь библиотека готова к работе, и можем ее использовать. Например, создадим кнопку Button1, текстовое поле Memo1 и в клике на Button1 пропишем:
\begin{lstlisting}[label=install_code_03,caption=Пример использования]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
double x=HML_RandomNumber();//получим случайное число
Memo1->Lines->Add("x = "+AnsiString(x));//выведем его
}
//---------------------------------------------------------------------------
\end{lstlisting}
\end{itemize}

\subsection{Подключение к C++ Builder на примере C++Builder XE4}
\begin{itemize}
\item Скопируем себе папку \textbf{\_library} с готовой последней версией библиотеки на сайте проекта \href{https://github.com/Harrix/HarrixMathLibrary}{https://github.com/Harrix/HarrixMathLibrary}.

\item Скопируем файлы \textbf{HarrixMathLibrary.cpp}, \textbf{HarrixMathLibrary.h}, \textbf{mtrand.cpp}, \textbf{mtrand.h} в папку с проектом на C++.

\item Пропишем проекте в файле \textbf{.cpp} главной формы (часто это \textbf{Unit1.cpp}) строчку \textbf{\#include "HarrixMathLibrary.h"}:
\begin{lstlisting}[label=install_code_04,caption=Подключение библиотеки]
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "HarrixMathLibrary.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
...
\end{lstlisting}

\item Добавим в проект файлы \textbf{HarrixMathLibrary.cpp} и \textbf{mtrand.cpp} через команду: \textbf{Project} $\rightarrow$ \textbf{Add to Project\dots}.

\item Если планируем использовать функции, использующие случайные числа (если не знаем, то тоже сделаем), то в конструкторе главной формы инициализируем генератор случайных чисел:
\begin{lstlisting}[label=install_code_05,caption=Инициализация генератора случайных чисел]
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
HML_SeedRandom();//Инициализировали генератор случайных чисел
...
}
//---------------------------------------------------------------------------
\end{lstlisting}

\item Теперь библиотека готова к работе, и можем ее использовать. Например, создадим кнопку Button1, текстовое поле Memo1 и в клике на Button1 пропишем:
\begin{lstlisting}[label=install_code_06,caption=Пример использования]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
double x=HML_RandomNumber();//получим случайное число
Memo1->Lines->Add("x = "+AnsiString(x));//выведем его
}
//---------------------------------------------------------------------------
\end{lstlisting}
\end{itemize}

\subsection{Подключение к Microsoft Visual Studio на примере Visual Studio 2013}

Используется СLR приложение Windows Forms Application (точнее пустой проект, к которому прикреплена форма) на Visual C++.

\begin{itemize}
\item Скопируем себе папку \textbf{\_library} с готовой последней версией библиотеки на сайте проекта \href{https://github.com/Harrix/HarrixMathLibrary}{https://github.com/Harrix/HarrixMathLibrary}.

\item Скопируем файлы \textbf{HarrixMathLibrary.cpp}, \textbf{HarrixMathLibrary.h}, \textbf{mtrand.cpp}, \textbf{mtrand.h} в папку с проектом *.vcxproj на C++.

\item Пропишем проекте в файле \textbf{.h} главной формы (у меня это \textbf{MyForm.h}) строчку \textbf{\#include "HarrixMathLibrary.h"}:
\begin{lstlisting}[label=install_code_07,caption=Подключение библиотеки]
#pragma once
#include "HarrixMathLibrary.h"
...
\end{lstlisting}

\item Добавим в проект файлы \textbf{HarrixMathLibrary.cpp} и \textbf{mtrand.cpp} через правый клик по проекту: \textbf{Добавить} $\rightarrow$ \textbf{Существующий элемент Shift+Alt+A}.

\item Если планируем использовать функции, использующие случайные числа (если не знаем, то тоже сделаем), то в конструкторе главной формы инициализируем генератор случайных чисел:
\begin{lstlisting}[label=install_code_08,caption=Инициализация генератора случайных чисел]
	public ref class MyForm : public System::Windows::Forms::Form
	{
	public:
		MyForm(void)
		{
			HML_SeedRandom();//Инициализировали генератор случайных чисел
			InitializeComponent();
			//
			//TODO: добавьте код конструктора
			//
		}
...
\end{lstlisting}

\item Теперь библиотека готова к работе, и можем ее использовать. Например, создадим кнопку button1 и listBox1 и в клике на button1 пропишем:
\begin{lstlisting}[label=install_code_09,caption=Пример использования]
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
 		double x=HML_RandomNumber();//получим случайное число
 		listBox1->Items->Add("x = " + x.ToString());//выведем его
 		 }
\end{lstlisting}
\end{itemize}

Как видите, алгоритм подключения почти одинаков.


text:
<!DOCTYPE html>

<link rel="import" href="../polymer_collapse/polymer_collapse.html">

<polymer-element name="polymer-ui-collapsible" attributes="active notap">
  <template>
    <link rel="stylesheet" href="polymer_ui_collapsible_old.css">
    <link rel="stylesheet" href="polymer_ui_collapsible.css">

      <template if="{{active}}">
      -
      </template>
      <template if="{{!active}}">
      +
      </template>

      <content select=".polymer-ui-collapsible-header"></content>

        <content></content>

    <polymer-collapse targetId="collapsibleBody" closed="{{!active}}"></polymer-collapse>
  </template>

</polymer-element>


text:
package TBBTestSuite::TestSuite::BrowserBundleHardening;

use TBBTestSuite::Tests::Command qw(command_run);

use parent 'TBBTestSuite::TestSuite::BrowserBundleTests';

sub description {
    'Tor Browser Bundle Hardening checks';
}

sub type {
    'browserbundle_hardening';
}

sub new {
    my ($ts, $testsuite) = @_;
    return undef unless $testsuite->{os} ne 'MacOSX';
    $testsuite->{type} = $ts->type();
    $testsuite->{tests} = [

        # Windows tests
        {
            name         => 'win_DEP_ASLR',
            type         => 'command',
            retry        => 1,
            descr        => 'Check DEP/ASLR',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ "$FindBin::Bin/data/check-windows-dep-aslr" ],
            enable       => sub { $_[0]->{os} eq 'Windows' },
            # ticket 16417
            skip_files   => [ qw(
                TorBrowser/Tor/PluggableTransports/_ctypes.pyd
                TorBrowser/Tor/PluggableTransports/_hashlib.pyd
                TorBrowser/Tor/PluggableTransports/_socket.pyd
                TorBrowser/Tor/PluggableTransports/_ssl.pyd
                TorBrowser/Tor/PluggableTransports/bz2.pyd
                TorBrowser/Tor/PluggableTransports/Crypto.Cipher._AES.pyd
                TorBrowser/Tor/PluggableTransports/Crypto.Hash._SHA256.pyd
                TorBrowser/Tor/PluggableTransports/Crypto.Hash._SHA512.pyd
                TorBrowser/Tor/PluggableTransports/Crypto.Random.OSRNG.winrandom.pyd
                TorBrowser/Tor/PluggableTransports/Crypto.Util._counter.pyd
                TorBrowser/Tor/PluggableTransports/Crypto.Util.strxor.pyd
                TorBrowser/Tor/PluggableTransports/flashproxy-client.exe
                TorBrowser/Tor/PluggableTransports/flashproxy-reg-appspot.exe
                TorBrowser/Tor/PluggableTransports/flashproxy-reg-email.exe
                TorBrowser/Tor/PluggableTransports/flashproxy-reg-http.exe
                TorBrowser/Tor/PluggableTransports/flashproxy-reg-url.exe
                TorBrowser/Tor/PluggableTransports/fte.cDFA.pyd
                TorBrowser/Tor/PluggableTransports/fteproxy.exe
                TorBrowser/Tor/PluggableTransports/M2Crypto.__m2crypto.pyd
                TorBrowser/Tor/PluggableTransports/meek-client-torbrowser.exe
                TorBrowser/Tor/PluggableTransports/meek-client.exe
                TorBrowser/Tor/PluggableTransports/obfs4proxy.exe
                TorBrowser/Tor/PluggableTransports/obfsproxy.exe
                TorBrowser/Tor/PluggableTransports/pyexpat.pyd
                TorBrowser/Tor/PluggableTransports/python27.dll
                TorBrowser/Tor/PluggableTransports/select.pyd
                TorBrowser/Tor/PluggableTransports/terminateprocess-buffer.exe
                TorBrowser/Tor/PluggableTransports/unicodedata.pyd
                TorBrowser/Tor/PluggableTransports/w9xpopen.exe
                TorBrowser/Tor/PluggableTransports/zope.interface._zope_interface_coptimizations.pyd
                ) ],
        },

        # Linux Tests
        {
            name         => 'readelf_RELRO',
            type         => 'command',
            retry        => 1,
            descr        => 'Check if binaries are RELocation Read-Only',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ 'readelf', '-ld' ],
            check_output => sub { ( $_[0] =~ m/GNU_RELRO/ )
                                        && ( $_[0] =~ m/BIND_NOW/ ) },
            enable       => sub { $_[0]->{os} eq 'Linux' },
            skip_files   => [ qw(
                TorBrowser/Tor/PluggableTransports/meek-client
                TorBrowser/Tor/PluggableTransports/meek-client-torbrowser
                TorBrowser/Tor/PluggableTransports/meek-client-torbrowser
                TorBrowser/Tor/PluggableTransports/obfs4proxy
                ) ],

        },
        {
            name         => 'readelf_stack_canary',
            type         => 'command',
            retry        => 1,
            descr        => 'Check for stack canary support',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ 'readelf', '-s' ],
            check_output => sub { $_[0] =~ m/__stack_chk_fail/ },
            enable       => sub { $_[0]->{os} eq 'Linux' },
            # ticket 13056
            skip_files   => [ qw(
                libmozalloc.so
                libnssckbi.so
                libplc4.so
                libplds4.so
                TorBrowser/Tor/libstdc++.so.6
                TorBrowser/Tor/PluggableTransports/Crypto/Cipher/_ARC4.so
                TorBrowser/Tor/PluggableTransports/Crypto/Cipher/_XOR.so
                TorBrowser/Tor/PluggableTransports/Crypto/Util/_counter.so
                TorBrowser/Tor/PluggableTransports/fte/cDFA.so
                TorBrowser/Tor/PluggableTransports/meek-client-torbrowser
                TorBrowser/Tor/PluggableTransports/twisted/python/_initgroups.so
                TorBrowser/Tor/PluggableTransports/twisted/runner/portmap.so
                TorBrowser/Tor/PluggableTransports/twisted/test/raiser.so
                TorBrowser/Tor/PluggableTransports/zope/interface/_zope_interface_coptimizations.so
                TorBrowser/Tor/PluggableTransports/meek-client
                TorBrowser/Tor/PluggableTransports/obfs4proxy
                ) ],
        },
        {
            name         => 'readelf_NX',
            type         => 'command',
            retry        => 1,
            descr        => 'Check for NX support',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ 'readelf', '-W', '-l' ],
            check_output => sub { ! ($_[0] =~ m/GNU_STACK.+RWE/) },
            enable       => sub { $_[0]->{os} eq 'Linux' },
        },
        {
            name         => 'readelf_PIE',
            type         => 'command',
            retry        => 1,
            descr        => 'Check for PIE support',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ 'readelf', '-h' ],
            check_output => sub { $_[0] =~ m/Type:\s+DYN/ },
            enable       => sub { $_[0]->{os} eq 'Linux' },
            skip_files   => [ qw(
                TorBrowser/Tor/PluggableTransports/meek-client
                TorBrowser/Tor/PluggableTransports/meek-client-torbrowser
                TorBrowser/Tor/PluggableTransports/obfs4proxy
                ) ],
        },
        {
            name         => 'readelf_no_rpath',
            type         => 'command',
            retry        => 1,
            descr        => 'Check for no rpath',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ 'readelf', '-d' ],
            check_output => sub { ! ( $_[0] =~ m/RPATH/ ) },
            enable       => sub { $_[0]->{os} eq 'Linux' },
        },
        {
            name         => 'readelf_no_runpath',
            type         => 'command',
            retry        => 1,
            descr        => 'Check for no runpath',
            files        => \&TBBTestSuite::TestSuite::BrowserBundleTests::tbb_binfiles,
            command      => [ 'readelf', '-d' ],
            check_output => sub { ! ( $_[0] =~ m/runpath/ ) },
            enable       => sub { $_[0]->{os} eq 'Linux' },
        },
    ];
    return bless $testsuite;
}

1;


text:
require 'puppetlabs_spec_helper/module_spec_helper'

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))

RSpec.configure do |c|
  c.module_path = File.join(fixture_path, 'modules')
  c.manifest_dir = File.join(fixture_path, 'manifests')

  c.default_facts = {
    :kernel          => 'Linux',
    :concat_basedir  => '/var/lib/puppet/concat',
    :puppetversion   => ENV['PUPPET_VERSION'] || Puppet.version
  }
end

at_exit { RSpec::Puppet::Coverage.report! }

SUPPORTED_BACKENDS = [
  'lmdb',
  'gmysql',
  'pipe',
  'gpgsql',
  'gsqlite3',
  'tinydns',
]


text:
require 'date'
require 'time'

# Gigasecond
class Gigasecond
  def self.from(date)
    (date.to_time + 10**9).to_date
  end
end


text:
require 'spec_helper'

describe Tutor::Attributes::Attribute do
  context "has instance behavior" do
    subject { instance }
    let(:instance) { described_class.new(name, options) }
    let(:name) { :test }
    let(:options) { {} }

    let(:klass) { stub_const "TestClass", Class.new; TestClass }

    describe "#initialize" do
      context "given no options" do
        it { expect(subject.name).to eq(name) }
        it { expect(subject.type).to be nil }
        it { expect(subject.nullable).to be true }
        it { expect(subject.default).to be nil }
        it { expect(subject.override).to be false }
        it { expect(subject.alias).to be nil }
        it { expect(subject.get).to be_a_kind_of(Tutor::Attributes::Blocks::Instance::Reader) }
        it { expect(subject.set).to be_a_kind_of(Tutor::Attributes::Blocks::Instance::Writer) }
      end
      context "given an alias option" do
        let(:aliased_name) { :aliased_method }
        let(:options) { { alias: aliased_name} }
        it { expect(subject.get).to be_a_kind_of(Tutor::Attributes::Blocks::Alias::Reader) }
        it { expect(subject.set).to be_a_kind_of(Tutor::Attributes::Blocks::Alias::Writer) }
      end
      context "given a get option" do
        let(:custom_block) { lambda { } }
        let(:options) { { get: custom_block } }
        it { expect(subject.get).to be_a_kind_of(Tutor::Attributes::Block) }
        it { expect(subject.get.block).to eq(custom_block) }
      end
      context "given a set option" do
        let(:custom_block) { lambda { } }
        let(:options) { { set: custom_block } }
        it { expect(subject.set).to be_a_kind_of(Tutor::Attributes::Block) }
        it { expect(subject.set.block).to eq(custom_block) }
      end
      context "given an override option" do
        let(:value) { double(:override_value) }
        let(:options) { { override: value } }
        it { expect(subject.override).to be value }
      end
      context "given a default option" do
        let(:value) { double(:default_value) }
        let(:options) { { default: value } }
        it { expect(subject.default).to be value }
      end
    end

    describe "#add_attribute_methods" do
      subject { super().add_attribute_methods(klass) }
      let(:klass) { stub_const "TestClass", Class.new; TestClass }

      it { is_expected.to be_a_kind_of(Array) }
      it { is_expected.to have(2).items }
      it do
        expect(instance).to receive(:add_reader_method).with(klass)
        expect(instance).to receive(:add_writer_method).with(klass)
        subject
      end

      context "when the name conflicts with an existing method" do
        let(:proxy) { double('proxy') }
        let(:existing_method_body) { Proc.new { proxy.invoked } }
        before(:each) { klass.send(:define_method, name, &existing_method_body) }

        it do
          count = 0
          allow_any_instance_of(Tutor::Attributes::Method).to receive(:define_on).with(klass, override: false) { count += 1 }
          subject
          expect(count).to eq(2)
        end
        context "but the override option has been set" do
          let(:options) { { override: true } }
          it do
            count = 0
            allow_any_instance_of(Tutor::Attributes::Method).to receive(:define_on).with(klass, override: true) { count += 1 }
            subject
            expect(count).to eq(2)
          end
        end
      end
    end

    shared_examples_for "a method adder" do |name, custom_attribute|
      it { is_expected.to be_a_kind_of(Tutor::Attributes::Method) }
      it { subject; expect(klass.method_defined?(name)).to be true }
      context "with a custom method" do
        let(:options) { { custom_attribute => custom_block } }
        let(:custom_block) { lambda { } }
        it { expect(subject.body).to be_a_kind_of(Tutor::Attributes::Block) }
        it { expect(subject.body.block).to eq(custom_block) }
        context "with given false" do
          let(:custom_block) { false }
          it { is_expected.to be nil }
        end
        context "with given nil" do
          let(:custom_block) { nil }
          it { is_expected.to be nil }
        end
      end
    end

    describe "#add_reader_method" do
      subject { super().add_reader_method(klass) }
      it { method = subject; expect(instance.reader_method).to eq(method) }
      it_behaves_like "a method adder", :test, :get
    end

    describe "#add_writer_method" do
      subject { super().add_writer_method(klass) }
      it { method = subject; expect(instance.writer_method).to eq(method) }
      it_behaves_like "a method adder",:test=, :set
    end
  end
end


text:
{% extends "admin/filer_gui/inlines/multiupload_inline.html" %}

{% block django_inline %}{% include 'admin/edit_inline/stacked.html' %}{% endblock %}


text:
import blackmamba.ide.source as source
import console

def main():
    try:
        input = console.input_alert('Jump to line...', 'Empty (or invalid) value  to dismiss.')
        source.scroll_to_line(int(input))
    except ValueError:
        # Invalid input value (not int)
        pass
    except KeyboardInterrupt:
        # Cancel button
        pass

if __name__ == '__main__':
    main()


text:
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets */

/**
 *  Utilities functions related to string manipulation
 *
 */
define(function (require, exports, module) {
    "use strict";

    var _ = require("lodash");

    /**
     * Format a string by replacing placeholder symbols with passed in arguments.
     *
     * Example: var formatted = StringUtils.format("Hello {0}", "World");
     *
     * @param {string} str The base string
     * @param {...} Arguments to be substituted into the string
     *
     * @return {string} Formatted string
     */
    function format(str) {
        // arguments[0] is the base string, so we need to adjust index values here
        var args = [].slice.call(arguments, 1);
        return str.replace(/\{(\d+)\}/g, function (match, num) {
            return typeof args[num] !== "undefined" ? args[num] : match;
        });
    }

    /**
     * @deprecated
     */
    function htmlEscape(str) {
        console.warn("StringUtils.htmlEscape is deprecated. Use _.escape instead.");
        return _.escape(str);
    }

    function regexEscape(str) {
        return str.replace(/([.?*+\^$\[\]\\(){}|\-])/g, "\\$1");
    }

    // Periods (aka "dots") are allowed in HTML identifiers, but jQuery interprets
    // them as the start of a class selector, so they need to be escaped
    function jQueryIdEscape(str) {
        return str.replace(/\./g, "\\.");
    }

    /**
     * Splits the text by new line characters and returns an array of lines
     * @param {string} text
     * @return {Array.<string>} lines
     */
    function getLines(text) {
        return text.split("\n");
    }

    /**
     * Returns a line number corresponding to an offset in some text. The text can
     * be specified as a single string or as an array of strings that correspond to
     * the lines of the string.
     *
     * Specify the text in lines when repeatedly calling the function on the same
     * text in a loop. Use getLines() to divide the text into lines, then repeatedly call
     * this function to compute a line number from the offset.
     *
     * @param {string | Array.<string>} textOrLines - string or array of lines from which
     *      to compute the line number from the offset
     * @param {number} offset
     * @return {number} line number
     */
    function offsetToLineNum(textOrLines, offset) {
        if (Array.isArray(textOrLines)) {
            var lines = textOrLines,
                total = 0,
                line;
            for (line = 0; line < lines.length; line++) {
                if (total < offset) {
                    // add 1 per line since /n were removed by splitting, but they needed to
                    // contribute to the total offset count
                    total += lines[line].length + 1;
                } else if (total === offset) {
                    return line;
                } else {
                    return line - 1;
                }
            }

            // if offset is NOT over the total then offset is in the last line
            if (offset <= total) {
                return line - 1;
            } else {
                return undefined;
            }
        } else {
            return textOrLines.substr(0, offset).split("\n").length - 1;
        }
    }

    /**
     * Returns true if the given string ends with the given suffix.
     *
     * @param {string} str
     * @param {string} suffix
     */
    function endsWith(str, suffix) {
        return str.indexOf(suffix, str.length - suffix.length) !== -1;
    }

    function urlSort(a, b) {
        var a2, b2;
        function isFile(s) {
            return ((s.lastIndexOf("/") + 1) < s.length);
        }

        if (brackets.platform === "win") {
            // Windows: prepend folder names with a '0' and file names with a '1' so folders are listed first
            a2 = ((isFile(a)) ? "1" : "0") + a.toLowerCase();
            b2 = ((isFile(b)) ? "1" : "0") + b.toLowerCase();
        } else {
            a2 = a.toLowerCase();
            b2 = b.toLowerCase();
        }

        if (a2 === b2) {
            return 0;
        } else {
            return (a2 > b2) ? 1 : -1;
        }
    }

    /**
     * Return an escaped path or URL string that can be broken near path separators.
     * @param {string} url the path or URL to format
     * @return {string} the formatted path or URL
     */
    function breakableUrl(url) {
        // This is for displaying in UI, so always want it escaped
        var escUrl = _.escape(url);

        // Inject zero-width space character (U+200B) near path separators (/) to allow line breaking there
        return escUrl.replace(
            new RegExp(regexEscape("/"), "g"),
            "/" + ""
        );
    }

    /**
     * Convert number of bytes into human readable format.
     * If param bytes is negative it returns the number without any changes.
     *
     * @param number bytes     Number of bytes to convert
     * @param number precision Number of digits after the decimal separator
     * @return string
     */
    function prettyPrintBytes(bytes, precision) {
        var kilobyte = 1024,
            megabyte = kilobyte * 1024,
            gigabyte = megabyte * 1024,
            terabyte = gigabyte * 1024,
            returnVal = bytes;

        if ((bytes >= 0) && (bytes < kilobyte)) {
            returnVal = bytes + " B";
        } else if (bytes < megabyte) {
            returnVal = (bytes / kilobyte).toFixed(precision) + " KB";
        } else if (bytes < gigabyte) {
            returnVal = (bytes / megabyte).toFixed(precision) + " MB";
        } else if (bytes < terabyte) {
            returnVal = (bytes / gigabyte).toFixed(precision) + " GB";
        } else if (bytes >= terabyte) {
            return (bytes / terabyte).toFixed(precision) + " TB";
        }

        return returnVal;
    }

    // Define public API
    exports.format              = format;
    exports.htmlEscape          = htmlEscape;
    exports.regexEscape         = regexEscape;
    exports.jQueryIdEscape      = jQueryIdEscape;
    exports.getLines            = getLines;
    exports.offsetToLineNum     = offsetToLineNum;
    exports.urlSort             = urlSort;
    exports.breakableUrl        = breakableUrl;
    exports.endsWith            = endsWith;
    exports.prettyPrintBytes    = prettyPrintBytes;
});