text:
'use strict';

var defaults = require('./core.defaults');
var helpers = require('../helpers/index');
var Interaction = require('./core.interaction');
var layouts = require('./core.layouts');
var platform = require('../platforms/platform');
var plugins = require('./core.plugins');

module.exports = function(Chart) {

	// Create a dictionary of chart types, to allow for extension of existing types
	Chart.types = {};

	// Store a reference to each instance - allowing us to globally resize chart instances on window resize.
	// Destroy method on the chart will remove the instance of the chart from this reference.
	Chart.instances = {};

	// Controllers available for dataset visualization eg. bar, line, slice, etc.
	Chart.controllers = {};

	/**
	 * Initializes the given config with global and chart default values.
	 */
	function initConfig(config) {
		config = config || {};

		// Do NOT use configMerge() for the data object because this method merges arrays
		// and so would change references to labels and datasets, preventing data updates.
		var data = config.data = config.data || {};
		data.datasets = data.datasets || [];
		data.labels = data.labels || [];

		config.options = helpers.configMerge(
			defaults.global,
			defaults[config.type],
			config.options || {});

		return config;
	}

	/**
	 * Updates the config of the chart
	 * @param chart {Chart} chart to update the options for
	 */
	function updateConfig(chart) {
		var newOptions = chart.options;

		helpers.each(chart.scales, function(scale) {
			layouts.removeBox(chart, scale);
		});

		newOptions = helpers.configMerge(
			Chart.defaults.global,
			Chart.defaults[chart.config.type],
			newOptions);

		chart.options = chart.config.options = newOptions;
		chart.ensureScalesHaveIDs();
		chart.buildOrUpdateScales();
		// Tooltip
		chart.tooltip._options = newOptions.tooltips;
		chart.tooltip.initialize();
	}

	function positionIsHorizontal(position) {
		return position === 'top' || position === 'bottom';
	}

	helpers.extend(Chart.prototype, /** @lends Chart */ {
		/**
		 * @private
		 */
		construct: function(item, config) {
			var me = this;

			config = initConfig(config);

			var context = platform.acquireContext(item, config);
			var canvas = context && context.canvas;
			var height = canvas && canvas.height;
			var width = canvas && canvas.width;

			me.id = helpers.uid();
			me.ctx = context;
			me.canvas = canvas;
			me.config = config;
			me.width = width;
			me.height = height;
			me.aspectRatio = height ? width / height : null;
			me.options = config.options;
			me._bufferedRender = false;

			/**
			 * Provided for backward compatibility, Chart and Chart.Controller have been merged,
			 * the "instance" still need to be defined since it might be called from plugins.
			 * @prop Chart#chart
			 * @deprecated since version 2.6.0
			 * @todo remove at version 3
			 * @private
			 */
			me.chart = me;
			me.controller = me; // chart.chart.controller #inception

			// Add the chart instance to the global namespace
			Chart.instances[me.id] = me;

			// Define alias to the config data: `chart.data === chart.config.data`
			Object.defineProperty(me, 'data', {
				get: function() {
					return me.config.data;
				},
				set: function(value) {
					me.config.data = value;
				}
			});

			if (!context || !canvas) {
				// The given item is not a compatible context2d element, let's return before finalizing
				// the chart initialization but after setting basic chart / controller properties that
				// can help to figure out that the chart is not valid (e.g chart.canvas !== null);
				// https://github.com/chartjs/Chart.js/issues/2807
				console.error("Failed to create chart: can't acquire context from the given item");
				return;
			}

			me.initialize();
			me.update();
		},

		/**
		 * @private
		 */
		initialize: function() {
			var me = this;

			// Before init plugin notification
			plugins.notify(me, 'beforeInit');

			helpers.retinaScale(me, me.options.devicePixelRatio);

			me.bindEvents();

			if (me.options.responsive) {
				// Initial resize before chart draws (must be silent to preserve initial animations).
				me.resize(true);
			}

			// Make sure scales have IDs and are built before we build any controllers.
			me.ensureScalesHaveIDs();
			me.buildOrUpdateScales();
			me.initToolTip();

			// After init plugin notification
			plugins.notify(me, 'afterInit');

			return me;
		},

		clear: function() {
			helpers.canvas.clear(this);
			return this;
		},

		stop: function() {
			// Stops any current animation loop occurring
			Chart.animationService.cancelAnimation(this);
			return this;
		},

		resize: function(silent) {
			var me = this;
			var options = me.options;
			var canvas = me.canvas;
			var aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;

			// the canvas render width and height will be casted to integers so make sure that
			// the canvas display style uses the same integer values to avoid blurring effect.

			// Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collased
			var newWidth = Math.max(0, Math.floor(helpers.getMaximumWidth(canvas)));
			var newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers.getMaximumHeight(canvas)));

			if (me.width === newWidth && me.height === newHeight) {
				return;
			}

			canvas.width = me.width = newWidth;
			canvas.height = me.height = newHeight;
			canvas.style.width = newWidth + 'px';
			canvas.style.height = newHeight + 'px';

			helpers.retinaScale(me, options.devicePixelRatio);

			if (!silent) {
				// Notify any plugins about the resize
				var newSize = {width: newWidth, height: newHeight};
				plugins.notify(me, 'resize', [newSize]);

				// Notify of resize
				if (me.options.onResize) {
					me.options.onResize(me, newSize);
				}

				me.stop();
				me.update(me.options.responsiveAnimationDuration);
			}
		},

		ensureScalesHaveIDs: function() {
			var options = this.options;
			var scalesOptions = options.scales || {};
			var scaleOptions = options.scale;

			helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {
				xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);
			});

			helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {
				yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);
			});

			if (scaleOptions) {
				scaleOptions.id = scaleOptions.id || 'scale';
			}
		},

		/**
		 * Builds a map of scale ID to scale object for future lookup.
		 */
		buildOrUpdateScales: function() {
			var me = this;
			var options = me.options;
			var scales = me.scales || {};
			var items = [];
			var updated = Object.keys(scales).reduce(function(obj, id) {
				obj[id] = false;
				return obj;
			}, {});

			if (options.scales) {
				items = items.concat(
					(options.scales.xAxes || []).map(function(xAxisOptions) {
						return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};
					}),
					(options.scales.yAxes || []).map(function(yAxisOptions) {
						return {options: yAxisOptions, dtype: 'linear', dposition: 'left'};
					})
				);
			}

			if (options.scale) {
				items.push({
					options: options.scale,
					dtype: 'radialLinear',
					isDefault: true,
					dposition: 'chartArea'
				});
			}

			helpers.each(items, function(item) {
				var scaleOptions = item.options;
				var id = scaleOptions.id;
				var scaleType = helpers.valueOrDefault(scaleOptions.type, item.dtype);

				if (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {
					scaleOptions.position = item.dposition;
				}

				updated[id] = true;
				var scale = null;
				if (id in scales && scales[id].type === scaleType) {
					scale = scales[id];
					scale.options = scaleOptions;
					scale.ctx = me.ctx;
					scale.chart = me;
				} else {
					var scaleClass = Chart.scaleService.getScaleConstructor(scaleType);
					if (!scaleClass) {
						return;
					}
					scale = new scaleClass({
						id: id,
						type: scaleType,
						options: scaleOptions,
						ctx: me.ctx,
						chart: me
					});
					scales[scale.id] = scale;
				}

				scale.mergeTicksOptions();

				// TODO(SB): I think we should be able to remove this custom case (options.scale)
				// and consider it as a regular scale part of the "scales"" map only! This would
				// make the logic easier and remove some useless? custom code.
				if (item.isDefault) {
					me.scale = scale;
				}
			});
			// clear up discarded scales
			helpers.each(updated, function(hasUpdated, id) {
				if (!hasUpdated) {
					delete scales[id];
				}
			});

			me.scales = scales;

			Chart.scaleService.addScalesToLayout(this);
		},

		buildOrUpdateControllers: function() {
			var me = this;
			var types = [];
			var newControllers = [];

			helpers.each(me.data.datasets, function(dataset, datasetIndex) {
				var meta = me.getDatasetMeta(datasetIndex);
				var type = dataset.type || me.config.type;

				if (meta.type && meta.type !== type) {
					me.destroyDatasetMeta(datasetIndex);
					meta = me.getDatasetMeta(datasetIndex);
				}
				meta.type = type;

				types.push(meta.type);

				if (meta.controller) {
					meta.controller.updateIndex(datasetIndex);
					meta.controller.linkScales();
				} else {
					var ControllerClass = Chart.controllers[meta.type];
					if (ControllerClass === undefined) {
						throw new Error('"' + meta.type + '" is not a chart type.');
					}

					meta.controller = new ControllerClass(me, datasetIndex);
					newControllers.push(meta.controller);
				}
			}, me);

			return newControllers;
		},

		/**
		 * Reset the elements of all datasets
		 * @private
		 */
		resetElements: function() {
			var me = this;
			helpers.each(me.data.datasets, function(dataset, datasetIndex) {
				me.getDatasetMeta(datasetIndex).controller.reset();
			}, me);
		},

		/**
		* Resets the chart back to it's state before the initial animation
		*/
		reset: function() {
			this.resetElements();
			this.tooltip.initialize();
		},

		update: function(config) {
			var me = this;

			if (!config || typeof config !== 'object') {
				// backwards compatibility
				config = {
					duration: config,
					lazy: arguments[1]
				};
			}

			updateConfig(me);

			// plugins options references might have change, let's invalidate the cache
			// https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167
			plugins._invalidate(me);

			if (plugins.notify(me, 'beforeUpdate') === false) {
				return;
			}

			// In case the entire data object changed
			me.tooltip._data = me.data;

			// Make sure dataset controllers are updated and new controllers are reset
			var newControllers = me.buildOrUpdateControllers();

			// Make sure all dataset controllers have correct meta data counts
			helpers.each(me.data.datasets, function(dataset, datasetIndex) {
				me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();
			}, me);

			me.updateLayout();

			// Can only reset the new controllers after the scales have been updated
			if (me.options.animation && me.options.animation.duration) {
				helpers.each(newControllers, function(controller) {
					controller.reset();
				});
			}

			me.updateDatasets();

			// Need to reset tooltip in case it is displayed with elements that are removed
			// after update.
			me.tooltip.initialize();

			// Last active contains items that were previously in the tooltip.
			// When we reset the tooltip, we need to clear it
			me.lastActive = [];

			// Do this before render so that any plugins that need final scale updates can use it
			plugins.notify(me, 'afterUpdate');

			if (me._bufferedRender) {
				me._bufferedRequest = {
					duration: config.duration,
					easing: config.easing,
					lazy: config.lazy
				};
			} else {
				me.render(config);
			}
		},

		/**
		 * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
		 * hook, in which case, plugins will not be called on `afterLayout`.
		 * @private
		 */
		updateLayout: function() {
			var me = this;

			if (plugins.notify(me, 'beforeLayout') === false) {
				return;
			}

			layouts.update(this, this.width, this.height);

			/**
			 * Provided for backward compatibility, use `afterLayout` instead.
			 * @method IPlugin#afterScaleUpdate
			 * @deprecated since version 2.5.0
			 * @todo remove at version 3
			 * @private
			 */
			plugins.notify(me, 'afterScaleUpdate');
			plugins.notify(me, 'afterLayout');
		},

		/**
		 * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
		 * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
		 * @private
		 */
		updateDatasets: function() {
			var me = this;

			if (plugins.notify(me, 'beforeDatasetsUpdate') === false) {
				return;
			}

			for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
				me.updateDataset(i);
			}

			plugins.notify(me, 'afterDatasetsUpdate');
		},

		/**
		 * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`
		 * hook, in which case, plugins will not be called on `afterDatasetUpdate`.
		 * @private
		 */
		updateDataset: function(index) {
			var me = this;
			var meta = me.getDatasetMeta(index);
			var args = {
				meta: meta,
				index: index
			};

			if (plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {
				return;
			}

			meta.controller.update();

			plugins.notify(me, 'afterDatasetUpdate', [args]);
		},

		render: function(config) {
			var me = this;

			if (!config || typeof config !== 'object') {
				// backwards compatibility
				config = {
					duration: config,
					lazy: arguments[1]
				};
			}

			var duration = config.duration;
			var lazy = config.lazy;

			if (plugins.notify(me, 'beforeRender') === false) {
				return;
			}

			var animationOptions = me.options.animation;
			var onComplete = function(animation) {
				plugins.notify(me, 'afterRender');
				helpers.callback(animationOptions && animationOptions.onComplete, [animation], me);
			};

			if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {
				var animation = new Chart.Animation({
					numSteps: (duration || animationOptions.duration) / 16.66, // 60 fps
					easing: config.easing || animationOptions.easing,

					render: function(chart, animationObject) {
						var easingFunction = helpers.easing.effects[animationObject.easing];
						var currentStep = animationObject.currentStep;
						var stepDecimal = currentStep / animationObject.numSteps;

						chart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);
					},

					onAnimationProgress: animationOptions.onProgress,
					onAnimationComplete: onComplete
				});

				Chart.animationService.addAnimation(me, animation, duration, lazy);
			} else {
				me.draw();

				// See https://github.com/chartjs/Chart.js/issues/3781
				onComplete(new Chart.Animation({numSteps: 0, chart: me}));
			}

			return me;
		},

		draw: function(easingValue) {
			var me = this;

			me.clear();

			if (helpers.isNullOrUndef(easingValue)) {
				easingValue = 1;
			}

			me.transition(easingValue);

			if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {
				return;
			}

			// Draw all the scales
			helpers.each(me.boxes, function(box) {
				box.draw(me.chartArea);
			}, me);

			if (me.scale) {
				me.scale.draw();
			}

			me.drawDatasets(easingValue);
			me._drawTooltip(easingValue);

			plugins.notify(me, 'afterDraw', [easingValue]);
		},

		/**
		 * @private
		 */
		transition: function(easingValue) {
			var me = this;

			for (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {
				if (me.isDatasetVisible(i)) {
					me.getDatasetMeta(i).controller.transition(easingValue);
				}
			}

			me.tooltip.transition(easingValue);
		},

		/**
		 * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
		 * hook, in which case, plugins will not be called on `afterDatasetsDraw`.
		 * @private
		 */
		drawDatasets: function(easingValue) {
			var me = this;

			if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {
				return;
			}

			// Draw datasets reversed to support proper line stacking
			for (var i = (me.data.datasets || []).length - 1; i >= 0; --i) {
				if (me.isDatasetVisible(i)) {
					me.drawDataset(i, easingValue);
				}
			}

			plugins.notify(me, 'afterDatasetsDraw', [easingValue]);
		},

		/**
		 * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`
		 * hook, in which case, plugins will not be called on `afterDatasetDraw`.
		 * @private
		 */
		drawDataset: function(index, easingValue) {
			var me = this;
			var meta = me.getDatasetMeta(index);
			var args = {
				meta: meta,
				index: index,
				easingValue: easingValue
			};

			if (plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {
				return;
			}

			meta.controller.draw(easingValue);

			plugins.notify(me, 'afterDatasetDraw', [args]);
		},

		/**
		 * Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw`
		 * hook, in which case, plugins will not be called on `afterTooltipDraw`.
		 * @private
		 */
		_drawTooltip: function(easingValue) {
			var me = this;
			var tooltip = me.tooltip;
			var args = {
				tooltip: tooltip,
				easingValue: easingValue
			};

			if (plugins.notify(me, 'beforeTooltipDraw', [args]) === false) {
				return;
			}

			tooltip.draw();

			plugins.notify(me, 'afterTooltipDraw', [args]);
		},

		// Get the single element that was clicked on
		// @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw
		getElementAtEvent: function(e) {
			return Interaction.modes.single(this, e);
		},

		getElementsAtEvent: function(e) {
			return Interaction.modes.label(this, e, {intersect: true});
		},

		getElementsAtXAxis: function(e) {
			return Interaction.modes['x-axis'](this, e, {intersect: true});
		},

		getElementsAtEventForMode: function(e, mode, options) {
			var method = Interaction.modes[mode];
			if (typeof method === 'function') {
				return method(this, e, options);
			}

			return [];
		},

		getDatasetAtEvent: function(e) {
			return Interaction.modes.dataset(this, e, {intersect: true});
		},

		getDatasetMeta: function(datasetIndex) {
			var me = this;
			var dataset = me.data.datasets[datasetIndex];
			if (!dataset._meta) {
				dataset._meta = {};
			}

			var meta = dataset._meta[me.id];
			if (!meta) {
				meta = dataset._meta[me.id] = {
					type: null,
					data: [],
					dataset: null,
					controller: null,
					hidden: null,			// See isDatasetVisible() comment
					xAxisID: null,
					yAxisID: null
				};
			}

			return meta;
		},

		getVisibleDatasetCount: function() {
			var count = 0;
			for (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
				if (this.isDatasetVisible(i)) {
					count++;
				}
			}
			return count;
		},

		isDatasetVisible: function(datasetIndex) {
			var meta = this.getDatasetMeta(datasetIndex);

			// meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,
			// the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.
			return typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;
		},

		generateLegend: function() {
			return this.options.legendCallback(this);
		},

		/**
		 * @private
		 */
		destroyDatasetMeta: function(datasetIndex) {
			var id = this.id;
			var dataset = this.data.datasets[datasetIndex];
			var meta = dataset._meta && dataset._meta[id];

			if (meta) {
				meta.controller.destroy();
				delete dataset._meta[id];
			}
		},

		destroy: function() {
			var me = this;
			var canvas = me.canvas;
			var i, ilen;

			me.stop();

			// dataset controllers need to cleanup associated data
			for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
				me.destroyDatasetMeta(i);
			}

			if (canvas) {
				me.unbindEvents();
				helpers.canvas.clear(me);
				platform.releaseContext(me.ctx);
				me.canvas = null;
				me.ctx = null;
			}

			plugins.notify(me, 'destroy');

			delete Chart.instances[me.id];
		},

		toBase64Image: function() {
			return this.canvas.toDataURL.apply(this.canvas, arguments);
		},

		initToolTip: function() {
			var me = this;
			me.tooltip = new Chart.Tooltip({
				_chart: me,
				_chartInstance: me, // deprecated, backward compatibility
				_data: me.data,
				_options: me.options.tooltips
			}, me);
		},

		/**
		 * @private
		 */
		bindEvents: function() {
			var me = this;
			var listeners = me._listeners = {};
			var listener = function() {
				me.eventHandler.apply(me, arguments);
			};

			helpers.each(me.options.events, function(type) {
				platform.addEventListener(me, type, listener);
				listeners[type] = listener;
			});

			// Elements used to detect size change should not be injected for non responsive charts.
			// See https://github.com/chartjs/Chart.js/issues/2210
			if (me.options.responsive) {
				listener = function() {
					me.resize();
				};

				platform.addEventListener(me, 'resize', listener);
				listeners.resize = listener;
			}
		},

		/**
		 * @private
		 */
		unbindEvents: function() {
			var me = this;
			var listeners = me._listeners;
			if (!listeners) {
				return;
			}

			delete me._listeners;
			helpers.each(listeners, function(listener, type) {
				platform.removeEventListener(me, type, listener);
			});
		},

		updateHoverStyle: function(elements, mode, enabled) {
			var method = enabled ? 'setHoverStyle' : 'removeHoverStyle';
			var element, i, ilen;

			for (i = 0, ilen = elements.length; i < ilen; ++i) {
				element = elements[i];
				if (element) {
					this.getDatasetMeta(element._datasetIndex).controller[method](element);
				}
			}
		},

		/**
		 * @private
		 */
		eventHandler: function(e) {
			var me = this;
			var tooltip = me.tooltip;

			if (plugins.notify(me, 'beforeEvent', [e]) === false) {
				return;
			}

			// Buffer any update calls so that renders do not occur
			me._bufferedRender = true;
			me._bufferedRequest = null;

			var changed = me.handleEvent(e);
			// for smooth tooltip animations issue #4989
			// the tooltip should be the source of change
			// Animation check workaround:
			// tooltip._start will be null when tooltip isn't animating
			if (tooltip) {
				changed = tooltip._start
					? tooltip.handleEvent(e)
					: changed | tooltip.handleEvent(e);
			}

			plugins.notify(me, 'afterEvent', [e]);

			var bufferedRequest = me._bufferedRequest;
			if (bufferedRequest) {
				// If we have an update that was triggered, we need to do a normal render
				me.render(bufferedRequest);
			} else if (changed && !me.animating) {
				// If entering, leaving, or changing elements, animate the change via pivot
				me.stop();

				// We only need to render at this point. Updating will cause scales to be
				// recomputed generating flicker & using more memory than necessary.
				me.render(me.options.hover.animationDuration, true);
			}

			me._bufferedRender = false;
			me._bufferedRequest = null;

			return me;
		},

		/**
		 * Handle an event
		 * @private
		 * @param {IEvent} event the event to handle
		 * @return {Boolean} true if the chart needs to re-render
		 */
		handleEvent: function(e) {
			var me = this;
			var options = me.options || {};
			var hoverOptions = options.hover;
			var changed = false;

			me.lastActive = me.lastActive || [];

			// Find Active Elements for hover and tooltips
			if (e.type === 'mouseout') {
				me.active = [];
			} else {
				me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);
			}

			// Invoke onHover hook
			// Need to call with native event here to not break backwards compatibility
			helpers.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);

			if (e.type === 'mouseup' || e.type === 'click') {
				if (options.onClick) {
					// Use e.native here for backwards compatibility
					options.onClick.call(me, e.native, me.active);
				}
			}

			// Remove styling for last active (even if it may still be active)
			if (me.lastActive.length) {
				me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);
			}

			// Built in hover styling
			if (me.active.length && hoverOptions.mode) {
				me.updateHoverStyle(me.active, hoverOptions.mode, true);
			}

			changed = !helpers.arrayEquals(me.active, me.lastActive);

			// Remember Last Actives
			me.lastActive = me.active;

			return changed;
		}
	});

	/**
	 * Provided for backward compatibility, use Chart instead.
	 * @class Chart.Controller
	 * @deprecated since version 2.6.0
	 * @todo remove at version 3
	 * @private
	 */
	Chart.Controller = Chart;
};


text:
module Storytime
  module Dashboard
    module VersionsHelper
      def versions_info(versionable)
        render 'storytime/dashboard/versions/versions_info', versionable: versionable
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
@implementation UIView (Frame)

- (BOOL)rr_intersectWithView:(UIView *)view
{
    if (view == nil) view = [UIApplication sharedApplication].keyWindow;

    CGRect rect1 = [self convertRect:self.bounds toView:nil];
    CGRect rect2 = [view convertRect:view.bounds toView:nil];
    return CGRectIntersectsRect(rect1, rect2);
}

- (CGFloat)rr_height
{
    return self.frame.size.height;
}
- (void)setRr_height:(CGFloat)rr_height
{
    CGRect frame = self.frame;
    frame.size.height = rr_height;
    self.frame = frame;
}
- (CGFloat)rr_width
{
     return self.frame.size.width;
}

- (void)setRr_width:(CGFloat)rr_width
{
    CGRect frame = self.frame;
    frame.size.width = rr_width;
    self.frame = frame;
}

- (void)setRr_x:(CGFloat)rr_x
{
    CGRect frame = self.frame;
    frame.origin.x = rr_x;
    self.frame = frame;

}
- (CGFloat)rr_x
{
    return self.frame.origin.x;
}

- (void)setRr_y:(CGFloat)rr_y
{
    CGRect frame = self.frame;
    frame.origin.y = rr_y;
    self.frame = frame;
}
- (CGFloat)rr_y
{
    return self.frame.origin.y;
}

- (void)setRr_centerX:(CGFloat)rr_centerX
{
    CGPoint center = self.center;
    center.x = rr_centerX;
    self.center = center;
}
- (CGFloat)rr_centerX
{
    return self.center.x;
}
- (void)setRr_centerY:(CGFloat)rr_centerY
{
    CGPoint center = self.center;
    center.y = rr_centerY;
    self.center = center;
}
- (CGFloat)rr_centerY
{
    return self.center.y;
}
@end


text:
@implementation IRAPIManagerTestCase (getMarketSummary)

- (void)test_getMarketSummary_sendsDataToNetworkManager {
    [[IRAPIManager manager] getMarketSummaryForPrimaryCurrencyCode:nil secondaryCurrencyCode:nil responseHandler:nil];
    NSString *expectedURLString = [NSString stringWithFormat:@"/%@", IRAPI_GetMarketSummaryMethod];
    XCTAssertEqualObjects(self.fakeNetworkManager.lastURLString, expectedURLString);
    XCTAssertNotNil(self.fakeNetworkManager.lastParameters);
}

@end


text:
var shared = require('./lib/shared');
var TweetFilter = require('../lib/filter')
var filter = new TweetFilter(TweetFilter.getFiltersFromFiles("filters/german"))

var matches = [
    "ich will mich vegan ernähren",
    "ich möchte mich vegan ernähren",
    "ich sollte mich vegan ernähren",
    "ich möchte vegan werden",
    "ich will vegan werden",
    "ich möchte vegan sein",
    "ich will vegan sein",
    "ich möchte vegan leben",
    "ich will vegan leben",
    "ich möchte vegan essen",
    "ich will vegan essen",
    "ich möchte endlich vegan werden",
    "ich will endlich vegan werden",
    "ich möchte endlich vegan sein",
    "ich will endlich vegan sein",
    "ich möchte endlich vegan leben",
    "ich will endlich vegan leben",
    "ich möchte endlich vegan essen",
    "ich will endlich vegan essen",
    "ich möchte auch vegan werden",
    "ich will auch vegan werden",
    "ich möchte auch vegan sein",
    "ich will auch vegan sein",
    "ich möchte auch vegan leben",
    "ich will auch vegan leben",
    "ich möchte auch vegan essen",
    "ich will auch vegan essen",
    "ich möchte gerne vegan werden",
    "ich will gerne vegan werden",
    "ich möchte gerne vegan sein",
    "ich will gerne vegan sein",
    "ich möchte gerne vegan leben",
    "ich will gerne vegan leben",
    "ich möchte gerne vegan essen",
    "ich will gerne vegan essen",
    "ich möchte bald vegan werden",
    "ich will bald vegan werden",
    "ich möchte bald vegan sein",
    "ich will bald vegan sein",
    "ich möchte bald vegan leben",
    "ich will bald vegan leben",
    "ich möchte bald vegan essen",
    "ich will bald vegan essen",
    "ich will wieder vegan sein",
    "ich will wieder vegan werden",
    "ich will wieder vegan leben",
    "ich will wieder vegan essen",
    "ich möchte wieder vegan sein",
    "ich möchte wieder vegan werden",
    "ich möchte wieder vegan leben",
    "ich möchte wieder vegan essen",
    "ich überlege vegan zu werden",
    "ich überlege auch vegan zu werden",
    "ich möchte bald vegan werden",
    "ich wäre gerne vegan",
    "ich wäre liebend gerne vegan",
    "ich würde gerne vegan werden",
    "ich würde ja gerne vegan werden",
    "ich hab voll bock vegan zu werden",
    "ich versuche auch vegan zu werden",
    "ich versuche jetzt auch vegan zu werden",
    "ich versuche gerade vegan zu werden",
    "ich versuche auch gerade vegan zu werden",
    "ich würde mich gerne vegan ernähren",
    "ich würde mich eigentlich gerne vegan ernähren"
];

var falsePositives = [
];

exports.matches = function(test) {
    shared.testMatches(test, matches, filter);
    test.done();
}

exports.falsePositives = function(test) {
    shared.testFalsePositives(test, falsePositives, filter);
    test.done();
}


text:
package quickstart;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ClientZookeeper {
	public static void main(String[] args) throws InterruptedException {
		ApplicationContext ctx = new ClassPathXmlApplicationContext(
				"classpath:motan_zookeeper_client.xml");
		FooService service = (FooService) ctx.getBean("remoteService");
		System.out.println(service.hello("motan zookeeper"));
	}
}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>My Project: tests/ipc_stress.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

My Project

Main Page

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

File Members

tests

Macros |
Functions |
Variables

ipc_stress.c File Reference

#include "../src/nn.h"

#include "../src/pair.h"

#include "../src/pubsub.h"

#include "../src/pipeline.h"

#include "../src/ipc.h"

#include "testutil.h"

#include "../src/utils/thread.c"

#include "../src/utils/atomic.h"

#include "../src/utils/atomic.c"

Include dependency graph for ipc_stress.c:

<map name="tests_2ipc__stress_8c" id="tests_2ipc__stress_8c">
<area shape="rect" id="node2" href="nn_8h.html" title="../src/nn.h" alt="" coords="314,304,395,331"/>
<area shape="rect" id="node5" href="pair_8h.html" title="../src/pair.h" alt="" coords="38,80,126,107"/>
<area shape="rect" id="node6" href="pubsub_8h.html" title="../src/pubsub.h" alt="" coords="150,80,259,107"/>
<area shape="rect" id="node7" href="pipeline_8h.html" title="../src/pipeline.h" alt="" coords="284,80,394,107"/>
<area shape="rect" id="node8" href="ipc_8h.html" title="../src/ipc.h" alt="" coords="418,80,502,107"/>
<area shape="rect" id="node9" href="testutil_8h.html" title="testutil.h" alt="" coords="527,80,599,107"/>
<area shape="rect" id="node20" href="thread_8c.html" title="../src/utils/thread.c" alt="" coords="864,80,995,107"/>
<area shape="rect" id="node26" href="atomic_8h.html" title="../src/utils/atomic.h" alt="" coords="712,155,846,181"/>
<area shape="rect" id="node30" href="atomic_8c.html" title="../src/utils/atomic.c" alt="" coords="624,80,758,107"/>
<area shape="rect" id="node10" href="attr_8h.html" title="../src/utils/attr.h" alt="" coords="386,155,500,181"/>
<area shape="rect" id="node11" href="err_8c.html" title="../src/utils/err.c" alt="" coords="525,155,635,181"/>
<area shape="rect" id="node17" href="sleep_8c.html" title="../src/utils/sleep.c" alt="" coords="234,155,360,181"/>
<area shape="rect" id="node12" href="err_8h.html" title="err.h" alt="" coords="556,229,604,256"/>
<area shape="rect" id="node15" href="fast_8h.html" title="fast.h" alt="" coords="420,304,474,331"/>
<area shape="rect" id="node18" href="sleep_8h.html" title="sleep.h" alt="" coords="223,229,287,256"/>
<area shape="rect" id="node21" href="thread_8h.html" title="thread.h" alt="" coords="1012,155,1082,181"/>
<area shape="rect" id="node24" href="thread__posix_8inc.html" title="thread_posix.inc" alt="" coords="871,155,988,181"/>
<area shape="rect" id="node22" href="thread__posix_8h.html" title="thread_posix.h" alt="" coords="992,229,1099,256"/>
<area shape="rect" id="node27" href="mutex_8h.html" title="mutex.h" alt="" coords="807,229,876,256"/>
<area shape="rect" id="node28" href="int_8h.html" title="int.h" alt="" coords="736,229,782,256"/>
</map>

Macros

#define 	THREAD_COUNT   10

#define 	TEST_LOOPS   10

#define 	SOCKET_ADDRESS   "ipc://test-stress.ipc"

Functions

int 	main ()

Variables

struct nn_atomic 	active

Macro Definition Documentation

          #define SOCKET_ADDRESS   "ipc://test-stress.ipc"

          #define TEST_LOOPS   10

          #define THREAD_COUNT   10

Function Documentation

          int main
          (
          	)

Variable Documentation

          struct nn_atomic active

<address class="footer">
Generated by

 1.8.11
</address>


text:
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;

namespace DotvvmBlog.BL.Services
{
    public class HtmlUtils
    {
        public static string GetTextFromHtml(string html)
        {
            // this is not reliable, we should use a proper HTML parser instead
            return Regex.Replace(html, @"\<[^\>]+\>", " ");
        }

        public static string Ellipsis(string text, int maxLength)
        {
            if (text.Length < maxLength - 3)
            {
                return text;
            }
            return text.Substring(0, maxLength - 3) + "...";
        }

        public static string GetHtmlFromText(string text)
        {
            // to preserve line endings, we need to HTML-encode each line separately
            using (var sr = new StringReader(text))
            {
                var output = new StringBuilder();
                output.Append("
");

                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    output.Append(WebUtility.HtmlEncode(line));
                    output.Append("
");
                }

                output.Append("
");
                return output.ToString();
            }
        }
    }
}


text:
/*==================================================
 *  Exhibit Time Extension French localization
 *==================================================
 */

if (!("l10n" in Exhibit.TimelineView)) {
    Exhibit.TimelineView.l10n = {};
}

Exhibit.TimelineView.l10n.viewLabel = "Ligne de temps";
Exhibit.TimelineView.l10n.viewTooltip = "Voir les items sur une ligne de temps";


text:
<?xml version="1.0" encoding="UTF-8"?><ti:app xmlns:ti="http://ti.appcelerator.org">
    <id>com.neoxia.alloy</id>
    <name>Liste_courses</name>
    <version>1.0</version>
    <publisher>s.hanfi</publisher>
    <url>http://</url>
    <description>not specified</description>
    <copyright>2013 by s.hanfi</copyright>
    <icon>appicon.png</icon>
    <persistent-wifi>false</persistent-wifi>
    <prerendered-icon>false</prerendered-icon>
    <statusbar-style>default</statusbar-style>
    <statusbar-hidden>false</statusbar-hidden>
    <fullscreen>false</fullscreen>
    <navbar-hidden>true</navbar-hidden>
    <analytics>true</analytics>
    <guid>f6d54f34-392f-42f0-8583-8e670ccad0ce</guid>
    <property name="ti.ui.defaultunit" type="string">system</property>
    <iphone>
        <orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
    </iphone>
    <android xmlns:android="http://schemas.android.com/apk/res/android">
    	<manifest>
			<supports-screens android:anyDensity="false"/>
		</manifest>
	</android>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>true</enabled>
            <inline-css-images>true</inline-css-images>
        </splash>
        <theme>default</theme>
    </mobileweb>
    <modules/>
    <deployment-targets>
        <target device="android">true</target>
        <target device="blackberry">false</target>
        <target device="ipad">true</target>
        <target device="iphone">true</target>
        <target device="mobileweb">true</target>
        <target device="tizen">false</target>
    </deployment-targets>
    <sdk-version>3.1.2.GA</sdk-version>
    <plugins>
        <plugin version="1.0">ti.alloy</plugin>
    </plugins>
<property name="ti.deploytype">test</property></ti:app>


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

<title>Uses of Interface org.apache.edgent.graph.Graph (Edgent v0.4.0)</title>
<meta name="date" content="2016-07-26">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.apache.edgent.graph.Graph

Packages that use Graph

Package
Description

org.apache.edgent.graph

Low-level graph building API.

org.apache.edgent.graph.spi

org.apache.edgent.providers.direct

Direct execution of a streaming topology.

org.apache.edgent.runtime.etiao

A runtime for executing an Edgent streaming topology, designed as an embeddable library
 so that it can be executed in a simple Java application.

org.apache.edgent.runtime.etiao.graph

org.apache.edgent.runtime.etiao.graph.model

org.apache.edgent.topology

Functional api to build a streaming topology.

org.apache.edgent.topology.spi.graph

Uses of Graph in org.apache.edgent.graph

Methods in org.apache.edgent.graph that return Graph

Modifier and Type
Method and Description

Graph
Vertex.graph()

Get the vertice's Graph.

Graph
Connector.graph()

Gets the Graph for this Connector.

Uses of Graph in org.apache.edgent.graph.spi

Classes in org.apache.edgent.graph.spi that implement Graph

Modifier and Type
Class and Description

class
AbstractGraph<G>

A skeletal implementation of the Graph interface,
 to minimize the effort required to implement the interface.

Uses of Graph in org.apache.edgent.providers.direct

Methods in org.apache.edgent.providers.direct that return Graph

Modifier and Type
Method and Description

Graph
DirectTopology.graph()

Uses of Graph in org.apache.edgent.runtime.etiao

Methods in org.apache.edgent.runtime.etiao with parameters of type Graph

Modifier and Type
Method and Description

Job
Executable.createJob(Graph graph,
         java.lang.String topologyName,
         java.lang.String jobName)

Uses of Graph in org.apache.edgent.runtime.etiao.graph

Classes in org.apache.edgent.runtime.etiao.graph that implement Graph

Modifier and Type
Class and Description

class
DirectGraph

DirectGraph is a Graph that
 is executed in the current virtual machine.

Uses of Graph in org.apache.edgent.runtime.etiao.graph.model

Constructors in org.apache.edgent.runtime.etiao.graph.model with parameters of type Graph

Constructor and Description

GraphType(Graph graph)

Create an instance of GraphType.

GraphType(Graph g,
         org.apache.edgent.runtime.etiao.graph.model.IdMapper<java.lang.String> ids)

Create an instance of GraphType using the specified
 IdMapper to generate unique object identifiers.

Uses of Graph in org.apache.edgent.topology

Methods in org.apache.edgent.topology that return Graph

Modifier and Type
Method and Description

Graph
Topology.graph()

Get the underlying graph.

Uses of Graph in org.apache.edgent.topology.spi.graph

Methods in org.apache.edgent.topology.spi.graph that return Graph

Modifier and Type
Method and Description

protected Graph
ConnectorStream.graph()

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Apache Edgent (incubating)

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 The Apache Software Foundation. All Rights Reserved - 54ea8ac-20160726-1240


text:
namespace fps_mapper {

  using namespace std;

  CameraInfoManager::CameraInfoManager(int id,
				       boss::IdContext* context): boss::Identifiable(id,context){
  }

  CameraInfoManager::~CameraInfoManager() {
    // scan the set and delete all camera infos;
    for (std::set<BaseCameraInfo*>::iterator it=_camera_info_set.begin();
	 it!=_camera_info_set.end(); it++) {
      delete *it;
    }
  }

  BaseCameraInfo* CameraInfoManager::getCamera(const std::string& topic) {
    std::map<std::string, BaseCameraInfo*>::iterator it = _camera_info_map.find(topic);
    if (it==_camera_info_map.end()){
      return 0;
    }
    return it->second;
  }

  BaseCameraInfo* CameraInfoManager::hasCamera(BaseCameraInfo* cam) {
    std::set<BaseCameraInfo*>::iterator it=_camera_info_set.find(cam);
    if (it!=_camera_info_set.end())
      return cam;
    return 0;
  }

  void CameraInfoManager::addCamera(BaseCameraInfo* cam) {
    BaseCameraInfo* other = getCamera(cam->topic());
    if (! other ) {
      _camera_info_map.insert(make_pair(cam->topic(), cam));
      _camera_info_set.insert(cam);
      _camera_info_vector.push_back(cam);
    } else {
      throw std::runtime_error("Camera is already in manager");
    }
  }

  void CameraInfoManager::serialize(boss::ObjectData& data, boss::IdContext& context){
    Identifiable::serialize(data,context);
    boss::ArrayData* camerasArray = new boss::ArrayData;
    for (std::set<BaseCameraInfo*>::iterator it = _camera_info_set.begin(); it!=_camera_info_set.end(); it++){
      BaseCameraInfo* cam=*it;
      camerasArray->add(new boss::PointerData(cam));
    }
    data.setField("cameras", camerasArray);
  }

  void CameraInfoManager::deserialize(boss::ObjectData& data, boss::IdContext& context){
    Identifiable::deserialize(data,context);
    boss::ArrayData& camerasArray=data.getField("cameras")->getArray();
    for (size_t i =0; i< camerasArray.size(); i++){
      boss::ValueData& v = camerasArray[i];
      boss::Identifiable* id = v.getPointer();
      BaseCameraInfo* cam = dynamic_cast<BaseCameraInfo*>(id);
      _camera_info_set.insert(cam);
      _camera_info_map.insert(make_pair(cam->topic(), cam));
    }

  }
}


text:
<!DOCTYPE html>

Next »

Let Secrets Out

A place where you can post your secrets anonymously and freely

Go posting your secrets »


text:
/**
 *
 */
package org.vaadin.special.client.ui.shortcutkey;

import org.vaadin.special.client.ui.AbstractNonVisualComponentConnector;
import org.vaadin.special.client.ui.VShortcutKey;

import com.vaadin.shared.ui.Connect;

/**
 * @author kamil
 *
 */
@SuppressWarnings("serial")
@Connect(org.vaadin.special.ui.ShortcutKey.class)
public class ShortcutKeyConnector extends AbstractNonVisualComponentConnector {

	@Override
	protected void init() {
		super.init();
	}

    @Override
    public VShortcutKey getWidget() {
    	return (VShortcutKey) super.getWidget();
    }

}


text:
package co.cask.cdap.explore.jdbc;

import co.cask.cdap.explore.client.ExploreClient;
import co.cask.cdap.explore.client.MockExploreClient;
import co.cask.cdap.proto.ColumnDesc;
import co.cask.cdap.proto.Id;
import co.cask.cdap.proto.QueryResult;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.junit.Assert;
import org.junit.Test;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

/**
 *
 */
public class ExploreResultSetTest {
  @Test
  public void testResultSet() throws Exception {
    ExploreClient exploreClient = new MockExploreClient(
        ImmutableMap.of("mock_query", (List<ColumnDesc>) Lists.newArrayList(
            new ColumnDesc("column1", "STRING", 1, ""),
            new ColumnDesc("column2", "int", 2, ""),
            new ColumnDesc("column3", "char", 3, ""),
            new ColumnDesc("column4", "float", 4, ""),
            new ColumnDesc("column5", "double", 5, ""),
            new ColumnDesc("column6", "boolean", 6, ""),
            new ColumnDesc("column7", "tinyint", 7, ""),
            new ColumnDesc("column8", "smallint", 8, ""),
            new ColumnDesc("column9", "bigint", 9, ""),
            new ColumnDesc("column10", "date", 10, ""),
            new ColumnDesc("column11", "timestamp", 11, ""),
            new ColumnDesc("column12", "decimal", 12, ""),
            new ColumnDesc("column14", "map<string,string>", 13, ""),
            new ColumnDesc("column15", "array<string>", 14, ""),
            new ColumnDesc("column16", "struct<name:string,attr:string>", 15, "")
        )),
        ImmutableMap.of("mock_query", (List<QueryResult>) Lists.newArrayList(
            new QueryResult(ImmutableList.<Object>of(
                "value1",
                1,
                "c",
                0.1f,
                0.2d,
                true,
                0x1,
                (short) 2,
                (long) 10,
                "2014-06-20",
                "2014-06-20 07:37:00",
                "1000000000",
                "\"{\"key1\":\"value1\"}",
                "[\"a\",\"b\",\"c\"]",
                "{\"name\":\"first\",\"attr\":\"second\"}"
            ))
        ))
    );

    ResultSet resultSet = new ExploreResultSet(exploreClient.submit(Id.Namespace.from(""), "mock_query").get(),
                                               new ExploreStatement(null, exploreClient, ""),
                                               0);
    Assert.assertTrue(resultSet.next());
    Assert.assertEquals(resultSet.getObject(1), resultSet.getObject("column1"));
    Assert.assertEquals("value1", resultSet.getString(1));
    Assert.assertEquals(1, resultSet.getInt(2));
    Assert.assertEquals("c", resultSet.getString(3));
    Assert.assertEquals(0.1f, resultSet.getFloat(4), 0.01);
    Assert.assertEquals(0.2d, resultSet.getDouble(5), 0.01);
    Assert.assertEquals(true, resultSet.getBoolean(6));
    Assert.assertEquals(0x1, resultSet.getByte(7));
    Assert.assertEquals(2, resultSet.getShort(8));
    Assert.assertEquals(10, resultSet.getLong(9));
    Assert.assertEquals(Date.valueOf("2014-06-20"), resultSet.getDate(10));
    Assert.assertEquals(Timestamp.valueOf("2014-06-20 07:37:00"), resultSet.getTimestamp(11));
    Assert.assertEquals(new BigDecimal("1000000000"), resultSet.getBigDecimal(12));
    Assert.assertEquals("\"{\"key1\":\"value1\"}", resultSet.getString(13));
    Assert.assertEquals("[\"a\",\"b\",\"c\"]", resultSet.getString(14));
    Assert.assertEquals("{\"name\":\"first\",\"attr\":\"second\"}", resultSet.getString(15));
    Assert.assertFalse(resultSet.next());

    Assert.assertFalse(resultSet.next());
    try {
      resultSet.getObject(1);
    } catch (SQLException e) {
      // Expected: no more rows
    }
  }

  @Test
  public void sameNamedColumns() throws Exception {
    ExploreClient exploreClient = new MockExploreClient(
        ImmutableMap.of("mock_query", (List<ColumnDesc>) Lists.newArrayList(
            new ColumnDesc("column1", "STRING", 2, ""),
            new ColumnDesc("column1", "int", 1, "")
        )),
        ImmutableMap.of("mock_query", (List<QueryResult>) Lists.newArrayList(
            new QueryResult(ImmutableList.<Object>of(1, "value1"))
        ))
    );

    ResultSet resultSet = new ExploreResultSet(exploreClient.submit(Id.Namespace.from(""), "mock_query").get(),
                                               new ExploreStatement(null, exploreClient, ""),
                                               0);
    Assert.assertTrue(resultSet.next());
    Assert.assertEquals(1, resultSet.findColumn("column1"));
    Assert.assertEquals(1, resultSet.getObject("column1"));

    // Can't call get... after resultSet is closed, nor findColumn
    resultSet.close();
    try {
      resultSet.getObject(1);
    } catch (SQLException e) {
      // Expected
    }
    try {
      resultSet.findColumn("column1");
    } catch (SQLException e) {
      // Expected
    }
  }
}


text:
.class Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;
.super Ljava/lang/Object;
.source "NotificationHeaderUtil.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/systemui/statusbar/NotificationHeaderUtil;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "HeaderProcessor"
.end annotation

# instance fields
.field private final mApplicator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ResultApplicator;

.field private mApply:Z

.field private mComparator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;

.field private final mExtractor:Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;

.field private final mId:I

.field private mParentData:Ljava/lang/Object;

.field private final mParentRow:Lcom/android/systemui/statusbar/ExpandableNotificationRow;

.field private mParentView:Landroid/view/View;

# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/ExpandableNotificationRow;ILcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;Lcom/android/systemui/statusbar/NotificationHeaderUtil$ResultApplicator;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput p2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mId:I

    iput-object p3, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mExtractor:Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;

    iput-object p5, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApplicator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ResultApplicator;

    iput-object p4, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mComparator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;

    iput-object p1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentRow:Lcom/android/systemui/statusbar/ExpandableNotificationRow;

    return-void
.end method

.method private applyToView(ZLandroid/view/View;)V
    .locals 2

    if-eqz p2, :cond_0

    iget v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mId:I

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mComparator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;

    invoke-interface {v1, v0}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;->isEmpty(Landroid/view/View;)Z

    move-result v1

    xor-int/lit8 v1, v1, 0x1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApplicator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ResultApplicator;

    invoke-interface {v1, v0, p1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$ResultApplicator;->apply(Landroid/view/View;Z)V

    :cond_0
    return-void
.end method

.method public static forTextView(Lcom/android/systemui/statusbar/ExpandableNotificationRow;I)Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;
    .locals 6

    new-instance v0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;

    invoke-static {}, Lcom/android/systemui/statusbar/NotificationHeaderUtil;->-get0()Lcom/android/systemui/statusbar/NotificationHeaderUtil$TextViewComparator;

    move-result-object v4

    invoke-static {}, Lcom/android/systemui/statusbar/NotificationHeaderUtil;->-get1()Lcom/android/systemui/statusbar/NotificationHeaderUtil$VisibilityApplicator;

    move-result-object v5

    const/4 v3, 0x0

    move-object v1, p0

    move v2, p1

    invoke-direct/range {v0 .. v5}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;-><init>(Lcom/android/systemui/statusbar/ExpandableNotificationRow;ILcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;Lcom/android/systemui/statusbar/NotificationHeaderUtil$ResultApplicator;)V

    return-object v0
.end method

# virtual methods
.method public apply(Lcom/android/systemui/statusbar/ExpandableNotificationRow;)V
    .locals 1

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->apply(Lcom/android/systemui/statusbar/ExpandableNotificationRow;Z)V

    return-void
.end method

.method public apply(Lcom/android/systemui/statusbar/ExpandableNotificationRow;Z)V
    .locals 2

    iget-boolean v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApply:Z

    if-eqz v1, :cond_0

    xor-int/lit8 v0, p2, 0x1

    :goto_0
    invoke-virtual {p1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->isSummaryWithChildren()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-virtual {p1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->getNotificationHeader()Landroid/view/NotificationHeaderView;

    move-result-object v1

    invoke-direct {p0, v0, v1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->applyToView(ZLandroid/view/View;)V

    return-void

    :cond_0
    const/4 v0, 0x0

    goto :goto_0

    :cond_1
    invoke-virtual {p1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->getPrivateLayout()Lcom/android/systemui/statusbar/NotificationContentView;

    move-result-object v1

    invoke-virtual {v1}, Lcom/android/systemui/statusbar/NotificationContentView;->getContractedChild()Landroid/view/View;

    move-result-object v1

    invoke-direct {p0, v0, v1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->applyToView(ZLandroid/view/View;)V

    invoke-virtual {p1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->getPrivateLayout()Lcom/android/systemui/statusbar/NotificationContentView;

    move-result-object v1

    invoke-virtual {v1}, Lcom/android/systemui/statusbar/NotificationContentView;->getHeadsUpChild()Landroid/view/View;

    move-result-object v1

    invoke-direct {p0, v0, v1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->applyToView(ZLandroid/view/View;)V

    invoke-virtual {p1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->getPrivateLayout()Lcom/android/systemui/statusbar/NotificationContentView;

    move-result-object v1

    invoke-virtual {v1}, Lcom/android/systemui/statusbar/NotificationContentView;->getExpandedChild()Landroid/view/View;

    move-result-object v1

    invoke-direct {p0, v0, v1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->applyToView(ZLandroid/view/View;)V

    return-void
.end method

.method public compareToHeader(Lcom/android/systemui/statusbar/ExpandableNotificationRow;)V
    .locals 6

    iget-boolean v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApply:Z

    if-nez v2, :cond_0

    return-void

    :cond_0
    invoke-virtual {p1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->getNotificationHeader()Landroid/view/NotificationHeaderView;

    move-result-object v1

    if-nez v1, :cond_1

    const/4 v2, 0x0

    iput-boolean v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApply:Z

    return-void

    :cond_1
    iget-object v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mExtractor:Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;

    if-nez v2, :cond_2

    const/4 v0, 0x0

    :goto_0
    iget-object v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mComparator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;

    iget-object v3, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentView:Landroid/view/View;

    iget v4, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mId:I

    invoke-virtual {v1, v4}, Landroid/view/NotificationHeaderView;->findViewById(I)Landroid/view/View;

    move-result-object v4

    iget-object v5, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentData:Ljava/lang/Object;

    invoke-interface {v2, v3, v4, v5, v0}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;->compare(Landroid/view/View;Landroid/view/View;Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v2

    iput-boolean v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApply:Z

    return-void

    :cond_2
    iget-object v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mExtractor:Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;

    invoke-interface {v2, p1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;->extractData(Lcom/android/systemui/statusbar/ExpandableNotificationRow;)Ljava/lang/Object;

    move-result-object v0

    goto :goto_0
.end method

.method public init()V
    .locals 3

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentRow:Lcom/android/systemui/statusbar/ExpandableNotificationRow;

    invoke-virtual {v1}, Lcom/android/systemui/statusbar/ExpandableNotificationRow;->getNotificationHeader()Landroid/view/NotificationHeaderView;

    move-result-object v1

    iget v2, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mId:I

    invoke-virtual {v1, v2}, Landroid/view/NotificationHeaderView;->findViewById(I)Landroid/view/View;

    move-result-object v1

    iput-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentView:Landroid/view/View;

    iget-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mExtractor:Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;

    if-nez v1, :cond_0

    :goto_0
    iput-object v0, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentData:Ljava/lang/Object;

    iget-object v0, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mComparator:Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;

    iget-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentView:Landroid/view/View;

    invoke-interface {v0, v1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$ViewComparator;->isEmpty(Landroid/view/View;)Z

    move-result v0

    xor-int/lit8 v0, v0, 0x1

    iput-boolean v0, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mApply:Z

    return-void

    :cond_0
    iget-object v0, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mExtractor:Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;

    iget-object v1, p0, Lcom/android/systemui/statusbar/NotificationHeaderUtil$HeaderProcessor;->mParentRow:Lcom/android/systemui/statusbar/ExpandableNotificationRow;

    invoke-interface {v0, v1}, Lcom/android/systemui/statusbar/NotificationHeaderUtil$DataExtractor;->extractData(Lcom/android/systemui/statusbar/ExpandableNotificationRow;)Ljava/lang/Object;

    move-result-object v0

    goto :goto_0
.end method


text:
package org.apache.samza.config;

import static org.junit.Assert.*;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

import org.apache.samza.Partition;
import org.apache.samza.system.SystemStreamPartition;
import org.junit.Test;

public class TestTaskConfigJava {

  @Test
  public void testGetBroadcastSystemStreamPartitions() {
    HashMap<String, String> map = new HashMap<String, String>();
    map.put("task.broadcast.inputs", "kafka.foo#4, kafka.boo#5, kafka.z-o-o#[12-14]");
    Config config = new MapConfig(map);

    TaskConfigJava taskConfig = new TaskConfigJava(config);
    Set<SystemStreamPartition> systemStreamPartitionSet = taskConfig.getBroadcastSystemStreamPartitions();

    HashSet<SystemStreamPartition> expected = new HashSet<SystemStreamPartition>();
    expected.add(new SystemStreamPartition("kafka", "foo", new Partition(4)));
    expected.add(new SystemStreamPartition("kafka", "boo", new Partition(5)));
    expected.add(new SystemStreamPartition("kafka", "z-o-o", new Partition(12)));
    expected.add(new SystemStreamPartition("kafka", "z-o-o", new Partition(13)));
    expected.add(new SystemStreamPartition("kafka", "z-o-o", new Partition(14)));
    assertEquals(expected, systemStreamPartitionSet);

    map.put("task.broadcast.inputs", "kafka.foo");
    taskConfig = new TaskConfigJava(new MapConfig(map));
    boolean catchCorrectException = false;
    try {
      taskConfig.getBroadcastSystemStreamPartitions();
    } catch (IllegalArgumentException e) {
      catchCorrectException = true;
    }
    assertTrue(catchCorrectException);
  }
}


text:
class UserEventsController < ApplicationController
  before_action :get_user_event, only: [:show, :edit, :update, :destroy]
  before_action :get_event, :get_users, :get_all_events

  def get_user
    @user = current_user
  end

  def get_user_event
    @user_event = UserEvent.find(params[:id])
  end

  def get_users
    @users = User.all.order(:name)
  end

  def get_event
    @event = Event.find(params[:event_id])
  end

  def get_all_events
    @events = Event.all.order(:start).order(:name)
  end

  # GET /user_events
  # GET /user_events.json
  def index
    @user_events = @event.user_events
    # remove all user_events that don't have an event or user
    @user_events.each do |user_event|
      if user_event.user.nil? || user_event.event.nil?
        @user_events - [user_event]
        user_event.destroy
      end
    end
    # sort the user events by email?
    @user_events = @user_events.sort {|a, b| a <=> b}

    # how many have paid?
    @paid = 0
    @user_events.each do |rsvp|
      if rsvp.paid?
        @paid = @paid + 1
      end
    end
  end

  # GET /user_events/1
  # GET /user_events/1.json
  def show
  end

  # GET /user_events/new
  def new
    if current_user.admin?
      @user_event = UserEvent.new({:event => @event})
    else
      @user_event = UserEvent.new({:user => current_user, :event => @event})
    end
  end

  # GET /user_events/1/edit
  def edit
  end

  # POST /user_events
  # POST /user_events.json
  def create
    # this one is trickier, due to users needing to be able to do it.
    # here, we want to use the current user -- but we might have a way to have an admin register someone?
    # Note: we also don't want to create a user event if one already exists
    @user_event = @event.user_events.create(user_event_params)
    unless current_user.admin?
      @user_event.user = current_user
    end

    respond_to do |format|
      if @user_event.save
        # on the notice add the event name
        format.html {redirect_to [@event, @user_event], notice: 'User was successfully registered.'}
        format.json {render :show, status: :created, location: [@event, @user_event]}
      else
        format.html {render :new}
        format.json {render json: @user_event.errors, status: :unprocessable_entity}
      end
    end
  end

  # PATCH/PUT /user_events/1
  # PATCH/PUT /user_events/1.json
  def update
    respond_to do |format|
      if @user_event.update(user_event_params)
        format.html {redirect_to [@event, @user_event], notice: 'User event was successfully updated.'}
        format.json {render :show, status: :ok, location: [@event, @user_event]}
      else
        format.html {render :edit}
        format.json {render json: @user_event.errors, status: :unprocessable_entity}
      end
    end
  end

  # DELETE /user_events/1
  # DELETE /user_events/1.json
  def destroy
    # TODO - force to current user if not admin.
    # TODO - if not admin, redirect to home.
    @user_event.destroy
    respond_to do |format|
      format.html {redirect_to events_path, notice: 'User event was successfully unregistered.'}
      format.json {head :no_content}
    end
  end

  # New route/method - search by date
  def search

  end

  def show_since

    start_date = Time.zone.local(*params[:range_start].sort.map(&:last).map(&:to_i))
    # user_event = *params[:user_event]
    #
    # date = Date.civil(*user_event[:since].sort.map(&:last).map(&:to_i))

    @user_events = @event.user_events.where(["updated_at >= ?", start_date])
    # remove all user_events that don't have an event or user
    @user_events.each do |user_event|
      if user_event.user.nil? || user_event.event.nil?
        @user_events - [user_event]
        user_event.destroy
      end
    end
    # sort the user events by email?
    @user_events = @user_events.sort {|a, b| a <=> b}

    render :index
  end

  # Never trust parameters from the scary internet, only allow the white list through.def user_event_params
  def user_event_params
    params.require(:user_event).permit(:user_id, :event_id, :paid, :payment_amount, :payment_id, :payment_date, :since)
  end
end


text:
<?php

/**
  * limeade attempts to ease unit testing by providing some additional features
  * to the lime unit testing framework.
  *
  * @author Carl Vondrick <carl@carlsoft.net>
  * @package limeade
  * @version SVN: $Id: limeade.php 6956 2008-01-05 22:54:18Z Carl.Vondrick $
  */
abstract class limeade
{
  public $lime = null;

  public function __construct(limeade_test $lime)
  {
    $this->lime = $lime;
  }
}


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

#ifndef FLUTTER_UNICORN_RUNTIME_RUNTIME_CONTEXT_IOS_H_
#define FLUTTER_UNICORN_RUNTIME_RUNTIME_CONTEXT_IOS_H_

#include <memory>
#include <string>

#include "js_runtime/runtime/engine_context.h"
#include "js_runtime/runtime/runtime_context.h"
#include "js_runtime/runtime/runtime_vm.h"

namespace unicorn {

class RuntimeContextIOS : public RuntimeContext, EngineContextDelegate {
 public:
  explicit RuntimeContextIOS(RuntimeVM* vm);
  ~RuntimeContextIOS();

  void CreateJavaScriptContext() override;
  void ReleaseJavaScriptContext() override;
  void SetName(const std::string& name) override;
  void InitializeContext() override;
  void UpdateSetting(const std::string& settings) override;
  bool ExecuteJavaScript(const std::string& name) override;
  std::unique_ptr<RuntimeValues> ExecuteJavaScriptWithResult(
      const std::string& name) override;

  EngineContext* GetEngineContext() const override {
                                    return engine_context_.get(); }

  void NotifyIdle() override;
  bool Available() override;
  void Destroy() override;

  // override EngineContextDelegate
  void OnEngineContextInitialized() override;
  void OnEngineContextFinalized() override;

 private:
  RuntimeVM* vm_;
  bool initialized_;
  std::unique_ptr<EngineContext> engine_context_;
};

}  // namespace unicorn
#endif  // FLUTTER_UNICORN_RUNTIME_RUNTIME_CONTEXT_IOS_H_


text:
layout: article
title: "Całkowite unikanie obrazów"
description: "Czasami najlepszym rozwiązaniem jest całkowita rezygnacja z dodawania obrazu. Gdy to możliwe, warto używać natywnych funkcji przeglądarki, które dają takie same lub podobne efekty."
introduction: "Czasami najlepszym rozwiązaniem jest całkowita rezygnacja z dodawania obrazu. Gdy to możliwe, warto używać natywnych funkcji przeglądarki, które dają takie same lub podobne efekty. Przeglądarki mogą obecnie generować elementy wizualne, które dawniej wymagały stosowania obrazów. Dzięki temu przeglądarka nie musi już pobierać osobnych plików graficznych i nie wyświetla obrazów w dziwnej skali. Ikony można renderować, korzystając ze standardu Unicode lub specjalnych czcionek z ikonami."
authors:
  - petelepage
article:
  written_on: 2014-04-30
  updated_on: 2014-06-10
  order: 5
collection: images
key-takeaways:
  unikaj-images:
    - W miarę możliwości unikaj obrazów. Zamiast nich korzystaj z funkcji przeglądarki, by wyświetlać cienie, gradienty, zaokrąglone narożniki itp.
---

{% wrap content%}

{% include modules/toc.liquid %}

{% include modules/takeaway.liquid list=page.key-takeaways.avoid-images %}

## Umieszczanie tekstu w znacznikach zamiast na obrazach

Gdy to tylko możliwe, tekst powinien być tekstem, a nie elementem obrazu. Na przykład nie należy używać grafik jako nagłówków ani umieszczać w nich informacji kontaktowych takich jak numery telefonów czy adresy. To uniemożliwia użytkownikom skopiowanie i wklejenie tych danych oraz ukrywa je przed czytnikami ekranu. Strona jest wtedy nieelastyczna. Zamiast tego umieść tekst w znacznikach i w razie potrzeby użyj czcionek internetowych, by uzyskać odpowiedni styl.

## Zastępowanie obrazów stylami CSS

Wiele przeglądarek pozwala korzystać z funkcji CSS, by tworzyć style, które dawniej wymagały stosowania obrazów. Na przykład właściwość background umożliwia tworzenie złożonych gradientów, box-shadow – cieni, a border-radius – zaokrąglonych narożników.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit
amet augue eu magna scelerisque porta ut ut dolor. Nullam placerat egestas
nisl sed sollicitudin. Fusce placerat, ipsum ac vestibulum porta, purus
dolor mollis nunc, pharetra vehicula nulla nunc quis elit. Duis ornare
fringilla dui non vehicula. In hac habitasse platea dictumst. Donec
ipsum lectus, hendrerit malesuada sapien eget, venenatis tempus purus.

{% highlight html %}

{% endhighlight %}

Pamiętaj, że te techniki wymagają cykli renderowania, co może mieć znaczenie na urządzeniach mobilnych. Jeśli będziesz ich nadużywać, możesz stracić uzyskane korzyści i obniżyć wydajność strony.

{% include modules/nextarticle.liquid %}

{% endwrap %}


text:
package com.bv.eidss;

import java.util.ArrayList;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;
import android.view.View.OnClickListener;

public class DropDownListAdapter extends BaseAdapter {

	private ArrayList<String> mListItems;
	private LayoutInflater mInflater;
	private TextView mSelectedItems;
	private static int intSelected;
	private ViewHolder holder;
	private boolean[] checkSelected;	// store select/unselect information about the values in the list

	public int getSelected() {
		return intSelected;
	}
	private void setSelected(int selection){
		intSelected = selection;
		for (int i = 0; i < checkSelected.length; i++) {
			checkSelected[i] = (intSelected & (1 << i)) > 0;
		}
	}

	public DropDownListAdapter(Context context, final CharSequence[] items,
							   TextView tv, int selection) {
		mListItems = new ArrayList<>();
		for(CharSequence it : items)
			mListItems.add(it.toString());
		mInflater = LayoutInflater.from(context);
		mSelectedItems = tv;
		checkSelected = new boolean[items.length];

		setSelected(selection);
	}

	@Override
	public int getCount() {
		return mListItems.size();
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.list_popup_item, null);
			holder = new ViewHolder();
			holder.tv = (TextView) convertView.findViewById(R.id.SelectOption);
			holder.chkbox = (CheckBox) convertView.findViewById(R.id.checkbox);
			int id = Resources.getSystem().getIdentifier("btn_check_holo_dark", "drawable", "android");
			holder.chkbox.setButtonDrawable(id);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}

		holder.tv.setText(mListItems.get(position));

		final int position1 = position;

		//whenever the checkbox is clicked the selected values textview is updated with new selected values
		holder.chkbox.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				setText(position1);
			}
		});

		if(checkSelected[position])
			holder.chkbox.setChecked(true);
		else
			holder.chkbox.setChecked(false);
		return convertView;
	}

	/*
	 * Function which updates the selected values display and information(checkSelected[])
	 * */
	private void setText(int position1){
		if (!checkSelected[position1]) {
			checkSelected[position1] = true;
			intSelected += (1 << position1);
		} else {
			checkSelected[position1] = false;
			intSelected -= (1 << position1);
		}

		getSelectionText();
	}

    private String getSelectionText() {
		String strSelected = "";
        for (int i = 0; i < checkSelected.length; i++) {
            if (checkSelected[i]) {
                if(strSelected.length() > 0)
                    strSelected += ", ";
                strSelected += mListItems.get(i);
            }
        }
        mSelectedItems.setText(strSelected);
        return strSelected;
    }

    public String putSelected(int selection) {
		setSelected(selection);
        return getSelectionText();
    }

	private class ViewHolder {
		TextView tv;
		CheckBox chkbox;
	}
}


text:
A tool that uses selenium to traverse your bank website and download exports of account activity to import into YNAB budgeting tool.

# Downloading Chase Activity

**NOTE:** Currently this is operational on Mac OSX only because the selenium driver in this repo is for OSX. There are plans to expand this to allow linux distros such as Ubuntu as well.

* First open your chrome browser and login to your bank. The login is automated on the script, but we do this to ensure that we have the cookie required from entering in the text message access code.

* Have your account username/password and checking/cc/savings account ids ready

* Now run the ynab downloader and follow the instructions on the command line:

For a credit card:
```bash
$ ynab-downloader chase --account_type cc
```
For a checking account:
```bash
$ ynab-downloader chase --account_type checking
```

# Caveats

Currently only chase credit card and checking/savings accounts are supported. Other banks will have to be implemented by contributions.

# Contribute

Fork the project, clone it,  and `pip install -e ynab_downloader`


text:
$(document).ready(function() {
	$('.sb-right-content').prepend("
");
	$('.sb-right-content').prepend("Update Check");
	$('.sb-right-content').prepend("Users");
	$('.sb-right-content').prepend("Plugins");
});


text:
<?php
/*
 * Task creates 100 flowchart pages. Useful when testing.
 */
class MakePagesTask extends BuildTask {

	public function run($request) {
		$masterPage = false;
		// Group all pages under a page
		$masterPages = Page::get()->filter('Title', 'flowchart-holder');
		if($masterPages->count()) {
			$masterPage = $masterPages->first();
		}
		if(!$masterPage) {
			$masterPage = new Page();
			$masterPage->Title = 'flowchart-holder';
			$masterPage->write();
		}

		$numPages = 100;
		for($a=0; $a<$numPages; $a++) {
			$randomName = uniqid();
			$page = new FlowchartPage();
			$page->Title = 'flowchart-'.$randomName;
			$page->URLSegment = 'flowchart-'.$randomName;
			$page->ParentID = $masterPage->ID;
			$page->write();
			echo '- '.$page->Title.PHP_EOL;
		}
	}

}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>ServiceWorkerGlobalScope.onerror</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="author" title="Chunyan Wang" href="mailto:chunyanx.wang@intel.com">
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope">


text:
package com.gemstone.gemfire.internal.cache.functions;

import com.gemstone.gemfire.cache.CacheClosedException;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.execute.FunctionAdapter;
import com.gemstone.gemfire.cache.execute.FunctionContext;
import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.Assert;

import dunit.DistributedTestCase;
import dunit.DistributedTestCase.WaitCriterion;

@SuppressWarnings("serial")
public class DistributedRegionFunction extends FunctionAdapter {

  @Override
  public void execute(FunctionContext context) {
    RegionFunctionContext rcontext = (RegionFunctionContext)context;
    Region<Object, Object> region = rcontext.getDataSet();
    InternalDistributedSystem sys = InternalDistributedSystem
        .getConnectedInstance();
    sys.getLogWriter().fine(
        "DistributedRegionFunction#execute( " + rcontext + " )");
    Assert.assertTrue(region.getAttributes().getDataPolicy().withStorage());
    Assert.assertTrue(region.getAttributes()
        .getDataPolicy() != DataPolicy.NORMAL);
    Assert.assertTrue(rcontext.getFilter().size() == 20);
    long startTime = System.currentTimeMillis();
    // Boolean.TRUE dummy argument indicates that CacheClose has to be done from
    // the body itself
    if (Boolean.TRUE.equals(rcontext.getArguments())) {
      // do not close cache in retry
      if (!rcontext.isPossibleDuplicate()) {
        sys.disconnect();
        throw new CacheClosedException("Throwing CacheClosedException "
            + "to simulate failover during function exception");
      }
    }
    else {
      WaitCriterion wc = new WaitCriterion() {
        String excuse;

        public boolean done() {
          return false;
        }

        public String description() {
          return excuse;
        }
      };
      DistributedTestCase.waitForCriterion(wc, 12000, 500, false);
    }
    long endTime = System.currentTimeMillis();

    // intentionally doing region operation to cause cacheClosedException
    region.put("execKey-201", new Integer(201));

    if (rcontext.isPossibleDuplicate()) { // Below operation is done when the
                                          // function is reexecuted
      region.put("execKey-202", new Integer(202));
      region.put("execKey-203", new Integer(203));
    }
    sys.getLogWriter().fine(
        "Time wait for Function Execution = " + (endTime - startTime));
    for (int i = 0; i < 5000; i++) {
      context.getResultSender().sendResult(Boolean.TRUE);
    }
    context.getResultSender().lastResult(Boolean.TRUE);
  }

  @Override
  public String getId() {
    return "DistributedRegionFunction";
  }

  @Override
  public boolean isHA() {
    return true;
  }
}


text:
layout: default
title: CAS - CAS SAML Protocol
---

#SAML Protocol
CAS has support for versions 1.1 and 2 of the SAML protocol to a specific extent. This document deals with CAS-specific concerns.

Support is enabled by including the following dependency in the Maven WAR overlay:

{% highlight xml %}
<dependency>
  <groupId>org.jasig.cas</groupId>
  <artifactId>cas-server-support-saml</artifactId>
  <version>${cas.version}</version>
</dependency>
{% endhighlight %}

#SAML 1.1
CAS supports the [standardized SAML 1.1 protocol](http://en.wikipedia.org/wiki/SAML_1.1) primarily to:

- Support a method of [attribute release](../integration/Attribute-Release.html)
- [Single Logout](../installation/Logout-Single-Signout.html)

A SAML 1.1 ticket validation response is obtained by validating a ticket via POST at the `/samlValidate URI`.

##Sample Request
{% highlight xml %}
POST /cas/samlValidate?ticket=
Host: cas.example.com
Content-Length: 491
Content-Type: text/xml

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <samlp:Request xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" MajorVersion="1"
      MinorVersion="1" RequestID="_192.168.16.51.1024506224022"
      IssueInstant="2002-06-19T17:03:44.022Z">
      <samlp:AssertionArtifact>
        ST-1-u4hrm3td92cLxpCvrjylcas.example.com
      </samlp:AssertionArtifact>
    </samlp:Request>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
{% endhighlight %}

##Sample Response
{% highlight xml %}
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header />
  <SOAP-ENV:Body>
    <Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
    xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="2008-12-10T14:12:14.817Z"
    MajorVersion="1" MinorVersion="1" Recipient="https://eiger.iad.vt.edu/dat/home.do"
    ResponseID="_5c94b5431c540365e5a70b2874b75996">
      <Status>
        <StatusCode Value="samlp:Success">
        </StatusCode>
      </Status>
      <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" AssertionID="_e5c23ff7a3889e12fa01802a47331653"
      IssueInstant="2008-12-10T14:12:14.817Z" Issuer="localhost" MajorVersion="1"
      MinorVersion="1">
        <Conditions NotBefore="2008-12-10T14:12:14.817Z" NotOnOrAfter="2008-12-10T14:12:44.817Z">
          <AudienceRestrictionCondition>
            <Audience>
              https://some-service.example.com/app/
            </Audience>
          </AudienceRestrictionCondition>
        </Conditions>
        <AttributeStatement>
          <Subject>
            <NameIdentifier>johnq</NameIdentifier>
            <SubjectConfirmation>
              <ConfirmationMethod>
                urn:oasis:names:tc:SAML:1.0:cm:artifact
              </ConfirmationMethod>
            </SubjectConfirmation>
          </Subject>
          <Attribute AttributeName="uid" AttributeNamespace="http://www.ja-sig.org/products/cas/">
            <AttributeValue>12345</AttributeValue>
          </Attribute>
          <Attribute AttributeName="groupMembership" AttributeNamespace="http://www.ja-sig.org/products/cas/">
            <AttributeValue>
              uugid=middleware.staff,ou=Groups,dc=vt,dc=edu
            </AttributeValue>
          </Attribute>
          <Attribute AttributeName="eduPersonAffiliation" AttributeNamespace="http://www.ja-sig.org/products/cas/">
            <AttributeValue>staff</AttributeValue>
          </Attribute>
          <Attribute AttributeName="accountState" AttributeNamespace="http://www.ja-sig.org/products/cas/">
            <AttributeValue>ACTIVE</AttributeValue>
          </Attribute>
        </AttributeStatement>
        <AuthenticationStatement AuthenticationInstant="2008-12-10T14:12:14.741Z"
        AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
          <Subject>
            <NameIdentifier>johnq</NameIdentifier>
            <SubjectConfirmation>
              <ConfirmationMethod>
                urn:oasis:names:tc:SAML:1.0:cm:artifact
              </ConfirmationMethod>
            </SubjectConfirmation>
          </Subject>
        </AuthenticationStatement>
      </Assertion>
    </Response>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
{% endhighlight %}

##Configuration

In addition to the `cas-server-support-saml` module dependency, the following steps are required to enabled the SAML 1.1 support.

###Definition/Mapping of `samlValidateController`

In `cas-servlet.xml`:

{% highlight xml %}
<bean id="samlValidateController" class="org.jasig.cas.web.ServiceValidateController"
  p:validationSpecificationClass="org.jasig.cas.validation.Cas20WithoutProxyingValidationSpecification"
  p:centralAuthenticationService-ref="centralAuthenticationService"
  p:proxyHandler-ref="proxy20Handler"
  p:argumentExtractor-ref="samlArgumentExtractor"
  p:successView="casSamlServiceSuccessView"
  p:failureView="casSamlServiceFailureView"/>

<bean id="handlerMappingC" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  <property name="mappings">
    <props>
      ...
      <prop key="/samlValidate">samlValidateController</prop>
      ...
{% endhighlight %}

###Servlet mapping for `/samlValidate`

In the `web.xml` file:

{% highlight xml %}
<servlet-mapping>
  <servlet-name>cas</servlet-name>
  <url-pattern>/samlValidate</url-pattern>
</servlet-mapping>
{% endhighlight %}

###SAML Argument Extractor

In the `argumentExtractorsConfiguration.xml` file:

{% highlight xml %}
<bean id="samlArgumentExtractor" class="org.jasig.cas.support.saml.web.support.SamlArgumentExtractor" />

<util:list id="argumentExtractors">
  <ref bean="casArgumentExtractor" />
  <ref bean="samlArgumentExtractor" />
</util:list>
{% endhighlight %}

###SAML ID Generator

In the uniqueIdGenerators.xml file:

{% highlight xml %}
<bean id="samlServiceTicketUniqueIdGenerator" class="org.jasig.cas.support.saml.util.SamlCompliantUniqueTicketIdGenerator">
  <constructor-arg index="0" value="[CAS-FQ-HOST-NAME]" />
</bean>

<util:map id="uniqueIdGeneratorsMap">
  <entry
    key="org.jasig.cas.authentication.principal.SimpleWebApplicationServiceImpl"
    value-ref="serviceTicketUniqueIdGenerator" />
  <entry
    key="org.jasig.cas.support.saml.authentication.principal.SamlService"
    value-ref="samlServiceTicketUniqueIdGenerator" />
</util:map>
{% endhighlight %}

###SAML Views
In `cas-servlet.xml`, uncomment the following:

{% highlight xml %}
<bean id="xmlViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver"
          p:order="3"
          p:location="${cas.viewResolver.xmlFile:classpath:/META-INF/spring/saml-protocol-views.xml}" />
{% endhighlight %}

#SAML 2

CAS support for SAML 2 at this point is mostly limited to [Google Apps Integration](../integration/Google-Apps-Integration.html). Full SAML 2 support can also be achieved via Shibboleth with CAS handling the authentication and SSO. [See this guide](../integration/Shibboleth.html) for more info.


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

public class gem_collect : MonoBehaviour
{
    public GameObject Gem;
    public Transform SpawnPoint;

    private float nextActionTime = 0.0f;
    public float period = 2.0f;

    void Update()
    {
        if (Time.time > nextActionTime)
        {
            nextActionTime += period;
            Instantiate(Gem, SpawnPoint.position, SpawnPoint.rotation);
        }
    }
}


text:
describe("Chips Plugin", function () {

  beforeEach(function() {
    loadFixtures('chips/chipsFixture.html');
    $('.chips').material_chip();
    $('.chips-initial').material_chip({
      data: [{ tag: 'Apple' }, { tag: 'Microsoft' }, { tag: 'Google' }],
    });
    $('.chips-placeholder').material_chip({
      placeholder: 'Enter a tag',
      secondaryPlaceholder: '+Tag',
    });
    $('.chips-autocomplete').material_chip({
      autocompleteData: {
        'Apple': null,
        'Microsoft': null,
        'Google': null
      }
    });
  });

  describe("Chips", function () {
    var $chips, $input;

    // beforeEach(function() {
    // });

    it("should work with multiple initializations", function () {
      $chips = $('.chips').first();
      $chips.material_chip();
      $chips.material_chip();
      $chips.material_chip();
      $chips.material_chip();

      $input = $chips.find('input');

      expect($input.length).toEqual(1, 'Should dynamically generate chips structure.');
    });

    it("should be able to add chip", function (done) {
      $chips = $('.chips').first();
      $input = $chips.find('input');

      $input.val('one');

      var e = $.Event('keydown');
      e.which = 13;
      $input.trigger(e);

      setTimeout(function() {
        var numChips = $chips.find('.chip').length;
        var $oneChip = $chips.find('.chip').first();

        expect(numChips).toEqual(1, 'one chip should have been added');

        $oneChip.children().remove()
        expect($oneChip.text()).toEqual('one', 'the chip should have value "one"');

        done();
      }, 400);

    });

    it("should be able to delete chip", function (done) {
      $chips = $('.chips.chips-initial').first();
      $input = $chips.find('input');
      var numChips = $chips.find('.chip').length

      expect(numChips).toEqual(3, '3 initial chips should have been added');

      $chips.find('.chip .close').first().click();

      setTimeout(function() {
        numChips = $chips.find('.chip').length

        expect(numChips).toEqual(2, 'one chip should have been deleted');

        done();
      }, 400);

    });
  });

  // describe("Chips autocomplete", function () {

  // });

});


text:
using System;
using System.Collections.Generic;
using Thor.Generator.ProjectSystem.CSharp;
using Microsoft.Build.Construction;

namespace Thor.Generator.ProjectSystem
{
    /// <summary>
    /// Represents a collection of .net projects.
    /// </summary>
    public sealed class Solution
    {
        private HashSet<Project> _projects;

        private Solution(IEnumerable<Project> projects)
        {
            _projects = new HashSet<Project>(projects);
        }

        /// <summary>
        /// Gets the projects of this solution.
        /// </summary>
        /// <value>The projects.</value>
        public IReadOnlyCollection<Project> Projects => _projects;

        /// <summary>
        /// Commits changes to the projects of this solution.
        /// </summary>
        public void CommitChanges()
        {
            foreach (Project project in _projects)
            {
                CSharpProjectSystems.TryCommitChanges(project);
            }
        }

        /// <summary>
        /// Creates a new solution object.
        /// </summary>
        /// <param name="projects">The projects.</param>
        /// <returns>
        /// Returns a new solution object.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="projects"/> is <c>null</c>.
        /// </exception>
        public static Solution Create(IEnumerable<Project> projects)
        {
            if (projects == null)
            {
                throw new ArgumentNullException(nameof(projects));
            }

            return new Solution(projects);
        }

        /// <summary>
        /// Creates a new solution object from a solution file.
        /// </summary>
        /// <param name="solutionFileName">Name of the solution file.</param>
        /// <returns>Returns a new solution object from a solution file.</returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="solutionFileName"/> is <c>null</c>.
        /// </exception>
        public static Solution Create(string solutionFileName)
        {
            if (solutionFileName == null)
            {
                throw new ArgumentNullException(nameof(solutionFileName));
            }

            List<Project> projects = new List<Project>();
            SolutionFile solutionFile = SolutionFile.Parse(solutionFileName);
            foreach (ProjectInSolution project in solutionFile.ProjectsInOrder)
            {
                if (project.ProjectType == SolutionProjectType.KnownToBeMSBuildFormat)
                {
                    if (CSharpProjectSystems.TryOpenProject(project.AbsolutePath,
                        out Project p))
                    {
                        projects.Add(p);
                    }
                }
            }
            return new Solution(projects);
        }
    }
}


text:
<?php
    require_once 'include/init.php';

    $firstname  = htmlspecialchars($_POST['firstname']);
    $lastname  = htmlspecialchars($_POST['lastname']);
    $email  = htmlspecialchars($_POST['email']);
    $amount  = htmlspecialchars($_POST['amount']);
    $my_order_id = uniqid('fb', false);
    $savethecard = htmlspecialchars($_POST['savethecard']);
    $ifttt = htmlspecialchars($_POST['ifttt']);

    if ($savethecard == "yes") { $save_opt = true; } else { $save_opt = false; $savethecard = "no"; }
    if ($ifttt == "yes") {
      $notif_opt = $website_url.'/ifttt.php';
    } else {
      $notif_opt = $notification_url.'?edom='.$mode.'&order_id='.$my_order_id;
      $ifttt = "no";
    }

    \Payplug\Payplug::setSecretKey($secretkey);
    $payment = \Payplug\Payment::create(array(
        'amount'            => $amount * 100,
        'currency'          => 'EUR',
        'save_card'         => $save_opt,
        'customer' => array(
            'email' => $email,
            'first_name' => $firstname,
            'last_name' => $lastname
        ),
        'hosted_payment' => array(
            'return_url' => $return_url.'?order_id='.$my_order_id,
            'cancel_url' => $cancel_url.'?order_id='.$my_order_id
        ),
        'notification_url'  => $notif_opt,
        'metadata'          => array(
            'order_id'          => $my_order_id
        )
    ));
?>

<!DOCTYPE html>

  <title>PayPlug Lightbox example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

  <link href="//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css" rel="stylesheet">

 Hosted page

          <?php
            $ppurl = $payment->hosted_payment->payment_url;
            $paymentid = $payment->id;

            echo "
 Order summary
";
            echo "
";
            echo "
";
            echo "
";
            echo "
";
            echo "Description	";
            echo "Billing information	";
            echo "Total	";
            echo "
";
            echo "
";
            echo "
";
            echo "
";
            echo "Order n°".$my_order_id."
Payment ID: ".$paymentid."
Save card: ".$savethecard."
Ifttt: ".$ifttt."	";
            echo "".$firstname." ".$lastname."
E-mail: ".$email."	";
            echo "".$amount." €	";
            echo "
";
            echo "	";
            echo "Total order (tax incl.)	";
            echo "".$amount." €	";
            echo "
";
            echo "
";
            echo "Total shipping	";
            echo "Free shipping!	";
            echo "
";
            echo "
";
            echo "
Total
	";
            echo "
".$amount." €
	";
            echo "
";
            echo "
";
            echo "
";

          ?>

            <form action="" method="post" id="signupForm" class="formulaire" novalidate>

                <button type="submit" class="btn btn-primary btn-lg">Pay now !</button>

            </form>

 Back


text:
// Copyright © 2012 onwards, Andrew Whewell
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//    * Neither the name of the author nor the names of the program's contributors may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VirtualRadar.Interface.Adsb;
using Test.Framework;

namespace Test.VirtualRadar.Interface.Adsb
{
    [TestClass]
    public class TargetStateAndStatusMessageTests
    {
        [TestMethod]
        public void TargetStateAndStatusMessage_Constructor_Initialises_To_Known_State_And_Properties_Work()
        {
            var message = new TargetStateAndStatusMessage();

            TestUtilities.TestProperty(message, m => m.TargetStateAndStatusType, TargetStateAndStatusType.Version1, TargetStateAndStatusType.Version2);
            TestUtilities.TestProperty(message, m => m.Version1, null, new TargetStateAndStatusVersion1());
            TestUtilities.TestProperty(message, m => m.Version2, null, new TargetStateAndStatusVersion2());
        }
    }
}