text:
/*
 _____________________________________________________
 |     |                                        |     |
 |  N  |                                        |  P  |
 |  E  |                                        |  R  |
 |  X  |                                        |  E  |
 |  T  |                                        |  V  |
 |     |                                        |     |
 |  B  |                 SLIDE                  |  B  |
 |  U  |                                        |  U  |
 |  T  |                                        |  T  |
 |  T  |                                        |  T  |
 |  O  |                                        |  O  |
 |  N  |                                        |  N  |
 |     |                                        |     |
 -----------------------------------------------------|
 |                                                    |
 |                   SLIDE BUTTONS                    |
 |                                                    |
 ------------------------------------------------------
 */

import R from 'ramda';
import { createSelector } from 'reselect';
import { getNSlides, getDimensions, toPx } from './common';
import { getContainerPositions, getPositionedSlides } from './positions';

const PROPORTIONS = {
  ARROW_BUTTONS_WIDTH: 1/12,
  SLIDE_BUTTONS_HEIGHT: 1/6,
  SLIDE_BUTTONS_TOP_BOTTON_MARGINS: 1/6,
};
const ARROW_BUTTONS_LATERAL_MARGIN = 5;
const SLIDE_BUTTONS_MIN_LATERAL_PADDING = 5;

export const getSlideDimensions = createSelector(
  [getDimensions, getNSlides],
  ({ width, height }, nSlides) => ({
    width: width * (1 - (PROPORTIONS.ARROW_BUTTONS_WIDTH * 2)),
    height: height * (1 - PROPORTIONS.SLIDE_BUTTONS_HEIGHT),
  })
);

export const getArrowButtonStyle = createSelector(
  [getDimensions, getSlideDimensions],
  ({ width }, { height: slideHeight }) => {
    const size = (width * PROPORTIONS.ARROW_BUTTONS_WIDTH);
    return {
      width: toPx(size - (ARROW_BUTTONS_LATERAL_MARGIN * 2)),
      height: toPx(size - (ARROW_BUTTONS_LATERAL_MARGIN * 2)),
      margin: toPx((slideHeight - size) / 2) + ' ' + // top-bottom
              toPx(ARROW_BUTTONS_LATERAL_MARGIN), // left-right
    };
  }
);

export const getSlideButtonsStyle = createSelector(
  [getDimensions, getSlideDimensions, getNSlides],
  ({ width, height }, { height: slideHeight }, nSlides) => {
    const areaHeight = height - slideHeight;
    const paddingTop =
      PROPORTIONS.SLIDE_BUTTONS_TOP_BOTTON_MARGINS * areaHeight;
    const slideButtonsMaxHeight = areaHeight - (paddingTop * 2);
    const slideButtonsMaxWidth =
      (width - (SLIDE_BUTTONS_MIN_LATERAL_PADDING * 2)) / nSlides;
    const slideButtonsAvailableSize =
      R.min(slideButtonsMaxWidth, slideButtonsMaxHeight);
    const slideButtonsSize = slideButtonsAvailableSize *
      (1 - (PROPORTIONS.SLIDE_BUTTONS_TOP_BOTTON_MARGINS * 2));
    const margin =
      slideButtonsAvailableSize * PROPORTIONS.SLIDE_BUTTONS_TOP_BOTTON_MARGINS;
    return {
      area: {
        width: toPx(slideButtonsAvailableSize * nSlides),
        height: toPx(areaHeight),
        paddingTop: toPx(paddingTop),
      },
      button: {
        margin: toPx(margin),
        width: toPx(slideButtonsSize),
        height: toPx(slideButtonsSize),
      },
    };
  }
);

export const getSlidesStyle = createSelector(
  [getPositionedSlides, getSlideDimensions],
  (slides, { width, height }) => slides.map(({ id, src, position }) => ({
    id,
    src,
    style: {
      width: toPx(width),
      height: toPx(height),
      left: toPx(position * width),
    }
  }))
);

export const getSlidesContainerStyle = createSelector(
  [getContainerPositions, getSlideDimensions],
  ({ activePosition, isInTransition, totalPositions }, { width, height }) => ({
    left: toPx(activePosition * width * -1),
    width: toPx(totalPositions * width),
    height: toPx(height),
    transitionProperty: isInTransition ? 'left' : undefined,
    transitionDuration: isInTransition ? undefined : '0s',
  })
);


text:
/**
 * Generated with Acceleo
 */
package org.wso2.developerstudio.eclipse.gmf.esb.components;

// Start of user code for imports
import java.util.Iterator;
import java.util.List;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.WrappedException;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;

import org.eclipse.emf.ecore.resource.ResourceSet;

import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EcoreUtil;

import org.eclipse.emf.eef.runtime.api.notify.EStructuralFeatureNotificationFilter;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.api.notify.NotificationFilter;

import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;

import org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext;
import org.eclipse.emf.eef.runtime.context.impl.EReferencePropertiesEditionContext;

import org.eclipse.emf.eef.runtime.impl.components.SinglePartPropertiesEditingComponent;

import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;

import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil;

import org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy;

import org.eclipse.emf.eef.runtime.policies.impl.CreateEditingPolicy;

import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;

import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.wso2.developerstudio.eclipse.gmf.esb.NamespacedProperty;
import org.wso2.developerstudio.eclipse.gmf.esb.ValidateFeature;
import org.wso2.developerstudio.eclipse.gmf.esb.ValidateMediator;
import org.wso2.developerstudio.eclipse.gmf.esb.ValidateResource;
import org.wso2.developerstudio.eclipse.gmf.esb.ValidateSchema;
import org.wso2.developerstudio.eclipse.gmf.esb.impl.EsbFactoryImpl;
import org.wso2.developerstudio.eclipse.gmf.esb.parts.EsbViewsRepository;
import org.wso2.developerstudio.eclipse.gmf.esb.parts.ValidateMediatorPropertiesEditionPart;

// End of user code

/**
 *
 *
 */
public class ValidateMediatorPropertiesEditionComponent extends SinglePartPropertiesEditingComponent {

	public static String BASE_PART = "Base"; //$NON-NLS-1$

	/**
	 * Settings for features ReferencesTable
	 */
	protected ReferencesTableSettings featuresSettings;

	/**
	 * Settings for schemas ReferencesTable
	 */
	protected ReferencesTableSettings schemasSettings;

	/**
	 * Settings for resources ReferencesTable
	 */
	protected ReferencesTableSettings resourcesSettings;

	/**
	 * Default constructor
	 *
	 */
	public ValidateMediatorPropertiesEditionComponent(PropertiesEditingContext editingContext, EObject validateMediator, String editing_mode) {
		super(editingContext, validateMediator, editing_mode);
		parts = new String[] { BASE_PART };
		repositoryKey = EsbViewsRepository.class;
		partKey = EsbViewsRepository.ValidateMediator.class;
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
	 *      org.eclipse.emf.ecore.resource.ResourceSet)
	 *
	 */
	public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
		setInitializing(true);
		if (editingPart != null && key == partKey) {
			editingPart.setContext(elt, allResource);

			final ValidateMediator validateMediator = (ValidateMediator)elt;
			final ValidateMediatorPropertiesEditionPart basePart = (ValidateMediatorPropertiesEditionPart)editingPart;
			// init values
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.description))
				basePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, validateMediator.getDescription()));

			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.commentsList))
				basePart.setCommentsList(validateMediator.getCommentsList());

			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.reverse)) {
				basePart.setReverse(validateMediator.isReverse());
			}
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.features)) {
				featuresSettings = new ReferencesTableSettings(validateMediator, EsbPackage.eINSTANCE.getValidateMediator_Features());
				basePart.initFeatures(featuresSettings);
			}
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.schemas)) {
				schemasSettings = new ReferencesTableSettings(validateMediator, EsbPackage.eINSTANCE.getValidateMediator_Schemas());
				basePart.initSchemas(schemasSettings);
			}
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.resources)) {
				resourcesSettings = new ReferencesTableSettings(validateMediator, EsbPackage.eINSTANCE.getValidateMediator_Resources());
				basePart.initResources(resourcesSettings);
			}
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.enableCacheSchema)) {
				basePart.setEnableCacheSchema(validateMediator.isEnableCacheSchema());
			}
			// Start of user code  for sourceXPath command update
            if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.source)) {
                basePart.setSource(validateMediator.getSourceXpath());
            }
			// End of user code

			// init filters

			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.features)) {
				basePart.addFilterToFeatures(new ViewerFilter() {
					/**
					 * {@inheritDoc}
					 *
					 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
					 */
					public boolean select(Viewer viewer, Object parentElement, Object element) {
						return (element instanceof String && element.equals("")) || (element instanceof ValidateFeature); //$NON-NLS-1$
					}

				});
				// Start of user code for additional businessfilters for features
				// End of user code
			}
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.schemas)) {
				basePart.addFilterToSchemas(new ViewerFilter() {
					/**
					 * {@inheritDoc}
					 *
					 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
					 */
					public boolean select(Viewer viewer, Object parentElement, Object element) {
						return (element instanceof String && element.equals("")) || (element instanceof ValidateSchema); //$NON-NLS-1$
					}

				});
				// Start of user code for additional businessfilters for schemas
				// End of user code
			}
			if (isAccessible(EsbViewsRepository.ValidateMediator.Properties.resources)) {
				basePart.addFilterToResources(new ViewerFilter() {
					/**
					 * {@inheritDoc}
					 *
					 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
					 */
					public boolean select(Viewer viewer, Object parentElement, Object element) {
						return (element instanceof String && element.equals("")) || (element instanceof ValidateResource); //$NON-NLS-1$
					}

				});
				// Start of user code for additional businessfilters for resources
				// End of user code
			}

			// Start of user code  for sourceXPath filter update
			// End of user code

			// init values for referenced views

			// init filters for referenced views

		}
		setInitializing(false);
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#associatedFeature(java.lang.Object)
	 */
	public EStructuralFeature associatedFeature(Object editorKey) {
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.description) {
			return EsbPackage.eINSTANCE.getEsbElement_Description();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.commentsList) {
			return EsbPackage.eINSTANCE.getEsbElement_CommentsList();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.reverse) {
			return EsbPackage.eINSTANCE.getMediator_Reverse();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.features) {
			return EsbPackage.eINSTANCE.getValidateMediator_Features();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.schemas) {
			return EsbPackage.eINSTANCE.getValidateMediator_Schemas();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.resources) {
			return EsbPackage.eINSTANCE.getValidateMediator_Resources();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.enableCacheSchema) {
			return EsbPackage.eINSTANCE.getValidateMediator_EnableCacheSchema();
		}
		if (editorKey == EsbViewsRepository.ValidateMediator.Properties.source) {
			return EsbPackage.eINSTANCE.getValidateMediator_SourceXpath();
		}
		return super.associatedFeature(editorKey);
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
	 *
	 */
	public void updateSemanticModel(final IPropertiesEditionEvent event) {
		ValidateMediator validateMediator = (ValidateMediator)semanticObject;
		if (EsbViewsRepository.ValidateMediator.Properties.description == event.getAffectedEditor()) {
			validateMediator.setDescription((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
		}
		if (EsbViewsRepository.ValidateMediator.Properties.commentsList == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.SET) {
				validateMediator.getCommentsList().clear();
				validateMediator.getCommentsList().addAll(((EList) event.getNewValue()));
			}
		}
		if (EsbViewsRepository.ValidateMediator.Properties.reverse == event.getAffectedEditor()) {
			validateMediator.setReverse((Boolean)event.getNewValue());
		}
		if (EsbViewsRepository.ValidateMediator.Properties.features == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.ADD) {
				EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, featuresSettings, editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy policy = provider.getPolicy(context);
					if (policy instanceof CreateEditingPolicy) {
						policy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.EDIT) {
				EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
					if (editionPolicy != null) {
						editionPolicy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
				featuresSettings.removeFromReference((EObject) event.getNewValue());
			} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
				featuresSettings.move(event.getNewIndex(), (ValidateFeature) event.getNewValue());
			}
		}
		if (EsbViewsRepository.ValidateMediator.Properties.schemas == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.ADD) {
				EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, schemasSettings, editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy policy = provider.getPolicy(context);
					if (policy instanceof CreateEditingPolicy) {
						policy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.EDIT) {
				EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
					if (editionPolicy != null) {
						editionPolicy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
				schemasSettings.removeFromReference((EObject) event.getNewValue());
			} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
				schemasSettings.move(event.getNewIndex(), (ValidateSchema) event.getNewValue());
			}
		}
		if (EsbViewsRepository.ValidateMediator.Properties.resources == event.getAffectedEditor()) {
			if (event.getKind() == PropertiesEditionEvent.ADD) {
				EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, resourcesSettings, editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy policy = provider.getPolicy(context);
					if (policy instanceof CreateEditingPolicy) {
						policy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.EDIT) {
				EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
				PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
				if (provider != null) {
					PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
					if (editionPolicy != null) {
						editionPolicy.execute();
					}
				}
			} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
				resourcesSettings.removeFromReference((EObject) event.getNewValue());
			} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
				resourcesSettings.move(event.getNewIndex(), (ValidateResource) event.getNewValue());
			}
		}
		if (EsbViewsRepository.ValidateMediator.Properties.enableCacheSchema == event.getAffectedEditor()) {
			validateMediator.setEnableCacheSchema((Boolean)event.getNewValue());
		}
		if (EsbViewsRepository.ValidateMediator.Properties.source == event.getAffectedEditor()) {
			// Start of user code for updateSourceXPath method body
            if (event.getNewValue() != null) {
                NamespacedProperty nsp = (NamespacedProperty) event.getNewValue();
                validateMediator.setSourceXpath(nsp);
            } else {
                validateMediator.setSourceXpath(EsbFactoryImpl.eINSTANCE.createNamespacedProperty());
            }
			// End of user code

		}
	}

	/**
	 * {@inheritDoc}
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
	 */
	public void updatePart(Notification msg) {
		super.updatePart(msg);
		if (editingPart.isVisible()) {
			ValidateMediatorPropertiesEditionPart basePart = (ValidateMediatorPropertiesEditionPart)editingPart;
			if (EsbPackage.eINSTANCE.getEsbElement_Description().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ValidateMediator.Properties.description)) {
				if (msg.getNewValue() != null) {
					basePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
				} else {
					basePart.setDescription("");
				}
			}
			if (EsbPackage.eINSTANCE.getEsbElement_CommentsList().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ValidateMediator.Properties.commentsList)) {
				if (msg.getNewValue() instanceof EList<?>) {
					basePart.setCommentsList((EList<?>)msg.getNewValue());
				} else if (msg.getNewValue() == null) {
					basePart.setCommentsList(new BasicEList<Object>());
				} else {
					BasicEList<Object> newValueAsList = new BasicEList<Object>();
					newValueAsList.add(msg.getNewValue());
					basePart.setCommentsList(newValueAsList);
				}
			}

			if (EsbPackage.eINSTANCE.getMediator_Reverse().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ValidateMediator.Properties.reverse))
				basePart.setReverse((Boolean)msg.getNewValue());

			if (EsbPackage.eINSTANCE.getValidateMediator_Features().equals(msg.getFeature()) && isAccessible(EsbViewsRepository.ValidateMediator.Properties.features))
				basePart.updateFeatures();
			if (EsbPackage.eINSTANCE.getValidateMediator_Schemas().equals(msg.getFeature()) && isAccessible(EsbViewsRepository.ValidateMediator.Properties.schemas))
				basePart.updateSchemas();
			if (EsbPackage.eINSTANCE.getValidateMediator_Resources().equals(msg.getFeature()) && isAccessible(EsbViewsRepository.ValidateMediator.Properties.resources))
				basePart.updateResources();
			if (EsbPackage.eINSTANCE.getValidateMediator_EnableCacheSchema().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(EsbViewsRepository.ValidateMediator.Properties.enableCacheSchema))
				basePart.setEnableCacheSchema((Boolean)msg.getNewValue());

					// Start of user code for sourceXPath live update
            if (EsbPackage.eINSTANCE.getValidateMediator_SourceXpath().equals(msg.getFeature())
                    && msg.getNotifier().equals(semanticObject) && basePart != null
                    && isAccessible(EsbViewsRepository.ValidateMediator.Properties.source)) {
                if (msg.getNewValue() != null) {
                    basePart.setSource((NamespacedProperty)msg.getNewValue());
                } else {
                    basePart.setSource(EsbFactoryImpl.eINSTANCE.createNamespacedProperty());
                }
            }
					// End of user code

		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#getNotificationFilters()
	 */
	@Override
	protected NotificationFilter[] getNotificationFilters() {
		NotificationFilter filter = new EStructuralFeatureNotificationFilter(
			EsbPackage.eINSTANCE.getEsbElement_Description(),
			EsbPackage.eINSTANCE.getEsbElement_CommentsList(),
			EsbPackage.eINSTANCE.getMediator_Reverse(),
			EsbPackage.eINSTANCE.getValidateMediator_Features(),
			EsbPackage.eINSTANCE.getValidateMediator_Schemas(),
			EsbPackage.eINSTANCE.getValidateMediator_Resources(),
			EsbPackage.eINSTANCE.getValidateMediator_EnableCacheSchema(),
			EsbPackage.eINSTANCE.getValidateMediator_SourceXpath()		);
		return new NotificationFilter[] {filter,};
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
	 *
	 */
	public Diagnostic validateValue(IPropertiesEditionEvent event) {
		Diagnostic ret = Diagnostic.OK_INSTANCE;
		if (event.getNewValue() != null) {
			try {
				if (EsbViewsRepository.ValidateMediator.Properties.description == event.getAffectedEditor()) {
					Object newValue = event.getNewValue();
					if (newValue instanceof String) {
						newValue = EEFConverterUtil.createFromString(EsbPackage.eINSTANCE.getEsbElement_Description().getEAttributeType(), (String)newValue);
					}
					ret = Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getEsbElement_Description().getEAttributeType(), newValue);
				}
				if (EsbViewsRepository.ValidateMediator.Properties.commentsList == event.getAffectedEditor()) {
					BasicDiagnostic chain = new BasicDiagnostic();
					for (Iterator iterator = ((List)event.getNewValue()).iterator(); iterator.hasNext();) {
						chain.add(Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getEsbElement_CommentsList().getEAttributeType(), iterator.next()));
					}
					ret = chain;
				}
				if (EsbViewsRepository.ValidateMediator.Properties.reverse == event.getAffectedEditor()) {
					Object newValue = event.getNewValue();
					if (newValue instanceof String) {
						newValue = EEFConverterUtil.createFromString(EsbPackage.eINSTANCE.getMediator_Reverse().getEAttributeType(), (String)newValue);
					}
					ret = Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getMediator_Reverse().getEAttributeType(), newValue);
				}
				if (EsbViewsRepository.ValidateMediator.Properties.enableCacheSchema == event.getAffectedEditor()) {
					Object newValue = event.getNewValue();
					if (newValue instanceof String) {
						newValue = EEFConverterUtil.createFromString(EsbPackage.eINSTANCE.getValidateMediator_EnableCacheSchema().getEAttributeType(), (String)newValue);
					}
					ret = Diagnostician.INSTANCE.validate(EsbPackage.eINSTANCE.getValidateMediator_EnableCacheSchema().getEAttributeType(), newValue);
				}
			} catch (IllegalArgumentException iae) {
				ret = BasicDiagnostic.toDiagnostic(iae);
			} catch (WrappedException we) {
				ret = BasicDiagnostic.toDiagnostic(we);
			}
		}
		return ret;
	}

}

redpajama_set_name: RedPajamaGithub


text:
using Autofac;

namespace UserManagement.Consumer
{
    public class UserManagementConsumerModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {

        }

    }
}


text:
layout: relation
title: 'conj'
shortdef: 'conjunct'
udver: '2'
---

A conjunct is the relation between two elements connected by a
coordinating conjunction, such as and, or, etc.

Following general UD guidelines, the first conjunct is the head
of the construction.
All other conjuncts depend on it via the ``conj`` relation.

~~~ sdparse
Bir kız , iki erkek çocukları var . \n They have one girl and two boys.
conj(kız, erkek)
~~~

~~~ sdparse
Film siyah beyaz . \n The movie is black and white
conj(siyah, beyaz)
~~~

~~~ sdparse
Ayşe'yle Ali kavga ediyoralardı . \n Ayşe and Ali were fighting .
conj(Ayşe'yle, Ali)
~~~

~~~ sdparse
Ayşe , Ali ve beni davet etmedi . \n He\/she did not invite Ayşe , Ali and me .
conj(Ayşe, Ali)
conj(Ayşe, beni)
cc(beni, ve)
punct(Ali, ,-2)
~~~

~~~ sdparse
Ya Ayşe , ya Ali , ya da  beni davet etmeliydi . \n He\/she should have invited either Ayşe , Ali or me .
conj(Ayşe, Ali)
conj(Ayşe, beni)
cc(beni, ya-7)
cc(Ali, ya-4)
cc(Ayşe, Ya-1)
fixed(ya-7, da)
~~~

See the relation [cc]() for a few more examples.
<!-- Interlanguage links updated Po lis 14 15:35:17 CET 2022 -->


text:
package types

import (
	"reflect"
	"testing"

	"github.com/coreos/ignition/v2/config/shared/errors"
	"github.com/coreos/ignition/v2/config/util"

	"github.com/coreos/vcontext/path"
	"github.com/coreos/vcontext/report"
)

func TestClevisCustomValidate(t *testing.T) {
	tests := []struct {
		in  ClevisCustom
		at  path.ContextPath
		out error
	}{
		{
			in:  ClevisCustom{},
			out: nil,
		},
		{
			in: ClevisCustom{
				Config:       util.StrToPtr("z"),
				NeedsNetwork: util.BoolToPtr(true),
				Pin:          util.StrToPtr("sss"),
			},
			out: nil,
		},
		{
			in: ClevisCustom{
				Config: util.StrToPtr("z"),
			},
			at:  path.New("", "pin"),
			out: errors.ErrClevisPinRequired,
		},
		{
			in: ClevisCustom{
				Config: util.StrToPtr("z"),
				Pin:    util.StrToPtr("z"),
			},
			at:  path.New("", "pin"),
			out: errors.ErrUnknownClevisPin,
		},
		{
			in: ClevisCustom{
				Pin: util.StrToPtr("tpm2"),
			},
			at:  path.New("", "config"),
			out: errors.ErrClevisConfigRequired,
		},
	}

	for i, test := range tests {
		r := test.in.Validate(path.ContextPath{})
		expected := report.Report{}
		expected.AddOnError(test.at, test.out)
		if !reflect.DeepEqual(expected, r) {
			t.Errorf("#%d: bad report: want %v, got %v", i, expected, r)
		}
	}
}


text:
package org.marvec.encryptor.api;

/**
 * @author Martin Večeřa
 */
public class Signature {

   private String signature;

   public Signature() {
   }

   public Signature(final String signature) {
      this.signature = signature;
   }

   public String getSignature() {
      return signature;
   }

   public void setSignature(final String signature) {
      this.signature = signature;
   }
}


text:
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var jasmine = require('gulp-jasmine');

gulp.task('jasmine', function () {
  return gulp.src('spec/**/*.js')
    .pipe(jasmine({
      verbose: true
    }));
});

gulp.task('babel', function () {
  return gulp.src('src/**/*.js')
    //.pipe(sourcemaps.init())
    .pipe(babel({
      stage: 0  // http://babeljs.io/docs/usage/experimental/
    }))
    .on('error', console.error.bind(console))
    //.pipe(concat('all.js'))
    //.pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('dist'));
});

gulp.task('watch', function(){
  gulp.watch(['src/**/*.js', 'spec/**/*.js'], ['babel', 'jasmine']);
});

gulp.task('default', ['watch']);


text:
.. phix test for websequencediagram documentation master file, created by
   sphinx-quickstart on Sun Dec  4 21:14:29 2011.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to phix test for websequencediagram's documentation!
============================================================

.. websequencediagram:: test.wsd
   :new-window:
   :server-url: http://www.websequencediagrams.com/

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
title: John Butler Trio - Tonight at The Moore
date: 2007-12-07 00:00:00 Z
categories:
- Blog
- News
layout: post
---

Tonight is the night for JBT at the Moore Theater in Seattle. This is going to me by third time seeing John Butler, twice this year. I can't wait the show is always amazing. We have grown the following also, Val's brother, Brad and his fianc


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="wel_text_primary_theme_dark">#fff</color>
    <color name="wel_text_primary_theme_light">#000</color>
    <color name="wel_divider_color_theme_dark">#33ffffff</color>
    <color name="wel_divider_color_theme_light">#22000000</color>
    <color name="wel_default_background_color">#1E88E5</color>
    <color name="wel_indicator_color_primary_theme_dark">#99ffffff</color>
    <color name="wel_indicator_color_secondary_theme_dark">#22000000</color>
    <color name="wel_indicator_color_primary_theme_light">#99000000</color>
    <color name="wel_indicator_color_secondary_theme_light">#22000000</color>
    <color name="wel_button_background_theme_dark">#55ffffff</color>
    <color name="wel_button_background_theme_light">#33000000</color>
    <color name="wel_overscroll_color_theme_dark">#55ffffff</color>
    <color name="wel_overscroll_color_theme_light">#33000000</color>
    <color name="wel_button_bar_background_dark">#33000000</color>
    <color name="wel_button_bar_background_light">#14000000</color>

    <color name="wel_transparent">#00000000</color>
    <color name="wel_white">#FFFFFF</color>
</resources>


text:
package br.com.nordestefomento.jrimum.bopepo.campolivre;

import br.com.nordestefomento.jrimum.domkee.financeiro.banco.febraban.ContaBancaria;
import br.com.nordestefomento.jrimum.domkee.financeiro.banco.febraban.Titulo;
import br.com.nordestefomento.jrimum.utilix.Field;
import br.com.nordestefomento.jrimum.utilix.Filler;

/**
 *
 *
 *

 * Campo livre padrão do Banco Itaú
 *

 *
 *

 * Constrói o campo livre no caso especial, ou seja, quando a carteira for:
 * 106, 107, 122, 142, 143, 195, 196 ou 198.
 *

 *
 *

 *
Layout do Banco Itaú para o campo livre ESPECIAL

 *

 *

 *

 *

 * Posição
 * Tamanho
 * Picture
 * Conteúdo
 *

 *

 *

 *

 * 20 a 22
 * 3
 * 9(03)
 * Carteira
 *

 *

 * 23 a 30
 * 8
 * 9(08)
 * Nosso número
 *

 *

 * 31 a 37
 * 7
 * 9(07)
 * Seu Número (Número do Documento)
 *

 *

 * 38 a 42
 * 5
 * 9(05)
 * Código do Cliente (fornecido pelo Banco)
 *

 *

 * 43 a 43
 * 1
 * 9(01)
 * DAC dos campos acima (posições 20 a 42 veja anexo 3)
 *

 *

 *

 * 44 a 44
 * 1
 * 9(01)
 * Zero
 *

 *

 *

 *

 *

 *
 * @author Romulo
 *
 * @since 0.2
 *
 * @version 0.2
 */
class CLItauComCarteirasEspeciais extends AbstractCLItau {

	/**
	 *
	 */
	private static final long serialVersionUID = -1532454262023154419L;

	/**
	 * Tamanho do campo livre para carteiras especiais.
	 */
	private static final Integer FIELDS_LENGTH = 6;

	/**
	 *

	 *   Dado um título, cria o campo livre do Banco Itaú para carteiras especiais.
	 *

	 * @param titulo título com as informações para geração do campo livre
	 */
	public CLItauComCarteirasEspeciais(Titulo titulo) {
		super(FIELDS_LENGTH, STRING_LENGTH);

		ContaBancaria conta = titulo.getContaBancaria();

		this.add(new Field<Integer>(conta.getCarteira().getCodigo(), 3, Filler.ZERO_LEFT));
		this.add(new Field<String>(titulo.getNossoNumero(), 8, Filler.ZERO_LEFT));
		this.add(new Field<String>(titulo.getNumeroDoDocumento(), 7, Filler.ZERO_LEFT));

		//Aqui é o código do cedente, simbolizado pelo código da conta bancária.
		this.add(new Field<Integer>(conta.getNumeroDaConta().getCodigoDaConta(), 5, Filler.ZERO_LEFT));

		this.add(new Field<Integer>(calculeDigitoDoCampoLivreEspecial(
											conta.getCarteira().getCodigo(),
											titulo.getNossoNumero(),
											titulo.getNumeroDoDocumento(),
											conta.getNumeroDaConta().getCodigoDaConta()), 1));
		this.add(new Field<Integer>(0, 1));
	}

	/**
	 *

	 * Calcula o dígito verificador para o campo livre especial a partir do
	 * código da carteira, do nosso número, do número do documento e do código da conta.
	 *

	 *
	 * @param codigoDaCarteira
	 * @param nossoNumero
	 * @param numeroDoDocumento
	 * @param codigoDaConta
	 * @return Integer digito
	 *
	 * @see #calculeDigitoDaPosicao41(Integer, Integer)
	 *
	 * @since 0.2
	 */
	private Integer calculeDigitoDoCampoLivreEspecial(Integer codigoDaCarteira,
			String nossoNumero, String numeroDoDocumento, Integer codigoDaConta) {

		StringBuilder campo = new StringBuilder();

		campo.append(Filler.ZERO_LEFT.fill(codigoDaCarteira.intValue(), 3));
		campo.append(Filler.ZERO_LEFT.fill(nossoNumero, 8));
		campo.append(Filler.ZERO_LEFT.fill(numeroDoDocumento, 7));
		campo.append(Filler.ZERO_LEFT.fill(codigoDaConta, 5));

		return calculeDigitoVerificador(campo.toString());
	}

}


text:
import _plotly_utils.basevalidators

class ButtondefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
    def __init__(
        self, plotly_name="buttondefaults", parent_name="layout.updatemenu", **kwargs
    ):
        super(ButtondefaultsValidator, self).__init__(
            plotly_name=plotly_name,
            parent_name=parent_name,
            data_class_str=kwargs.pop("data_class_str", "Button"),
            data_docs=kwargs.pop(
                "data_docs",
                """
""",
            ),
            **kwargs
        )


text:
package net.vexelon.telnet;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.Executors;

public class BlockingServer {

    public void start(String host, int port) throws IOException {
        var es = Executors.newFixedThreadPool(10);

        try (var server = new ServerSocket()) {
            server.bind(new InetSocketAddress(host, port));

            var clientId = 0;

            while (true) {
                es.execute(new EchoLoop(++clientId, server.accept()));
            }
        }
    }

    private record EchoLoop(int clientId, Socket client) implements Runnable {

        @Override public void run() {
            try {
                var addr = client.getInetAddress().getHostAddress();
                System.out.println("(#" + clientId + ") : New client connection from " + addr);

                int eofs = 0;
                while (eofs < 3) {
                    var line = new BufferedReader(new InputStreamReader(client.getInputStream())).readLine();
                    if (line == null) break; // conn closed

                    eofs += line.isEmpty() ? 1 : 0; // client sent empty lines

                    client.getOutputStream().write(("ECHO : " + line + "\r\n").getBytes(StandardCharsets.UTF_8));
                }

                client.close();

                System.out.println("(#" + clientId + ") : Closed client connection from " + addr);
            } catch (Throwable t) {
                throw new RuntimeException(t);
            }
        }
    }
}


text:
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data
Imports System.Data.SqlClient

'-------------------------------------------------------------------------------------------'
' Inicio de clase "rTCotizaciones_ArticulosFechasVendedores"
'-------------------------------------------------------------------------------------------'
Partial Class rTCotizaciones_ArticulosFechasVendedores
    Inherits vis2Formularios.frmReporte

    Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try

            Dim lcParametro0Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(0), goServicios.enuOpcionesRedondeo.KN_FechaInicioDelDia)
            Dim lcParametro0Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(0), goServicios.enuOpcionesRedondeo.KN_FechaFinDelDia)
            Dim lcParametro1Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(1))
            Dim lcParametro1Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(1))
            Dim lcParametro2Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(2))
            Dim lcParametro2Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(2))
            Dim lcParametro3Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(3))
            Dim lcParametro3Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(3))
            Dim lcParametro4Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(4))
            Dim lcParametro4Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(4))
            Dim lcParametro5Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(5))
            Dim lcParametro5Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(5))
            Dim lcParametro6Desde As String = cusAplicacion.goReportes.paParametrosIniciales(6) 'goServicios.mObtenerListaFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(6))
            Dim lcParametro7Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(7))
            Dim lcParametro7Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(7))
            Dim lcParametro8Desde As String = cusAplicacion.goReportes.paParametrosIniciales(8)
            Dim lcParametro9Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(9))
            Dim lcParametro9Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(9))

            Dim lcOrdenamiento As String = cusAplicacion.goReportes.pcOrden

            Dim loComandoSeleccionar As New StringBuilder()

            loComandoSeleccionar.AppendLine(" EXEC sp_TCotizaciones_AriculosFechasVendedores")
            loComandoSeleccionar.AppendLine(" 	@sp_lcFecIni = " & lcParametro0Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcFecFin = " & lcParametro0Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodArtIni = " & lcParametro1Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodArtFin = " & lcParametro1Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodCliIni = " & lcParametro2Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodCliFin = " & lcParametro2Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodVenIni = " & lcParametro3Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodVenFin = " & lcParametro3Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodDepIni = " & lcParametro4Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodDepFin = " & lcParametro4Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodTipIni = " & lcParametro5Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodTipFin = " & lcParametro5Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcStatus  = '" & lcParametro6Desde & "',")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodRevIni = " & lcParametro7Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodRevFin = " & lcParametro7Hasta & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcTipRev  = '" & lcParametro8Desde & "',")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodSucIni = " & lcParametro9Desde & ",")
            loComandoSeleccionar.AppendLine(" 	@sp_lcCodSucFin = " & lcParametro9Hasta & ",")
            loComandoSeleccionar.AppendLine("   @sp_NumDecCant = " & cusAplicacion.goOpciones.pnDecimalesParaCantidad)

			'Me.mEscribirConsulta(loComandoSeleccionar.ToString)
            Dim loServicios As New cusDatos.goDatos

            Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString, "curReportes")

			'Me.mEscribirConsulta(loComandoSeleccionar.ToString)

            If (laDatosReporte.Tables(0).Rows.Count <= 0) Then
                Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _
                                          "No se Encontraron Registros para los Parámetros Especificados. ", _
                                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _
                                           "350px", _
                                           "200px")
            End If

            loObjetoReporte = cusAplicacion.goReportes.mCargarReporte("rTCotizaciones_ArticulosFechasVendedores", laDatosReporte)

            Me.mTraducirReporte(loObjetoReporte)

            Me.mFormatearCamposReporte(loObjetoReporte)

            Me.crvrTCotizaciones_ArticulosFechasVendedores.ReportSource = loObjetoReporte

        Catch loExcepcion As Exception

            Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
                          "No se pudo Completar el Proceso: " & loExcepcion.Message, _
                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
                           "auto", _
                           "auto")

        End Try
    End Sub
    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

        Try

            loObjetoReporte.Close()

        Catch loExcepcion As Exception

        End Try

    End Sub

End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo
'-------------------------------------------------------------------------------------------'
' CMS: 29/06/10 : Codigo inicial
'-------------------------------------------------------------------------------------------'
' MAT: 04/02/11: Nueva Programación del Procedimiento Almacenado. Mejora en el Diseño
'-------------------------------------------------------------------------------------------'


text:
package au.org.aurin.wif.svc.demand;

import java.util.List;

import au.org.aurin.wif.exception.config.ParsingException;
import au.org.aurin.wif.exception.config.WifInvalidConfigException;
import au.org.aurin.wif.exception.validate.IncompleteDemandScenarioException;
import au.org.aurin.wif.exception.validate.WifInvalidInputException;
import au.org.aurin.wif.model.demand.AreaRequirement;
import au.org.aurin.wif.model.demand.DemandScenario;

/**
 * The Interface DemandScenarioService.
 */
public interface DemandScenarioService {

  /**
   * Creates the demand scenario.
   *
   * @param demandScenario
   *          the demand scenario
   * @param projectId
   *          the project id
   * @return the demand scenario
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   * @throws IncompleteDemandScenarioException
   *           the incomplete demand scenario exception
   */
  DemandScenario createDemandScenario(DemandScenario demandScenario,
      String projectId) throws WifInvalidInputException,
      WifInvalidConfigException, ParsingException,
      IncompleteDemandScenarioException;

  /**
   * Gets the demand scenario.
   *
   * @param id
   *          the id
   * @return the demand scenario
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   */
  DemandScenario getDemandScenario(String id) throws WifInvalidInputException,
      WifInvalidConfigException, ParsingException;

  /**
   * Gets the demand scenario.
   *
   * @param id
   *          the id
   * @param projectId
   *          the project id
   * @return the demand scenario
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   */
  DemandScenario getDemandScenario(String id, String projectId)
      throws WifInvalidInputException, WifInvalidConfigException,
      ParsingException;

  /**
   * Update demand scenario.
   *
   * @param demandScenario
   *          the demand scenario
   * @param projectId
   *          the project id
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   */
  void updateDemandScenario(DemandScenario demandScenario, String projectId)
      throws WifInvalidInputException, WifInvalidConfigException,
      ParsingException;

  /**
   * Delete demand scenario.
   *
   * @param id
   *          the id
   * @param projectId
   *          the project id
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   */
  void deleteDemandScenario(String id, String projectId)
      throws WifInvalidInputException, WifInvalidConfigException,
      ParsingException;

  /**
   * Gets the demand scenarios.
   *
   * @param projectId
   *          the project id
   * @return the demand scenarios
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   */
  List<DemandScenario> getDemandScenarios(String projectId)
      throws WifInvalidInputException;

  /**
   * Gets the outcome.
   *
   * @param id
   *          the id
   * @return the outcome
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   * @throws IncompleteDemandScenarioException
   *           the incomplete demand scenario exception
   */
  List<AreaRequirement> getOutcome(String id) throws WifInvalidInputException,
      WifInvalidConfigException, ParsingException,
      IncompleteDemandScenarioException;

  /**
   * Gets the outcome.
   *
   * @param demandScenario
   *          the demand scenario
   * @return the outcome
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   *           the parsing exception
   * @throws IncompleteDemandScenarioException
   *           the incomplete demand scenario exception
   */
  List<AreaRequirement> getOutcome(DemandScenario demandScenario)
      throws WifInvalidInputException, WifInvalidConfigException,
      ParsingException, IncompleteDemandScenarioException;
}


text:
// Copyright 2016-2020 TriAxis Games L.L.C. All Rights Reserved.

#pragma once

#include "Modules/ModuleManager.h"

/**
* The public interface to this module
*/
class IRuntimeMeshComponentEditorPlugin : public IModuleInterface
{

public:

	/**
	* Singleton-like access to this module's interface.  This is just for convenience!
	* Beware of calling this during the shutdown phase, though.  Your module might have been unloaded already.
	*
	* @return Returns singleton instance, loading the module on demand if needed
	*/
	static inline IRuntimeMeshComponentEditorPlugin& Get()
	{
		return FModuleManager::LoadModuleChecked< IRuntimeMeshComponentEditorPlugin >("RuntimeMeshComponentEditorPlugin");
	}

	/**
	* Checks to see if this module is loaded and ready.  It is only valid to call Get() if IsAvailable() returns true.
	*
	* @return True if the module is loaded and ready to use
	*/
	static inline bool IsAvailable()
	{
		return FModuleManager::Get().IsModuleLoaded("RuntimeMeshComponentEditorPlugin");
	}
};


text:
package parser

import (
	"fmt"

	"github.com/hashicorp/hil/ast"
	"github.com/hashicorp/hil/scanner"
)

type ParseError struct {
	Message string
	Pos     ast.Pos
}

func Errorf(pos ast.Pos, format string, args ...interface{}) error {
	return &ParseError{
		Message: fmt.Sprintf(format, args...),
		Pos:     pos,
	}
}

// TokenErrorf is a convenient wrapper around Errorf that uses the
// position of the given token.
func TokenErrorf(token *scanner.Token, format string, args ...interface{}) error {
	return Errorf(token.Pos, format, args...)
}

func ExpectationError(wanted string, got *scanner.Token) error {
	return TokenErrorf(got, "expected %s but found %s", wanted, got)
}

func (e *ParseError) Error() string {
	return fmt.Sprintf("parse error at %s: %s", e.Pos, e.Message)
}

func (e *ParseError) String() string {
	return e.Error()
}


text:
layout: markdown_page
title: "Data analysis"
---
## Redash data visualization tool
Redash is a data visualization tool. Currently it has one data source, i.e. the database in `version.gitlab.com`.
This database stores the EE usage pings that are sent from some EE customers.
You can create and save SQL queries that execute against that database, and create charts based on those results, that can be refreshed dynamically.
Log in to `http://redash.gitlab.com` using your GitLab Google credentials.

We are working on adding a second data source for `staging.gitlab.com`, so that we can get production gitlab.com inside Redash as well.

## Access data
Follow these steps to get access to raw data from gitlab.com and EE usage pings stored in `version.gitlab.com`.

### Get a GitLab Linux account
Ask production folks (`#infrastructure` channel) to set up a Linux account for you. Mine is `victor`, and is used as an example below.

---

### Access `worker1.staging.gitlab.com` staging rails console
Access the server
```
$ ssh victor@worker1.staging.gitlab.com
```

Run
```
$ sudo gitlab-rails c production
```

---

### Access `db1.staging.gitlab.com` db
As required, ask production folks to refresh the `db1.staging.gitlab.com` db with the `gitlab.com` db.

Access the server
```
$ ssh victor@db1.staging.gitlab.com
```

Run
```
$ sudo gitlab-psql gitlabhq_production
```

---

### Access `version.gitlab.com` db
Access the server
```
$ ssh victor@version.gitlab.com
```

Use `psql`
```
$ sudo su postgres
$ psql
```

Access the db
```
postgres=# \c version_gitlab_com_production
postgres=# \dt
```

---

### Access `piwik.gitlab.com` db
Access the server
```
$ ssh victor@piwik.gitlab.com
```

Use `mysql` and access the db
```
$ sudo mysql --defaults-file=/etc/mysql/debian.cnf
```

Refer to the [Piwik schema](https://developer.piwik.org/guides/persistence-and-the-mysql-backend)

---

### Access db from a sql client
Access db from a sql client for additional features and ease of use. The sql client can connect to your local machine, and tunnel to the server. A suggested native Mac sql client for PostgreSQL is [Postico](https://eggerapps.at/postico/). Ask GitLab to expense a license. Download and install. For MySQL, [Sequel Pro](http://sequelpro.com) (i.e. "Pancakes") is decent.

Set up forwarding through your local machine by running one of the following
```
$ ssh -L5432:localhost:5432 victor@db1.staging.gitlab.com
$ ssh -L5432:localhost:5432 victor@version.gitlab.com
$ ssh -L3306:localhost:3306 victor@piwik.gitlab.com
```

#### `db1.staging.gitlab.com`
Find the database password on `db1.staging.gitlab.com`
```
$ sudo vi /etc/gitlab/gitlab.rb
```
Look at `postgresql['sql_password']`.

In your sql client, connect with
```
host: localhost
port: 5432
username: gitlab
password: <password>
database: gitlabhq_production
```

#### `version.gitlab.com`
Find the database login and password on `version.gitlab.com`
```
$ sudo cat /home/gitlab-version/version-gitlab-com/config/database.yml
```

In your sql client, connect with
```
host: localhost
port: 5432
username: <username>
password: <password>
database: version_gitlab_com_production
```

#### `piwik.gitlab.com`
Find the database login and password on `piwik.gitlab.com`
```
$ sudo vi /etc/mysql/debian.cnf
```

In your sql client, connect with
```
host: 127.0.0.1
port: 3306
username: <username>
password: <password>
database: piwik
```


text:
//
//  SyncanoProtocolUsers.h
//  Syncano
//
//  Created by Syncano Inc. on 23/12/13.
//  Copyright (c) 2013 Syncano Inc. All rights reserved.
//

#ifndef Syncano_SyncanoProtocolUsers_h
#define Syncano_SyncanoProtocolUsers_h

#import "SyncanoParameters_Users.h"
#import "SyncanoResponse_Users.h"

/**
   SyncanoProtocolUsers is used to transmit information about SyncanoUser objects

   @note All `SyncanoProtocol*` protocols define method signatures used by objects (i.e. Syncano, SyncanoSyncServer communicating with Syncano API.
 */
@protocol SyncanoProtocolUsers <NSObject>
@required

#pragma mark - Synchronized

///-
/// @name Synchronous requests
///-

/**
   Logs in a user.

   @note This method is intended for User API key usage.

   @param params User login parameters.

   @return Response for logging in user.
 */
- (SyncanoResponse_Users_Login *)userLogin:(SyncanoParameters_Users_Login *)params;
/**
   Create new user

   @param params Parameters of new user

   @return Response for creation of new user
 */
- (SyncanoResponse_Users_New *)userNew:(SyncanoParameters_Users_New *)params;
/**
   Get all users list

   @param params User list parameters

   @return Response for user list
 */
- (SyncanoResponse_Users_GetAll *)userGetAll:(SyncanoParameters_Users_GetAll *)params;
/**
   Get user list

   @param params user list parameters

   @return Response for user list
 */
- (SyncanoResponse_Users_Get *)userGet:(SyncanoParameters_Users_Get *)params;
/**
   Get one user

   @param params Single user getter parameters

   @return Response for single user
 */
- (SyncanoResponse_Users_GetOne *)userGetOne:(SyncanoParameters_Users_GetOne *)params;
/**
   Update existing user

   @param params Update user parameters

   @return Reponse to existing user update
 */
- (SyncanoResponse_Users_Update *)userUpdate:(SyncanoParameters_Users_Update *)params;
/**
   Count existing users

   @param params Count users parameters

   @return Reponse to existing user count request
 */
- (SyncanoResponse_Users_Count *)userCount:(SyncanoParameters_Users_Count *)params;
/**
   Delete existing user

   @param params Delete user parameters

   @return Reponse to existing user deletion
 */
- (SyncanoResponse *)userDelete:(SyncanoParameters_Users_Delete *)params;

#pragma mark - Asynchronized

///-
/// @name Asynchronous requests
///-

/**
   Logs in a user.

   @note This method is intended for User API key usage.

   @param params User login parameters.
   @param callback Callback response for logging in user.
 */
- (void)userLogin:(SyncanoParameters_Users_Login *)params callback:(void (^)(SyncanoResponse_Users_Login *))callback;
/**
   Create new user

   @param params Parameters of new user
 */
- (void)userNew:(SyncanoParameters_Users_New *)params callback:(void (^)(SyncanoResponse_Users_New *response))callback;
/**
   Get all users list

   @param params User list parameters
 */
- (void)userGetAll:(SyncanoParameters_Users_GetAll *)params callback:(void (^)(SyncanoResponse_Users_GetAll *response))callback;
/**
   Get user list

   @param params user list parameters
 */
- (void)userGet:(SyncanoParameters_Users_Get *)params callback:(void (^)(SyncanoResponse_Users_Get *response))callback;
/**
   Get one user

   @param params Single user getter parameters
 */
- (void)userGetOne:(SyncanoParameters_Users_GetOne *)params callback:(void (^)(SyncanoResponse_Users_GetOne *response))callback;
/**
   Update existing user

   @param params Update user parameters
 */
- (void)userUpdate:(SyncanoParameters_Users_Update *)params callback:(void (^)(SyncanoResponse_Users_Update *response))callback;
/**
   Count existing users

   @param params Count users parameters
 */
- (void)userCount:(SyncanoParameters_Users_Count *)params callback:(void (^)(SyncanoResponse_Users_Count *response))callback;
/**
   Delete existing user

   @param params Delete user parameters
 */
- (void)userDelete:(SyncanoParameters_Users_Delete *)params callback:(void (^)(SyncanoResponse *response))callback;

@end

#endif


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Adornments;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;

namespace Microsoft.CodeAnalysis.Diagnostics
{
    [Export(typeof(ITaggerProvider))]
    [ContentType(ContentTypeNames.RoslynContentType)]
    [ContentType(ContentTypeNames.XamlContentType)]
    [TagType(typeof(IErrorTag))]
    internal partial class DiagnosticsSuggestionTaggerProvider :
        AbstractDiagnosticsAdornmentTaggerProvider<IErrorTag>
    {
        private static readonly IEnumerable<Option2<bool>> s_tagSourceOptions =
            ImmutableArray.Create(EditorComponentOnOffOptions.Tagger, InternalFeatureOnOffOptions.Squiggles);

        protected override IEnumerable<Option2<bool>> Options => s_tagSourceOptions;

        [ImportingConstructor]
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
        public DiagnosticsSuggestionTaggerProvider(
            IThreadingContext threadingContext,
            IDiagnosticService diagnosticService,
            IGlobalOptionService globalOptions,
            IAsynchronousOperationListenerProvider listenerProvider)
            : base(threadingContext, diagnosticService, globalOptions, listenerProvider)
        {
        }

        protected internal override bool IncludeDiagnostic(DiagnosticData diagnostic)
            => diagnostic.Severity == DiagnosticSeverity.Info;

        protected override IErrorTag CreateTag(Workspace workspace, DiagnosticData diagnostic)
            => new ErrorTag(
                PredefinedErrorTypeNames.HintedSuggestion,
                CreateToolTipContent(workspace, diagnostic));

        protected override SnapshotSpan AdjustSnapshotSpan(SnapshotSpan snapshotSpan, int minimumLength)
        {
            // We always want suggestion tags to be two characters long.
            return AdjustSnapshotSpan(snapshotSpan, minimumLength: 2, maximumLength: 2);
        }
    }
}


text:
package org.hisp.dhis.dataelement.hibernate;

import java.util.Collection;

import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.dataelement.CategoryComboStore;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;

/**
 * @author Lars Helge Overland
 */
public class HibernateCategoryComboStore
    extends HibernateIdentifiableObjectStore<DataElementCategoryCombo>
    implements CategoryComboStore
{
    @Override
    @SuppressWarnings("unchecked")
    public Collection<DataElementCategoryCombo> getCategoryCombosByDimensionType( String dimensionType )
    {
        return getSharingCriteria( Restrictions.or( Restrictions.eq( "dimensionType", dimensionType ), Restrictions.eq( "name", "default" ) ) ).list();
    }
}


text:
UNIX_SettingsDefineStateProvider::UNIX_SettingsDefineStateProvider()
{
}

UNIX_SettingsDefineStateProvider::~UNIX_SettingsDefineStateProvider()
{
}

CIMInstance UNIX_SettingsDefineStateProvider::constructInstance(
	const CIMName &className,
	const CIMNamespaceName &nameSpace,
	const UNIX_SettingsDefineState &_p)
{
	CIMProperty p;

	CIMInstance inst(className);

	// Set path
	inst.setPath(CIMObjectPath(String(""), // hostname
			nameSpace,
			CIMName("UNIX_SettingsDefineState"),
			constructKeyBindings(_p)));

	//CIM_SettingsDefineState Properties
	if (_p.getManagedElement(p)) inst.addProperty(p);
	if (_p.getSettingData(p)) inst.addProperty(p);

	return inst;
}

Array<CIMKeyBinding> UNIX_SettingsDefineStateProvider::constructKeyBindings(const UNIX_SettingsDefineState& _p)

{

	Array<CIMKeyBinding> keys;

	keys.append(CIMKeyBinding(
		PROPERTY_MANAGED_ELEMENT,
		CIMValue(_p.getManagedElement()).toString(),
		CIMKeyBinding::REFERENCE));
	keys.append(CIMKeyBinding(
		PROPERTY_SETTING_DATA,
		CIMValue(_p.getSettingData()).toString(),
		CIMKeyBinding::REFERENCE));

	return keys;
}

#define UNIX_PROVIDER UNIX_SettingsDefineStateProvider
#define UNIX_PROVIDER_NAME "UNIX_SettingsDefineStateProvider"
#define CLASS_IMPLEMENTATION UNIX_SettingsDefineState
#define CLASS_IMPLEMENTATION_NAME "UNIX_SettingsDefineState"
#define BASE_CLASS_NAME "CIM_SettingsDefineState"
#define NUMKEYS_CLASS_IMPLEMENTATION 2

#include "UNIXProviderBase.hpp"


text:
module.exports.installedHooks = {
};


text:
package com.intellij.codeInsight.intention.impl.config;

import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.DataManager;
import com.intellij.ide.actions.ShowSettingsUtilImpl;
import com.intellij.ide.plugins.IdeaPluginDescriptorImpl;
import com.intellij.ide.plugins.PluginManagerConfigurable;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.ide.ui.search.SearchUtil;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.ex.FileTypeManagerEx;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ex.Settings;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.profile.codeInspection.ui.DescriptionEditorPane;
import com.intellij.profile.codeInspection.ui.DescriptionEditorPaneKt;
import com.intellij.ui.HyperlinkLabel;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.SearchTextField;
import com.intellij.util.ui.GridBag;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UI.PanelFactory;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;

// used in Rider
public class IntentionDescriptionPanel {
  private static final Logger LOG = Logger.getInstance(IntentionDescriptionPanel.class);
  private JPanel myPanel;

  private JPanel myAfterPanel;
  private JPanel myBeforePanel;
  private DescriptionEditorPane myDescriptionBrowser;
  private JPanel myPoweredByPanel;
  private JPanel myPoweredByWrapper;
  private final List<IntentionUsagePanel> myBeforeUsagePanels = new ArrayList<>();
  private final List<IntentionUsagePanel> myAfterUsagePanels = new ArrayList<>();
  @NonNls private static final String BEFORE_TEMPLATE = "before.java.template";
  @NonNls private static final String AFTER_TEMPLATE = "after.java.template";

  public IntentionDescriptionPanel() {
    myPanel = new JPanel(new GridBagLayout());
    final var constraint = new GridBag()
      .setDefaultInsets(UIUtil.LARGE_VGAP, 0, 0, 0)
      .setDefaultFill(GridBagConstraints.BOTH)
      .setDefaultWeightY(0.5)
      .setDefaultWeightX(1.0);

    myDescriptionBrowser = new DescriptionEditorPane();
    final var descriptionScrollPane = ScrollPaneFactory.createScrollPane(myDescriptionBrowser);
    descriptionScrollPane.setBorder(null);
    myPanel.add(descriptionScrollPane, constraint.nextLine().weighty(1.0).insetTop(0));

    myBeforePanel = new JPanel();
    myPanel.add(PanelFactory.panel(myBeforePanel)
                  .withLabel(CodeInsightBundle.message("border.title.before"))
                  .moveLabelOnTop()
                  .resizeX(true)
                  .resizeY(true)
                  .createPanel(),
                constraint.nextLine()
    );

    myAfterPanel = new JPanel();
    myPanel.add(PanelFactory.panel(myAfterPanel)
                  .withLabel(CodeInsightBundle.message("border.title.after"))
                  .moveLabelOnTop()
                  .resizeX(true)
                  .resizeY(true)
                  .createPanel(),
                constraint.nextLine()
    );

    myPoweredByPanel = new JPanel(new BorderLayout());
    myPoweredByWrapper = PanelFactory.panel(myPoweredByPanel)
      .withLabel(CodeInsightBundle.message("powered.by"))
      .resizeX(true)
      .createPanel();
    myPanel.add(myPoweredByWrapper, constraint.nextLine().weighty(0.0));

    myDescriptionBrowser.addHyperlinkListener(e -> {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        try {
          URI url = new URI(e.getDescription());
          if (url.getScheme().equals("settings")) {
            DataManager.getInstance().getDataContextFromFocusAsync().onSuccess(context -> {
              if (context != null) {
                Settings settings = Settings.KEY.getData(context);
                SearchTextField searchTextField = SearchTextField.KEY.getData(context);
                String configId = url.getHost();
                String search = url.getQuery();
                if (settings != null) {
                  Configurable configurable = settings.find(configId);
                  settings.select(configurable).doWhenDone(() -> {
                    if (searchTextField != null && search != null) searchTextField.setText(search);
                  });
                } else {
                  final Project project = context.getData(CommonDataKeys.PROJECT);
                  ShowSettingsUtilImpl.showSettingsDialog(project, configId, search);
                }
              }
            });
          }
          else {
            BrowserUtil.browse(url);
          }
        }
        catch (URISyntaxException ex) {
          LOG.error(ex);
        }
      }
    });
  }

  public void reset(IntentionActionMetaData actionMetaData, String filter)  {
    try {
      final TextDescriptor url = actionMetaData.getDescription();
      final String description = StringUtil.isEmpty(url.getText()) ?
                                 CodeInsightBundle.message("under.construction.string") :
                                 SearchUtil.markup(url.getText(), filter);
      DescriptionEditorPaneKt.readHTML(myDescriptionBrowser, description);
      setupPoweredByPanel(actionMetaData);

      showUsages(myBeforePanel, myBeforeUsagePanels, actionMetaData.getExampleUsagesBefore());
      showUsages(myAfterPanel, myAfterUsagePanels, actionMetaData.getExampleUsagesAfter());

      SwingUtilities.invokeLater(() -> myPanel.revalidate());
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }

  private void setupPoweredByPanel(final IntentionActionMetaData actionMetaData) {
    PluginId pluginId = actionMetaData == null ? null : actionMetaData.getPluginId();
    myPoweredByPanel.removeAll();
    IdeaPluginDescriptorImpl pluginDescriptor  = (IdeaPluginDescriptorImpl)PluginManagerCore.getPlugin(pluginId);
    ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
    boolean isCustomPlugin = pluginDescriptor != null && pluginDescriptor.isBundled() && !appInfo.isEssentialPlugin(pluginId);
    if (isCustomPlugin) {
      HyperlinkLabel label = new HyperlinkLabel(CodeInsightBundle.message("powered.by.plugin", pluginDescriptor.getName()));
      label.addHyperlinkListener(__ -> PluginManagerConfigurable.showPluginConfigurable(ProjectManager.getInstance().getDefaultProject(),
                                                                                List.of(pluginId)));
      myPoweredByPanel.add(label, BorderLayout.CENTER);
    }
    myPoweredByWrapper.setVisible(isCustomPlugin);
  }

  public void reset(String intentionCategory)  {
    try {
      DescriptionEditorPaneKt.readHTML(myDescriptionBrowser, CodeInsightBundle.message("intention.settings.category.text", intentionCategory));
      setupPoweredByPanel(null);

      TextDescriptor beforeTemplate = new PlainTextDescriptor(CodeInsightBundle.message("templates.intention.settings.category.before"), BEFORE_TEMPLATE);
      showUsages(myBeforePanel, myBeforeUsagePanels, new TextDescriptor[]{beforeTemplate});
      TextDescriptor afterTemplate = new PlainTextDescriptor(CodeInsightBundle.message("templates.intention.settings.category.after"), AFTER_TEMPLATE);
      showUsages(myAfterPanel, myAfterUsagePanels, new TextDescriptor[]{afterTemplate});

      SwingUtilities.invokeLater(() -> myPanel.revalidate());
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }

  private static void showUsages(final JPanel panel,
                                 final List<IntentionUsagePanel> usagePanels,
                                 final TextDescriptor @Nullable [] exampleUsages) throws IOException {
    GridBagConstraints gb = null;
    boolean reuse = exampleUsages != null && panel.getComponents().length == exampleUsages.length;
    if (!reuse) {
      disposeUsagePanels(usagePanels);
      panel.setLayout(new GridBagLayout());
      panel.removeAll();
      gb = new GridBagConstraints();
      gb.anchor = GridBagConstraints.NORTHWEST;
      gb.fill = GridBagConstraints.BOTH;
      gb.gridheight = GridBagConstraints.REMAINDER;
      gb.gridwidth = 1;
      gb.gridx = 0;
      gb.gridy = 0;
      gb.insets = JBUI.emptyInsets();
      gb.ipadx = 5;
      gb.ipady = 5;
      gb.weightx = 1;
      gb.weighty = 1;
    }

    if (exampleUsages != null) {
      for (int i = 0; i < exampleUsages.length; i++) {
        final TextDescriptor exampleUsage = exampleUsages[i];
        final String name = exampleUsage.getFileName();
        final FileTypeManagerEx fileTypeManager = FileTypeManagerEx.getInstanceEx();
        final String extension = fileTypeManager.getExtension(name);
        final FileType fileType = fileTypeManager.getFileTypeByExtension(extension);

        IntentionUsagePanel usagePanel;
        if (reuse) {
          usagePanel = (IntentionUsagePanel)panel.getComponent(i);
        }
        else {
          usagePanel = new IntentionUsagePanel();
          usagePanels.add(usagePanel);
        }
        usagePanel.reset(exampleUsage.getText(), fileType);

        if (!reuse) {
          panel.add(usagePanel, gb);
          gb.gridx++;
        }
      }
    }
    panel.revalidate();
    panel.repaint();
  }

  public JPanel getComponent() {
    return myPanel;
  }

  public void dispose() {
    disposeUsagePanels(myBeforeUsagePanels);
    disposeUsagePanels(myAfterUsagePanels);
  }

  private static void disposeUsagePanels(List<? extends IntentionUsagePanel> usagePanels) {
    for (final IntentionUsagePanel usagePanel : usagePanels) {
      Disposer.dispose(usagePanel);
    }
    usagePanels.clear();
  }

  public void init(final int preferredWidth) {
  }
}


text:
//******************************************
//  Copyright (C) 2014-2015 Charles Nurse  *
//                                         *
//  Licensed under MIT License             *
//  (see included LICENSE)                 *
//                                         *
// *****************************************

using System;
using Naif.Core.Caching;
using Naif.Core.Contracts;
using NPoco;

namespace Naif.Data.NPoco
{
    public class NPocoUnitOfWork : IUnitOfWork
    {
        private readonly ICacheProvider _cache;

        public NPocoUnitOfWork(string connectionStringName, ICacheProvider cache)
            : this(connectionStringName, String.Empty, cache)
        {
        }

        public NPocoUnitOfWork(string connectionStringName, string tablePrefix, ICacheProvider cache)
        {
            Requires.NotNullOrEmpty("connectionStringName", connectionStringName);
            Requires.NotNull("cache", cache);

            Database = new Database(connectionStringName) {Mapper = new NPocoMapper(tablePrefix)};
            _cache = cache;
        }

        public void Commit() { }

        public IRepository<T> GetRepository<T>() where T : class
        {
            return new NPocoRepository<T>(this, _cache);
        }

        internal Database Database { get; private set; }

        public void Dispose()
        {
            Database.Dispose();
        }
    }
}


text:
<!doctype html>

		<meta charset='utf-8' />
		<meta name='viewport' content='width=device-width' />
		<meta http-equiv='X-UA-Compatible' content='ie=edge'>
		<title>CPU thermal throttling in your macOS menu bar</title>
		<link rel='stylesheet' href='/public/css/xbar.css?cb=08%20Mar%2021%2015%3a22%20GMT'>
		<link rel='preconnect' href='https://fonts.gstatic.com'>
		<link rel='preconnect' href='https://fonts.googleapis.com'>
		<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@500&display=swap'>

	<meta name='description' content='Displays the current CPU thermal throttling speed (using `pmset -g therm`). - install xbar for free to get started.'>
	<meta name='author' content='Sampo Juustila'>
	<meta name='keywords' content='macos,menubar,xbar,bitbar'>
	<meta itemprop='image' content='https://xbarapp.com/public/img/xbar-2048.png'>
	<meta itemprop='name' content='CPU thermal throttling in your macOS menu bar'>
	<meta itemprop='description' content='Displays the current CPU thermal throttling speed (using `pmset -g therm`). - install xbar for free to get started.'>
	<meta name='twitter:card' content='summary_large_image'>
	<meta name='twitter:title' content='CPU thermal throttling in your macOS menu bar'>
	<meta name='twitter:description' content='Displays the current CPU thermal throttling speed (using `pmset -g therm`). - install xbar for free to get started.'>
	<meta name='twitter:image' content='https://xbarapp.com/public/img/xbar-2048.png'>
	<meta name='twitter:creator' content='matryer'>
	<meta property='og:title' content='CPU thermal throttling in your macOS menu bar'>
	<meta property='og:description' content='Displays the current CPU thermal throttling speed (using `pmset -g therm`). - install xbar for free to get started.'>
	<meta property='og:url' content='https://xbarapp.com/plugins/System/cpu-thermal-throttle.30s.sh.html'>
	<meta property='og:site_name' content='xbar lets you put anything into your macOS menu bar'>
	<meta property='og:type' content='article'>
	<meta property='og:image' content='https://xbarapp.com/public/img/xbar-2048.png'>
	<link rel='apple-touch-icon' sizes='180x180' href='https://xbarapp.com/public/img/xbar-2048.png'>
	<link rel='icon' type='image/png' sizes='32x32' href='https://xbarapp.com/public/img/xbar-2048.png'>
	<link rel='shortcut icon' href='https://xbarapp.com/public/img/xbar-2048.png'>
	<meta name='msapplication-TileColor' content='#ffffff'>
	<meta name='msapplication-config' content='/public/browserconfig.xml'>
	<meta name='theme-color' content='#ffffff'>

						xbar

						💜 Sponsor

						Coming soon

					AWS

					Cryptocurrency

					Dev

					E-Commerce

					Email

					Environment

					Finance

					Games

					IoT

					Lifestyle

					Music

					Network

					Politics

					Science

					Sports

					System

					Time

					Tools

					Travel

					Weather

					Web

CPU thermal throttling

										Sampo Juustila (@plaa on GitHub)

						Displays the current CPU thermal throttling speed (using `pmset -g therm`).

						🖥 Open in xbar app

Requires xbar app

						Can you help?—This plugin is missing an image.
						Please add one
						(via <xbar.image>...</xbar.image> metadata) to enhance this plugin's presence. View file on GitHub

							cpu-thermal-throttle.30s.sh

						Edit

						Open on GitHub

#!/bin/bash

# <bitbar.title>CPU thermal throttling</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Sampo Juustila</bitbar.author>
# <bitbar.author.github>plaa</bitbar.author.github>
# <bitbar.desc>Displays the current CPU thermal throttling speed (using `pmset -g therm`).</bitbar.desc>

OUTPUT="$(pmset -g therm)"
SCHEDLIMIT="$(echo "$OUTPUT" | grep CPU_Scheduler_Limit | cut -d= -f2)"
SPEEDLIMIT="$(echo "$OUTPUT" | grep CPU_Speed_Limit | cut -d= -f2)"
AVAILCPU="$(echo "$OUTPUT" | grep CPU_Available_CPUs | cut -d= -f2)"
TOTAL=$(($SCHEDLIMIT * $SPEEDLIMIT / 100))

if [ "$TOTAL" -ge 80 ]; then
  SYMBOL="🌡"
else
  SYMBOL="🔥"
fi

cat <<EOF
$SYMBOL$TOTAL%
---
CPU_Speed_Limit $SPEEDLIMIT%
CPU_Scheduler_Limit $SCHEDLIMIT%
CPU_Available_CPUs $AVAILCPU
EOF

						GitHub project
						•
						Writing plugins guide

						Copyright ©2021 Mat Ryer + contributors • @matryer

						Last updated on 08 Mar 21 15:22 GMT


text:
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o

def h2odemo():
    """
    Python API test: h2o.demo(funcname, interactive=True, echo=True, test=False)[source]

    Copied from pyunit_glm_demo.py
    """
    ret = h2o.demo(funcname="glm", interactive=False, echo=True, test=True)
    assert ret is None

if __name__ == "__main__":
    pyunit_utils.standalone_test(h2odemo)
else:
    h2odemo()


text:
import { assert } from 'chai';
import { addDisposableDomListener } from './Lifecycle';
import jsdom = require('jsdom');

describe('addDisposableDomListener', () => {
  const dom = new jsdom.JSDOM();
  const document = dom.window.document;

  function createEvent(type: string): Event {
    const event = document.createEvent('Event');
    event.initEvent(type);
    return event;
  }

  it('dispose', () => {
    let calledTimes = 0;
    const div = document.createElement('div');
    const disposable = addDisposableDomListener(div, 'test', () => { calledTimes++; });

    assert.equal(calledTimes, 0);

    div.dispatchEvent(createEvent('test'));
    assert.equal(calledTimes, 1);

    disposable.dispose();

    div.dispatchEvent(createEvent('test'));
    assert.equal(calledTimes, 1);

    disposable.dispose(); // double disposing

    div.dispatchEvent(createEvent('test'));
    assert.equal(calledTimes, 1);
  });
});


text:
package com.valtech.source.dependometer.app.core.elements;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import com.valtech.source.dependometer.app.core.common.MetricEnum;

/**
 * @author Dietmar Menges (dietmar.menges@valtech.de)
 */
abstract class CompilationUnitGroupingElement extends TypeGroupingElement
{
   private final Set<CompilationUnit> m_CompilationUnits = new TreeSet<CompilationUnit>();

   private final List<CompilationUnit> m_ProjectInternalCompilationUnits = new ArrayList<CompilationUnit>();

   CompilationUnitGroupingElement(String fullyQualifiedName, Object source)
   {
      super(fullyQualifiedName, source);
   }

   void addCompilationUnit(CompilationUnit compilationUnit)
   {
      assert compilationUnit != null;
      assert !m_CompilationUnits.contains(compilationUnit);

      m_CompilationUnits.add(compilationUnit);
      if (compilationUnit.belongsToProject())
      {
         assert !m_ProjectInternalCompilationUnits.contains(compilationUnit);
         m_ProjectInternalCompilationUnits.add(compilationUnit);
      }
   }

   public void collectMetrics()
   {
      super.collectMetrics();
      if (belongsToProject())
      {
         calculateTypeMetricsForProjectInternalTypes(getProjectInternalTypes());
         calculateComponentMetrics(getProjectInternalCompilationUnits(), false);
         if (getNumberOfTypesThatMayUseAssertions() > 0 && getNumberOfAssertions() != -1)
         {
            addMetric(MetricEnum.AVERAGE_USAGE_OF_ASSERTIONS_PER_CLASS, (double)getNumberOfAssertions()
               / (double)getNumberOfTypesThatMayUseAssertions());
         }
      }
      else
      {
         calculateTypeMetricsForProjectExternalTypes(getProjectExternalTypes());
      }
   }

   public final CompilationUnit[] getProjectInternalCompilationUnits()
   {
      return m_ProjectInternalCompilationUnits.toArray(new CompilationUnit[0]);
   }

   public final CompilationUnit[] getCompilationUnits()
   {
      return m_CompilationUnits.toArray(new CompilationUnit[0]);
   }

   final boolean containsCompilationUnit(CompilationUnit unit)
   {
      assert unit != null;
      return m_CompilationUnits.contains(unit);
   }

   public final boolean hasViewableSourceFile()
   {
      return false;
   }

   public final File getAbsoluteSourcePath()
   {
      assert hasViewableSourceFile();
      return null;
   }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>livelessons</groupId>
		<artifactId>livelessons-cloud</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</parent>
	<artifactId>livelessons-cloud-connectors</artifactId>
	<properties>
		<main.basedir>../..</main.basedir>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-cloud-connectors</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>9.1-901-1.jdbc4</version>
		</dependency>
	</dependencies>
</project>


text:
package com.microsoft.azure.management.loganalytics.v2020_03_01_preview;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
 * Defines values for WorkspaceEntityStatus.
 */
public final class WorkspaceEntityStatus extends ExpandableStringEnum<WorkspaceEntityStatus> {
    /** Static value Creating for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus CREATING = fromString("Creating");

    /** Static value Succeeded for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus SUCCEEDED = fromString("Succeeded");

    /** Static value Failed for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus FAILED = fromString("Failed");

    /** Static value Canceled for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus CANCELED = fromString("Canceled");

    /** Static value Deleting for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus DELETING = fromString("Deleting");

    /** Static value ProvisioningAccount for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus PROVISIONING_ACCOUNT = fromString("ProvisioningAccount");

    /** Static value Updating for WorkspaceEntityStatus. */
    public static final WorkspaceEntityStatus UPDATING = fromString("Updating");

    /**
     * Creates or finds a WorkspaceEntityStatus from its string representation.
     * @param name a name to look for
     * @return the corresponding WorkspaceEntityStatus
     */
    @JsonCreator
    public static WorkspaceEntityStatus fromString(String name) {
        return fromString(name, WorkspaceEntityStatus.class);
    }

    /**
     * @return known WorkspaceEntityStatus values
     */
    public static Collection<WorkspaceEntityStatus> values() {
        return values(WorkspaceEntityStatus.class);
    }
}


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

                <title></title>
                <link rel="stylesheet" type="text/css" href="css/winxp.blue.css">

                            © Copy
right 1999-2007
SWsoft, Inc.
All rights reserved

Domain Default page

                                        If you see this page, it means that you have set up your web server for
 serving a new site, but have no
t uploaded the site content yet.

You have the following choices:

You can upload your web site contents using FTP.

You can install web applications on your site: an image gallery, a
discussion forum, a blog, an onl
ine store, a chat, and many other applications.

This page is autogenerated by Plesk
™


text:
from functools import lru_cache

from PyQt5.QtGui import QIcon, QPixmap, QColor

from balsa import get_logger

from propmtime import __application_name__

# this is needed for there to be an icon (NOTE: PyCharm will say this is unused ... IT ACTUALLY IS - DO NOT DELETE!!!)
from propmtime import icons

log = get_logger(__application_name__)

@lru_cache()
def get_icon(invert):

    # https://stackoverflow.com/questions/13350631/simple-color-fill-qicons-in-qt
    pixmap = QPixmap(':icon.png')
    assert(pixmap is not None)

    if invert:
        log.debug('inverting icon')
        mask = pixmap.mask()
        pixmap.fill((QColor('white')))
        pixmap.setMask(mask)

    icon = QIcon(pixmap)

    return icon


text:
package org.jboss.netty.example.http.file;

import static org.jboss.netty.channel.Channels.*;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;
import org.jboss.netty.handler.stream.ChunkedWriteHandler;

/**
 * @author The Netty Project
 * @author Trustin Lee
 */
public class HttpStaticFileServerPipelineFactory implements ChannelPipelineFactory {
    @Override
    public ChannelPipeline getPipeline() throws Exception {
        // Create a default pipeline implementation.
        ChannelPipeline pipeline = pipeline();

        // Uncomment the following line if you want HTTPS
        //SSLEngine engine = SecureChatSslContextFactory.getServerContext().createSSLEngine();
        //engine.setUseClientMode(false);
        //pipeline.addLast("ssl", new SslHandler(engine));

        pipeline.addLast("decoder", new HttpRequestDecoder());
        pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
        pipeline.addLast("encoder", new HttpResponseEncoder());
        pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());

        pipeline.addLast("handler", new HttpStaticFileServerHandler());
        return pipeline;
    }
}


text:
using System.IO.IsolatedStorage;
using System.Linq;

namespace Knapsack
{
    public class StylesheetModuleContainerBuilder : ModuleContainerBuilder
    {
        readonly string applicationRoot;

        public StylesheetModuleContainerBuilder(IsolatedStorageFile storage, string rootDirectory, string applicationRoot)
            : base(storage, rootDirectory)
        {
            this.applicationRoot = EnsureDirectoryEndsWithSlash(applicationRoot);
        }

        public override ModuleContainer Build()
        {
            var moduleBuilder = new UnresolvedStylesheetModuleBuilder(rootDirectory, applicationRoot);
            var unresolvedModules = relativeModuleDirectories.Select(x=>moduleBuilder.Build(x.Item1, x.Item2));
            var modules = UnresolvedModule.ResolveAll(unresolvedModules);
            return new ModuleContainer(
                modules,
                storage,
                textWriter => new StylesheetModuleWriter(textWriter, rootDirectory, applicationRoot, LoadFile)
            );
        }
    }
}