text:
package info

import (
	"context"
	"strings"
	"time"
)

// RawInterface is the interface for all of the package methods which normally
// would be in the 'appengine' package.
type RawInterface interface {
	AppID() string
	FullyQualifiedAppID() string
	GetNamespace() string

	Datacenter() string
	DefaultVersionHostname() string
	InstanceID() string
	IsDevAppServer() bool
	IsOverQuota(err error) bool
	IsTimeoutError(err error) bool
	ModuleHostname(module, version, instance string) (string, error)
	ModuleName() string
	RequestID() string
	ServerSoftware() string
	ServiceAccount() (string, error)
	VersionID() string

	Namespace(namespace string) (context.Context, error)

	AccessToken(scopes ...string) (token string, expiry time.Time, err error)
	PublicCertificates() ([]Certificate, error)
	SignBytes(bytes []byte) (keyName string, signature []byte, err error)

	// Testable returns this RawInterface's Testing interface. Testing will
	// return nil if testing is not supported in this implementation.
	GetTestable() Testable
}

// Testable is an additional set of functions for testing instrumentation.
type Testable interface {
	SetVersionID(string) context.Context
	SetRequestID(string) context.Context
}

// AppID returns the current App ID.
func AppID(c context.Context) string {
	return Raw(c).AppID()
}

// TrimmedAppID gets the 'appid' portion of "foo.com:appid". This form can
// occur if you use
func TrimmedAppID(c context.Context) string {
	toks := strings.Split(AppID(c), ":")
	return toks[len(toks)-1]
}

// FullyQualifiedAppID returns the fully-qualified App ID.
func FullyQualifiedAppID(c context.Context) string {
	return Raw(c).FullyQualifiedAppID()
}

// GetNamespace returns the current namespace. If the current namespace is the
// default namespace, GetNamespace will return an empty string.
func GetNamespace(c context.Context) string {
	return Raw(c).GetNamespace()
}

// Datacenter returns the current datacenter.
func Datacenter(c context.Context) string {
	return Raw(c).Datacenter()
}

// DefaultVersionHostname returns the default version hostname.
func DefaultVersionHostname(c context.Context) string {
	return Raw(c).DefaultVersionHostname()
}

// InstanceID returns the current instance ID.
func InstanceID(c context.Context) string {
	return Raw(c).InstanceID()
}

// IsDevAppServer returns true if running on a development server.
func IsDevAppServer(c context.Context) bool {
	return Raw(c).IsDevAppServer()
}

// IsOverQuota returns true if the supplied error is an over quota error.
func IsOverQuota(c context.Context, err error) bool {
	return Raw(c).IsOverQuota(err)
}

// IsTimeoutError returns true if the supplied error indicates a timeout.
func IsTimeoutError(c context.Context, err error) bool {
	return Raw(c).IsTimeoutError(err)
}

// ModuleHostname returns the hostname of a module instance.
func ModuleHostname(c context.Context, module, version, instance string) (string, error) {
	return Raw(c).ModuleHostname(module, version, instance)
}

// ModuleName returns the current module name.
func ModuleName(c context.Context) string {
	return Raw(c).ModuleName()
}

// RequestID returns the current request ID.
func RequestID(c context.Context) string {
	return Raw(c).RequestID()
}

// ServerSoftware returns the AppEngine release version.
func ServerSoftware(c context.Context) string {
	return Raw(c).ServerSoftware()
}

// ServiceAccount returns the current service account name, in the form of an
// e-mail address.
func ServiceAccount(c context.Context) (string, error) {
	return Raw(c).ServiceAccount()
}

// VersionID returns the version ID for the current application, in the form
// "X.Y".
func VersionID(c context.Context) string {
	return Raw(c).VersionID()
}

// Namespace sets the current namespace. If the namespace is invalid or could
// not be set, an error will be returned.
func Namespace(c context.Context, namespace string) (context.Context, error) {
	return Raw(c).Namespace(namespace)
}

// MustNamespace is the same as Namespace, but will panic if there's an error.
// Since an error can only occur if namespace doesn't match the a regex this
// is valid to use if the namespace you're using is statically known, or known
// to conform to the regex. The regex in question is:
//
//   ^[0-9A-Za-z._-]{0,100}$
func MustNamespace(c context.Context, namespace string) context.Context {
	ret, err := Namespace(c, namespace)
	if err != nil {
		panic(err)
	}
	return ret
}

// AccessToken generates an OAuth2 access token for the specified scopes
// on behalf of the current ServiceAccount.
func AccessToken(c context.Context, scopes ...string) (token string, expiry time.Time, err error) {
	return Raw(c).AccessToken(scopes...)
}

// PublicCertificates retrieves the public certificates of the app.
func PublicCertificates(c context.Context) ([]Certificate, error) {
	return Raw(c).PublicCertificates()
}

// SignBytes signs bytes using the application's unique private key.
func SignBytes(c context.Context, bytes []byte) (keyName string, signature []byte, err error) {
	return Raw(c).SignBytes(bytes)
}

// GetTestable returns this Interface's Testing interface. Testing will return
// nil if testing is not supported in this implementation.
func GetTestable(c context.Context) Testable {
	return Raw(c).GetTestable()
}


text:
package com.intellij.ide.wizard;

import com.intellij.CommonBundle;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.application.ApplicationInfo;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.help.HelpManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.components.panels.OpaquePanel;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.UiNotifyConnector;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
  private static final Logger LOG = Logger.getInstance("#com.intellij.ide.wizard.AbstractWizard");

  protected int myCurrentStep;
  protected final ArrayList<T> mySteps;
  private JButton myPreviousButton;
  private JButton myNextButton;
  private JButton myCancelButton;
  private JButton myHelpButton;
  protected JPanel myContentPanel;
  protected TallImageComponent myIcon;
  private Component myCurrentStepComponent;
  private final Map<Component, String> myComponentToIdMap = new HashMap<Component, String>();
  private final StepListener myStepListener = new StepListener() {
    public void stateChanged() {
      updateStep();
    }
  };

  public AbstractWizard(final String title, final Component dialogParent) {
    super(dialogParent, true);
    mySteps = new ArrayList<T>();
    initWizard(title);
  }

  public AbstractWizard(final String title, @Nullable final Project project) {
    super(project, true);
    mySteps = new ArrayList<T>();
    initWizard(title);
  }

  private void initWizard(final String title) {
    setTitle(title);
    myCurrentStep = 0;
    myPreviousButton = new JButton(IdeBundle.message("button.wizard.previous"));
    myNextButton = new JButton(IdeBundle.message("button.wizard.next"));
    myCancelButton = new JButton(CommonBundle.getCancelButtonText());
    myHelpButton = new JButton(CommonBundle.getHelpButtonText());
    myContentPanel = new JPanel(new CardLayout());

    myIcon = new TallImageComponent(null);

    JRootPane rootPane = getRootPane();
    if (rootPane != null) {        // it will be null in headless mode, i.e. tests
      rootPane.registerKeyboardAction(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            helpAction();
          }
        },
        KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0),
        JComponent.WHEN_IN_FOCUSED_WINDOW
      );

      rootPane.registerKeyboardAction(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            helpAction();
          }
        },
        KeyStroke.getKeyStroke(KeyEvent.VK_HELP, 0),
        JComponent.WHEN_IN_FOCUSED_WINDOW
      );
    }
  }

  protected JComponent createSouthPanel() {
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));

    JPanel buttonPanel = new JPanel();

    if (SystemInfo.isMac) {
      panel.add(buttonPanel, BorderLayout.EAST);
      buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));

      if (!UIUtil.isUnderDarcula()) {
        myHelpButton.putClientProperty("JButton.buttonType", "help");
      }
      if (UIUtil.isUnderAquaLookAndFeel()) {
        myHelpButton.setText("");
      }

      JPanel leftPanel = new JPanel();
      if (ApplicationInfo.contextHelpAvailable()) {
        leftPanel.add(myHelpButton);
      }
      leftPanel.add(myCancelButton);
      panel.add(leftPanel, BorderLayout.WEST);

      if (mySteps.size() > 1) {
        buttonPanel.add(Box.createHorizontalStrut(5));
        buttonPanel.add(myPreviousButton);
      }
      buttonPanel.add(Box.createHorizontalStrut(5));
      buttonPanel.add(myNextButton);
    }
    else {
      panel.add(buttonPanel, BorderLayout.CENTER);
      GroupLayout layout = new GroupLayout(buttonPanel);
      buttonPanel.setLayout(layout);
      layout.setAutoCreateGaps(true);

      final GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
      final GroupLayout.ParallelGroup vGroup = layout.createParallelGroup();
      final Collection<Component> buttons = ContainerUtil.newArrayListWithExpectedSize(5);
      final boolean helpAvailable = ApplicationInfo.contextHelpAvailable();

      if (helpAvailable && UIUtil.isUnderGTKLookAndFeel()) {
        add(hGroup, vGroup, buttons, myHelpButton);
      }
      add(hGroup, vGroup, null, Box.createHorizontalGlue());
      if (mySteps.size() > 1) {
        add(hGroup, vGroup, buttons, myPreviousButton);
      }
      add(hGroup, vGroup, buttons, myNextButton, myCancelButton);
      if (helpAvailable && !UIUtil.isUnderGTKLookAndFeel()) {
        add(hGroup, vGroup, buttons, myHelpButton);
      }

      layout.setHorizontalGroup(hGroup);
      layout.setVerticalGroup(vGroup);
      layout.linkSize(buttons.toArray(new Component[buttons.size()]));
    }

    myPreviousButton.setEnabled(false);
    myPreviousButton.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        doPreviousAction();
      }
    });
    myNextButton.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        if (isLastStep()) {
          // Commit data of current step and perform OK action
          final Step currentStep = mySteps.get(myCurrentStep);
          LOG.assertTrue(currentStep != null);
          try {
            currentStep._commit(true);
            doOKAction();
          }
          catch (final CommitStepException exc) {
            String message = exc.getMessage();
            if (message != null) {
              Messages.showErrorDialog(myContentPanel, message);
            }
          }
        }
        else {
          doNextAction();
        }
      }
    });

    myCancelButton.addActionListener(
      new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          doCancelAction();
        }
      }
    );
    myHelpButton.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        helpAction();
      }
    });

    return panel;
  }

  private static void add(final GroupLayout.Group hGroup,
                          final GroupLayout.Group vGroup,
                          @Nullable final Collection<Component> collection,
                          final Component... components) {
    for (Component component : components) {
      hGroup.addComponent(component);
      vGroup.addComponent(component);
      if (collection != null) collection.add(component);
    }
  }

  public static class TallImageComponent extends OpaquePanel {
    private Icon myIcon;

    private TallImageComponent(Icon icon) {
      myIcon = icon;
    }

    @Override
    protected void paintChildren(Graphics g) {
      if (myIcon == null) return;

      paintIcon(g);
    }

    public void paintIcon(Graphics g) {
      if (myIcon == null) {
        return;
      }
      final BufferedImage image = UIUtil.createImage(myIcon.getIconWidth(), myIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
      final Graphics2D gg = image.createGraphics();
      myIcon.paintIcon(this, gg, 0, 0);

      final Rectangle bounds = g.getClipBounds();
      int y = myIcon.getIconHeight()-1;
      while (y < bounds.y + bounds.height) {
        g.drawImage(image,
                    bounds.x, y, bounds.x + bounds.width, y + 1,
                    0, myIcon.getIconHeight() - 1, bounds.width, myIcon.getIconHeight(), this);

        y++;
      }

      g.drawImage(image, 0, 0, this);
    }

    public void setIcon(Icon icon) {
      myIcon = icon;
      revalidate();
      repaint();
    }

    @Override
    public Dimension getPreferredSize() {
      return new Dimension(myIcon != null ? myIcon.getIconWidth() : 0, 0);
    }

    @Override
    public Dimension getMinimumSize() {
      return new Dimension(myIcon != null ? myIcon.getIconWidth() : 0, 0);
    }
  }

  protected JComponent createCenterPanel() {
    final JPanel iconPanel = new JPanel(new BorderLayout());
    iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8));
    iconPanel.add(myIcon, BorderLayout.CENTER);

    final JPanel panel = new JPanel(new BorderLayout());
    panel.add(iconPanel, BorderLayout.WEST);
    panel.add(myContentPanel, BorderLayout.CENTER);
    return panel;
  }

  public int getCurrentStep() {
    return myCurrentStep;
  }

  public int getStepCount() {
    return mySteps.size();
  }

  public T getCurrentStepObject() {
    return mySteps.get(myCurrentStep);
  }

  public void addStep(@NotNull final T step) {
    mySteps.add(step);

    if (step instanceof StepAdapter) {
      ((StepAdapter)step).registerStepListener(myStepListener);
    }
    // card layout is used
    final Component component = step.getComponent();
    if (component != null) {
      addStepComponent(component);
    }
  }

  protected void init() {
    super.init();
    updateStep();
  }

  protected String addStepComponent(final Component component) {
    String id = myComponentToIdMap.get(component);
    if (id == null) {
      id = Integer.toString(myComponentToIdMap.size());
      myComponentToIdMap.put(component, id);
      myContentPanel.add(component, id);
    }
    return id;
  }

  private void showStepComponent(final Component component) {
    String id = myComponentToIdMap.get(component);
    if (id == null) {
      id = addStepComponent(component);
      myContentPanel.revalidate();
      myContentPanel.repaint();
    }
    ((CardLayout)myContentPanel.getLayout()).show(myContentPanel, id);
  }

  protected void doPreviousAction() {
    // Commit data of current step
    final Step currentStep = mySteps.get(myCurrentStep);
    LOG.assertTrue(currentStep != null);
    try {
      currentStep._commit(false);
    }
    catch (final CommitStepException exc) {
      Messages.showErrorDialog(
        myContentPanel,
        exc.getMessage()
      );
      return;
    }

    myCurrentStep = getPreviousStep(myCurrentStep);
    updateStep();
  }

  protected void doNextAction() {
    // Commit data of current step
    final Step currentStep = mySteps.get(myCurrentStep);
    LOG.assertTrue(currentStep != null);
    LOG.assertTrue(!isLastStep(), "steps: " + mySteps + " current: " + currentStep);
    try {
      currentStep._commit(false);
    }
    catch (final CommitStepException exc) {
      Messages.showErrorDialog(
        myContentPanel,
        exc.getMessage()
      );
      return;
    }

    myCurrentStep = getNextStep(myCurrentStep);
    updateStep();
  }

  /**
   * override this to provide alternate step order
   * @param step index
   * @return the next step's index
   */
  protected int getNextStep(int step) {
    final int stepCount = mySteps.size();
    if (++step >= stepCount) {
      step = stepCount - 1;
    }
    return step;
  }

  protected final int getNextStep() {
    return getNextStep(getCurrentStep());
  }

  protected T getNextStepObject() {
    int step = getNextStep();
    return mySteps.get(step);
  }

  /**
   * override this to provide alternate step order
   * @param step index
   * @return the previous step's index
   */
  protected int getPreviousStep(int step) {
    if (--step < 0) {
      step = 0;
    }
    return step;
  }

  protected final int getPreviousStep() {
    return getPreviousStep(getCurrentStep());
  }

  protected void updateStep() {
    if (mySteps.isEmpty()) {
      return;
    }

    final Step step = mySteps.get(myCurrentStep);
    LOG.assertTrue(step != null);
    step._init();
    myCurrentStepComponent = step.getComponent();
    LOG.assertTrue(myCurrentStepComponent != null);
    showStepComponent(myCurrentStepComponent);

    myIcon.setIcon(step.getIcon());

    updateButtons();

    JComponent component = mySteps.get(getCurrentStep()).getPreferredFocusedComponent();
    requestFocusTo(component != null ? component : myNextButton);
  }

  private static void requestFocusTo(final JComponent component) {
    UiNotifyConnector.doWhenFirstShown(component, new Runnable() {
      @Override
      public void run() {
        final IdeFocusManager focusManager = IdeFocusManager.findInstanceByComponent(component);
        focusManager.requestFocus(component, false);
      }
    });
  }

  protected boolean canGoNext() {
    return true;
  }

  protected boolean canFinish() {
    return isLastStep() && canGoNext();
  }

  protected void updateButtons() {
    if (isLastStep()) {
      if (mySteps.size() > 1) {
        myNextButton.setText(UIUtil.removeMnemonic(IdeBundle.message("button.finish")));
        myNextButton.setMnemonic('F');
      }
      else {
        myNextButton.setText(IdeBundle.message("button.ok"));
      }
      myNextButton.setEnabled(canFinish());
    }
    else {
      myNextButton.setText(UIUtil.removeMnemonic(IdeBundle.message("button.wizard.next")));
      myNextButton.setMnemonic('N');
      myNextButton.setEnabled(canGoNext());
    }

    if (myNextButton.isEnabled() && !ApplicationManager.getApplication().isUnitTestMode()) {
      getRootPane().setDefaultButton(myNextButton);
    }

    myPreviousButton.setEnabled(myCurrentStep > 0);
  }

  protected boolean isLastStep() {
    return myCurrentStep == mySteps.size() - 1 || getCurrentStep() == getNextStep(getCurrentStep());
  }

  protected JButton getNextButton() {
    return myNextButton;
  }

  protected JButton getPreviousButton() {
    return myPreviousButton;
  }

  protected JButton getHelpButton() {
    return myHelpButton;
  }

  public JButton getCancelButton() {
    return myCancelButton;
  }

  @Deprecated
  protected JButton getFinishButton() {
    return new JButton();
  }

  public Component getCurrentStepComponent() {
    return myCurrentStepComponent;
  }

  protected void helpAction() {
    HelpManager.getInstance().invokeHelp(getHelpID());
  }

  @Override
  protected void doHelpAction() {
    HelpManager.getInstance().invokeHelp(getHelpID());
  }

  protected int getNumberOfSteps() {
    return mySteps.size();
  }

  @Nullable
  @NonNls
  protected abstract String getHelpID();
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="Examples">
  <process id="taskListenersOnCompleteExecutionVariables" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>

    <sequenceFlow sourceRef="startevent1" targetRef="serviceTask1" />

    <serviceTask
            id="serviceTask1"
            name="Service Task 1"
            activiti:class="org.activiti.examples.bpmn.executionlistener.ConditionalThrowExceptionDelegate">
      <extensionElements>
        <activiti:field name="injectedVar" stringValue="test1" />
      </extensionElements>
    </serviceTask>

    <sequenceFlow sourceRef="serviceTask1" targetRef="usertask1"></sequenceFlow>

    <userTask id="usertask1" name="User Task 1">
      <extensionElements>
        <activiti:taskListener
                event="complete"
                class="org.activiti.examples.bpmn.tasklistener.CurrentTaskTransactionDependentTaskListener"
                onTransaction="committed"/>
      </extensionElements>
    </userTask>

    <sequenceFlow sourceRef="usertask1" targetRef="serviceTask2" />

    <serviceTask
            id="serviceTask2"
            name="Service Task 2"
            activiti:class="org.activiti.examples.bpmn.executionlistener.ConditionalThrowExceptionDelegate">
      <extensionElements>
        <activiti:field name="injectedVar" stringValue="test2" />
      </extensionElements>
    </serviceTask>

    <sequenceFlow sourceRef="serviceTask2" targetRef="usertask2"></sequenceFlow>

    <userTask id="usertask2" name="User Task 2">
      <extensionElements>
        <activiti:taskListener
                event="complete"
                class="org.activiti.examples.bpmn.tasklistener.CurrentTaskTransactionDependentTaskListener"
                onTransaction="committed"/>
      </extensionElements>
    </userTask>

    <sequenceFlow sourceRef="usertask2" targetRef="endevent1"></sequenceFlow>

    <endEvent id="endevent1" name="End"></endEvent>
  </process>
</definitions>


text:
package org.terasology.rendering.nui.layers.mainMenu.videoSettings;

import org.terasology.config.RenderingConfig;
import org.terasology.rendering.nui.databinding.Binding;

/**
 */
public class DynamicShadowsBinding implements Binding<DynamicShadows> {

    private RenderingConfig config;

    public DynamicShadowsBinding(RenderingConfig config) {
        this.config = config;
    }

    @Override
    public DynamicShadows get() {
        return DynamicShadows.find(config.isDynamicShadows(), config.isDynamicShadowsPcfFiltering());
    }

    @Override
    public void set(DynamicShadows value) {
        value.apply(config);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
    <sequence name="fault">
        <log level="custom">
            <property name="STATUS" value="Executing default 'fault' sequence"/>
            <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
            <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
        </log>
        <filter source="get-property('MESSAGE_FORMAT')" regex="soap1[1-2]">
            <then>
                <property name="SOAP_FAULT_CODE" value="Server"/>
                <makefault>

                    <reason expression="$ctx:ERROR_MESSAGE"/>
                </makefault>
            </then>
            <else>
                <payloadFactory>
                    <format>
                        <am:fault xmlns:am="http://wso2.org/apimanager">
                            <am:code>$1</am:code>
                            <am:type>Status report</am:type>
                            <am:message>Runtime Error</am:message>
                            <am:description>$2</am:description>
                        </am:fault>
                    </format>
                    <args>
                        <arg expression="$ctx:ERROR_CODE"/>
                        <arg expression="$ctx:ERROR_MESSAGE"/>
                    </args>
                </payloadFactory>
                <filter source="$axis2:HTTP_METHOD" regex="^(?!.*(POST|PUT)).*$">
                    <property name="messageType" value="application/xml" scope="axis2"/>
                </filter>
            </else>
        </filter>
        <filter xpath="$ctx:CUSTOM_HTTP_SC">
            <then>
                <property name="HTTP_SC" expression="$ctx:CUSTOM_HTTP_SC" scope="axis2"/>
            </then>
            <else>
                <property name="HTTP_SC" value="500" scope="axis2"/>
            </else>
        </filter>
        <class name="org.wso2.carbon.apimgt.usage.publisher.APIMgtFaultHandler"/>
        <property name="RESPONSE" value="true"/>

        <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
        <property name="ContentType" scope="axis2" action="remove"/>
        <property name="Authorization" scope="transport" action="remove"/>
        <property name="Host" scope="transport" action="remove"/>
        <property name="Accept" scope="transport" action="remove"/>
        <property name="X-JWT-Assertion" scope="transport" action="remove"/>
        <send/>
    </sequence>
    <sequence name="main">
        <description>The default main sequence for API manager - Returns 404 Not Found</description>
        <in>
            <log level="custom">
                <property name="STATUS" value="Message dispatched to the main sequence. Invalid URL."/>
                <property name="RESOURCE" expression="fn:concat('/', $axis2:REST_URL_POSTFIX)"/>
            </log>
            <filter source="$ctx:TRANSPORT_DENIED" regex="true">
                <payloadFactory>
                    <format>
                        <am:fault xmlns:am="http://wso2.org/apimanager">
                            <am:code>403</am:code>
                            <am:type>Status report</am:type>
                            <am:message>Forbidden</am:message>
                            <am:description>Unsupported Transport [ $2 ]. The requested resource (/$1) is not
                                available.
                            </am:description>
                        </am:fault>
                    </format>
                    <args>
                        <arg expression="$axis2:REST_URL_POSTFIX"/>
                        <arg expression="$ctx:IN_TRANSPORT"/>
                    </args>
                </payloadFactory>
                <property name="HTTP_SC" value="403" scope="axis2"/>
                <property name="RESPONSE" value="true"/>

                <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
                <property name="ContentType" scope="axis2" action="remove"/>
                <property name="Authorization" scope="transport" action="remove"/>
                <property name="Host" scope="transport" action="remove"/>
                <property name="Accept" scope="transport" action="remove"/>
                <send/>
            </filter>
            <filter source="get-property('MESSAGE_FORMAT')" regex="soap1[1-2]">
                <then>
                    <property name="SOAP_FAULT_CODE" value="Server"/>
                    <makefault>

                        <reason value="The requested endpoint is not available."/>
                    </makefault>
                </then>
                <else>
                    <payloadFactory>
                        <format>
                            <am:fault xmlns:am="http://wso2.org/apimanager">
                                <am:code>404</am:code>
                                <am:type>Status report</am:type>
                                <am:message>Not Found</am:message>
                                <am:description>The requested resource (/$1) is not available.</am:description>
                            </am:fault>
                        </format>
                        <args>
                            <arg expression="$axis2:REST_URL_POSTFIX"/>
                        </args>
                    </payloadFactory>
                </else>
            </filter>
            <filter source="$axis2:HTTP_METHOD" regex="^(?!.*(POST|PUT)).*$">
                <property name="messageType" value="application/xml" scope="axis2"/>
            </filter>
            <property name="HTTP_SC" value="404" scope="axis2"/>
            <property name="RESPONSE" value="true"/>

            <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
            <property name="ContentType" scope="axis2" action="remove"/>
            <property name="Authorization" scope="transport" action="remove"/>
            <property name="Host" scope="transport" action="remove"/>
            <property name="Accept" scope="transport" action="remove"/>
            <property name="X-JWT-Assertion" scope="transport" action="remove"/>
            <send/>
            <drop/>
        </in>
        <out>
            <log level="full">
                <property name="STATUS" value="Unexpected response message in out flow"/>
            </log>
            <drop/>
        </out>
    </sequence>
    <api xmlns="http://ws.apache.org/ns/synapse"
         name="Response_API"
         context="/response">
        <resource methods="POST GET" url-mapping="/*">
            <inSequence>
                <property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
                <filter source="boolean(get-property('query.param.response'))" regex="true">
                    <then>
                        <property name="HTTP_SC" expression="get-property('query.param.response')" scope="axis2"/>
                    </then>
                </filter>
                <payloadFactory>
                    <format>
                        <response xmlns="">
                            <value>Received Request</value>
                        </response>
                    </format>
                </payloadFactory>
                <property name="RESPONSE" value="true" scope="default" type="STRING"/>

                <property name="Location" value="http://google.lk/abc/domain" scope="transport"/>
                <send/>
            </inSequence>
        </resource>
    </api>
</definitions>


text:
cask 'zest' do
  version '0.1.1'
  sha256 '9405fecb40731b47bb357e87714711afe6d1f6a9c3a4fa9d01b0109da9c3f947'

  # github.com/zestdocs/zest was verified as official when first introduced to the cask
  url "https://github.com/zestdocs/zest/releases/download/v#{version}/zest-v#{version}.dmg"
  appcast 'https://github.com/zestdocs/zest/releases.atom',
          checkpoint: '070f49a40e5db4448424a7ab4305fd05ecfee703f14e99b76c776961a760eed5'
  name 'Zest'
  homepage 'http://zestdocs.org/'

  app 'Zest.app'

  zap delete: [
                '~/Library/Application Support/zest',
                '~/Library/Caches/zest',
                '~/Library/Preferences/org.zestdocs.plist',
                '~/Library/Saved Application State/org.zestdocs.savedState',
              ]

  caveats do
    discontinued
  end
end


text:
package org.diorite.permissions.pattern.group;

import java.util.HashMap;
import java.util.Map;

public class GroupsManager
{
    private static Map<String, SpecialGroup<?>> groups = new HashMap<>(5, .25F);

    static
    {
        register(new LevelGroup(true), "{$++}");
        register(new LevelGroup(false), "{$--}");
        register(new RangeGroup(), "{$-$}");
    }

    public static void register(final SpecialGroup<?> group, final String... patterns)
    {
        for (final String pattern : patterns)
        {
            groups.put(pattern, group);
        }
    }

    public SpecialGroup<?> get(final String pat)
    {
        return groups.get(pat);
    }
}


text:
@interface LanMuModel : MBTestMainModel
@property (nonatomic, copy) NSString *cateid; //分类的id
@property (nonatomic, copy) NSString *thumb; //栏目图片url
@property (nonatomic, copy) NSString *title; //栏目标题
@property (nonatomic, copy) NSString *type; //栏目类型
@end


text:
USE [ANTERO]
GO
/****** Object:  StoredProcedure [sa].[p_lataa_sa_hakeneet_toisen_asteen_hakijat]    Script Date: 13.11.2019 17:21:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

--TÄMÄ PROSEDUURI TYHJENTÄÄ JA TÄYTTÄÄ TAULUN [sa].[sa_haku_ja_valinta_hakijat_toinen_aste]

ALTER procedure [sa].[p_lataa_sa_hakeneet_toisen_asteen_hakijat]
@vuosi int
,@haku1_oid varchar(255) = NULL
,@haku2_oid varchar(255) = NULL
,@haku3_oid varchar(255) = NULL
,@haku4_oid varchar(255) = NULL
,@haku5_oid varchar(255) = NULL
,@haku6_oid varchar(255) = NULL AS

--aputaulut
declare @valintaLista table (tila varchar(50))
insert into @valintaLista values ('HYVAKSYTTY')
insert into @valintaLista values ('PERUNUT')
insert into @valintaLista values ('VARASIJALTA_HYVAKSYTTY')

declare @vastaanottoLista table (tila varchar(50))
insert into @vastaanottoLista values ('VASTAANOTTANUT_SITOVASTI')

--poistetaan ko. vuoden tiedot
delete from [sa].[sa_haku_ja_valinta_hakijat_toinen_aste] where vuosi = @vuosi

--kirjoitetaan henkilö-oidit ko. vuodelta
insert into [sa].[sa_haku_ja_valinta_hakijat_toinen_aste] (oid, vuosi)
select distinct
	f.henkilo_oid
	,vuosi = @vuosi
from dw.f_haku_ja_valinta_hakeneet_toinen_aste f
left join ANTERO.dw.d_haku d on d.id = f.d_haku_id
where d.haku_oid in (@haku1_oid,@haku2_oid,@haku3_oid,@haku4_oid,@haku5_oid,@haku6_oid)

--Haut per henkilö-oid
update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set haut=(case
			when not exists (select HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and (h.HakuOid=@haku1_oid or h.HakuOid=@haku2_oid))
				then case
						  when not exists (select HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and (h.HakuOid =@haku3_oid or h.HakuOid=@haku4_oid)) then 'Hakenut vain valmaan'
						  when not exists (select HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and (h.HakuOid =@haku5_oid or h.HakuOid=@haku6_oid)) then 'Hakenut vain erityisopetukseen'
						  else 'Hakenut erityisopetukseen ja valmaan'
					  end
			else case
					  when not exists (select HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and (h.HakuOid =@haku3_oid or h.HakuOid=@haku4_oid))
						   then case
									 when not exists (select HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and (h.HakuOid =@haku5_oid or h.HakuOid=@haku6_oid)) then 'Hakenut vain amm/lukioon'
							         else 'Hakenut amm/lukioon ja valmaan'
								 end
					  else case when not exists (select HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and (h.HakuOid =@haku5_oid or h.HakuOid=@haku6_oid)) then 'Hakenut amm/lukioon ja erityisopetukseen'
								else 'Hakenut kaikissa kolmessa haussa'
						   end
				 end

		end)
where vuosi=@vuosi

--Valinnat per henkilö-oid
update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set valinnat= (case
			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu amm/lukioon'

			when ( not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu erityisopetukseen'

			when ( not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu valmaan'

			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu amm/lukioon ja erityisopetukseen'

			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu amm/lukioon ja valmaan'

			when ( not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu erityisopetukseen ja valmaan'

			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.ValinnanTila in (SELECT tila FROM @valintaLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Valittu kaikkiin kolmeen'

			else 'Ei valittu'
		end)
where vuosi=@vuosi

--Vastaanotto per henkilö-oid
update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set vastaanotto= (case
			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut amm/lukioon'

			when ( not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut erityisopetukseen'

			when ( not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut valmaan'

			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut amm/lukioon ja erityisopetukseen'

			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut amm/lukioon ja valmaan'

			when ( not exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut erityisopetukseen ja valmaan'

			when ( exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku2_oid or h.HakuOid = @haku1_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku3_oid or h.HakuOid = @haku4_oid))
					and exists (select distinct HakuOid from sa.sa_odw_hakeneet h where h.HenkiloOID=oid and h.VastaanotonTila in (SELECT tila FROM @vastaanottoLista) and (h.HakuOid = @haku5_oid or h.HakuOid = @haku6_oid)) ) then 'Vastaanottanut kaikkiin kolmeen'

			else
				case
					when valinnat <> 'Ei valittu' then 'Valittiin mutta ei vastaanottanut'
					else 'Ei valittu'
				 end
		end)
--from sa.sa_haku_ja_valinta_hakijat_toinen_aste f
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set haut_jarjestys=(case haut
						when 'Hakenut vain amm/lukioon' then 1
						when 'Hakenut vain erityisopetukseen' then 2
						when 'Hakenut vain valmaan' then 3
						when 'Hakenut amm/lukioon ja erityisopetukseen' then 4
						when 'Hakenut amm/lukioon ja valmaan' then 5
						when 'Hakenut erityisopetukseen ja valmaan' then 6
						when 'Hakenut kaikissa kolmessa haussa' then 7
						else '99'
					end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set valinnat_jarjestys=(case valinnat
						when 'Valittu amm/lukioon' then 1
						when 'Valittu erityisopetukseen' then 2
						when 'Valittu valmaan' then 3
						when 'Valittu amm/lukioon ja erityisopetukseen' then 4
						when 'Valittu amm/lukioon ja valmaan' then 5
						when 'Valittu erityisopetukseen ja valmaan' then 6
						when 'Valittu kaikkiin kolmeen' then 7
						when 'Ei valittu' then 8
						else '99'
					end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set vastaanotto_jarjestys=(case vastaanotto
						when 'Vastaanottanut amm/lukioon' then 1
						when 'Vastaanottanut erityisopetukseen' then 2
						when 'Vastaanottanut valmaan' then 3
						when 'Vastaanottanut amm/lukioon ja erityisopetukseen' then 4
						when 'Vastaanottanut amm/lukioon ja valmaan' then 5
						when 'Vastaanottanut erityisopetukseen ja valmaan' then 6
						when 'Vastaanottanut kaikkiin kolmeen' then 7
						when 'Valittiin mutta ei vastaanottanut' then 8
						when 'Ei valittu' then 9
						else '99'
					end)
where vuosi=@vuosi

/* Tekstikenttien päivitys */

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set haut=(case haut_jarjestys
			when 1 then 'Haki vain ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa'
			when 2 then 'Haki vain erityisopetuksena järjestettävän ammatillisen koulutuksen haussa'
			when 3 then 'Haki vain perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 4 then 'Haki ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa ja erityisopetuksena järjestettävän ammatillisen koulutuksen haussa'
			when 5 then 'Haki ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa ja perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 6 then 'Haki erityisopetuksena järjestettävän ammatillisen koulutuksen haussa ja perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 7 then 'Haki kaikissa kolmessa haussa'
			else 'Tuntematon'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set haut_SV=(case haut_jarjestys
			when 1 then 'Ansökte endast till yrkes-/gymnasieutbildning'
			when 2 then 'Ansökte endast till specialundervisning'
			when 3 then 'Ansökte endast till förberedande utbildning'
			when 4 then 'Ansökte till yrkes-/gymnasieutbildning och specialundervisning'
			when 5 then 'Ansökte till yrkes-/gymnasieutbildning och förberedande utbildning'
			when 6 then 'Ansökte till specialundervisning och förberedande utbildning'
			when 7 then 'Ansökte till alla tre utbildningar'
			else 'Information saknas'
		end)

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set haut_EN=(case haut_jarjestys
			when 1 then 'Applied only for vocational or general upper secondary education'
			when 2 then 'Applied only for vocational special needs education and training'
			when 3 then 'Applied only for preparatory training'
			when 4 then 'Applied for vocational or general upper secondary education and vocational special needs education and training'
			when 5 then 'Applied for vocational or general upper secondary education and preparatory training'
			when 6 then 'Applied for vocational special needs education and training and preparatory training'
			when 7 then 'Applied for all three'
			else 'Missing data'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set valinnat=(case valinnat_jarjestys
			when 1 then 'Valittiin ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa'
			when 2 then 'Valittiin erityisopetuksena järjestettävän ammatillisen koulutuksen haussa'
			when 3 then 'Valittiin perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 4 then 'Valittiin ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa ja erityisopetuksena järjestettävän ammatillisen koulutuksen haussa'
			when 5 then 'Valittiin ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa ja perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 6 then 'Valittiin erityisopetuksena järjestettävän ammatillisen koulutuksen haussa ja perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 7 then 'Valittiin kaikissa kolmessa haussa'
			when 8 then 'Ei valittu'
			else 'Tuntematon'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set valinnat_SV=(case valinnat_jarjestys
			when 1 then 'Blev antagen till yrkes-/gymnasieutbildning' -- vid vårens gemensamma ansökan
			when 2 then 'Blev antagen till specialundervisning'
			when 3 then 'Blev antagen till förberedande utbildning'
			when 4 then 'Blev antagen till yrkes-/gymnasieutbildning och specialundervisning'
			when 5 then 'Blev antagen till yrkes-/gymnasieutbildning och förberedande utbildning'
			when 6 then 'Blev antagen till specialundervisning och förberedande utbildning'
			when 7 then 'Blev antagen till alla tre utbildningar' --vid alla tre ansökningar
			when 8 then 'Blev inte antagen'
			else 'Information saknas'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set valinnat_EN=(case valinnat_jarjestys
			when 1 then 'Was selected to vocational or general upper secondary education'
			when 2 then 'Was selected to vocational special needs education and training'
			when 3 then 'Was selected to preparatory training'
			when 4 then 'Was selected to vocational or general upper secondary education and vocational special needs education and training'
			when 5 then 'Was selected to vocational or general upper secondary education and preparatory training'
			when 6 then 'Was selected to vocational special needs education and training and preparatory training'
			when 7 then 'Was selected to all three'
			when 8 then 'Was not selected'
			else 'Missing data'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set vastaanotto=(case vastaanotto_jarjestys
			when 1 then 'Vastaanotti paikan ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa'
			when 2 then 'Vastaanotti paikan erityisopetuksena järjestettävän ammatillisen koulutuksen haussa'
			when 3 then 'Vastaanotti paikan perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 4 then 'Vastaanotti paikan ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa ja erityisopetuksena järjestettävän ammatillisen koulutuksen haussa'
			when 5 then 'Vastaanotti paikan ammatillisen koulutuksen ja lukiokoulutuksen kevään yhteishaussa ja perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 6 then 'Vastaanotti paikan erityisopetuksena järjestettävän ammatillisen koulutuksen haussa ja perusopetuksen jälkeisen valmistavan koulutuksen haussa'
			when 7 then 'Vastaanotti paikan kaikissa kolmessa haussa'
			when 8 then 'Valittiin mutta ei vastaanottanut'
			when 9 then 'Ei valittu'
			else 'Tuntematon'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set vastaanotto_SV=(case vastaanotto_jarjestys
			when 1 then 'Tog emot plats i yrkes-/gymnasieutbildning antagningen' --vid yrkes-/gymnasieutbildning ansökan
			when 2 then 'Tog emot plats i specialundervisning antagningen'
			when 3 then 'Tog emot plats i förberedande utbildning antagningen'
			when 4 then 'Tog emot plats i yrkes-/gymnasieutbildning och specialundervisning antagningen'
			when 5 then 'Tog emot plats i yrkes-/gymnasieutbildning och förberedande utbildning antagningen'
			when 6 then 'Tog emot plats i specialundervisning och förberedande utbildning antagningen'
			when 7 then 'Tog emot plats i alla tre ansökningar antagningen'
			when 8 then 'Blev antagen men tog inte emot platsen'
			when 9 then 'Blev inte antagen'
		end)
where vuosi=@vuosi

update sa.sa_haku_ja_valinta_hakijat_toinen_aste
set vastaanotto_EN=(case vastaanotto_jarjestys
			when 1 then 'Accepted a place for vocational or general upper secondary education'
			when 2 then 'Accepted a place for vocational special needs education and training'
			when 3 then 'Accepted a place for preparatory training'
			when 4 then 'Accepted a place for vocational or general upper secondary education and vocational special needs education and training'
			when 5 then 'Accepted a place for vocational or general upper secondary education and preparatory training'
			when 6 then 'Accepted a place for vocational special needs education and training and preparatory training'
			when 7 then 'Accepted a place for all three'
			when 8 then 'Was selected but did not accept a place'
			when 9 then 'Was not selected'
			else 'Missing data'
		end)
where vuosi=@vuosi


text:
"use strict";

require("../../lib/jasmine-promise");
var Q = require("q");
var FS = require("../../../fs");
/*global describe,it,expect */

describe("stat", function () {
    it("should return a Stats object", function () {
        return FS.mock(FS.join(__dirname, "fixture"))
        .then(function (mock) {
            return mock.stat("hello.txt");
        })
        .then(function (stat) {
            expect(stat.node).toBeDefined();
            expect(stat.size).toBeDefined();
            expect(stat.size).toBeGreaterThan(0);
            expect(stat.isDirectory()).toBe(false);
            expect(stat.isFile()).toBe(true);
        });
    });

});


text:
using EgoEngineLibrary.Graphics.Dds;
using System;
using System.Text;

namespace EgoEngineLibrary.Formats.Tpk;

public static class TpkFileExtensions
{
    private const uint MinBc1LinearSize = 8;
    private const uint MinBc2LinearSize = 16;
    private const uint MinBc3LinearSize = 16;

    public static DdsFile ToDds(this TpkFile tpk)
    {
        var dds = new DdsFile();

        switch (tpk.Format)
        {
            case TpkImageFormat.Bgra: // BGRA little-endian
                dds.header.flags |= DdsHeader.Flags.DDSD_LINEARSIZE;
                dds.header.ddspf.flags |= DdsPixelFormat.Flags.DDPF_ALPHAPIXELS | DdsPixelFormat.Flags.DDPF_RGB;
                dds.header.ddspf.fourCC = 0;
                dds.header.ddspf.rGBBitCount = 32;
                dds.header.ddspf.bBitMask = 0xFF;
                dds.header.ddspf.gBitMask = 0xFF00;
                dds.header.ddspf.rBitMask = 0xFF0000;
                dds.header.ddspf.aBitMask = 0xFF000000;
                dds.header.pitchOrLinearSize = tpk.Width * tpk.Height * 4;
                break;
            case TpkImageFormat.Dxt1:
                dds.header.flags |= DdsHeader.Flags.DDSD_LINEARSIZE;
                dds.header.ddspf.flags |= DdsPixelFormat.Flags.DDPF_FOURCC;
                dds.header.ddspf.fourCC = BitConverter.ToUInt32(Encoding.UTF8.GetBytes("DXT1"), 0);
                dds.header.pitchOrLinearSize = Math.Max(tpk.Width * tpk.Height / 2, MinBc1LinearSize);
                break;
            case TpkImageFormat.Dxt3:
                dds.header.flags |= DdsHeader.Flags.DDSD_LINEARSIZE;
                dds.header.ddspf.flags |= DdsPixelFormat.Flags.DDPF_FOURCC;
                dds.header.ddspf.fourCC = BitConverter.ToUInt32(Encoding.UTF8.GetBytes("DXT3"), 0);
                dds.header.pitchOrLinearSize = Math.Max(tpk.Width * tpk.Height, MinBc2LinearSize);
                break;
            case TpkImageFormat.Dxt5:
                dds.header.flags |= DdsHeader.Flags.DDSD_LINEARSIZE;
                dds.header.ddspf.flags |= DdsPixelFormat.Flags.DDPF_FOURCC;
                dds.header.ddspf.fourCC = BitConverter.ToUInt32(Encoding.UTF8.GetBytes("DXT5"), 0);
                dds.header.pitchOrLinearSize = Math.Max(tpk.Width * tpk.Height, MinBc3LinearSize);
                break;
            default:
                throw new NotSupportedException($"Tpk format {tpk.Format} not supported.");
        }

        dds.header.width = tpk.Width;
        dds.header.height = tpk.Height;

        if (tpk.MipMapCount > 0)
        {
            dds.header.flags |= DdsHeader.Flags.DDSD_MIPMAPCOUNT;
            dds.header.mipMapCount = tpk.MipMapCount;
            dds.header.caps |= DdsHeader.Caps.DDSCAPS_MIPMAP | DdsHeader.Caps.DDSCAPS_COMPLEX;
        }

        dds.bdata = tpk.Data;
        return dds;
    }

    public static void FromDds(this TpkFile tpk, DdsFile dds)
    {
        tpk.Format = GetTpkImageFormat(dds);
        tpk.Width = dds.header.width;
        tpk.Height = dds.header.height;
        tpk.MipMapCount = dds.header.mipMapCount;
        tpk.Data = dds.bdata;
    }
    public static TpkImageFormat GetTpkImageFormat(this DdsFile dds)
    {
        TpkImageFormat format;

        switch (dds.header.ddspf.fourCC)
        {
            case 0:
                format = TpkImageFormat.Bgra;
                break;
            case 827611204: // DXT1 aka DXGI_FORMAT_BC1_UNORM
                format = TpkImageFormat.Dxt1;
                break;
            case 861165636: // DXT5 aka DXGI_FORMAT_BC2_UNORM
                format = TpkImageFormat.Dxt3;
                break;
            case 894720068: // DXT5 aka DXGI_FORMAT_BC3_UNORM
                format = TpkImageFormat.Dxt5;
                break;
            case 808540228: // DX10
                if (dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_B8G8R8A8_TYPELESS ||
                    dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_B8G8R8A8_UNORM)
                {
                    goto case 0;
                }
                else if (dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_BC1_TYPELESS ||
                    dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_BC1_UNORM)
                {
                    goto case 827611204;
                }
                else if (dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_BC2_TYPELESS ||
                    dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_BC2_UNORM)
                {
                    goto case 861165636;
                }
                else if (dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_BC3_TYPELESS ||
                    dds.header10.dxgiFormat == DXGI_Format.DXGI_FORMAT_BC3_UNORM)
                {
                    goto case 894720068;
                }
                else
                {
                    goto default;
                }
            default:
                throw new NotSupportedException("DDS image format not supported");
        }

        return format;
    }
}


text:
package org.carewebframework.help;

/**
 * Defines a specific help context target.
 */
public class HelpContext {

    public final String module;

    public final String topic;

    public final String label;

    public HelpContext(String module, String topic, String label) {
        this.module = module;
        this.topic = topic;
        this.label = label;
    }
}


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

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set device callback function</title>

gupnp_control_point_new

gupnp_device_info_get_service

Gupnp Functions

PHP Manual

gupnp_device_action_callback_set

(PECL gupnp >= 0.1.0)

gupnp_device_action_callback_set — Set device callback function

Description

   bool gupnp_device_action_callback_set
    ( resource $root_device
   , int $signal
   , string $action_name
   , mixed $callback
   [, mixed $arg
  ] )

   Set device callback function for signal and action.

Parameters

root_device

       A root device identifier, returned by gupnp_root_device_new().

signal

       The value of signal. Signal can be one of the following values:

GUPNP_SIGNAL_ACTION_INVOKED

           Emitted whenever an action is invoked. Handler should process action
           and must call either gupnp_service_action_return()
           or gupnp_service_action_return_error().

GUPNP_SIGNAL_NOTIFY_FAILED

           Emitted whenever notification of a client fails.

action_name

       The name of action.

callback

       The callback function for the certain signal. Typically, callback function
       takes on three parameters. The service parameter's
       identifier being the first, action parameter's
       identifier (in case GUPNP_SIGNAL_ACTION_INVOKED signal) or
       error parameter's message (in case GUPNP_SIGNAL_NOTIFY_FAILED
       signal) being the second, and the arg is third.

arg

       User data for callback.

Return Values

   Returns TRUE on success or FALSE on failure.

Errors/Exceptions

   Issues E_WARNING either with not valid callback function or with not valid signal.

See Also

gupnp_root_device_new() - Create a new root device

gupnp_control_point_new

gupnp_device_info_get_service

Gupnp Functions

PHP Manual


text:
package org.arakhne.afc.inputoutput.filetype;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.activation.MimeType;

import org.arakhne.afc.inputoutput.mime.MimeName;

/** This class defines a set of informations that could distinguish
 * a file content from another one. It is also known as Magic Number
 * on several operating systems.
 *
 *
This magic number supports zip archive of files. For a single
 * zipped file, please use {@link ZipMagicNumber}. For a jar file,
 * plase use {@link JarMagicNumber}.
 *
 * @author $Author: sgalland$
 * @version $FullVersion$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 * @since 14.0
 * @see ZipMagicNumber
 * @see JarMagicNumber
 */
public abstract class ZipArchiveMagicNumber extends MagicNumber {

	private final File innerFile;

	/** Constructor.
	 * @param mimeType is the MIME type associated to this magic number.
	 */
	public ZipArchiveMagicNumber(MimeType mimeType) {
		this(mimeType, (File) null);
	}

	/** Constructor.
	 * @param mimeType is the MIME type associated to this magic number.
	 * @param formatVersion is the version of the supported format.
	 * @param innerFile is the file to open from the inside of the Zip archive
	 *     to test the type. The filename is relative to the root of the zip file
	 *     content.
	 */
	public ZipArchiveMagicNumber(MimeType mimeType, String formatVersion, File innerFile) {
		super(mimeType, formatVersion,
				MimeName.MIME_ZIP.toMimeType(),
				MimeName.MIME_OCTET_STREAM.toMimeType());
		this.innerFile = innerFile;
	}

	/** Constructor.
	 * @param mimeType is the MIME type associated to this magic number.
	 * @param innerFile is the file to open from the inside of the Zip archive
	 *     to test the type. The filename is relative to the root of the zip file
	 *     content.
	 */
	public ZipArchiveMagicNumber(MimeType mimeType, File innerFile) {
		super(mimeType,
				MimeName.MIME_ZIP.toMimeType(),
				MimeName.MIME_OCTET_STREAM.toMimeType());
		this.innerFile = innerFile;
	}

	/** Constructor.
	 * @param mimeType is the MIME type associated to this magic number.
	 * @param formatVersion is the version of the supported format.
	 */
	public ZipArchiveMagicNumber(MimeType mimeType, String formatVersion) {
		this(mimeType, formatVersion, (File) null);
	}

	@Override
	protected void doStreamEncoding(MagicNumberStream stream)  throws IOException {
		stream.setOverridingStream(new ZipInputStream(stream.getInputStream()));
	}

	@Override
	protected void undoStreamEncoding(MagicNumberStream stream)  throws IOException {
		stream.resetOverridingStream();
	}

	/** Replies if the given ZIP stream contains data of the expected type.
	 *
	 * @throws IOException if the stream cannot be read.
	 */
	private boolean isContentTypeIn(ZipInputStream stream) throws IOException {
		boolean isContentType = false;
		if (this.innerFile != null) {
			final String strInner = this.innerFile.toString();
			InputStream dataStream = null;
			ZipEntry zipEntry = stream.getNextEntry();
			while (zipEntry != null && dataStream == null) {
				if (strInner.equals(zipEntry.getName())) {
					dataStream = stream;
				} else {
					zipEntry = stream.getNextEntry();
				}
			}
			if (dataStream != null) {
				isContentType = isContentType(stream, zipEntry, dataStream);
			}
		} else {
			isContentType = isContentType(stream, null, null);
		}
		return isContentType;
	}

	@Override
	protected final boolean isContentType(MagicNumberStream stream) {
		boolean isContentType = false;
		try (InputStream is = stream.getInputStream()) {
			if (is instanceof ZipInputStream) {
				isContentType = isContentTypeIn((ZipInputStream) is);
			}
		} catch (Exception e) {
			//
		}
		return isContentType;
	}

	/** Replies if the specified stream contains data
	 * that corresponds to this magic number.
	 *
	 * @param zipStream is the stream of the Zip archive
	 * @param zipEntry is the zip entry that is corresponding to the innerFile given as parameter
	 *     of the constructor, or null not significant.
	 * @param zipEntryStream is the stream on the data of the given zip entry, or null not significant.
	 * @return true if the stream is containing this magic number, otherwise false
	 */
	protected abstract boolean isContentType(ZipInputStream zipStream, ZipEntry zipEntry, InputStream zipEntryStream);

}


text:
#pragma once

#include "../../core/string.hpp"
#include "../../core/array.hpp"

#include "rgxss.hpp"
#include "rgxerr.hpp"

namespace z
{
	namespace util
	{
		/**
		* \brief Scan a string, creating a list of regex symbols.
		*
		* \param pattern The string to scan.
		* \param output An array of regex symbols, returned by reference.
		*
		* \return The first error encountered in the pattern. If no error, gives RGX_NO_ERROR (0).
		*
		* \threadsafe_function_ref
		*/
		rgxerr rgxscan(const zstring& pattern, core::array<rgxss>& output) noexcept;
	}
}


text:
package com.example.android.sunshine.app.widget;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.UiThread;

import com.example.android.sunshine.app.sync.SunshineSyncAdapter;

/**
 * Provider for a horizontally expandable widget showing today's weather.
 */
public class TodayWidgetProvider extends AppWidgetProvider {

    /**
     * Notification received that the widget has been launched (as broadcast from system).
     * @param context the context
     * @param appWidgetManager the widget manager
     * @param appWidgetIds the widget identifiers
     */
    @UiThread
    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        context.startService(new Intent(context, TodayWidgetIntentService.class));
    }

    /**
     * Notification received that the widget configuration has changed, e.g. widget resized by user
     * (as broadcast from system).
     * @param context the context
     * @param appWidgetManager the widget manager
     * @param appWidgetId the widget identifier
     * @param newOptions the latest configuration options
     */
    @Override
    public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager,
                                          int appWidgetId, Bundle newOptions) {
        context.startService(new Intent(context, TodayWidgetIntentService.class));
    }

    /**
     * Notification received that the data has changed (as broadcast from e.g. SunshineSyncAdapter).
     * @param context the context
     * @param intent the received intent
     */
    @Override
    public void onReceive(@NonNull Context context, @NonNull Intent intent) {
        super.onReceive(context, intent);
        if (SunshineSyncAdapter.ACTION_DATA_UPDATED.equals(intent.getAction())) {
            context.startService(new Intent(context, TodayWidgetIntentService.class));
        }
    }

}


text:
@interface LBMyOrdersListModel : NSObject

@property (copy, nonatomic)NSString *goods_id;
@property (copy, nonatomic)NSString *goods_name;
@property (copy, nonatomic)NSString *goods_num;
@property (copy, nonatomic)NSString *goods_price;
@property (copy, nonatomic)NSString *thumb;

@end


text:
package org.apache.taverna.workflow.edits;

import java.util.ArrayList;
import java.util.List;

import org.apache.taverna.scufl2.api.activity.Activity;
import org.apache.taverna.scufl2.api.port.InputActivityPort;
import org.apache.taverna.scufl2.api.port.InputProcessorPort;
import org.apache.taverna.scufl2.api.profiles.ProcessorBinding;
import org.apache.taverna.scufl2.api.profiles.ProcessorInputPortBinding;

public class AddActivityInputPortMappingEdit extends AbstractEdit<Activity> {
	private final InputProcessorPort inputProcessorPort;
	private final InputActivityPort inputActivityPort;
	private List<ProcessorInputPortBinding> portBindings;

	public AddActivityInputPortMappingEdit(Activity activity,
			InputProcessorPort inputProcessorPort,
			InputActivityPort inputActivityPort) {
		super(activity);
		this.inputProcessorPort = inputProcessorPort;
		this.inputActivityPort = inputActivityPort;
	}

	@Override
	protected void doEditAction(Activity activity) {
		portBindings = new ArrayList<>();
		for (ProcessorBinding binding : scufl2Tools
				.processorBindingsToActivity(activity))
			portBindings.add(new ProcessorInputPortBinding(binding,
					inputProcessorPort, inputActivityPort));
	}

	@Override
	protected void undoEditAction(Activity activity) {
		for (ProcessorInputPortBinding binding : portBindings)
			binding.setParent(null);
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Census.UmbracoObject
{
    public class BaseUmbracoObject
    {
    }
}


text:
package org.dyn4j.collision;

import java.util.List;

import junit.framework.TestCase;

import org.dyn4j.collision.broadphase.BroadphasePair;
import org.dyn4j.collision.manifold.ClippingManifoldSolver;
import org.dyn4j.collision.manifold.Manifold;
import org.dyn4j.collision.manifold.ManifoldPoint;
import org.dyn4j.collision.narrowphase.Gjk;
import org.dyn4j.collision.narrowphase.Penetration;
import org.dyn4j.collision.narrowphase.Sat;
import org.dyn4j.collision.narrowphase.Separation;
import org.dyn4j.geometry.HalfEllipse;
import org.dyn4j.geometry.Shape;
import org.dyn4j.geometry.Slice;
import org.dyn4j.geometry.Transform;
import org.dyn4j.geometry.Vector2;
import org.junit.Before;
import org.junit.Test;

/**
 * Test case for {@link HalfEllipse} - {@link Slice} collision detection.
 * @author William Bittle
 * @version 3.1.5
 * @since 3.1.5
 */
public class HalfEllipseSliceTest extends AbstractTest {
	/** The first test {@link HalfEllipse} */
	private HalfEllipse ellipse;

	/** The second test {@link Slice} */
	private Slice slice;

	/**
	 * Sets up the test.
	 */
	@Before
	public void setup() {
		this.ellipse = new HalfEllipse(1.0, 0.25);
		this.slice = new Slice(0.5, Math.toRadians(50));
		this.sapI.clear();
		this.sapBF.clear();
		this.sapT.clear();
		this.dynT.clear();
	}

	/**
	 * Tests {@link Shape} AABB.
	 */
	@Test
	public void detectShapeAABB() {
		Transform t1 = new Transform();
		Transform t2 = new Transform();

		// test containment
		TestCase.assertTrue(this.aabb.detect(ellipse, t1, slice, t2));
		TestCase.assertTrue(this.aabb.detect(slice, t2, ellipse, t1));

		// test overlap
		t1.translate(-0.25, 0.0);
		TestCase.assertTrue(this.aabb.detect(ellipse, t1, slice, t2));
		TestCase.assertTrue(this.aabb.detect(slice, t2, ellipse, t1));

		// test only AABB overlap
		t2.translate(0.0, 0.25);
		TestCase.assertTrue(this.aabb.detect(ellipse, t1, slice, t2));
		TestCase.assertTrue(this.aabb.detect(slice, t2, ellipse, t1));

		// test no overlap
		t1.translate(-1.0, 0.0);
		TestCase.assertFalse(this.aabb.detect(ellipse, t1, slice, t2));
		TestCase.assertFalse(this.aabb.detect(slice, t2, ellipse, t1));
	}

	/**
	 * Tests {@link Collidable} AABB.
	 */
	@Test
	public void detectCollidableAABB() {
		// create some collidables
		CollidableTest ct1 = new CollidableTest(ellipse);
		CollidableTest ct2 = new CollidableTest(slice);

		// test containment
		TestCase.assertTrue(this.aabb.detect(ct1, ct2));
		TestCase.assertTrue(this.aabb.detect(ct2, ct1));

		// test overlap
		ct1.translate(-0.25, 0.0);
		TestCase.assertTrue(this.aabb.detect(ct1, ct2));
		TestCase.assertTrue(this.aabb.detect(ct2, ct1));

		// test only AABB overlap
		ct2.translate(0.0, 0.25);
		TestCase.assertTrue(this.aabb.detect(ct1, ct2));
		TestCase.assertTrue(this.aabb.detect(ct2, ct1));

		// test no overlap
		ct1.translate(-1.0, 0.0);
		TestCase.assertFalse(this.aabb.detect(ct1, ct2));
		TestCase.assertFalse(this.aabb.detect(ct2, ct1));
	}

	/**
	 * Tests the broadphase detectors.
	 */
	@Test
	public void detectBroadphase() {
		List<BroadphasePair<CollidableTest>> pairs;

		// create some collidables
		CollidableTest ct1 = new CollidableTest(ellipse);
		CollidableTest ct2 = new CollidableTest(slice);

		this.sapI.add(ct1);
		this.sapI.add(ct2);
		this.sapBF.add(ct1);
		this.sapBF.add(ct2);
		this.sapT.add(ct1);
		this.sapT.add(ct2);
		this.dynT.add(ct1);
		this.dynT.add(ct2);

		// test containment
		pairs = this.sapI.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(1, pairs.size());

		// test overlap
		ct1.translate(-0.25, 0.0);
		this.sapI.update(ct1);
		this.sapBF.update(ct1);
		this.sapT.update(ct1);
		this.dynT.update(ct1);
		pairs = this.sapI.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(1, pairs.size());

		// test only AABB overlap
		ct2.translate(0.0, 0.25);
		this.sapI.update(ct2);
		this.sapBF.update(ct2);
		this.sapT.update(ct2);
		this.dynT.update(ct2);
		pairs = this.sapI.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(1, pairs.size());

		// test no overlap
		ct1.translate(-1.0, 0.0);
		this.sapI.update(ct1);
		this.sapBF.update(ct1);
		this.sapT.update(ct1);
		this.dynT.update(ct1);
		pairs = this.sapI.detect();
		TestCase.assertEquals(0, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(0, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(0, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(0, pairs.size());
	}

	/**
	 * Tests {@link Sat}.
	 */
	@Test(expected = UnsupportedOperationException.class)
	public void detectSat() {
		Penetration p = new Penetration();
		Transform t1 = new Transform();
		Transform t2 = new Transform();
		this.sat.detect(ellipse, t1, slice, t2, p);
	}

	/**
	 * Tests {@link Gjk}.
	 */
	@Test
	public void detectGjk() {
		Penetration p = new Penetration();
		Transform t1 = new Transform();
		Transform t2 = new Transform();
		Vector2 n = null;

		// test containment
		TestCase.assertTrue(this.gjk.detect(ellipse, t1, slice, t2, p));
		TestCase.assertTrue(this.gjk.detect(ellipse, t1, slice, t2));
		n = p.getNormal();
		TestCase.assertEquals( 0.422, n.x, 1.0e-3);
		TestCase.assertEquals(-0.906, n.y, 1.0e-3);
		TestCase.assertEquals( 0.211, p.getDepth(), 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.detect(slice, t2, ellipse, t1, p));
		TestCase.assertTrue(this.gjk.detect(slice, t2, ellipse, t1));
		n = p.getNormal();
		TestCase.assertEquals(-0.422, n.x, 1.0e-3);
		TestCase.assertEquals( 0.906, n.y, 1.0e-3);
		TestCase.assertEquals( 0.211, p.getDepth(), 1.0e-3);

		// test overlap
		t1.translate(-0.25, 0.0);
		TestCase.assertTrue(this.gjk.detect(ellipse, t1, slice, t2, p));
		TestCase.assertTrue(this.gjk.detect(ellipse, t1, slice, t2));
		n = p.getNormal();
		TestCase.assertEquals( 0.422, n.x, 1.0e-3);
		TestCase.assertEquals(-0.906, n.y, 1.0e-3);
		TestCase.assertEquals( 0.105, p.getDepth(), 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.detect(slice, t2, ellipse, t1, p));
		TestCase.assertTrue(this.gjk.detect(slice, t2, ellipse, t1));
		n = p.getNormal();
		TestCase.assertEquals(-0.422, n.x, 1.0e-3);
		TestCase.assertEquals( 0.906, n.y, 1.0e-3);
		TestCase.assertEquals( 0.105, p.getDepth(), 1.0e-3);

		// test AABB overlap
		t2.translate(0.0, 0.25);
		TestCase.assertFalse(this.gjk.detect(ellipse, t1, slice, t2, p));
		TestCase.assertFalse(this.gjk.detect(ellipse, t1, slice, t2));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.detect(slice, t2, ellipse, t1, p));
		TestCase.assertFalse(this.gjk.detect(slice, t2, ellipse, t1));

		// test no overlap
		t1.translate(-1.0, 0.0);
		TestCase.assertFalse(this.gjk.detect(ellipse, t1, slice, t2, p));
		TestCase.assertFalse(this.gjk.detect(ellipse, t1, slice, t2));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.detect(slice, t2, ellipse, t1, p));
		TestCase.assertFalse(this.gjk.detect(slice, t2, ellipse, t1));
	}

	/**
	 * Tests the {@link Gjk} distance method.
	 */
	@Test
	public void gjkDistance() {
		Separation s = new Separation();

		Transform t1 = new Transform();
		Transform t2 = new Transform();

		Vector2 n = null;
		Vector2 p1 = null;
		Vector2 p2 = null;

		// test containment
		TestCase.assertFalse(this.gjk.distance(ellipse, t1, slice, t2, s));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.distance(slice, t2, ellipse, t1, s));

		// test overlap
		t1.translate(-0.25, 0.0);
		TestCase.assertFalse(this.gjk.distance(ellipse, t1, slice, t2, s));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.distance(slice, t2, ellipse, t1, s));

		// test AABB overlap
		t2.translate(0.0, 0.25);
		TestCase.assertTrue(this.gjk.distance(ellipse, t1, slice, t2, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.022, s.getDistance(), 1.0e-3);
		TestCase.assertEquals( 0.422, n.x, 1.0e-3);
		TestCase.assertEquals( 0.906, n.y, 1.0e-3);
		TestCase.assertEquals( 0.091, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.182, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.100, p2.x, 1.0e-3);
		TestCase.assertEquals( 0.203, p2.y, 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.distance(slice, t2, ellipse, t1, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.022, s.getDistance(), 1.0e-3);
		TestCase.assertEquals(-0.422, n.x, 1.0e-3);
		TestCase.assertEquals(-0.906, n.y, 1.0e-3);
		TestCase.assertEquals( 0.100, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.203, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.091, p2.x, 1.0e-3);
		TestCase.assertEquals( 0.182, p2.y, 1.0e-3);

		// test no overlap
		t1.translate(-1.0, 0.0);
		TestCase.assertTrue(this.gjk.distance(ellipse, t1, slice, t2, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.784, s.getDistance(), 1.0e-3);
		TestCase.assertEquals( 0.961, n.x, 1.0e-3);
		TestCase.assertEquals( 0.273, n.y, 1.0e-3);
		TestCase.assertEquals(-0.754, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.035, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.000, p2.x, 1.0e-3);
		TestCase.assertEquals( 0.250, p2.y, 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.distance(slice, t2, ellipse, t1, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.784, s.getDistance(), 1.0e-3);
		TestCase.assertEquals(-0.961, n.x, 1.0e-3);
		TestCase.assertEquals(-0.273, n.y, 1.0e-3);
		TestCase.assertEquals( 0.000, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.250, p1.y, 1.0e-3);
		TestCase.assertEquals(-0.754, p2.x, 1.0e-3);
		TestCase.assertEquals( 0.035, p2.y, 1.0e-3);
	}

	/**
	 * Test the {@link ClippingManifoldSolver}.
	 */
	@Test
	public void getClipManifold() {
		Manifold m = new Manifold();
		Penetration p = new Penetration();

		Transform t1 = new Transform();
		Transform t2 = new Transform();

		ManifoldPoint mp1, mp2;
		Vector2 p1, p2;

		// test containment gjk
		this.gjk.detect(ellipse, t1, slice, t2, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, ellipse, t1, slice, t2, m));
		TestCase.assertEquals(2, m.getPoints().size());
		// try reversing the shapes
		TestCase.assertTrue(this.cmfs.getManifold(p, slice, t2, ellipse, t1, m));
		TestCase.assertEquals(1, m.getPoints().size());

		t1.translate(-0.25, 0.0);

		// test overlap gjk
		this.gjk.detect(ellipse, t1, slice, t2, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, ellipse, t1, slice, t2, m));
		TestCase.assertEquals(2, m.getPoints().size());
		mp1 = m.getPoints().get(0);
		p1 = mp1.getPoint();
		TestCase.assertEquals( 0.250, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.000, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.105, mp1.getDepth(), 1.0e-3);
		mp2 = m.getPoints().get(1);
		p2 = mp2.getPoint();
		// It really is the point (0,0) with a depth of zero but I wonder if it should
		// be sent to the contact solver or not.  For now we'll let it be.
		TestCase.assertEquals( 0.000, p2.x, 1.0e-3);
		TestCase.assertEquals( 0.000, p2.y, 1.0e-3);
		TestCase.assertEquals( 0.000, mp2.getDepth(), 1.0e-3);
		// try reversing the shapes
		this.gjk.detect(slice, t2, ellipse, t1, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, slice, t2, ellipse, t1, m));
		TestCase.assertEquals(2, m.getPoints().size());
		mp1 = m.getPoints().get(0);
		p1 = mp1.getPoint();
		TestCase.assertEquals( 0.250, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.000, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.105, mp1.getDepth(), 1.0e-3);
		mp2 = m.getPoints().get(1);
		p2 = mp2.getPoint();
		// It really is the point (0,0) with a depth of zero but I wonder if it should
		// be sent to the contact solver or not.  For now we'll let it be.
		TestCase.assertEquals( 0.000, p2.x, 1.0e-3);
		TestCase.assertEquals( 0.000, p2.y, 1.0e-3);
		TestCase.assertEquals( 0.000, mp2.getDepth(), 1.0e-3);
	}
}


text:
import {
    HtmlCompiler
} from './html-compiler';
import {
    JsCompiler
} from './js-compiler';
import {
    Vulcanizer
} from './vulcanizer';
import {
    CopyCompiler
} from './copy-compiler';

Plugin.registerCompiler({
    extensions: ['pt.html'],
}, () => new HtmlCompiler());

Plugin.registerCompiler({
    extensions: ['pt.js'],
}, () => new JsCompiler());

Plugin.registerCompiler({
    extensions: ['vul.html'],
}, () => new Vulcanizer());

Plugin.registerCompiler({
    extensions: ['pt.json'],
}, () => new CopyCompiler());


text:
using Lifx.Lib.Enums;

namespace Lifx.Lib.Packets
{
    internal abstract class CommandPacketBase : PacketBase
    {
        public CommandType Type { get; set; }

        internal virtual void GetPayload(byte[] payload) { }
    }
}


text:
package org.sakaiproject.signup.tool.jsf.organizer.action;

import java.util.Date;
import java.util.List;

import org.sakaiproject.exception.PermissionException;
import org.sakaiproject.signup.logic.SignupEmailFacade;
import org.sakaiproject.signup.logic.SignupEventTypes;
import org.sakaiproject.signup.logic.SignupMeetingService;
import org.sakaiproject.signup.logic.SignupUserActionException;
import org.sakaiproject.signup.logic.messages.SignupEventTrackingInfoImpl;
import org.sakaiproject.signup.model.SignupAttendee;
import org.sakaiproject.signup.model.SignupMeeting;
import org.sakaiproject.signup.model.SignupTimeslot;
import org.sakaiproject.signup.tool.util.Utilities;
import org.sakaiproject.tool.cover.ToolManager;
import org.springframework.dao.OptimisticLockingFailureException;

/**
 * <p>
 * This class will provide business logic for 'add-attendee' action by user.
 * </P>
 */
public class AddAttendee extends SignupAction {

	/**
	 * Constructor
	 *
	 * @param signupMeetingService
	 *            a SignupMeetingService object.
	 * @param currentUserId
	 *            an unique sakai internal user id.
	 * @param currentSiteId
	 *            an unique sakai site id.
	 */
	public AddAttendee(SignupMeetingService signupMeetingService, String currentUserId, String currentSiteId,
			boolean isOrganizer) {
		super(currentUserId, currentSiteId, signupMeetingService, isOrganizer);
	}

	/**
	 * This method perform signup process for adding user into the
	 * event/meeting.
	 *
	 * @param meeting
	 *            a SignupMeeting object.
	 * @param currentTimeslot
	 *            a SignupTimeslot object.
	 * @param newAttendee
	 *            a SignupAttendee object.
	 * @return a SignupMeeting object, which is a refreshed updat-to-date data.
	 * @throws Exception
	 *             throw if anything goes wrong.
	 */
	public SignupMeeting signup(SignupMeeting meeting, SignupTimeslot currentTimeslot, SignupAttendee newAttendee)
			throws Exception {
		boolean hasException = false;
		try {
			handleVersion(meeting, currentTimeslot, newAttendee);
			/* check if it comes from RESTful case */
			if (ToolManager.getCurrentPlacement() != null) {
				String signupEventType = isOrganizer ? SignupEventTypes.EVENT_SIGNUP_ADD_ATTENDEE_L
						: SignupEventTypes.EVENT_SIGNUP_ADD_ATTENDEE_S;
				Utilities.postEventTracking(signupEventType, ToolManager.getCurrentPlacement().getContext()
						+ " meetingId:" + meeting.getId()
						+ this.signupEventTrackingInfo.getAllAttendeeTransferLogInfo());
			}
			logger.debug("Meeting Name:" + meeting.getTitle() + " - UserId:" + userId
					+ this.signupEventTrackingInfo.getAllAttendeeTransferLogInfo());
		} catch (PermissionException pe) {
			hasException = false;
			throw new SignupUserActionException(Utilities.rb.getString("no.permissoin.do_it"));
		} finally {
			meeting = reloadMeeting(meeting.getId());
			if(!hasException){
				//modify calendar for the attendee numbers update
				try {
					signupMeetingService.modifyCalendar(meeting);
				} catch (Exception e) {
					//do nothing
				}
			}
		}

		return meeting;
	}

	/**
	 * Check if the pre-condition is still satisfied for continuing the update
	 * process after retrieving the up-to-dated data. This process is a
	 * concurrency process.
	 *
	 * @param meeting
	 *            a SignupMeeting object.
	 * @param currentTimeslot
	 *            a SignupTimeslot object.
	 * @param newAttendee
	 *            a SignupAttendee object.
	 * @throws Exception
	 *             throw if anything goes wrong.
	 */
	public void actionsForOptimisticVersioning(SignupMeeting meeting, SignupTimeslot currentTimeslot,
			SignupAttendee newAttendee) throws Exception {
		// reset it again
		this.signupEventTrackingInfo = new SignupEventTrackingInfoImpl();
		this.signupEventTrackingInfo.setMeeting(meeting);

		/*
		 * Instructor or TF can add anyone in regardless of limitation of Max#
		 * attendees or lock status in the timeslot
		 */
		if (!meeting.getPermission().isUpdate()) {
			checkTimeSlotStillAvailable(meeting, currentTimeslot);
			checkForPromotion(meeting, newAttendee);// whether someone else
			// promoted this newAttendee
		}

		addAttendeeToTimeSlot(meeting, currentTimeslot, newAttendee);
		removeNewAttendeeFromWaitingList(meeting, newAttendee);

	}

	/**
	 * Give it a number of tries to update the event/meeting object into DB
	 * storage if this still satisfy the pre-condition regardless some changes
	 * in DB storage
	 *
	 * @param meeting
	 *            a SignupMeeting object.
	 * @param currentTimeslot
	 *            a SignupTimeslot object.
	 * @param currentAttendee
	 *            a SignupAttendee object.
	 * @return a SignupMeeting object, which is a refreshed updat-to-date data.
	 * @throws Exception
	 *             throw if anything goes wrong.
	 */
	private SignupMeeting handleVersion(SignupMeeting meeting, SignupTimeslot currentTimeslot,
			SignupAttendee currentAttendee) throws Exception {
		for (int i = 0; i < MAX_NUMBER_OF_RETRY; i++) {
			try {
				meeting = signupMeetingService.loadSignupMeeting(meeting.getId(), userId, siteId);
				actionsForOptimisticVersioning(meeting, currentTimeslot, currentAttendee);
				signupMeetingService.updateSignupMeeting(meeting, isOrganizer);
				return meeting;
			} catch (OptimisticLockingFailureException oe) {
				// don't do any thing
			}
		}
		throw new SignupUserActionException(Utilities.rb.getString("someone.already.updated.db"));
	}

	private void checkTimeSlotStillAvailable(SignupMeeting meeting, SignupTimeslot currentTimeslot) throws Exception {
		List<SignupTimeslot> signupTimeSlots = meeting.getSignupTimeSlots();
		Long changedTimeslotId = currentTimeslot.getId();
		//check if sign-up deadline is hit
		if((new Date()).after(meeting.getSignupDeadline())){
			throw new SignupUserActionException(Utilities.rb.getString("event.signup.deadline.passed"));
		}

		for (SignupTimeslot upTodateTimeslot : signupTimeSlots) {
			if (upTodateTimeslot.getId().equals(changedTimeslotId)) {
				if (upTodateTimeslot.isCanceled())
					throw new SignupUserActionException(Utilities.rb.getString("timeslot.just.canceled"));

				if (upTodateTimeslot.isLocked())
					throw new SignupUserActionException(Utilities.rb.getString("timeslot.just.locked"));

				if (!upTodateTimeslot.isAvailable())
					throw new SignupUserActionException(Utilities.rb.getString("someone.already.taken.theTimeslot"));
			}
		}
	}

	/**
	 * This check required only if version exception is thrown during add signup
	 * to ensure that no one else promoted the current user
	 */
	private void checkForPromotion(SignupMeeting meeting, SignupAttendee newAttendee) throws Exception {
		String attendeeUserId = newAttendee.getAttendeeUserId();
		List<SignupTimeslot> signupTimeSlots = meeting.getSignupTimeSlots();
		int totalSignupSlots=0;
		for (SignupTimeslot timeslot : signupTimeSlots) {
			List<SignupAttendee> attendees = timeslot.getAttendees();
			for (SignupAttendee attendee : attendees) {
				if (attendee.getAttendeeUserId().equals(attendeeUserId)){
					totalSignupSlots++;
				}
			}
		}
		int preferredSlot = meeting.getMaxNumOfSlots().intValue();
		if (totalSignupSlots >=preferredSlot){
			throw new SignupUserActionException(Utilities.rb.getString("you.promoted.to.another.ts_meanwhile"));
		}
	}

	private SignupMeeting reloadMeeting(Long meetingId) {
		SignupMeeting m = signupMeetingService.loadSignupMeeting(meetingId, userId, siteId);
		return m;
	}

	private void addAttendeeToTimeSlot(SignupMeeting meeting, SignupTimeslot selectedTimeSlot,
			SignupAttendee newAttendee) throws Exception {
		List<SignupTimeslot> signupTimeSlots = meeting.getSignupTimeSlots();
		for (SignupTimeslot upTodateTimeslot : signupTimeSlots) {
			if (selectedTimeSlot.getId().equals(upTodateTimeslot.getId())) {
				List<SignupAttendee> attendees = upTodateTimeslot.getAttendees();
				if (attendees != null && !attendees.isEmpty()) {
					for (SignupAttendee attendee : attendees) {
						if (attendee.getAttendeeUserId().equals(newAttendee.getAttendeeUserId()))
							throw new SignupUserActionException(Utilities.rb.getString("attendee.already.in.timeslot"));
					}
				}

				/* For organizer case and for attendee, it's already safeguarded */
				if (upTodateTimeslot.isCanceled())
					throw new SignupUserActionException(Utilities.rb.getString("timeslot.just.canceled"));

				upTodateTimeslot.getAttendees().add(newAttendee);
				signupEventTrackingInfo.addOrUpdateAttendeeAllocationInfo(newAttendee, upTodateTimeslot,
						SignupEmailFacade.SIGNUP_ATTENDEE_SIGNUP, true);
			}
		}
	}

	private void removeNewAttendeeFromWaitingList(SignupMeeting meeting, SignupAttendee newAttendee) {
		super.removeAttendeeFromWaitingList(meeting, newAttendee);
	}

}


text:
module BunnyExchanges
  VERSION = "0.2.0"
end


text:
@class TweetViewController;

@protocol TweetViewControllerDelegate
- (void)tweetViewControllerDone:(TweetViewController *)controller;
@end

@interface TweetViewController : UIViewController

@property (nonatomic) ACAccountStore *accountStore;
@property (weak, nonatomic) id <TweetViewControllerDelegate> delegate;

- (IBAction)done:(id)sender;
- (IBAction)tweetIt:(id)sender;
- (BOOL)userHasAccessToTwitter;

@end


text:
/* Hapy is a public domain software. See Hapy README file for the details. */

/* This program, a simple "interactive" calculator, illustrates some of
   the techniques common to parsing a stream of "messages". In this case,
   a message is an arithmetic expression. Compare with calc.cc */

#include <Hapy/Parser.h>
#include <Hapy/Rules.h>
#include <Hapy/IoStream.h>

#include <iterator>
#include <functional>

using namespace Hapy;

Rule rExpression;
Rule rNumber;
Rule rGrammar;

// extract top-level expressions (less magical version)
int intrpNumber(const Pree &num) {
	return atoi(num.image().c_str());
}

// calculate expression value
int intrpExpr(const Pree &expr) {
	// rExpression = rNumber | parens | sum
	const Pree &alt = expr[0];
	if (alt.rid() == rNumber.id()) // rNumber
		return intrpNumber(alt);
	else
	if (alt[0].image() == "(") // parens
		return intrpExpr(alt[1]);
	else // sum
		return intrpExpr(alt[0]) + intrpExpr(alt[2]);
}

// interpret and report a single top-level expression
void intrpTop(const Pree &expr) {
	const int value = intrpExpr(expr);
	cout << expr.image() << " = " << value << endl;
}

// supply parser with more input
void getData(Parser &parser) {
	if (!parser.sawDataEnd()) {
		char c;
		if (cin.get(c))
			parser.pushData(string(1, c));
		else
			parser.sawDataEnd(true);
	}
}

// interpret one expression; return true if we should continue
bool interpret(const Result &result) {
	if (result.statusCode == Result::scMatch) {
		intrpTop(result.pree.find(rExpression.id()));
		return true;
	}

	// if empty input did not parse, that is OK; just stop
	if (result.input.size() > 0)
		cerr << result.location() << ": syntax error" << endl;
	return false;
}

void interpretEach(Parser &parser) {
	do {
		parser.moveOn();
		if (parser.begin()) {
			while (parser.step())
				getData(parser);
		}
		parser.end();
	} while (interpret(parser.result()));
}

int main() {
	rGrammar = rExpression >> ';';
	rExpression =
		rNumber |
		'(' >> rExpression >> ')' |
		rExpression >> '+' >> rExpression;
	rNumber = +digit_r;

	rExpression.trim(*space_r);
	rNumber.verbatim(true);

	rGrammar.committed(true);
	rNumber.leaf(true);
	rNumber.committed(true);

	Parser parser;
	parser.grammar(rGrammar);

	cin.unsetf(std::ios::skipws);
	interpretEach(parser);

	return 0;
}