text:
jQuery(document).ready (function($)
	{
		var esc_attr = esc_html = function(string/* Convert special characters. */)
		{
			if(/[&\<\>"']/.test(string = String(string)))
				string = string.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'),
					string = string.replace(/"/g, '"').replace(/'/g, ''');
			return string;
		};
		if (location.href.match (/page\=ws-plugin--s2member-pro-clickbank-ops/))
			{
				$('select#ws-plugin--s2member-auto-eot-system-enabled').change (function()
					{
						var $this = $(this), val = $this.val ();
						var $viaCron = $('p#ws-plugin--s2member-auto-eot-system-enabled-via-cron');

						if /* Display Cron instructions. */ (val == 2)
							$viaCron.show ();
						else // Hide instructions.
							$viaCron.hide ();
					});
			}
		else if (location.href.match (/page\=ws-plugin--s2member-pro-clickbank-buttons/))
			{
				$('div.ws-menu-page select[id]').filter ( /* Filter all select elements with an id. */function()
					{
						return this.id.match (/^ws-plugin--s2member-pro-level[1-9][0-9]*-type$/);
					}).change (function()
					{
						var button = this.id.replace (/^ws-plugin--s2member-pro-(.+?)-type$/g, '$1');

						var termDisabled = ($(this).val () === 'recurring') ? true : false;
						var periodsDisabled = ($(this).val () === 'standard') ? true : false;

						$('p#ws-plugin--s2member-pro-' + button + '-term-line').css ('display', (termDisabled ? 'none' : ''));
						$('p#ws-plugin--s2member-pro-' + button + '-periods-line').css ('display', (periodsDisabled ? 'none' : ''));

						(termDisabled) ? $('select#ws-plugin--s2member-pro-' + button + '-term').val ('1-M') : null;
						(periodsDisabled) ? $('select#ws-plugin--s2member-pro-' + button + '-p1').val ('0-D') : null;
						(periodsDisabled) ? $('select#ws-plugin--s2member-pro-' + button + '-p3').val ('1-M') : null;

					}).trigger ('change');

				$('div.ws-menu-page input[id]').filter ( /* Filter all input elements with an id. */function()
					{
						return this.id.match (/^ws-plugin--s2member-pro-(level[1-9][0-9]*|ccap)-ccaps$/);
					}).keyup (function()
					{
						var value = this.value.replace (/^(-all|-al|-a|-)[;,]*/gi, ''), _all = (this.value.match (/^(-all|-al|-a|-)[;,]*/i)) ? '-all,' : '';
						if /* Only if there is a problem with the actual values; because this causes interruptions. */ (value.match (/[^a-z_0-9,]/))
							this.value = _all + $.trim ($.trim (value).replace (/[ \-]/g, '_').replace (/[^a-z_0-9,]/gi, '').toLowerCase ());
					});
				ws_plugin__s2member_pro_clickbankButtonGenerate = /* Handles ClickBank Button Generation. */ function(button)
					{
						var shortCodeTemplate = '[s2Member-Pro-ClickBank-Button %%attrs%% image="default" output="anchor" /]', shortCodeTemplateAttrs = '', labels = {};

						var vendor = '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_username"]); ?>';

						eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($vars['labels']); ?>");

						var shortCode = $('input#ws-plugin--s2member-pro-' + button + '-shortcode');

						var level = /* Just strip the button name to get the Level number. */ button.replace (/^level/, '');
						var label = /* Labels may NOT contain any double-quotes. */ labels['level' + level].replace (/"/g, "");
						var desc = $.trim ($('input#ws-plugin--s2member-pro-' + button + '-desc').val ().replace (/"/g, "").replace (/&/g, "and"));

						var prodType = $('select#ws-plugin--s2member-pro-' + button + '-type').val ().replace (/[^A-Z]/gi, '').toLowerCase ();
						var prodItem = $('input#ws-plugin--s2member-pro-' + button + '-item-number').val ().replace (/[^A-Z0-9]/gi, '');

						if /* In this case, we used the Fixed-Term configuration. */ (prodType === 'standard')
							{
								var trialPeriod = '0', trialTerm = 'D'; // Just use the defaults in this case.
								var regPeriod = $('select#ws-plugin--s2member-pro-' + button + '-term').val ().split ('-')[0].replace (/[^0-9]/g, '');
								var regTerm = $('select#ws-plugin--s2member-pro-' + button + '-term').val ().split ('-')[1].replace (/[^A-Z]/g, '');
								var regRecur = '0'; // No, it is NOT recurring.
							}
						else if /* Here we use the ClickBank Trial Period and Re-Bill configuration. */ (prodType === 'recurring')
							{
								var trialPeriod = $('select#ws-plugin--s2member-pro-' + button + '-p1').val ().split ('-')[0].replace (/[^0-9]/g, '');
								var trialTerm = $('select#ws-plugin--s2member-pro-' + button + '-p1').val ().split ('-')[1].replace (/[^A-Z]/g, '');
								var regPeriod = $('select#ws-plugin--s2member-pro-' + button + '-p3').val ().split ('-')[0].replace (/[^0-9]/g, '');
								var regTerm = $('select#ws-plugin--s2member-pro-' + button + '-p3').val ().split ('-')[1].replace (/[^A-Z]/g, '');
								var regRecur = '1'; // Yes, it IS recurring.
							}
						var cCaps = $.trim ($.trim ($('input#ws-plugin--s2member-pro-' + button + '-ccaps').val ()).replace (/^(-all|-al|-a|-)[;,]*/gi, '').replace (/[ \-]/g, '_').replace (/[^a-z_0-9,]/gi, '').toLowerCase ());
						cCaps = ($.trim ($('input#ws-plugin--s2member-pro-' + button + '-ccaps').val ()).match (/^(-all|-al|-a|-)[;,]*/i)) ? ((cCaps) ? '-all,' : '-all') + cCaps.toLowerCase () : cCaps.toLowerCase ();

						var levelCcapsPer = (prodType === 'standard' && regTerm !== 'L') ? level + ':' + cCaps + ':' + regPeriod + ' ' + regTerm : level + ':' + cCaps;
						levelCcapsPer = /* Clean any trailing separators from this string. */ levelCcapsPer.replace (/\:+$/g, '');

						if /* Must have a Product Item Number to work with. */ (!prodItem)
							{
								alert('— Oops, a slight problem: —\n\nPlease supply a valid ClickBank Product Item #.');
								return false;
							}
						else if /* Each Button should have a Description. */ (!desc)
							{
								alert('— Oops, a slight problem: —\n\nPlease type a Description for this Button.');
								return false;
							}
						shortCodeTemplateAttrs += 'cbp="' + esc_attr(prodItem) + '" cbskin="" cbfid="" cbur="" cbf="auto" vtid="" level="' + esc_attr(level) + '" ccaps="' + esc_attr(cCaps) + '" desc="' + esc_attr(desc) + '" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';
						shortCodeTemplateAttrs += ' tp="' + esc_attr(trialPeriod) + '" tt="' + esc_attr(trialTerm) + '" rp="' + esc_attr(regPeriod) + '" rt="' + esc_attr(regTerm) + '" rr="' + esc_attr(regRecur) + '"';
						shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));

						alert('Your Button has been generated.\nPlease copy/paste the Shortcode into your Membership Options Page.');

						shortCode.each ( /* Focus and select the Shortcode. */function()
							{
								this.focus (), this.select ();
							});
						return false;
					};
				ws_plugin__s2member_pro_clickbankCcapButtonGenerate = /* Handles ClickBank Button Generation. */ function()
					{
						var shortCodeTemplate = '[s2Member-Pro-ClickBank-Button %%attrs%% image="default" output="anchor" /]', shortCodeTemplateAttrs = '';

						var vendor = '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_username"]); ?>';

						var shortCode = $('input#ws-plugin--s2member-pro-ccap-shortcode');

						var desc = $.trim ($('input#ws-plugin--s2member-pro-ccap-desc').val ().replace (/"/g, "").replace (/&/g, "and"));

						var prodType = $('select#ws-plugin--s2member-pro-ccap-type').val ().replace (/[^A-Z]/gi, '').toLowerCase ();
						var prodItem = $('input#ws-plugin--s2member-pro-ccap-item-number').val ().replace (/[^A-Z0-9]/gi, '');

						if /* In this case, we used the Fixed-Term configuration. */ (prodType === 'standard')
							{
								var /* Just use the defaults in this case. */ trialPeriod = '0', trialTerm = 'D';
								var regPeriod = $('select#ws-plugin--s2member-pro-ccap-term').val ().split ('-')[0].replace (/[^0-9]/g, '');
								var regTerm = $('select#ws-plugin--s2member-pro-ccap-term').val ().split ('-')[1].replace (/[^A-Z]/g, '');
								var regRecur = /* No, it is NOT recurring. */ '0';
							}
						var cCaps = $.trim ($.trim ($('input#ws-plugin--s2member-pro-ccap-ccaps').val ()).replace (/^(-all|-al|-a|-)[;,]*/gi, '').replace (/[ \-]/g, '_').replace (/[^a-z_0-9,]/gi, '').toLowerCase ());
						cCaps = ($.trim ($('input#ws-plugin--s2member-pro-ccap-ccaps').val ()).match (/^(-all|-al|-a|-)[;,]*/i)) ? ((cCaps) ? '-all,' : '-all') + cCaps.toLowerCase () : cCaps.toLowerCase ();

						var levelCcapsPer = (prodType === 'standard' && regTerm !== 'L') ? '*:' + cCaps + ':' + regPeriod + ' ' + regTerm : '*:' + cCaps;
						levelCcapsPer = /* Clean any trailing separators from this string. */ levelCcapsPer.replace (/\:+$/g, '');

						if /* Must have a Product Item Number to work with. */ (!prodItem)
							{
								alert('— Oops, a slight problem: —\n\nPlease supply a valid ClickBank Product Item #.');
								return false;
							}
						else if /* Must have some Independent Custom Capabilities. */ (!cCaps || cCaps === '-all')
							{
								alert('— Oops, a slight problem: —\n\nPlease provide at least one Custom Capability.');
								return false;
							}
						else if /* Each Button should have a Description. */ (!desc)
							{
								alert('— Oops, a slight problem: —\n\nPlease type a Description for this Button.');
								return false;
							}
						shortCodeTemplateAttrs += 'cbp="' + esc_attr(prodItem) + '" cbskin="" cbfid="" cbur="" cbf="auto" vtid="" level="*" ccaps="' + esc_attr(cCaps) + '" desc="' + esc_attr(desc) + '" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';
						shortCodeTemplateAttrs += ' rp="' + esc_attr(regPeriod) + '" rt="' + esc_attr(regTerm) + '" rr="' + esc_attr(regRecur) + '"';
						shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));

						alert('Your Button has been generated.\nPlease copy/paste the Shortcode into your WordPress Editor.');

						shortCode.each ( /* Focus and select the Shortcode. */function()
							{
								this.focus (), this.select ();
							});
						return false;
					};
				ws_plugin__s2member_pro_clickbankSpButtonGenerate = /* Handles ClickBank Button Generation for Specific Post/Page Access. */ function()
					{
						var shortCodeTemplate = '[s2Member-Pro-ClickBank-Button %%attrs%% image="default" output="anchor" /]', shortCodeTemplateAttrs = '';

						var vendor = '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_username"]); ?>';

						var shortCode = $('input#ws-plugin--s2member-pro-sp-shortcode');

						var prodItem = $('input#ws-plugin--s2member-pro-sp-item-number').val ().replace (/[^A-Z0-9]/gi, '');

						var leading = $('select#ws-plugin--s2member-pro-sp-leading-id').val ().replace (/[^0-9]/g, '');
						var additionals = $('select#ws-plugin--s2member-pro-sp-additional-ids').val () || [];
						var hours = $('select#ws-plugin--s2member-pro-sp-hours').val ().replace (/[^0-9]/g, '');
						var desc = $.trim ($('input#ws-plugin--s2member-pro-sp-desc').val ().replace (/"/g, '').replace (/&/g, "and"));

						if /* Must have a Product Item Number to work with. Otherwise, Button generation will fail. */ (!prodItem)
							{
								alert('— Oops, a slight problem: —\n\nPlease supply a valid ClickBank Product Item #.');
								return false;
							}
						else if /* Must have a Leading Post/Page ID to work with. Otherwise, Link generation will fail. */ (!leading)
							{
								alert('— Oops, a slight problem: —\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it\'s because you\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member ⥱ Restriction Options ⥱ Specific Post/Page Access.');
								return false;
							}
						else if /* Each Button should have a Description. */ (!desc)
							{
								alert('— Oops, a slight problem: —\n\nPlease type a Description for this Button.');
								return false;
							}

						for (var i = 0, ids = leading; i < additionals.length; i++)
							if (additionals[i] && additionals[i] !== leading)
								ids += ',' + additionals[i];

						var spIdsHours = /* Combined sp:ids:expiration hours. */ 'sp:' + ids + ':' + hours;

						shortCodeTemplateAttrs += 'cbp="' + esc_attr(prodItem) + '" cbskin="" cbfid="" cbur="" cbf="auto" vtid="" sp="1" ids="' + esc_attr(ids) + '" exp="' + esc_attr(hours) + '" desc="' + esc_attr(desc) + '"';
						shortCodeTemplateAttrs += ' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';
						shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));

						alert('Your Button has been generated.\nPlease copy/paste the Shortcode into your WordPress Editor.');

						shortCode.each ( /* Focus and select the Shortcode. */function()
							{
								this.focus (), this.select ();
							});

						return false;
					};
				ws_plugin__s2member_pro_clickbankRegLinkGenerate = /* Handles ClickBank Link Generation. */ function()
					{
						var level = $('select#ws-plugin--s2member-pro-reg-link-level').val ().replace (/[^0-9]/g, '');
						var subscrID = $.trim ($('input#ws-plugin--s2member-pro-reg-link-subscr-id').val ());
						var custom = $.trim ($('input#ws-plugin--s2member-pro-reg-link-custom').val ());
						var cCaps = $.trim ($.trim ($('input#ws-plugin--s2member-pro-reg-link-ccaps').val ()).replace (/[ \-]/g, '_').replace (/[^a-z_0-9,]/gi, '').toLowerCase ());
						var fixedTerm = $.trim ($('input#ws-plugin--s2member-pro-reg-link-fixed-term').val ().replace (/[^A-Z 0-9]/gi, '').toUpperCase ());
						var $link = $('p#ws-plugin--s2member-pro-reg-link'), $loading = $('img#ws-plugin--s2member-pro-reg-link-loading');

						var levelCcapsPer = (fixedTerm && !fixedTerm.match (/L$/)) ? level + ':' + cCaps + ':' + fixedTerm : level + ':' + cCaps;
						levelCcapsPer = /* Clean any trailing separators from this string. */ levelCcapsPer.replace (/\:+$/g, '');

						if /* We must have a Paid Subscr. ID value. */ (!subscrID)
							{
								alert('— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value.');
								return false;
							}
						else if (!custom || custom.indexOf ('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($_SERVER["HTTP_HOST"]); ?>') !== 0)
							{
								alert('— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name.');
								return false;
							}
						else if /* Check format. */ (fixedTerm && !fixedTerm.match (/^[1-9]+ (D|W|M|Y|L)$/))
							{
								alert('— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly.');
								return false;
							}

						$link.hide (), $loading.show (), $.post (ajaxurl, {action: 'ws_plugin__s2member_reg_access_link_via_ajax', ws_plugin__s2member_reg_access_link_via_ajax: '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>', s2member_reg_access_link_subscr_gateway: 'clickbank', s2member_reg_access_link_subscr_id: subscrID, s2member_reg_access_link_custom: custom, s2member_reg_access_link_item_number: levelCcapsPer}, function(response)
							{
								$link.show ().html ('' + esc_html(response) + ''), $loading.hide ();
							});
						return false;
					};
				ws_plugin__s2member_pro_clickbankSpLinkGenerate = /* Handles ClickBank Link Generation. */ function()
					{
						var leading = $('select#ws-plugin--s2member-pro-sp-link-leading-id').val ().replace (/[^0-9]/g, '');
						var additionals = $('select#ws-plugin--s2member-pro-sp-link-additional-ids').val () || [];
						var hours = $('select#ws-plugin--s2member-pro-sp-link-hours').val ().replace (/[^0-9]/g, '');
						var $link = $('p#ws-plugin--s2member-pro-sp-link'), $loading = $('img#ws-plugin--s2member-pro-sp-link-loading');

						if /* Must have a Leading Post/Page ID to work with. Otherwise, Link generation will fail. */ (!leading)
							{
								alert('— Oops, a slight problem: —\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it\'s because you\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member ⥱ Restriction Options ⥱ Specific Post/Page Access.');
								return false;
							}
						for (var i = 0, ids = leading; i < additionals.length; i++)
							if (additionals[i] && additionals[i] !== leading)
								ids += ',' + additionals[i];

						$link.hide (), $loading.show (), $.post (ajaxurl, {action: 'ws_plugin__s2member_sp_access_link_via_ajax', ws_plugin__s2member_sp_access_link_via_ajax: '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>', s2member_sp_access_link_ids: ids, s2member_sp_access_link_hours: hours}, function(response)
							{
								$link.show ().html ('' + esc_html(response) + ''), $loading.hide ();
							});
						return false;
					};
			}
	});


text:
using System;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;

namespace MahApps.Metro.Controls
{
    [ContentProperty("ItemsSource")]
    [DefaultEvent("SelectionChanged"),
     TemplatePart(Name = "PART_Container", Type = typeof(Grid)),
     TemplatePart(Name = "PART_Button", Type = typeof(Button)),
     TemplatePart(Name = "PART_ButtonContent", Type = typeof(ContentControl)),
     TemplatePart(Name = "PART_Popup", Type = typeof(Popup)),
     TemplatePart(Name = "PART_Expander", Type = typeof(Button)),
     TemplatePart(Name = "PART_ListBox", Type = typeof(ListBox))]
    public class SplitButton : Selector
    {
        public static readonly RoutedEvent ClickEvent
            = EventManager.RegisterRoutedEvent("Click",
                                               RoutingStrategy.Bubble,
                                               typeof(RoutedEventHandler),
                                               typeof(SplitButton));

        public event RoutedEventHandler Click
        {
            add { this.AddHandler(ClickEvent, value); }
            remove { this.RemoveHandler(ClickEvent, value); }
        }

        public static readonly DependencyProperty IsExpandedProperty = DependencyProperty.Register("IsExpanded", typeof(bool), typeof(SplitButton));

        public static readonly DependencyProperty ExtraTagProperty = DependencyProperty.Register("ExtraTag", typeof(object), typeof(SplitButton));

        public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register("Orientation", typeof(Orientation), typeof(SplitButton), new FrameworkPropertyMetadata(Orientation.Horizontal, FrameworkPropertyMetadataOptions.AffectsMeasure));

        public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(object), typeof(SplitButton));
        public static readonly DependencyProperty IconTemplateProperty = DependencyProperty.Register("IconTemplate", typeof(DataTemplate), typeof(SplitButton));

        public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(SplitButton));
        public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register("CommandTarget", typeof(IInputElement), typeof(SplitButton));
        public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register("CommandParameter", typeof(object), typeof(SplitButton));

        public static readonly DependencyProperty ButtonStyleProperty = DependencyProperty.Register("ButtonStyle", typeof(Style), typeof(SplitButton), new FrameworkPropertyMetadata(default(Style), FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure));
        public static readonly DependencyProperty ButtonArrowStyleProperty = DependencyProperty.Register("ButtonArrowStyle", typeof(Style), typeof(SplitButton), new FrameworkPropertyMetadata(default(Style), FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure));
        public static readonly DependencyProperty ListBoxStyleProperty = DependencyProperty.Register("ListBoxStyle", typeof(Style), typeof(SplitButton), new FrameworkPropertyMetadata(default(Style), FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure));
        public static readonly DependencyProperty ArrowBrushProperty = DependencyProperty.Register("ArrowBrush", typeof(Brush), typeof(SplitButton), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender));
        public static readonly DependencyProperty ArrowMouseOverBrushProperty = DependencyProperty.Register("ArrowMouseOverBrush", typeof(Brush), typeof(SplitButton), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender));
        public static readonly DependencyProperty ArrowPressedBrushProperty = DependencyProperty.Register("ArrowPressedBrush", typeof(Brush), typeof(SplitButton), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender));

        /// <summary>
        /// Reflects the parameter to pass to the CommandProperty upon execution.
        /// </summary>
        public object CommandParameter
        {
            get { return (object)this.GetValue(CommandParameterProperty); }
            set { this.SetValue(CommandParameterProperty, value); }
        }

        /// <summary>
        /// Gets or sets the target element on which to fire the command.
        /// </summary>
        public IInputElement CommandTarget
        {
            get { return (IInputElement)this.GetValue(CommandTargetProperty); }
            set { this.SetValue(CommandTargetProperty, value); }
        }

        /// <summary>
        /// Get or sets the Command property.
        /// </summary>
        public ICommand Command
        {
            get { return (ICommand)this.GetValue(CommandProperty); }
            set { this.SetValue(CommandProperty, value); }
        }

        /// <summary>
        /// Indicates whether the Popup is visible.
        /// </summary>
        public bool IsExpanded
        {
            get { return (bool)this.GetValue(IsExpandedProperty); }
            set { this.SetValue(IsExpandedProperty, value); }
        }

        /// <summary>
        /// Gets or sets an extra tag.
        /// </summary>
        public object ExtraTag
        {
            get { return this.GetValue(ExtraTagProperty); }
            set { this.SetValue(ExtraTagProperty, value); }
        }

        /// <summary>
        /// Gets or sets the dimension of children stacking.
        /// </summary>
        public Orientation Orientation
        {
            get { return (Orientation)this.GetValue(OrientationProperty); }
            set { this.SetValue(OrientationProperty, value); }
        }

        /// <summary>
        ///  Gets or sets the Content used to generate the icon part.
        /// </summary>
        [Bindable(true)]
        public object Icon
        {
            get { return this.GetValue(IconProperty); }
            set { this.SetValue(IconProperty, value); }
        }

        /// <summary>
        /// Gets or sets the ContentTemplate used to display the content of the icon part.
        /// </summary>
        [Bindable(true)]
        public DataTemplate IconTemplate
        {
            get { return (DataTemplate)this.GetValue(IconTemplateProperty); }
            set { this.SetValue(IconTemplateProperty, value); }
        }

        /// <summary>
        /// Gets/sets the button style.
        /// </summary>
        public Style ButtonStyle
        {
            get { return (Style)this.GetValue(ButtonStyleProperty); }
            set { this.SetValue(ButtonStyleProperty, value); }
        }

        /// <summary>
        /// Gets/sets the button arrow style.
        /// </summary>
        public Style ButtonArrowStyle
        {
            get { return (Style)this.GetValue(ButtonArrowStyleProperty); }
            set { this.SetValue(ButtonArrowStyleProperty, value); }
        }

        /// <summary>
        /// Gets/sets the popup listbox style.
        /// </summary>
        public Style ListBoxStyle
        {
            get { return (Style)this.GetValue(ListBoxStyleProperty); }
            set { this.SetValue(ListBoxStyleProperty, value); }
        }

        /// <summary>
        /// Gets/sets the brush of the button arrow icon.
        /// </summary>
        public Brush ArrowBrush
        {
            get { return (Brush)this.GetValue(ArrowBrushProperty); }
            set { this.SetValue(ArrowBrushProperty, value); }
        }

        /// <summary>
        /// Gets/sets the brush of the button arrow icon if the mouse is over the split button.
        /// </summary>
        public Brush ArrowMouseOverBrush
        {
            get { return (Brush)this.GetValue(ArrowMouseOverBrushProperty); }
            set { this.SetValue(ArrowMouseOverBrushProperty, value); }
        }

        /// <summary>
        /// Gets/sets the brush of the button arrow icon if the arrow button is pressed.
        /// </summary>
        public Brush ArrowPressedBrush
        {
            get { return (Brush)this.GetValue(ArrowPressedBrushProperty); }
            set { this.SetValue(ArrowPressedBrushProperty, value); }
        }

        private Button _clickButton;
        private Button _expander;
        private ListBox _listBox;
        private Popup _popup;

        static SplitButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(SplitButton), new FrameworkPropertyMetadata(typeof(SplitButton)));
        }

        public SplitButton()
        {
            // maybe later
            //Keyboard.AddKeyDownHandler(this, this.OnKeyDown);
            Mouse.AddPreviewMouseDownOutsideCapturedElementHandler(this, this.OutsideCapturedElementHandler);
        }

        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            e.RoutedEvent = ClickEvent;
            this.RaiseEvent(e);
            this.SetCurrentValue(IsExpandedProperty, false);
        }

        private void ListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.SetCurrentValue(IsExpandedProperty, false);
            e.Handled = true;
        }

        private void ExpanderClick(object sender, RoutedEventArgs e)
        {
            this.SetCurrentValue(IsExpandedProperty, !this.IsExpanded);
        }

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            this._clickButton = this.EnforceInstance<Button>("PART_Button");
            this._expander = this.EnforceInstance<Button>("PART_Expander");
            this._listBox = this.EnforceInstance<ListBox>("PART_ListBox");
            this._popup = this.EnforceInstance<Popup>("PART_Popup");
            this.InitializeVisualElementsContainer();
            if (this._listBox != null && this.Items != null && this.ItemsSource == null)
            {
                foreach (var newItem in this.Items)
                {
                    this.TryRemoveVisualFromOldTree(newItem);
                    this._listBox.Items.Add(newItem);
                }
            }
        }

        private void TryRemoveVisualFromOldTree(object newItem)
        {
            var visual = newItem as Visual;
            if (visual != null)
            {
                var fe = LogicalTreeHelper.GetParent(visual) as FrameworkElement ?? VisualTreeHelper.GetParent(visual) as FrameworkElement;
                if (Equals(this, fe))
                {
                    this.RemoveLogicalChild(visual);
                    this.RemoveVisualChild(visual);
                }
            }
        }

        /// <summary>Updates the current selection when an item in the <see cref="T:System.Windows.Controls.Primitives.Selector" /> has changed</summary>
        /// <param name="e">The event data.</param>
        protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
        {
            base.OnItemsChanged(e);
            if (this._listBox == null || this.ItemsSource != null || this._listBox.ItemsSource != null)
            {
                return;
            }
            switch (e.Action)
            {
                case NotifyCollectionChangedAction.Add:
                    if (e.NewItems != null)
                    {
                        foreach (var newItem in e.NewItems)
                        {
                            this.TryRemoveVisualFromOldTree(newItem);
                            this._listBox.Items.Add(newItem);
                        }
                    }
                    break;
                case NotifyCollectionChangedAction.Remove:
                    if (e.OldItems != null)
                    {
                        foreach (var oldItem in e.OldItems)
                        {
                            this._listBox.Items.Remove(oldItem);
                        }
                    }
                    break;
                case NotifyCollectionChangedAction.Move:
                case NotifyCollectionChangedAction.Replace:
                    if (e.OldItems != null)
                    {
                        foreach (var oldItem in e.OldItems)
                        {
                            this._listBox.Items.Remove(oldItem);
                        }
                    }
                    if (e.NewItems != null)
                    {
                        foreach (var newItem in e.NewItems)
                        {
                            this.TryRemoveVisualFromOldTree(newItem);
                            this._listBox.Items.Add(newItem);
                        }
                    }
                    break;
                case NotifyCollectionChangedAction.Reset:
                    if (this.Items != null)
                    {
                        this._listBox.Items.Clear();
                        foreach (var newItem in this.Items)
                        {
                            this.TryRemoveVisualFromOldTree(newItem);
                            this._listBox.Items.Add(newItem);
                        }
                    }
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }

        //Get element from name. If it exist then element instance return, if not, new will be created
        private T EnforceInstance<T>(string partName) where T : FrameworkElement, new()
        {
            T element = this.GetTemplateChild(partName) as T ?? new T();
            return element;
        }

        private void InitializeVisualElementsContainer()
        {
            this._expander.Click -= this.ExpanderClick;
            this._clickButton.Click -= this.ButtonClick;
            this._listBox.SelectionChanged -= this.ListBoxSelectionChanged;
            this._listBox.PreviewMouseLeftButtonDown -= this.ListBoxPreviewMouseLeftButtonDown;
            this._popup.Opened -= this.PopupOpened;
            this._popup.Closed -= this.PopupClosed;

            this._expander.Click += this.ExpanderClick;
            this._clickButton.Click += this.ButtonClick;
            this._listBox.SelectionChanged += this.ListBoxSelectionChanged;
            this._listBox.PreviewMouseLeftButtonDown += this.ListBoxPreviewMouseLeftButtonDown;
            this._popup.Opened += this.PopupOpened;
            this._popup.Closed += this.PopupClosed;

            BindingOperations.ClearBinding(this._listBox, ItemsSourceProperty);
            this._listBox.SetBinding(ItemsSourceProperty, new Binding(ItemsSourceProperty.Name)
                                                          {
                                                              Mode = BindingMode.OneWay,
                                                              RelativeSource = RelativeSource.TemplatedParent
                                                          });
        }

        protected override void OnSelectionChanged(SelectionChangedEventArgs e)
        {
            base.OnSelectionChanged(e);
        }

        //Make popup close even if no selectionchanged event fired (case when user select the same item as before)
        private void ListBoxPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var source = e.OriginalSource as DependencyObject;
            if (source != null)
            {
                var item = ContainerFromElement(this._listBox, source) as ListBoxItem;
                if (item != null)
                {
                    this.SetCurrentValue(IsExpandedProperty, false);
                }
            }
        }

        private void PopupClosed(object sender, EventArgs e)
        {
            this.SetCurrentValue(IsExpandedProperty, false);
            this.ReleaseMouseCapture();
            Mouse.RemoveLostMouseCaptureHandler(this._popup, this.LostMouseCaptureHandler);
            if (this.IsKeyboardFocusWithin)
            {
                this._expander?.Focus();
            }
        }

        private void PopupOpened(object sender, EventArgs e)
        {
            Mouse.Capture(this, CaptureMode.SubTree);
            // Mouse capture can be lost on 'this' when the user clicks on the scroll bar, which can cause
            // OutsideCapturedElementHandler to never be called. If we monitor the popup for lost mouse capture
            // (which the popup gains on mouse down of the scroll bar), then we can recapture the mouse at that point
            // to cause OutsideCapturedElementHandler to be called again.
            Mouse.AddLostMouseCaptureHandler(this._popup, this.LostMouseCaptureHandler);
        }

        private void LostMouseCaptureHandler(object sender, MouseEventArgs e)
        {
            // If the list is still expanded, recapture the SplitButton subtree
            // so that we still can know when the user has clicked outside of the popup.
            // This happens on scroll bar mouse up, so this doesn't disrupt the scroll bar functionality
            // at all.
            if (this.IsExpanded)
            {
                Mouse.Capture(this, CaptureMode.SubTree);
            }
        }

        private void OutsideCapturedElementHandler(object sender, MouseButtonEventArgs e)
        {
            this.PopupClosed(sender, e);
        }

        protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
        {
            base.OnIsKeyboardFocusWithinChanged(e);
            // To hide the popup when the user e.g. alt+tabs, monitor for when the window becomes a background window.
            if (!(bool)e.NewValue)
            {
                this.SetCurrentValue(IsExpandedProperty, false);
            }
        }

        /* maybe later
        private static bool IsKeyModifyingPopupState(KeyEventArgs e)
        {
            return (((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt) && ((e.SystemKey == Key.Down) || (e.SystemKey == Key.Up)))
                    || (e.Key == Key.F4);
        }

        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            if (!this.IsExpanded)
            {
                if (IsKeyModifyingPopupState(e))
                {
                    this.IsExpanded = true;
                    e.Handled = true;
                }
            }
            else
            {
                if (IsKeyModifyingPopupState(e))
                {
                    this.PopupClosed(sender, e);
                    e.Handled = true;
                }
                else if (e.Key == Key.Escape)
                {
                    this.PopupClosed(sender, e);
                    e.Handled = true;
                }
            }
        }
        */
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Html;
using System.Runtime.CompilerServices;

namespace jQueryApi.UI.Interactions {

    [Imported]
    [IgnoreNamespace]
    [Serializable]
    public sealed class SelectableUnselectingEvent {

        public Element Unselecting {
            get; set;
        }
    }
}


text:
#include "tensorflow/lite/delegates/gpu/gl/converters/bhwc_to_phwc4.h"

#include <algorithm>
#include <vector>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/types/span.h"
#include "tensorflow/lite/delegates/gpu/common/convert.h"
#include "tensorflow/lite/delegates/gpu/common/shape.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/gl/egl_environment.h"
#include "tensorflow/lite/delegates/gpu/gl/gl_buffer.h"
#include "tensorflow/lite/delegates/gpu/gl/portable_gl31.h"

namespace tflite {
namespace gpu {
namespace gl {
namespace {

inline std::vector<float> GenerateFloats(float multiplier, int size) {
  std::vector<float> v(size);
  for (int i = 0; i < size; ++i) {
    v[i] = multiplier * i * (i % 2 == 0 ? -1 : 1);
  }
  return v;
}

Status RunTest(const BHWC& shape) {
  // Create random input and calculate expected output for it.
  std::vector<float> input = GenerateFloats(0.01, shape.DimensionsProduct());
  std::vector<float> output(GetElementsSizeForPHWC4(shape), 0);
  RETURN_IF_ERROR(
      ConvertToPHWC4(absl::MakeConstSpan(input.data(), input.size()), shape,
                     absl::MakeSpan(output.data(), output.size())));

  std::unique_ptr<EglEnvironment> env;
  RETURN_IF_ERROR(EglEnvironment::NewEglEnvironment(&env));

  // Create input and output buffers
  GlBuffer input_buffer;
  RETURN_IF_ERROR(CreateReadOnlyShaderStorageBuffer(
      absl::MakeConstSpan(input.data(), input.size()), &input_buffer));

  GlBuffer output_buffer;
  RETURN_IF_ERROR(CreateReadWriteShaderStorageBuffer<float>(
      GetElementsSizeForPHWC4(shape), &output_buffer));

  // Create converter and run it.
  ConverterBhwcToPhwc4 converter;
  RETURN_IF_ERROR(ConverterBhwcToPhwc4::Create(&converter));
  RETURN_IF_ERROR(
      converter.Convert(shape, input_buffer, nullptr, &output_buffer));

  std::vector<float> converted_output(output.size(), 0);
  RETURN_IF_ERROR(output_buffer.Read(
      absl::MakeSpan(converted_output.data(), converted_output.size())));
  if (output != converted_output) {
    return InternalError("Outputs don't match");
  }
  return OkStatus();
}

TEST(HwcToPhwc4, Smoke) {
  for (int32_t h : {1, 2, 3, 7, 20}) {
    for (int32_t w : {1, 2, 4, 5, 11}) {
      for (int32_t c : {1, 2, 4, 5, 8, 9}) {
        BHWC shape(1, h, w, c);
        EXPECT_TRUE(RunTest(shape).ok())
            << shape.h << " " << shape.w << " " << shape.c;
      }
    }
  }
}

}  // namespace
}  // namespace gl
}  // namespace gpu
}  // namespace tflite


text:
package com.marcotc.collection.impl;

import com.marcotc.collection.Implementation;
import com.marcotc.collection.Benchmark;

import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntIterator;

public class FastUtils implements Implementation {

	@Override
	public Benchmark getAdd() {
		return new Add();
	}

	@Override
	public Benchmark getIterate() {
		return new Iterate();
	}

	@Override
	public Benchmark getIterator() {
		return new Iterator();
	}

	@Override
	public Benchmark getContains() {
		return new Contains();
	}

	@Override
	public Benchmark getRemove() {
		return new Remove();
	}

	@Override
	public Benchmark getClear() {
		return new Clear();
	}

	public static class Add implements Benchmark {
		IntArrayList list;

		@Override
		public void setup(int i) {
		}

		@Override
		public int execute(int i) {
			list = new IntArrayList(0);
	        for (int j = 0; j < i; j++) {
	            list.add(j);
	        }

			return list.size();
		}
	}

	public static abstract class AbstractFullList implements Benchmark {
		IntArrayList list;

		@Override
		public void setup(int i) {
			list = new IntArrayList(0);
        	for (int j = 0; j < i; j++) {
        		list.add(j);
            }
		}
	}

	public static class Contains extends AbstractFullList {
		@Override
		public int execute(int i) {
	        for (int j = 0; j < i; j++) {
	            list.contains(j);
	        }

			return list.size();
		}
	}

	public static class Iterate extends AbstractFullList {
		@Override
		public int execute(int i) {
			int x = 0;
            for (int j = 0; j < list.size(); j++) {
                x += list.getInt(j);
            }
            return x;
		}
	}

	public static class Iterator extends AbstractFullList {
		@Override
		public int execute(int i) {
			int x = 0;
			IntIterator iterator = list.iterator();
			while (iterator.hasNext()) {
				x += iterator.nextInt();
			}
            return x;
		}
	}

	public static class Remove extends AbstractFullList {
		@Override
		public int execute(int i) {
			list.add(1);
			list.add(2);
			list.add(3);
			list.removeInt(list.size() - 1);
			list.removeInt(list.size()/2);
			list.removeInt(0);
			return list.size();
		}
	}

	public static class Clear extends AbstractFullList {
		@Override
		public int execute(int i) {
			list.clear();
			return list.size();
		}
	}
}


text:
{{'ADD_CHANNEL_TO' | translate}} {{device.id}}

<channels-form></channels-form>


text:
body {
    padding-top: 80px;
    padding-bottom: 20px;
}

/* Set padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Set width on the form input elements since they're 100% wide by default */
/* ausgeschaltet */
/*
input,
select,
textarea {
    max-width: 280px;
}
*/

/* styles for validation helpers */
.field-validation-error {
    color: #b94a48;
}

.field-validation-valid {
    display: none;
}

input.input-validation-error {
    border: 1px solid #b94a48;
}

input[type="checkbox"].input-validation-error {
    border: 0 none;
}

.validation-summary-errors {
    color: #b94a48;
}

.validation-summary-valid {
    display: none;
}

/* Größe der Überschrift für fullcalendar */
.fc-header-title h2 {
    font-size: 18px;
    white-space: normal !important;
}

.navbar-inverse {
  background-color: #919191;
  border-color: #080808;
}

.navbar-inverse .navbar-text {
  color: #fff;
}

.navbar-inverse .navbar-nav > li > a {
  color: #fff;
}

  .navbar-inverse .navbar-brand {
  color: #fff;
}
.bg-fillter-main {
  color: #fff;
  background-color: #fa6666;
}

.bg-fillter-admin {
  color: #fff;
  background-color: #47aba1;
}

.bg-fillter-events {
  color: #fff;
  background-color: #a56585;
}

.bg-fillter-cantine {
  color: #fff;
  background-color: #77bd90;
}

.bg-fillter-rooms {
  color: #fff;
  background-color: #feb151;
}

.bg-fillter-faculty {
  color: #fff;
  background-color: #78a3aa;
}

.bg-fillter-default {
  color: #000;
  background-color: #E1E1E1;
}

.logo img {
  margin-left: auto;
  margin-right: auto;
  display: block;
  position: relative;
  top: 8px;
}


text:
package com.github.pfichtner.jrunalyser.ui.segmentstat;

import java.awt.Color;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.util.Date;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.github.pfichtner.jrunalyser.base.data.Speed;
import com.github.pfichtner.jrunalyser.base.data.WayPoint;
import com.github.pfichtner.jrunalyser.base.data.segment.Segment;
import com.github.pfichtner.jrunalyser.base.data.stat.Statistics;
import com.github.pfichtner.jrunalyser.base.datasource.DatasourceFascade;
import com.github.pfichtner.jrunalyser.ui.base.Settings;
import com.github.pfichtner.jrunalyser.ui.base.StaticSettings;
import com.github.pfichtner.jrunalyser.ui.dock.ebus.SegmentSelectedMessage;
import com.github.pfichtner.jrunalyser.ui.format.DistanceFormatter;
import com.github.pfichtner.jrunalyser.ui.format.DurationFormatter;
import com.github.pfichtner.jrunalyser.ui.format.PaceFormatter;
import com.github.pfichtner.jrunalyser.ui.format.SpeedFormatter;
import com.google.common.collect.Iterables;

public class SegmentStatsPanel extends JPanel {

	private DatasourceFascade dsf;

	private JTextField index;
	private JTextField startTime;
	private JTextField distance;
	private JTextField duration;
	private JTextField elevation;
	private JTextField ascentDescent;
	private JTextField speed;
	private JTextField pace;

	public SegmentStatsPanel() {
		super(createLayout());
		init(this);
	}

	private void init(JPanel pnl) {
		int row = 0;
		this.index = createTextField(pnl, "Nummer", row++);
		this.distance = createTextField(pnl, "Distanz", row++);
		this.startTime = createTextField(pnl, "Startzeit", row++);
		this.duration = createTextField(pnl, "Dauer", row++);
		this.elevation = createTextField(pnl, "Höhe", row++);
		this.ascentDescent = createTextField(pnl, "Elevation", row++);
		this.speed = createTextField(pnl, "∅ Geschwindigkeit", row++);
		this.pace = createTextField(pnl, "∅ Schritt", row++);
		JPanel filler = new JPanel();
		GridBagConstraints c1 = new GridBagConstraints();
		c1.gridy = row++;
		c1.weighty = 1;
		c1.fill = GridBagConstraints.BOTH;
		pnl.add(filler, c1);
	}

	private static GridBagLayout createLayout() {
		GridBagLayout gbl = new GridBagLayout();
		gbl.columnWeights = new double[] { 0.0, 1.0 };
		return gbl;
	}

	private static JTextField createTextField(Container pnl, String label,
			int row) {
		GridBagConstraints c1 = new GridBagConstraints();
		c1.gridx = 0;
		c1.gridy = row;
		c1.anchor = GridBagConstraints.WEST;
		c1.insets = new Insets(5, 5, 0, 0);
		pnl.add(new JLabel(label), c1);

		GridBagConstraints c2 = (GridBagConstraints) c1.clone();
		c2.gridx = 1;
		c2.fill = GridBagConstraints.HORIZONTAL;
		JTextField field = createTextField();
		pnl.add(field, c2);
		return field;
	}

	private static JTextField createTextField() {
		JTextField result = new JTextField();
		result.setEditable(false);
		result.setBackground(Color.WHITE);
		return result;
	}

	public void setDatasourceFascade(DatasourceFascade dsf) {
		this.dsf = dsf;
	}

	public void setActiveSegment(SegmentSelectedMessage message) {
		Segment segment = message.getSegment();
		Statistics stats = segment.getStatistics();

		Settings settings = StaticSettings.INSTANCE;
		DistanceFormatter dif = new DistanceFormatter(
				DistanceFormatter.Type.SHORT);
		DurationFormatter duf = new DurationFormatter(
				DurationFormatter.Type.SHORT);
		SpeedFormatter spf = new SpeedFormatter(SpeedFormatter.Type.SHORT);
		PaceFormatter paf = new PaceFormatter(PaceFormatter.Type.SHORT);

		this.index.setText("#" + (message.getIndex() + 1)); //$NON-NLS-1$
		this.startTime.setText(DateFormat.getDateTimeInstance().format(
				new Date(Iterables.get(segment.getTrackpoints(), 0).getTime()
						.longValue())));
		this.distance.setText(dif.format(stats.getDistance().convertTo(
				settings.getDistanceUnit())));
		this.duration.setText(duf.format(stats.getDuration().convertTo(
				settings.getTimeUnit())));
		WayPoint minEle = stats.getMinElevation();
		WayPoint maxEle = stats.getMaxElevation();
		NumberFormat nf = NumberFormat.getNumberInstance();
		this.elevation.setText(minEle == null || maxEle == null
				|| minEle.getElevation() == null
				|| maxEle.getElevation() == null ? null : nf.format(minEle
				.getElevation().intValue())
				+ "m / "
				+ nf.format(maxEle.getElevation().intValue()) + "m");
		this.ascentDescent.setText("↑" + nf.format(stats.getAscent()) + "m / ↓"
				+ nf.format(stats.getDescent()) + "m");
		Speed avgSpeed = stats.getAvgSpeed();
		this.speed.setText(spf.format(settings, avgSpeed));
		this.pace.setText(paf.format(settings, avgSpeed));
	}

}


text:
<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/FrameworkViewMinifier/default',
    __DIR__
);


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Serialized Form (SBT Compiler API 1.0.0-beta9 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Serialized Form

Package com.google.code.sbt.compiler.api

Class com.google.code.sbt.compiler.api.CompilerConfiguration extends Object implements Serializable

serialVersionUID:

1L

Serialized Fields

sourceEncoding

String sourceEncoding

The -encoding option for Scala and Java compilers.

javacOptions

String javacOptions

Java compiler options.

scalacOptions

String scalacOptions

Scala compiler options.

sourceFiles

List<E> sourceFiles

Java and Scala source files.

scalaLibraryFile

File scalaLibraryFile

Scala library scala-library-<version>.jar file.

scalaCompilerFile

File scalaCompilerFile

Scala compiler scala-compiler-<version>.jar file.

scalaExtraJars

List<E> scalaExtraJars

Additional jar files to be added to Scala compiler classloader.

xsbtiFile

File xsbtiFile

SBT interface sbt-interface-<version>.jar file.

compilerInterfaceSrcFile

File compilerInterfaceSrcFile

SBT compiler interface sources compiler-interface-<version>-sources.jar file.

classpathFiles

List<E> classpathFiles

Compilation classpath files.

outputDirectory

File outputDirectory

Compilation output directory.

analysisCacheFile

File analysisCacheFile

SBT incremental compilation analysis cache file.

analysisCacheMap

Map<K,V> analysisCacheMap

All available SBT incremental compilation analysis cache files for reactor projects.

Class com.google.code.sbt.compiler.api.CompilerException extends Exception implements Serializable

serialVersionUID:

2L

Serialized Fields

problems

CompilationProblem[] problems

Class com.google.code.sbt.compiler.api.DefaultCompilationProblem extends Object implements Serializable

serialVersionUID:

1L

Serialized Fields

category

String category

message

String message

position

SourcePosition position

severity

String severity

Class com.google.code.sbt.compiler.api.DefaultSourcePosition extends Object implements Serializable

serialVersionUID:

1L

Serialized Fields

line

int line

lineContent

String lineContent

offset

int offset

pointer

int pointer

file

File file

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2013–2016. All rights reserved.


text:
package arq.examples.riot;

import org.apache.jena.rdf.model.Model ;
import org.apache.jena.riot.* ;

/** Example writing a model with RIOT */
public class ExRIOT_writeModel
{
    public static void main(String[] args)
    {
        Model model = RDFDataMgr.loadModel("D.ttl") ;

        System.out.println() ;
        System.out.println("#### ---- Write as Turtle") ;
        System.out.println() ;
        RDFDataMgr.write(System.out, model, Lang.TURTLE) ;

        System.out.println() ;
        System.out.println("#### ---- Write as Turtle (streaming)") ;
        System.out.println() ;
        RDFDataMgr.write(System.out, model, RDFFormat.TURTLE_BLOCKS) ;

        System.out.println() ;
        System.out.println("#### ---- Write as Turtle via model.write") ;
        System.out.println() ;
        model.write(System.out, "TTL") ;
    }

}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Run Coach</title>

Run Coach

        <button ng-click="authorize()">Authorize</button>

Create

Open


text:
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using HelperFramework.PInvoke;

namespace HelperFramework.WinForms
{
	public class CueTextBox : TextBox
	{

		#region CueText;

		private String _cueText = String.Empty;

		/// <summary>
		/// Gets or sets the text the <see cref="TextBox"/> will display as a cue to the user.
		/// </summary>
		[Description("The text value to be displayed as a cue to the user.")]
		[Category("Appearance")]
		[DefaultValue("")]
		[Localizable(true)]
		public String CueText
		{
			get { return _cueText; }
			set
			{
				if (value == null)
				{
					value = String.Empty;
				}

				if (!_cueText.Equals(value, StringComparison.CurrentCulture))
				{
					_cueText = value;
					UpdateCue();
					OnCueTextChanged(EventArgs.Empty);
				}
			}
		}

		/// <summary>
		/// Occurs when the <see cref="CueText"/> property value changes.
		/// </summary>
		public event EventHandler CueTextChanged;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		protected virtual void OnCueTextChanged(EventArgs e)
		{
			EventHandler handler = CueTextChanged;
			if (handler != null)
			{
				handler(this, e);
			}
		}

		private void UpdateCue()
		{
			// If the handle isn't yet created,
			// this will be called when it is created
			if (IsHandleCreated)
			{
				PInvoke.System.SendMessage(new HandleRef(this, Handle), Win32.EM.SETCUEBANNER, (_showCueTextWithFocus) ? new IntPtr(1) : IntPtr.Zero, _cueText);
			}
		}

		protected override void OnHandleCreated(EventArgs e)
		{
			UpdateCue();

			base.OnHandleCreated(e);
		}

		#endregion CueText;

		#region CharacterCasing;
		// CharacterCasing enforces also the cue text, so we need to override that;

		protected override void OnKeyPress(KeyPressEventArgs e)
		{
			switch (CharacterCasing)
			{
				case CharacterCasing.Lower:
					if (Char.IsUpper(e.KeyChar))
					{
						e.KeyChar = Char.ToLower(e.KeyChar);
					}
					break;
				case CharacterCasing.Upper:
					if (Char.IsLower(e.KeyChar))
					{
						e.KeyChar = Char.ToUpper(e.KeyChar);
					}
					break;
			}
			base.OnKeyPress(e);
		}

		private CharacterCasing _characterCasing = CharacterCasing.Normal;
		/// <summary>
		/// Gets or sets whether the <see cref="T:System.Windows.Forms.TextBox"/> control modifies the case of characters as they are typed.
		/// </summary>
		///
		/// <returns>
		/// One of the <see cref="T:System.Windows.Forms.CharacterCasing"/> enumeration values that specifies whether the <see cref="T:System.Windows.Forms.TextBox"/> control modifies the case of characters. The default is CharacterCasing.Normal.
		/// </returns>
		/// <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">A value that is not within the range of valid values for the enumeration was assigned to the property. </exception><filterpriority>1</filterpriority><PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/><IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/></PermissionSet>
		[DefaultValue(CharacterCasing.Normal)]
		public new CharacterCasing CharacterCasing
		{
			get
			{
				return _characterCasing;
			}
			set
			{
				_characterCasing = value;
			}
		}

		#endregion CharacterCasing;

		#region ShowCueTextOnFocus;

		private Boolean _showCueTextWithFocus;

		/// <summary>
		/// Gets or sets a value indicating whether the <see cref="TextBox"/> will display the <see cref="CueText"/>
		/// even when the control has focus.
		/// </summary>
		[Description("Indicates whether the CueText will be displayed even when the control has focus.")]
		[Category("Appearance")]
		[DefaultValue(false)]
		[Localizable(true)]
		public Boolean ShowCueTextWithFocus
		{
			get { return _showCueTextWithFocus; }
			set
			{
				if (_showCueTextWithFocus != value)
				{
					_showCueTextWithFocus = value;
					UpdateCue();
					OnShowCueTextWithFocusChanged(EventArgs.Empty);
				}
			}
		}

		/// <summary>
		/// Occurs when the <see cref="ShowCueTextWithFocus"/> property value changes.
		/// </summary>
		public event EventHandler ShowCueTextWithFocusChanged;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		protected virtual void OnShowCueTextWithFocusChanged(EventArgs e)
		{
			EventHandler handler = ShowCueTextWithFocusChanged;
			if (handler != null)
			{
				handler(this, e);
			}
		}

		#endregion ShowCueTextOnFocus;

	}
}


text:
@interface YTVimeoURLParserTestCase : XCTestCase

@end

@implementation YTVimeoURLParserTestCase

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

#pragma mark -
-(void)testValidVimeoURL{

    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];
    XCTAssertTrue([parser validateVimeoURL:@"https://vimeo.com/145706460"]);
    XCTAssertTrue([parser extractVideoIdentifier:@"https://vimeo.com/145706460"].length > 0);

}

-(void)testValidVimeoURL_StaffPicks{
    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];

    XCTAssertTrue([parser validateVimeoURL:@"https://vimeo.com/channels/staffpicks/147365861"]);
    XCTAssertTrue([parser extractVideoIdentifier:@"https://vimeo.com/channels/staffpicks/147365861"].length > 0);

}

-(void)testValidVimeoURL_Groups{

    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];

    XCTAssertTrue([parser validateVimeoURL:@"https://vimeo.com/groups/travelhd/videos/147536447"]);
    XCTAssertTrue([parser extractVideoIdentifier:@"https://vimeo.com/groups/travelhd/videos/147536447"].length > 0);

}

-(void)testValidVimeoURL_Album{

    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];
    XCTAssertTrue([parser validateVimeoURL:@"https://vimeo.com/album/3643712/video/59749737"]);
    XCTAssertTrue([parser extractVideoIdentifier:@"https://vimeo.com/album/3643712/video/59749737"].length > 0);

}

#pragma mark -
-(void)testInvalidVimeoURL_nilParm{

    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];
    XCTAssertFalse([parser validateVimeoURL:nil]);
    XCTAssertFalse([parser extractVideoIdentifier:nil].length > 0);

}

-(void)testInvalidVimeoURL_EmptyString{

    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];
    XCTAssertFalse([parser validateVimeoURL:@""]);
    XCTAssertFalse([parser extractVideoIdentifier:@""].length > 0);
}

-(void)testInvalidVimeoURL_NonNumeric{

    YTVimeoURLParser *parser = [[YTVimeoURLParser alloc]init];
    XCTAssertFalse([parser validateVimeoURL:@"https://vimeo.com/album/3643712/video/AAAAAA"]);
    XCTAssertFalse([parser extractVideoIdentifier:@"https://vimeo.com/album/3643712/video/AAAAAA"].length > 0);
}

@end


text:
require 'google/apis/clouderrorreporting_v1beta1/service.rb'
require 'google/apis/clouderrorreporting_v1beta1/classes.rb'
require 'google/apis/clouderrorreporting_v1beta1/representations.rb'
require 'google/apis/clouderrorreporting_v1beta1/gem_version.rb'

module Google
  module Apis
    # Error Reporting API
    #
    # Groups and counts similar errors from cloud services and applications, reports
    # new errors, and provides access to error groups and their associated errors.
    #
    # @see https://cloud.google.com/error-reporting/
    module ClouderrorreportingV1beta1
      # Version of the Error Reporting API this client connects to.
      # This is NOT the gem version.
      VERSION = 'V1beta1'

      # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
      AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
    end
  end
end


text:
package com.mycompany.sample.payment.service.gateway;

import com.mycompany.sample.vendor.nullPaymentGateway.service.payment.NullPaymentGatewayType;
import org.apache.commons.lang.ArrayUtils;
import org.sparkcommerce.common.money.Money;
import org.sparkcommerce.common.payment.PaymentTransactionType;
import org.sparkcommerce.common.payment.PaymentType;
import org.sparkcommerce.common.payment.dto.PaymentResponseDTO;
import org.sparkcommerce.common.payment.service.PaymentGatewayWebResponsePrintService;
import org.sparkcommerce.common.payment.service.PaymentGatewayWebResponseService;
import org.sparkcommerce.common.vendor.service.exception.PaymentException;
import com.mycompany.sample.vendor.nullPaymentGateway.service.payment.NullPaymentGatewayConstants;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * This is an example implementation of a {@link PaymentGatewayWebResponseService}.
 * This will translate the Post information back from
 * {@link com.mycompany.sample.vendor.nullPaymentGateway.web.controller.NullPaymentGatewayProcessorController}
 * into a PaymentResponseDTO for processing in the Spark System.
 *
 * Replace with a real Payment Gateway Integration like Braintree or PayPal PayFlow.
 *
 * In order to use load this demo service, you will need to component scan
 * the package "com.mycompany.sample".
 *
 * This should NOT be used in production, and is meant solely for demonstration
 * purposes only.
 *
 * @author Elbert Bautista (elbertbautista)
 */
@Service("blNullPaymentGatewayWebResponseService")
public class NullPaymentGatewayWebResponseServiceImpl implements PaymentGatewayWebResponseService {

    @Resource(name = "blPaymentGatewayWebResponsePrintService")
    protected PaymentGatewayWebResponsePrintService webResponsePrintService;

    @Resource(name = "blNullPaymentGatewayConfiguration")
    protected NullPaymentGatewayConfiguration configuration;

    @Override
    public PaymentResponseDTO translateWebResponse(HttpServletRequest request) throws PaymentException {
        PaymentResponseDTO responseDTO = new PaymentResponseDTO(PaymentType.CREDIT_CARD,
                NullPaymentGatewayType.NULL_GATEWAY)
                .rawResponse(webResponsePrintService.printRequest(request));

        Map<String,String[]> paramMap = request.getParameterMap();

        Money amount = Money.ZERO;
        if (paramMap.containsKey(NullPaymentGatewayConstants.TRANSACTION_AMT)) {
            String amt = paramMap.get(NullPaymentGatewayConstants.TRANSACTION_AMT)[0];
            amount = new Money(amt);
        }

        boolean approved = false;
        if (paramMap.containsKey(NullPaymentGatewayConstants.RESULT_SUCCESS)) {
            String[] msg = paramMap.get(NullPaymentGatewayConstants.RESULT_SUCCESS);
            if (ArrayUtils.contains(msg, "true")) {
                approved = true;
            }
        }

        PaymentTransactionType type = PaymentTransactionType.AUTHORIZE_AND_CAPTURE;
        if (!configuration.isPerformAuthorizeAndCapture()) {
            type = PaymentTransactionType.AUTHORIZE;
        }

        responseDTO.successful(approved)
                .amount(amount)
                .paymentTransactionType(type)
                .orderId(paramMap.get(NullPaymentGatewayConstants.ORDER_ID)[0])
                .responseMap(NullPaymentGatewayConstants.GATEWAY_TRANSACTION_ID,
                        paramMap.get(NullPaymentGatewayConstants.GATEWAY_TRANSACTION_ID)[0])
                .responseMap(NullPaymentGatewayConstants.RESULT_MESSAGE,
                        paramMap.get(NullPaymentGatewayConstants.RESULT_MESSAGE)[0])
                .billTo()
                    .addressFirstName(paramMap.get(NullPaymentGatewayConstants.BILLING_FIRST_NAME)[0])
                    .addressLastName(paramMap.get(NullPaymentGatewayConstants.BILLING_LAST_NAME)[0])
                    .addressLine1(paramMap.get(NullPaymentGatewayConstants.BILLING_ADDRESS_LINE1)[0])
                    .addressLine2(paramMap.get(NullPaymentGatewayConstants.BILLING_ADDRESS_LINE2)[0])
                    .addressCityLocality(paramMap.get(NullPaymentGatewayConstants.BILLING_CITY)[0])
                    .addressStateRegion(paramMap.get(NullPaymentGatewayConstants.BILLING_STATE)[0])
                    .addressPostalCode(paramMap.get(NullPaymentGatewayConstants.BILLING_ZIP)[0])
                    .addressCountryCode(paramMap.get(NullPaymentGatewayConstants.BILLING_COUNTRY)[0])
                    .done()
                .creditCard()
                    .creditCardHolderName(paramMap.get(NullPaymentGatewayConstants.CREDIT_CARD_NAME)[0])
                    .creditCardLastFour(paramMap.get(NullPaymentGatewayConstants.CREDIT_CARD_LAST_FOUR)[0])
                    .creditCardType(paramMap.get(NullPaymentGatewayConstants.CREDIT_CARD_TYPE)[0])
                    .creditCardExpDate(paramMap.get(NullPaymentGatewayConstants.CREDIT_CARD_EXP_DATE)[0])
                    .done();

        return responseDTO;

    }

}


text:
namespace vosvideo
{
	namespace mediafile
	{
		class MediaFileManager
		{
		public:
			MediaFileManager();
			virtual ~MediaFileManager();
		};
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>DebugVector2 — armacode Documentation</title>
<link href="../../_static/basic.css" rel="stylesheet" type="text/css"/>
<link href="../../_static/pygments.css" rel="stylesheet" type="text/css"/>

<link href="../../_static/ar-ma_favicon.ico" rel="shortcut icon"/>
<link href="../../index.html" rel="top" title="armacode Documentation"/>
<link href="../../libraries.html" rel="up" title="Libraries"/>
<link href="DictionaryMerge.html" rel="next" title="DictionaryMerge"/>
<link href="DebugVector.html" rel="prev" title="DebugVector"/>

Navigation

index

next |

previous |

armacode Documentation »

Libraries »

DebugVector2¶

DebugVector2(start_pt, end_pt, name=None, layer=None, color=None)¶

Add a line with end arrow for visualisation.

Previous topic

DebugVector

Next topic

DictionaryMerge

This Page

Show Source

Quick search

<form action="../../search.html" class="search" method="get">
<input name="q" type="text"/>
<input type="submit" value="Go"/>
<input name="check_keywords" type="hidden" value="yes"/>
<input name="area" type="hidden" value="default"/>
</form>

    Enter search terms or a module, class or function name.

Navigation

index

next |

previous |

armacode Documentation »

Libraries »

        © Copyright 2014, Tony Ho.
      Created using Sphinx 1.3.5.


text:
function [datamx, cdata, expdirs, errfiles, errratio] = read_armafiles(rootdir, fprefix)
%READ_ARMAFILES reads all armadillo output files in the subdirectories of ROODIR.
%ALL armadillo output files should have fprefix. If the extension is  BIN, it is a binary file.
%If the extension is MAT, then it is an ASCII file.
%
%   read_armafiles(resultroot, 'result')
%
%   See Also: READ_ARMAMASKS, FTEST, MYFSTAT, BATCHCOPYFILES, BATCHFTEST

%   $ Hyunwoo J. Kim $  $ 2015/08/02 22:49:27 (CDT) $

    expdirs = dir(fullfile(rootdir, 'exp*'));
    %% Read, convert and write permutation test results
    cdata = cell(length(expdirs),1);
    errors  = false(length(expdirs),1);

    parfor i =1:length(expdirs)
        try
            data = readdata(fullfile(rootdir, expdirs(i).name),fprefix);
            cdata{i} = data;
        catch err
            disp(err)
            errors(i) = true;
            continue;
        end
    end
    datamx = cell2mat(cdata(~errors));
    errfiles = expdirs(errors);
    errratio = sum(errors)/length(errors);
end

function mx = readdata(path,fprefix)
    ff = dir(fullfile(path,sprintf('%s*',fprefix)));
    ext = ff.name(end-2:end);
    if strcmp(ext,'bin')==1
        mx = fread_arma_binary(fullfile(path,ff.name));
    else
        mx = load(fullfile(path,ff.name),'-ascii');
    end
end


text:
Viewer::Viewer(QWidget* parent)
  : QGLViewer(parent), surface(0)
{
  // Do not store state in a file
  setStateFileName("");
}

void Viewer::init()
{
  setBackgroundColor(Qt::white);
  glLineStipple(5, 0xaaaa);
  glDisable(GL_LINE_STIPPLE);

  // anti-aliasing
  glEnable(GL_BLEND);
  glEnable(GL_LINE_SMOOTH);
  glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}

QString Viewer::helpString() const
{
  return ""
  "
Surface mesher demo
\n"
  "
No help availlable for now.
";
}

void Viewer::interpolateToFitBoundingBox(double xmin, double ymin, double zmin,
                                         double xmax, double ymax, double zmax)
{
  QAction* auto_resize = parent()->parent()->findChild<QAction*>("actionAuto_resize");
  Q_ASSERT_X(auto_resize, "Viewer::interpolateToFitBoundingBox", "cannot find action \"actionAuto_resize\"");
  if(auto_resize && auto_resize->isChecked())
  {
    qglviewer::Camera new_camera = *(camera ());
    new_camera.fitBoundingBox(qglviewer::Vec(xmin, ymin, zmin),
                              qglviewer::Vec(xmax, ymax, zmax));
    camera()->interpolateTo(*new_camera.frame(), 1.);
  }
}

void Viewer::draw()
{
  if(surface)
    surface->draw();
}

void Viewer::drawWithNames()
{
  if(surface)
    surface->drawWithNames();
}
void Viewer::postSelection(const QPoint& p)
{
  if(surface)
    surface->postSelection(p);
}

void Viewer::set_surface(Surface* s)
{
  surface = s;
}

#include "viewer.moc"


text:
class InvalidContextException(Exception):
        pass

class NotCallableException(Exception):
        pass

class ValidationError(Exception):
        pass


text:
using MediatR;

namespace Shrew.Web.Infrastructure.SuggestionsBox
{
    public class DetailsCommand : IAsyncRequest
    {
        public DetailsModel Details { get; private set; }
        public DetailsCommand(DetailsModel details)
        {
            this.Details = details;
        }
    }
}


text:
require 'test_helper'
require 'generators/docker_hosting/hosting_generator'

class HostingGeneratorTest < Rails::Generators::TestCase
  tests ::DockerHosting::Generators::HostingGenerator
  destination File.expand_path('../../tmp', __FILE__)
  setup { prepare_destination }

  test 'generate hosting configurations for sqlite3' do
    ActiveRecord::Base.configurations[Rails.env] = {
        'adapter' => 'sqlite3'
    }

    run_generator %w(hosting_generator)
    assert_file 'config/hosting/Dockerfile'
  end

  test 'generate hosting configurations for postgresql' do
    ActiveRecord::Base.configurations[Rails.env] = {
        'adapter' => 'postgresql'
    }

    run_generator %w(hosting_generator)
    assert_file 'config/hosting/Dockerfile'
  end
end


text:
using NUnit.Framework;

using System;
using System.Data;

using GHTUtils;
using GHTUtils.Base;

namespace tests.system_data_dll.System_Data
{
[TestFixture] public class DataColumn_Caption : GHTBase
{
	[Test] public void Main()
	{
		DataColumn_Caption tc = new DataColumn_Caption();
		Exception exp = null;
		try
		{
			tc.BeginTest("DataColumn_Caption");
			tc.run();
		}
		catch(Exception ex)
		{
			exp = ex;
		}
		finally
		{
			tc.EndTest(exp);
		}
	}

	//Activate This Construntor to log All To Standard output
	//public TestClass():base(true){}

	//Activate this constructor to log Failures to a log file
	//public TestClass(System.IO.TextWriter tw):base(tw, false){}

	//Activate this constructor to log All to a log file
	//public TestClass(System.IO.TextWriter tw):base(tw, true){}

	//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES

	public void run()
	{
		Exception exp = null;

		DataColumn dc;
		string sCaption = "NewCaption";
		dc = new DataColumn("ColName",typeof(string));

		//Checking default value ( ColumnName )
		try
		{
			BeginCase("Checking default value ( ColumnName )");
			Compare(dc.Caption,dc.ColumnName );
		}
		catch(Exception ex)	{exp = ex;}
		finally	{EndCase(exp); exp = null;}

		//Cheking Set
		dc.Caption = sCaption;

		try
		{
			BeginCase("Checking Get");
			Compare(dc.Caption ,sCaption );
		}
		catch(Exception ex)	{exp = ex;}
		finally	{EndCase(exp); exp = null;}

	}
}
}


text:
package parse

import (
	"github.com/lomik/go-carbon/points"
	pickle "github.com/lomik/graphite-pickle"
)

func Pickle(body []byte) ([]*points.Points, error) {
	result := []*points.Points{}

	err := pickle.ParseMessage(body, func(name string, value float64, timestamp int64) {
		if len(result) == 0 || result[len(result)-1].Metric != name {
			result = append(result, points.OnePoint(name, value, timestamp))
		} else {
			result[len(result)-1].Add(value, timestamp)
		}
	})

	return result, err
}


text:
@php $relationshipDetails = json_decode($relationship['details']); @endphp

{{ $relationship->display_name }}

        {{ __('voyager.database.type') }}: relationship

        <input class="row_order" type="hidden" value="{{ $relationship['order'] }}" name="field_order_{{ $relationship['field'] }}">

        <input type="checkbox" name="field_browse_{{ $relationship['field'] }}" @if(isset($relationship->browse) && $relationship->browse){{ 'checked="checked"' }}@elseif(!isset($relationship->browse)){{ 'checked="checked"' }}@endif>
         Browse

        <input type="checkbox" name="field_read_{{ $relationship['field'] }}" @if(isset($relationship->read) && $relationship->read){{ 'checked="checked"' }}@elseif(!isset($relationship->read)){{ 'checked="checked"' }}@endif>
         Read

        <input type="checkbox" name="field_edit_{{ $relationship['field'] }}" @if(isset($relationship->edit) && $relationship->edit){{ 'checked="checked"' }}@elseif(!isset($relationship->edit)){{ 'checked="checked"' }}@endif>
         Edit

        <input type="checkbox" name="field_add_{{ $relationship['field'] }}" @if(isset($relationship->add) && $relationship->add){{ 'checked="checked"' }}@elseif(!isset($relationship->add)){{ 'checked="checked"' }}@endif>
         Add

        <input type="checkbox" name="field_delete_{{ $relationship['field'] }}" @if(isset($relationship->delete) && $relationship->delete){{ 'checked="checked"' }}@elseif(!isset($relationship->delete)){{ 'checked="checked"' }}@endif>
         Delete

Relationship

        <input type="text" name="field_display_name_{{ $relationship['field'] }}" class="form-control relationship_display_name" value="{{ $relationship['display_name'] }}">

             OpenClose Relationship Details

         Delete

{{ str_singular(ucfirst($table)) }}

            <select class="relationship_type select2" name="relationship_type_{{ $relationship['field'] }}">
                <option value="hasOne" @if(isset($relationshipDetails->type) && $relationshipDetails->type == 'hasOne'){{ 'selected="selected"' }}@endif>Has One</option>
                <option value="hasMany" @if(isset($relationshipDetails->type) && $relationshipDetails->type == 'hasMany'){{ 'selected="selected"' }}@endif>Has Many</option>
                <option value="belongsTo" @if(isset($relationshipDetails->type) && $relationshipDetails->type == 'belongsTo'){{ 'selected="selected"' }}@endif>Belongs To</option>
                <option value="belongsToMany" @if(isset($relationshipDetails->type) && $relationshipDetails->type == 'belongsToMany'){{ 'selected="selected"' }}@endif>Belongs To Many</option>
            </select>
            <select class="relationship_table select2" name="relationship_table_{{ $relationship['field'] }}">
                @foreach($tables as $table)
                    <option value="{{ $table }}" @if(isset($relationshipDetails->table) && $relationshipDetails->table == $table){{ 'selected="selected"' }}@endif>{{ ucfirst($table) }}</option>
                @endforeach
            </select>
            <input type="text" class="form-control" name="relationship_model_{{ $relationship['field'] }}" placeholder="Model Namespace (ex. App\Category)" value="@if(isset($relationshipDetails->model)){{ $relationshipDetails->model }}@endif">

type == 'belongsTo'){{ 'flexed' }}@endif">
                    Which column from the {{ str_singular(ucfirst($table)) }} is used to reference the ?
                    <select name="relationship_column_belongs_to_{{ $relationship['field'] }}" class="new_relationship_field select2">
                        @foreach($fieldOptions as $data)
                            <option value="{{ $data['field'] }}" @if($relationshipDetails->column == $data['field']){{ 'selected="selected"' }}@endif>{{ $data['field'] }}</option>
                        @endforeach
                    </select>

type == 'hasOne' || $relationshipDetails->type == 'hasMany'){{ 'flexed' }}@endif">
                    Which column from the  is used to reference the {{ str_singular(ucfirst($table)) }}?
                    <select name="relationship_column_{{ $relationship['field'] }}" class="new_relationship_field select2 rowDrop" data-table="@if(isset($relationshipDetails->table)){{ $relationshipDetails->table }}@endif" data-selected="{{ $relationshipDetails->column }}">
                    </select>

type == 'belongsToMany'){{ 'visible' }}@endif">
            Pivot Table:
            <select name="relationship_pivot_table_{{ $relationship['field'] }}" class="select2">
                @foreach($tables as $tbl)
                    <option value="{{ $tbl }}" @if(isset($relationshipDetails->pivot_table) && $relationshipDetails->pivot_table == $tbl){{ 'selected="selected"' }}@endif>{{ str_singular(ucfirst($tbl)) }}</option>
                @endforeach
            </select>

            Display the
            <select name="relationship_label_{{ $relationship['field'] }}" class="rowDrop select2" data-table="@if(isset($relationshipDetails->table)){{ $relationshipDetails->table }}@endif" data-selected="@if(isset($relationshipDetails->label)){{ $relationshipDetails->label }}@endif">
            </select>
            type == 'belongsTo' || $relationshipDetails->type == 'belongsToMany'){{ 'display:block' }}@endif">Store the
            <select name="relationship_key_{{ $relationship['field'] }}" class="rowDrop select2 relationship_key" style="@if($relationshipDetails->type == 'belongsTo' || $relationshipDetails->type == 'belongsToMany'){{ 'display:block' }}@endif" data-table="@if(isset($relationshipDetails->table)){{ $relationshipDetails->table }}@endif" data-selected="@if(isset($relationshipDetails->key)){{ $relationshipDetails->key }}@endif">
            </select>

    <input type="hidden" value="0" name="field_required_{{ $relationship['field'] }}" checked="checked">
    <input type="hidden" name="field_input_type_{{ $relationship['field'] }}" value="relationship">
    <input type="hidden" name="field_{{ $relationship['field'] }}" value="{{ $relationship['field'] }}">
    <input type="hidden" name="relationships[]" value="{{ $relationship['field'] }}">