text:
#ifndef __UICHECKBOX_H__
#define __UICHECKBOX_H__

#include "ui/UIWidget.h"
#include "ui/GUIExport.h"

/**
 * @addtogroup ui
 * @{
 */
NS_CC_BEGIN
class Sprite;

namespace ui {

/**
 * Checkbox event type, there are two type here:
 * - selected state
 * - unselected state
 * @deprecated use `CheckBox::EventType` instead
 */
typedef enum
{
    CHECKBOX_STATE_EVENT_SELECTED,
    CHECKBOX_STATE_EVENT_UNSELECTED
}CheckBoxEventType;

/**
 * A callback which will be called after checkbox event happens.
 * @deprecated use `CheckBox::ccCheckBoxCallback` instead.
 */
typedef void (Ref::*SEL_SelectedStateEvent)(Ref*,CheckBoxEventType);
#define checkboxselectedeventselector(_SELECTOR) (SEL_SelectedStateEvent)(&_SELECTOR)

/**
 *  Checkbox is a specific type of two-states button that can be either checked or unchecked.
 *   @js NA
 *   @lua NA
 */
class CC_GUI_DLL CheckBox : public Widget
{

    DECLARE_CLASS_GUI_INFO

public:
    /**
     * CheckBox event type, currently only "selected" and "unselected" event are cared.
     */
    enum class EventType
    {
        SELECTED,
        UNSELECTED
    };

    /**
     * A callback which will be called after certain CheckBox event issue.
     * @see `CheckBox::EventType`
     */
    typedef std::function<void(Ref*,CheckBox::EventType)> ccCheckBoxCallback;

    /**
     * Default constructor.
     */
    CheckBox();

    /**
     * Default destructor.
     */
    virtual ~CheckBox();

    /**
     * Create and return a empty CheckBox instance pointer.
     */
    static CheckBox* create();

    /**
     * Create an checkbox with various images.
     *
     * @param backGround    backGround texture.
     * @param backGroundSelected    backGround selected state texture.
     * @param cross    cross texture.
     * @param frontCrossDisabled    cross dark state texture.
     * @param texType    @see `Widget::TextureResType`
     *
     * @return A CheckBox instance pointer.
     */
    static CheckBox* create(const std::string& backGround,
                            const std::string& backGroundSeleted,
                            const std::string& cross,
                            const std::string& backGroundDisabled,
                            const std::string& frontCrossDisabled,
                            TextureResType texType = TextureResType::LOCAL);

    /**
     * Another factory method to create a CheckBox instance.
     * This method uses less resource to create a CheckBox.
     * @param backGround The background image name in `std::string`.
     * @param cross The cross image name in `std::string`.
     * @param texType  The texture's resource type in `Widget::TextureResType`.
     * @return A CheckBox instance pointer
     */
    static CheckBox* create(const std::string& backGround,
                            const std::string& cross,
                            TextureResType texType = TextureResType::LOCAL);

    /**
     * Load all textures for initializing a checkbox.
     *
     * @param backGround    The background image name.
     * @param backGroundSelected    The background selected image name.
     * @param cross    The cross image name.
     * @param frontCrossDisabled    The front cross disabled state image name.
     * @param texType    @see `Widget::TextureResType`
     */
    void loadTextures(const std::string& backGround,
                      const std::string& backGroundSelected,
                      const std::string& cross,
                      const std::string& backGroundDisabled,
                      const std::string& frontCrossDisabled,
                      TextureResType texType = TextureResType::LOCAL);

    /**
     * Load background texture for checkbox.
     *
     * @param backGround   The background image name.
     * @param texType    @see `Widget::TextureResType`
     */
    void loadTextureBackGround(const std::string& backGround,TextureResType type = TextureResType::LOCAL);

    /**
     * Load background selected state texture for checkbox.
     *
     * @param backGroundSelected    The background selected state image name.
     * @param texType    @see `Widget::TextureResType`
     */
    void loadTextureBackGroundSelected(const std::string& backGroundSelected,TextureResType texType = TextureResType::LOCAL);

    /**
     * Load cross texture for checkbox.
     *
     * @param cross    The cross texture name.
     * @param texType    @see `Widget::TextureResType`
     */
    void loadTextureFrontCross(const std::string&,TextureResType texType = TextureResType::LOCAL);

    /**
     * Load background disabled state texture for checkbox.
     *
     * @param backGroundDisabled    The background disabled state texture name.
     *
     * @param texType    @see `Widget::TextureResType`
     */
    void loadTextureBackGroundDisabled(const std::string& backGroundDisabled,TextureResType texType = TextureResType::LOCAL);

    /**
     * Load frontcross disabled texture for checkbox.
     *
     * @param frontCrossDisabled    The front cross disabled state texture name.
     * @param texType    @see `Widget::TextureResType`
     */
    void loadTextureFrontCrossDisabled(const std::string& frontCrossDisabled,TextureResType texType = TextureResType::LOCAL);

    /**
     * Change Checkbox state to selected.
     *
     * @deprecated use `isSelected()` instead
     * @param selected   True means the Checkbox will be selected, false means unselected.
     */
    CC_DEPRECATED_ATTRIBUTE void setSelectedState(bool selected){this->setSelected(selected);}

    /**
     * Query whether the CheckBox is selected or not.
     *
     * @deprecated use `setSelected(bool)` instead.
     * @return selected    true that checkbox is selected, false otherwise.
     */
    CC_DEPRECATED_ATTRIBUTE bool getSelectedState()const{return this->isSelected();}

    /**
     * Query whether CheckBox is selected or not.
     *@return true means "selected", false otherwise.
     */
    bool isSelected()const;

    /**
     * Change CheckBox state.
     * Set to true will cause the CheckBox's state to "selected", false otherwise.
     *@param selected Set to true will change CheckBox to selected state, false otherwise.
     */
    void setSelected(bool selected);

    /**Add a callback function which would be called when checkbox is selected or unselected.
     *@deprecated use `addEventListener(const ccCheckBoxCallback&)` instead
     *@param target A pointer type in Ref*.
     *@param selector A member function pointer in SEL_SelectedStateEvent.
     */
    CC_DEPRECATED_ATTRIBUTE void addEventListenerCheckBox(Ref* target,SEL_SelectedStateEvent selector);

    /**
     *Add a callback function which would be called when checkbox is selected or unselected.
     *@param callback A std::function with type @see `ccCheckBoxCallback`
     */
    void addEventListener(const ccCheckBoxCallback& callback);

    //override functions
    virtual Size getVirtualRendererSize() const override;
    virtual Node* getVirtualRenderer() override;
    virtual std::string getDescription() const override;

    /** When user pressed the CheckBox, the button will zoom to a scale.
     * The final scale of the CheckBox  equals (CheckBox original scale + _zoomScale)
     * @since v3.3
     */
    void setZoomScale(float scale);
    /**
     * @brief Return a zoom scale
     * @return A zoom scale of Checkbox.
     * @since v3.3
     */
    float getZoomScale()const;

CC_CONSTRUCTOR_ACCESS:
    virtual bool init() override;
    virtual bool init(const std::string& backGround,
                      const std::string& backGroundSeleted,
                      const std::string& cross,
                      const std::string& backGroundDisabled,
                      const std::string& frontCrossDisabled,
                      TextureResType texType = TextureResType::LOCAL);

protected:
    virtual void initRenderer() override;
    virtual void onPressStateChangedToNormal() override;
    virtual void onPressStateChangedToPressed() override;
    virtual void onPressStateChangedToDisabled() override;

    void selectedEvent();
    void unSelectedEvent();

    virtual void releaseUpEvent() override;

    virtual void onSizeChanged() override;

    void backGroundTextureScaleChangedWithSize();
    void backGroundSelectedTextureScaleChangedWithSize();
    void frontCrossTextureScaleChangedWithSize();
    void backGroundDisabledTextureScaleChangedWithSize();
    void frontCrossDisabledTextureScaleChangedWithSize();

    virtual Widget* createCloneInstance() override;
    virtual void copySpecialProperties(Widget* model) override;
    virtual void adaptRenderers() override;
protected:
    Sprite* _backGroundBoxRenderer;
    Sprite* _backGroundSelectedBoxRenderer;
    Sprite* _frontCrossRenderer;
    Sprite* _backGroundBoxDisabledRenderer;
    Sprite* _frontCrossDisabledRenderer;
    bool _isSelected;
    //if you use the old event callback, it will retain the _checkBoxEventListener
    Ref*       _checkBoxEventListener;

#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
    SEL_SelectedStateEvent    _checkBoxEventSelector;
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (pop)
#endif

    ccCheckBoxCallback _checkBoxEventCallback;

    TextureResType _backGroundTexType;
    TextureResType _backGroundSelectedTexType;
    TextureResType _frontCrossTexType;
    TextureResType _backGroundDisabledTexType;
    TextureResType _frontCrossDisabledTexType;

    float _zoomScale;
    float _backgroundTextureScaleX;
    float _backgroundTextureScaleY;
    std::string _backGroundFileName;
    std::string _backGroundSelectedFileName;
    std::string _frontCrossFileName;
    std::string _backGroundDisabledFileName;
    std::string _frontCrossDisabledFileName;

    bool _backGroundBoxRendererAdaptDirty;
    bool _backGroundSelectedBoxRendererAdaptDirty;
    bool _frontCrossRendererAdaptDirty;
    bool _backGroundBoxDisabledRendererAdaptDirty;
    bool _frontCrossDisabledRendererAdaptDirty;
};

}

NS_CC_END
// end of ui group
/// @}

#endif /* defined(__CocoGUI__CheckBox__) */


text:
package org.zaproxy.addon.encoder;

import java.awt.Color;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.TitledBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.parosproxy.paros.Constant;
import org.parosproxy.paros.extension.OptionsChangedListener;
import org.parosproxy.paros.model.OptionsParam;
import org.parosproxy.paros.view.AbstractFrame;
import org.parosproxy.paros.view.View;
import org.zaproxy.addon.encoder.processors.EncodeDecodeProcessors;
import org.zaproxy.addon.encoder.processors.EncodeDecodeResult;
import org.zaproxy.zap.utils.DisplayUtils;
import org.zaproxy.zap.utils.FontUtils;
import org.zaproxy.zap.utils.ZapTextArea;

public class EncodeDecodeDialog extends AbstractFrame implements OptionsChangedListener {

    public static final String ENCODE_DECODE_FIELD = "EncodeDecodeInputField";
    public static final String ENCODE_DECODE_RESULTFIELD = "EncodeDecodeResultField";
    private static final long serialVersionUID = 1L;
    private static final Logger LOGGER = LogManager.getLogger(EncodeDecodeDialog.class);
    private final EncodeDecodeProcessors encodeDecodeProcessors;
    private JTabbedPane jTabbed = null;
    private JPanel jPanel = null;
    private javax.swing.JToolBar panelToolbar = null;
    private List<TabModel> tabs = new ArrayList<>();
    private ZapTextArea inputField = null;
    private JButton addTabButton;
    private JButton addOutputButton;
    private AddEncodeDecodeTabDialog addTabDialog;
    private AddEncodeDecodeOutputPanelDialog addOutputDialog;
    private JButton deleteSelectedTabButton;
    private int globalOutputPanelIndex;
    private JButton resetButton;

    public EncodeDecodeDialog(List<TabModel> tabModels) {
        super();
        encodeDecodeProcessors = new EncodeDecodeProcessors();
        init();
        setTabs(tabModels);

        addWindowListener(
                new WindowAdapter() {

                    @Override
                    public void windowClosing(WindowEvent e) {
                        saveSetting();
                    }

                    @Override
                    public void windowClosed(WindowEvent e) {
                        saveSetting();
                    }

                    @Override
                    public void windowIconified(WindowEvent e) {
                        saveSetting();
                    }
                });
    }

    public void setTabs(List<TabModel> tabModels) {
        getTabbedPane().removeAll();

        for (TabModel tabModel : tabModels) {
            List<OutputPanelModel> outputPanels = tabModel.getOutputPanels();
            tabModel.setOutputPanels(new ArrayList<>());
            addTab(tabModel, outputPanels);
        }

        updatePanelState();
        if (!tabs.isEmpty()) {
            getTabbedPane().setSelectedIndex(0);
        }
    }

    /**
     * Updates the state of the buttons and requests focus in the input field.
     *
     * <p>Should be called after adding or removing a tab.
     */
    private void updatePanelState() {
        boolean tabsPresent = !tabs.isEmpty();
        getDeleteSelectedTabButton().setEnabled(tabsPresent);
        getAddOutputButton().setEnabled(tabsPresent);

        getInputField().requestFocusInWindow();
    }

    private void resetTabs() {
        tabs = new ArrayList<>();

        List<TabModel> defaultTabModels = new ArrayList<>();
        try {
            defaultTabModels.addAll(EncoderConfig.loadDefaultConfig());
        } catch (ConfigurationException | IOException e) {
            LOGGER.warn("There was a problem loading the default encoder config.", e);
        }

        setTabs(defaultTabModels);

        try {
            EncoderConfig.saveConfig(tabs);
        } catch (ConfigurationException | IOException e) {
            LOGGER.warn("There was a problem saving the encoder config.", e);
        }
    }

    /** This method initializes this */
    private void init() {
        this.setAlwaysOnTop(false);
        this.setContentPane(getMainPanel());
        this.setTitle(Constant.messages.getString("encoder.dialog.title"));
    }

    private javax.swing.JToolBar getPanelToolbar() {
        if (panelToolbar == null) {

            panelToolbar = new javax.swing.JToolBar();
            panelToolbar.setLayout(new java.awt.GridBagLayout());
            panelToolbar.setEnabled(true);
            panelToolbar.setFloatable(false);
            panelToolbar.setRollover(true);
            panelToolbar.setPreferredSize(new java.awt.Dimension(800, 30));
            panelToolbar.setName("Encode Decode Toolbar");

            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridx = 0;
            gbc.gridy = 0;
            gbc.insets = new java.awt.Insets(0, 0, 0, 0);
            gbc.anchor = java.awt.GridBagConstraints.WEST;

            panelToolbar.add(getAddTabButton(), gbc);
            ++gbc.gridx;

            panelToolbar.add(getDeleteSelectedTabButton(), gbc);
            ++gbc.gridx;

            panelToolbar.add(getAddOutputButton(), gbc);
            ++gbc.gridx;

            panelToolbar.add(new JLabel(), gbc);
            ++gbc.gridx;

            gbc.weightx = 1.0;
            gbc.weighty = 1.0;
            gbc.anchor = java.awt.GridBagConstraints.EAST;
            panelToolbar.add(new JLabel(), gbc);
            ++gbc.gridx;
            panelToolbar.add(getResetButton(), gbc);
        }
        return panelToolbar;
    }

    private JButton getDeleteSelectedTabButton() {
        if (deleteSelectedTabButton == null) {
            deleteSelectedTabButton = new JButton();
            deleteSelectedTabButton.addActionListener(e -> deleteSelectedTab());
            deleteSelectedTabButton.setIcon(
                    new ImageIcon(
                            ExtensionEncoder.class.getResource(
                                    "/org/zaproxy/addon/encoder/resources/ui-tab--delete.png")));
            deleteSelectedTabButton.setToolTipText(
                    Constant.messages.getString("encoder.dialog.deletetab"));
            DisplayUtils.scaleIcon(deleteSelectedTabButton);
        }
        return deleteSelectedTabButton;
    }

    private JButton getResetButton() {
        if (resetButton == null) {
            resetButton =
                    new JButton(Constant.messages.getString("encoder.dialog.reset.button.title"));
            resetButton.addActionListener(
                    e -> {
                        int confirm =
                                View.getSingleton()
                                        .showConfirmDialog(
                                                this,
                                                Constant.messages.getString(
                                                        "encoder.dialog.reset.confirm"));
                        if (confirm == JOptionPane.OK_OPTION) {
                            resetTabs();
                        }
                    });
            resetButton.setToolTipText(
                    Constant.messages.getString("encoder.dialog.reset.button.tooltip"));
        }
        return resetButton;
    }

    private void deleteSelectedTab() {
        int selectedIndex = getTabbedPane().getSelectedIndex();
        if (selectedIndex != -1) {
            getTabbedPane().remove(selectedIndex);
            tabs.remove(selectedIndex);
            updatePanelState();
        }
    }

    private JButton getAddTabButton() {
        if (addTabButton == null) {
            addTabButton = new JButton();
            addTabButton.addActionListener(e -> addTab());
            addTabButton.setIcon(
                    new ImageIcon(
                            ExtensionEncoder.class.getResource(
                                    "/org/zaproxy/addon/encoder/resources/ui-tab--plus.png")));
            addTabButton.setToolTipText(Constant.messages.getString("encoder.dialog.addtab"));
            DisplayUtils.scaleIcon(addTabButton);
        }
        return addTabButton;
    }

    private int getIndex(TabModel tabModel) {
        return tabs.indexOf(tabModel);
    }

    private void addTab() {
        TabModel tabModel = showAddTabDialogue();
        if (tabModel != null) {
            addTab(tabModel, new ArrayList<>());
            SwingUtilities.invokeLater(() -> jPanel.repaint());
            updatePanelState();
        }
    }

    private void addTab(TabModel tabModel, List<OutputPanelModel> outputPanelModels) {
        if (tabModel.getOutputPanels().size() > 0) {
            throw new IllegalArgumentException("Can not add Tab with output panels");
        }

        tabs.add(tabModel);
        int tabIndex = getIndex(tabModel);

        final JPanel jPanel = new JPanel();
        jPanel.setLayout(new GridBagLayout());
        getTabbedPane()
                .insertTab(
                        createTabTitle(tabModel),
                        null,
                        jPanel,
                        null,
                        getTabbedPane().getTabCount());
        getTabbedPane().setSelectedIndex(tabIndex);

        for (OutputPanelModel outputPanel : outputPanelModels) {
            addOutputPanel(outputPanel, tabIndex);
        }
    }

    private String createTabTitle(TabModel tabModel) {
        if (tabModel.getName().startsWith(EncodeDecodeProcessors.PREDEFINED_PREFIX)) {
            return Constant.messages.getString(tabModel.getName());
        }
        return tabModel.getName();
    }

    public TabModel showAddTabDialogue() {
        if (addTabDialog == null) {
            addTabDialog = new AddEncodeDecodeTabDialog(this);
            addTabDialog.pack();
        }

        addTabDialog.setVisible(true);
        String name = addTabDialog.getTabName();
        addTabDialog.clearFields();

        if (name != null) {
            TabModel tabModel = new TabModel();
            tabModel.setName(name);
            return tabModel;
        }
        return null;
    }

    private JButton getAddOutputButton() {
        if (addOutputButton == null) {
            addOutputButton = new JButton();
            addOutputButton.addActionListener(e -> addOutputPanelToCurrentTab());
            addOutputButton.setIcon(
                    new ImageIcon(
                            ExtensionEncoder.class.getResource(
                                    "/org/zaproxy/addon/encoder/resources/ui-output--plus.png")));
            addOutputButton.setToolTipText(Constant.messages.getString("encoder.dialog.addoutput"));
            DisplayUtils.scaleIcon(addOutputButton);
        }
        return addOutputButton;
    }

    private void addOutputPanelToCurrentTab() {
        OutputPanelModel outputPanelModel = showAddOutputDialogue();
        if (outputPanelModel != null) {
            int tabIndex = getTabbedPane().getSelectedIndex();
            addOutputPanel(outputPanelModel, tabIndex);
            SwingUtilities.invokeLater(() -> jPanel.repaint());
        }
    }

    private void addOutputPanel(OutputPanelModel outputPanelModel, int tabIndex) {
        Component component = getTabbedPane().getComponentAt(tabIndex);
        if (component instanceof JPanel) {
            JPanel parentPanel = (JPanel) component;
            TabModel foundTab = getTabByIndex(tabIndex);
            foundTab.getOutputPanels().add(outputPanelModel);
            ZapTextArea outputField = newField(false);
            addField(parentPanel, outputField, createOutputPanelTitle(outputPanelModel));
            updateEncodeDecodeField(outputField, outputPanelModel);
        }
    }

    private String createOutputPanelTitle(OutputPanelModel outputPanelModel) {
        String processorId = outputPanelModel.getProcessorId();
        if (processorId.startsWith(EncodeDecodeProcessors.PREDEFINED_PREFIX)) {
            processorId = Constant.messages.getString(processorId);
        }

        if (outputPanelModel.getName().isEmpty()) {
            return processorId;
        }

        return outputPanelModel.getName() + " (" + processorId + ")";
    }

    private int getIndex(TabModel tabModel, OutputPanelModel outputPanelModel) {
        return tabModel.getOutputPanels().indexOf(outputPanelModel);
    }

    public void deleteOutputPanel(JTextComponent toDelete) {
        OutputPanelPosition outputPanelPos = findOutputPanel(toDelete);
        if (outputPanelPos == null) {
            LOGGER.warn("component for delete not found");
            return;
        }

        Component tab = getTabbedPane().getComponentAt(outputPanelPos.getTabIndex());
        if (tab instanceof JPanel) {
            JPanel parentPanel = (JPanel) tab;
            parentPanel.remove(outputPanelPos.getOutputPanelIndex());
            getTabByIndex(outputPanelPos.getTabIndex())
                    .getOutputPanels()
                    .remove(outputPanelPos.getOutputPanelIndex());
            SwingUtilities.invokeLater(() -> jPanel.repaint());
        }
    }

    private OutputPanelPosition findOutputPanel(JTextComponent searched) {
        for (int i = 0; i < getTabbedPane().getTabCount(); i++) {
            Component tab = getTabbedPane().getComponentAt(i);
            if (tab instanceof JPanel) {
                JPanel parentPanel = (JPanel) tab;
                for (int j = 0; j < parentPanel.getComponentCount(); j++) {
                    Component outputPanel = parentPanel.getComponent(j);
                    if (outputPanel.equals(searched.getParent().getParent())) {
                        return new OutputPanelPosition(i, j);
                    }
                }
            }
        }
        return null;
    }

    private TabModel getTabByIndex(int selectedTabIndex) {
        return tabs.get(selectedTabIndex);
    }

    public OutputPanelModel showAddOutputDialogue() {
        if (addOutputDialog == null) {
            addOutputDialog = new AddEncodeDecodeOutputPanelDialog(this, encodeDecodeProcessors);
            addOutputDialog.pack();
        }
        addOutputDialog.setVisible(true);
        String name = addOutputDialog.getOutputPanelName();
        String processorId = addOutputDialog.getProcessorId();

        addOutputDialog.clearFields();

        if (name != null) {
            OutputPanelModel outputPanelModel = new OutputPanelModel();
            outputPanelModel.setName(name);
            outputPanelModel.setProcessorId(processorId);
            return outputPanelModel;
        }
        return null;
    }

    private void addField(JPanel parent, JComponent c, String title) {
        final GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = globalOutputPanelIndex++;
        gbc.insets = new java.awt.Insets(1, 1, 1, 1);
        gbc.anchor = GridBagConstraints.NORTHWEST;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 0.5D;
        gbc.weighty = 0.5D;

        final JScrollPane jsp = new JScrollPane();
        jsp.setViewportView(c);
        jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jsp.setBorder(
                BorderFactory.createTitledBorder(
                        null,
                        title,
                        TitledBorder.DEFAULT_JUSTIFICATION,
                        TitledBorder.DEFAULT_POSITION,
                        FontUtils.getFont(FontUtils.Size.standard)));

        parent.add(jsp, gbc);
    }

    private JTabbedPane getTabbedPane() {
        if (jTabbed == null) {
            jTabbed = new JTabbedPane();
            jTabbed.setPreferredSize(new java.awt.Dimension(800, 500));
        }
        return jTabbed;
    }

    /**
     * This method initializes jPanel
     *
     * @return javax.swing.JPanel
     */
    private JPanel getMainPanel() {
        if (jPanel == null) {

            // jPanel is the outside one
            jPanel = new JPanel();
            jPanel.setPreferredSize(new java.awt.Dimension(800, 600));
            jPanel.setLayout(new GridBagLayout());

            final GridBagConstraints gbcScrollPanel = new GridBagConstraints();
            gbcScrollPanel.gridx = 0;
            gbcScrollPanel.gridy = 1;
            gbcScrollPanel.insets = new java.awt.Insets(1, 1, 1, 1);
            gbcScrollPanel.anchor = GridBagConstraints.NORTHWEST;
            gbcScrollPanel.fill = GridBagConstraints.BOTH;
            gbcScrollPanel.weightx = 1.0D;
            gbcScrollPanel.weighty = 0.25D;

            final GridBagConstraints gbcTabPanel = new GridBagConstraints();
            gbcTabPanel.gridx = 0;
            gbcTabPanel.gridy = 3;
            gbcTabPanel.insets = new java.awt.Insets(1, 1, 1, 1);
            gbcTabPanel.anchor = GridBagConstraints.NORTHWEST;
            gbcTabPanel.fill = GridBagConstraints.BOTH;
            gbcTabPanel.weightx = 1.0D;
            gbcTabPanel.weighty = 1.0D;

            final JScrollPane scrollPanelWithInputField = new JScrollPane();
            scrollPanelWithInputField.setViewportView(getInputField());
            scrollPanelWithInputField.setHorizontalScrollBarPolicy(
                    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            scrollPanelWithInputField.setBorder(
                    BorderFactory.createTitledBorder(
                            null,
                            Constant.messages.getString("encoder.dialog.field.input.label"),
                            TitledBorder.DEFAULT_JUSTIFICATION,
                            TitledBorder.DEFAULT_POSITION,
                            FontUtils.getFont(FontUtils.Size.standard)));

            final GridBagConstraints gbcToolbar = new GridBagConstraints();
            gbcToolbar.gridx = 0;
            gbcToolbar.gridy = 2;
            gbcToolbar.insets = new java.awt.Insets(1, 1, 1, 1);
            gbcToolbar.anchor = GridBagConstraints.NORTHWEST;
            gbcToolbar.fill = GridBagConstraints.BOTH;

            jPanel.add(scrollPanelWithInputField, gbcScrollPanel);
            jPanel.add(getPanelToolbar(), gbcToolbar);
            jPanel.add(getTabbedPane(), gbcTabPanel);
        }
        return jPanel;
    }

    private ZapTextArea newField(boolean editable) {
        final ZapTextArea field = new ZapTextArea();
        field.setLineWrap(true);
        field.setBorder(BorderFactory.createEtchedBorder());
        field.setEditable(editable);
        field.setName(ENCODE_DECODE_RESULTFIELD);

        field.addMouseListener(
                new java.awt.event.MouseAdapter() {
                    @Override
                    public void mousePressed(java.awt.event.MouseEvent e) {
                        if (SwingUtilities.isRightMouseButton(e)) {
                            View.getSingleton()
                                    .getPopupMenu()
                                    .show(e.getComponent(), e.getX(), e.getY());
                        }
                    }
                });

        return field;
    }

    private ZapTextArea getInputField() {
        if (inputField == null) {
            inputField = newField(true);
            inputField.setName(ENCODE_DECODE_FIELD);

            inputField
                    .getDocument()
                    .addDocumentListener(
                            new DocumentListener() {
                                @Override
                                public void insertUpdate(DocumentEvent documentEvent) {
                                    updateEncodeDecodeFields();
                                }

                                @Override
                                public void removeUpdate(DocumentEvent documentEvent) {
                                    updateEncodeDecodeFields();
                                }

                                @Override
                                public void changedUpdate(DocumentEvent documentEvent) {}
                            });

            inputField.addMouseListener(
                    new java.awt.event.MouseAdapter() {
                        @Override
                        public void mousePressed(java.awt.event.MouseEvent e) {
                            if (SwingUtilities.isRightMouseButton(e)) {
                                View.getSingleton()
                                        .getPopupMenu()
                                        .show(e.getComponent(), e.getX(), e.getY());
                            }
                        }
                    });
        }
        return inputField;
    }

    public void setInputField(String text) {
        this.getInputField().setText(text);
        this.updateEncodeDecodeFields();
    }

    private ZapTextArea findZapTextArea(OutputPanelPosition position) {
        Component currentTab = getTabbedPane().getComponentAt(position.getTabIndex());
        if (currentTab instanceof JPanel) {
            JPanel tabPanel = (JPanel) currentTab;
            Component component = tabPanel.getComponent(position.getOutputPanelIndex());
            if (component instanceof JScrollPane) {
                JScrollPane scrollPane = (JScrollPane) component;
                Component view = scrollPane.getViewport().getView();
                if (view instanceof ZapTextArea) {
                    return (ZapTextArea) view;
                }
            }
        }
        return null;
    }

    private void updateEncodeDecodeFields() {
        for (TabModel tab : tabs) {
            for (OutputPanelModel outputPanel : tab.getOutputPanels()) {
                ZapTextArea zapTextArea =
                        findZapTextArea(
                                new OutputPanelPosition(getIndex(tab), getIndex(tab, outputPanel)));
                if (zapTextArea != null) {
                    updateEncodeDecodeField(zapTextArea, outputPanel);
                }
            }
        }
    }

    private boolean updateEncodeDecodeField(ZapTextArea zapTextArea, OutputPanelModel outputPanel) {
        EncodeDecodeResult result;
        try {
            result =
                    encodeDecodeProcessors.process(
                            outputPanel.getProcessorId(), getInputField().getText());
        } catch (Exception e) {
            zapTextArea.setText(e.getMessage());
            zapTextArea.setBorder(BorderFactory.createLineBorder(Color.RED));
            zapTextArea.setEnabled(false);
            return false;
        }

        if (result == null) {
            zapTextArea.setText(
                    Constant.messages.getString("encoder.dialog.encodedecode.notfound"));
            zapTextArea.setBorder(BorderFactory.createLineBorder(Color.RED));
            zapTextArea.setEnabled(false);
            return false;
        }

        if (result.hasError()) {
            zapTextArea.setText(result.getResult());
            zapTextArea.setBorder(BorderFactory.createEmptyBorder());
            zapTextArea.setEnabled(false);
            return false;
        }

        zapTextArea.setText(result.getResult());
        zapTextArea.setBorder(BorderFactory.createEmptyBorder());
        zapTextArea.setEnabled(true);
        return true;
    }

    private void saveSetting() {
        try {
            EncoderConfig.saveConfig(tabs);
        } catch (Exception e) {
            LOGGER.error("Can not store Encoder Config", e);
        }
    }

    @Override
    public void optionsChanged(OptionsParam optionsParam) {
        updateEncodeDecodeFields();
    }

    private static class OutputPanelPosition {
        private int tabIndex;
        private int outputPanelIndex;

        public OutputPanelPosition(int tabIndex, int outputPanelIndex) {
            this.tabIndex = tabIndex;
            this.outputPanelIndex = outputPanelIndex;
        }

        public int getTabIndex() {
            return tabIndex;
        }

        public int getOutputPanelIndex() {
            return outputPanelIndex;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
layout: default
title: Smart Home Layout for Home Automation Vancouver
excerpt: Smart home automation from West Coast Audio Video Gallery in Vancouver makes your everyday life easier and stress free. Learn more by vising our website.
permalink: /demos/smart-home-layout
article: false
ticker: true

---

 div > .uk-panel'}" data-uk-grid-margin="">

Smart Home Layout

Total Home Technology streamlines and simplifies all the technology in your home, offering the ultimate lifestyle of comfort and convenience. Make your everyday lives easier and stress-free by integrating smart home automation into your West Vancouver, BC home today! Use the interactive demo system rendering below to hover over any system component to gather more information about it use within the home.

Home Control:

If your coffee table is littered with six remote controls - and you can't figure out which one turns the Blu-Ray player on - we've got your solution! Intelligent home control devices put an end to remote overload. With one reliable and user-friendly device, anyone in your family can operate the entertainment system, lights, thermostats, shades and more.

Motorized Shading and Drapery:

Windows are a key design element in any residence. However, achieving the greatest beauty and efficiency in each room means being able to control the light that surrounds us. Clients and designers have hundreds of window treatment fabric and color options available to compliment any décor.

Networking:

A network is a home's central nervous system. We'll help lay a solid and reliable foundation that's ready for today's technology and for tomorrow's. We will work with you to find a complete networking solution that satisfies all of your system needs.

Mobile Control:

Imagine using your mobile phone as a remote for your home automation system. A professional touchpanel user interface right on the popular smartphone enabling all kinds of customizable control capability. Control multiple locations, such as a primary residence, vacation home and office, from a single, intuitive graphical interface that provides real-time status of room temperature, shade position and lighting levels.

Lighting Control:

Light establishes a mood. It can make your home more appealing and it can also make your home safer and more efficient. Imagine having one lighting scene for dinnertime, and another for after-dinner drinks. Imagine also pushing one button and turning-off every light in the house whenever you leave. Whether you are building a new home or upgrading an existing system, we'll tailor a lighting solution to suit your needs.

Energy Management:

Effective green and sustainability efforts are much more complex than just harvesting daylight and dimming lighting levels. The only way to achieve meaningful reductions in energy usage and utility costs is for all of your home's systems to be completely integrated on a single, intelligent management platform. With real-time monitoring, it is possible to look at your processes and see where energy is being used efficiently - or inefficiently - through- out your entire home.

Security and Surveillance:

With cameras in and around your home, you can monitor activities whether you're in the house or halfway around the globe. We can route your security system through a central monitoring system, alerting you via email or text message of events that you set.

Home Theaters and Media Rooms:

Some of the most exhilarating surround sound rooms are not cinema rooms at all! They're Living Rooms, Family Rooms, Master Bedrooms and outdoor Patios that serve dual functions. In fact, almost any room in your home can be recreated into a multi-purpose media room, concealing a home theatre that only reveals itself at the touch of a button. We can engineer hidden screens and speakers that descend from ceilings, hide inside framed artwork, or rise from specially-designed furniture.

Entry Systems:

Our entry systems can be standalone or integrated into your phone system so that when someone rings the doorbell, your phone rings. You can pick up to speak to the visitor or press a button to open the gate. By adding video capability, you can see who's there. We can program your doorbell or phone to pause the music system so you never miss a ring, no matter how loud you like your music. Together, we can customize a solution to your specific needs.

Media Distribution:

Media distribution systems send content to any room in your home or office via a central processor. Control of your music playlists is simple and intuitive by means of a touch panel, keypad, handheld RF remote, iPad or similar wi-fi device. Whether the speakers are placed in the walls, ceiling, bookshelves, yard, shower or pool, each A/D system is uniquely designed to blend in with its surroundings in order to minimize the visual impact.

Centralized Distribution:

Centralized Distribution allows for complete control and connectivity for every room, every application and every budget. The power of total integration control and seamless connectivity all manifest from one centralized zone. System expansion is easy; every room and each device is simply another node on the network throughout the home.

Solar Panels:

Solar panels can be used as a component to a larger photovoltaic system to generate and supply electricity to residential applications throughout the home. Harness the true power of the sun for an eco-friendly home.

Security and Surveillance:

With cameras in and around your home, you can monitor activities whether you're in the house or halfway around the globe. We can route your security system through a central monitoring system, alerting you via email or text message of events that you set.


text:
package qub;

public interface FakeDefaultApplicationLauncherTests
{
    static void test(TestRunner runner)
    {
        runner.testGroup(FakeDefaultApplicationLauncher.class, () ->
        {
            DefaultApplicationLauncherTests.test(runner, (DesktopProcess process) ->
            {
                return FakeDefaultApplicationLauncher.create(process.getFileSystem());
            });

            runner.testGroup("openFileWithDefaultApplication(String)", () ->
            {
                runner.test("with file that exists", (Test test) ->
                {
                    try (final FakeDesktopProcess process = FakeDesktopProcess.create())
                    {
                        final Folder currentFolder = process.getCurrentFolder();
                        try (final TemporaryFile file = TemporaryFile.get(currentFolder.createFile("fake-file.txt").await()))
                        {
                            final FakeDefaultApplicationLauncher launcher = FakeDefaultApplicationLauncher.create(file.getFileSystem());
                            test.assertNull(launcher.openFileWithDefaultApplication(file).await());
                            test.assertEqual(
                                Iterable.create(
                                    file.getPath()),
                                launcher.getPathsOpened());
                        }
                    }
                });
            });

            runner.testGroup("openFolderWithDefaultApplication(String)", () ->
            {
                runner.test("with file that exists", (Test test) ->
                {
                    try (final FakeDesktopProcess process = FakeDesktopProcess.create())
                    {
                        final Folder currentFolder = process.getCurrentFolder();
                        try (final TemporaryFolder folder = TemporaryFolder.get(currentFolder.createFolder("fake-folder").await()))
                        {
                            final FakeDefaultApplicationLauncher launcher = FakeDefaultApplicationLauncher.create(folder.getFileSystem());
                            test.assertNull(launcher.openFolderWithDefaultApplication(folder).await());
                            test.assertEqual(
                                Iterable.create(
                                    folder.getPath()),
                                launcher.getPathsOpened());
                        }
                    }
                });
            });
        });
    }
}


text:
var debug = process.env.NODE_ENV === "production";
var webpack = require('webpack');

module.exports = {
    context: __dirname + '/src',
    devtool: debug ? "inline-sourcemap" : null,
    entry: "./js/bundle.js",
    module: {
        loaders: [{
            test: /\.js?$/,
            exclude: /(node_modules|bower_components)/,
            loader: 'babel-loader',
            query: {
                presets: ['react', 'es2015', 'stage-0'],
                plugins: ['react-html-attrs', 'transform-decorators-legacy', 'transform-class-properties'],
            }
        }]
    },
    output: {
        path: __dirname + '/dist/js/',
        filename: "bundle.min.js"
    },
    plugins: debug ? [] : [
        new webpack.optimize.DedupePlugin(),
        new webpack.optimize.OccurenceOrderPlugin(),
        new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
    ],
};


text:
// flow-typed signature: bf7eb42903dc0553aec6d4c3a6a8e8bb
// flow-typed version: <<STUB>>/loadable-components_v^2.2.2/flow_v0.76.0

/**
 * This is an autogenerated libdef stub for:
 *
 *   'loadable-components'
 *
 * Fill this stub out by replacing all the `any` types.
 *
 * Once filled out, we encourage you to share your work with the
 * community by sending a pull request to:
 * https://github.com/flowtype/flow-typed
 */

declare module 'loadable-components' {
  declare module.exports: any;
}

/**
 * We include stubs for each file inside this npm package in case you need to
 * require those files directly. Feel free to delete any files that aren't
 * needed.
 */
declare module 'loadable-components/babel' {
  declare module.exports: any;
}

declare module 'loadable-components/dist/loadable-components.babel.cjs' {
  declare module.exports: any;
}

declare module 'loadable-components/dist/loadable-components.cjs' {
  declare module.exports: any;
}

declare module 'loadable-components/dist/loadable-components.es' {
  declare module.exports: any;
}

declare module 'loadable-components/dist/loadable-components' {
  declare module.exports: any;
}

declare module 'loadable-components/dist/loadable-components.min' {
  declare module.exports: any;
}

declare module 'loadable-components/dist/loadable-components.server.cjs' {
  declare module.exports: any;
}

declare module 'loadable-components/server' {
  declare module.exports: any;
}

declare module 'loadable-components/src/babel' {
  declare module.exports: any;
}

declare module 'loadable-components/src/componentTracker' {
  declare module.exports: any;
}

declare module 'loadable-components/src/constants' {
  declare module.exports: any;
}

declare module 'loadable-components/src/getState' {
  declare module.exports: any;
}

declare module 'loadable-components/src/index' {
  declare module.exports: any;
}

declare module 'loadable-components/src/loadable' {
  declare module.exports: any;
}

declare module 'loadable-components/src/loadComponents' {
  declare module.exports: any;
}

declare module 'loadable-components/src/server/DeferredState' {
  declare module.exports: any;
}

declare module 'loadable-components/src/server/index' {
  declare module.exports: any;
}

declare module 'loadable-components/src/utils/resolveModuleDefault' {
  declare module.exports: any;
}

// Filename aliases
declare module 'loadable-components/babel.js' {
  declare module.exports: $Exports<'loadable-components/babel'>;
}
declare module 'loadable-components/dist/loadable-components.babel.cjs.js' {
  declare module.exports: $Exports<'loadable-components/dist/loadable-components.babel.cjs'>;
}
declare module 'loadable-components/dist/loadable-components.cjs.js' {
  declare module.exports: $Exports<'loadable-components/dist/loadable-components.cjs'>;
}
declare module 'loadable-components/dist/loadable-components.es.js' {
  declare module.exports: $Exports<'loadable-components/dist/loadable-components.es'>;
}
declare module 'loadable-components/dist/loadable-components.js' {
  declare module.exports: $Exports<'loadable-components/dist/loadable-components'>;
}
declare module 'loadable-components/dist/loadable-components.min.js' {
  declare module.exports: $Exports<'loadable-components/dist/loadable-components.min'>;
}
declare module 'loadable-components/dist/loadable-components.server.cjs.js' {
  declare module.exports: $Exports<'loadable-components/dist/loadable-components.server.cjs'>;
}
declare module 'loadable-components/server.js' {
  declare module.exports: $Exports<'loadable-components/server'>;
}
declare module 'loadable-components/src/babel.js' {
  declare module.exports: $Exports<'loadable-components/src/babel'>;
}
declare module 'loadable-components/src/componentTracker.js' {
  declare module.exports: $Exports<'loadable-components/src/componentTracker'>;
}
declare module 'loadable-components/src/constants.js' {
  declare module.exports: $Exports<'loadable-components/src/constants'>;
}
declare module 'loadable-components/src/getState.js' {
  declare module.exports: $Exports<'loadable-components/src/getState'>;
}
declare module 'loadable-components/src/index.js' {
  declare module.exports: $Exports<'loadable-components/src/index'>;
}
declare module 'loadable-components/src/loadable.js' {
  declare module.exports: $Exports<'loadable-components/src/loadable'>;
}
declare module 'loadable-components/src/loadComponents.js' {
  declare module.exports: $Exports<'loadable-components/src/loadComponents'>;
}
declare module 'loadable-components/src/server/DeferredState.js' {
  declare module.exports: $Exports<'loadable-components/src/server/DeferredState'>;
}
declare module 'loadable-components/src/server/index.js' {
  declare module.exports: $Exports<'loadable-components/src/server/index'>;
}
declare module 'loadable-components/src/utils/resolveModuleDefault.js' {
  declare module.exports: $Exports<'loadable-components/src/utils/resolveModuleDefault'>;
}


text:
module Aladin
  class Books < Array

    class << self
      attr_accessor :ttb_key, :per_page
      def configure
        yield self
      end

      def search(query, options={})
        set_query(query, options)
        res = Net::HTTP.get_response(uri)
        if res.is_a?(Net::HTTPSuccess)
          body = res.body.gsub(/;?/, "")
          hash = JSON.parse(body) rescue JSON.parse(body.gsub("'", '"'))

          Books.new(hash)
        end
      end

      private
        def uri
          @uri ||= URI.parse('http://www.aladin.co.kr/ttb/api/ItemSearch.aspx')
        end

        def default_params
          {
            :ttbkey => ttb_key,
            :QueryType => "Title",
            :SearchTarget => "Book",
            :output => "js"
          }
        end

        def set_query(query, options = {})
          options[:page] ||= 1
          options[:per_page] ||= per_page
          params = default_params.update(
            :Query => query,
            :start => 1 + (options[:page]-1)*options[:per_page],
            :MaxResults => options[:per_page]
          )

          uri.query = URI.encode_www_form(params)
        end
    end

    attr_accessor :total, :page, :per_page, :error_code, :error_msg

    def initialize(hash)
      if hash["errorCode"]
        set_error(hash)
      else
        set_page_info(hash)

        super hash["item"].map {|i| Book.new(i)}
      end
    end

    def error?
      @error_code.present?
    end

    private
      def set_error(hash)
        @error_code = hash["errorCode"]
        @error_msg = hash["errorMessage"]
      end

      def set_page_info(hash)
        @total = hash["totalResults"]
        @page = 1 + (hash["startIndex"]/hash["itemsPerPage"])
        @per_page = hash["itemsPerPage"]
      end

  end
end


text:
'use strict';

var gulp   = require('gulp');
var karma  = require('gulp-karma');
var config = require('../config');
var coveralls = require('gulp-coveralls');

gulp.task('unit', ['views'], function() {

  // Nonsensical source to fall back to files listed in karma.conf.js,
  // see https://github.com/lazd/gulp-karma/issues/9
  return gulp.src('./thisdoesntexist')
    .pipe(karma({
      configFile: config.test.karma,
      action: 'run'
    }))
      .on('end', function() {
        console.log("pushing to coveralls");
        gulp.src('coverage/**/lcov.info')
            .pipe(coveralls());
      })
    .on('error', function(err) {
      // Make sure failed tests cause gulp to exit non-zero
      throw err;
    })
});


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>Uses of Class org.foxlabs.validation.ValidationException (Validation Framework 1.1.2 API)</title>
<meta name="date" content="2020-03-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.foxlabs.validation.ValidationException

Packages that use ValidationException

Package
Description

org.foxlabs.validation.path

Uses of ValidationException in org.foxlabs.validation.path

Constructors in org.foxlabs.validation.path with parameters of type ValidationException

Constructor and Description

PathIterator(ValidationException violations,
            NodeFormatter formatter)

Constructs a new PathIterator with the specified violations
 hierarhy and path separator.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2011–2020 FoxLabs. All rights reserved.


text:
module Codex
  class Submit < Subcommand
    def initialize(opts, context)
      super
      @context.login
    end

    def print
      raise Exception.new("File not found/readable") unless File.readable?(@opts[:file])
      @opts[:lang] = guess_lang unless @opts[:lang_given]
      p = @context.get("/?groupId=#{@context.opts[:group]}&taskId=#{@context.opts[:task]}&module=groups%2Ftasks&page=newSubmit")
      f = p.forms[1]
      f.radiobuttons_with(:value => /file/).pop.check
      lang = f.radiobuttons_with(:value => @opts[:lang])
      raise Exception.new("Language #{@opts[:lang]} not allowed for this task") if lang.empty?
      lang.pop.check
      f.newSubmitForm_comment = @opts[:comment]
      f.file_upload.file_name = @opts[:file]
      res = @context.client.submit(f, f.buttons[0])
      raise Exception.new("Failure. Please enable debugging mode and retry") unless res.title =~ /Odevzdaná/
      return if @opts[:quick]
      #TODO - poll until results are really available
      Result.new({}, @context).print
    end

    private

    def guess_lang
      g = File.extname(@opts[:file]).sub '.', ''
      raise Exception.new("Unknown language: #{g}") unless Extensions.include? g
      g
    end

  end
end


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\models\PostComment;

/* @var $this yii\web\View */
/* @var $searchModel common\models\PostCommentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '评论';
$this->params['breadcrumbs'][] = $this->title;
?>

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

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

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

            'id',
            'post_id',
            'author',
            //'title',
            'content:ntext',

            'status',
            [
                'attribute' => 'status',
                'value' => function ($model, $key, $index, $column) {
                    return PostComment::itemAlias("status", $model->status);
                },
                'filter'=>PostComment::itemAlias("status"),
            ],
            'create_at',
            // 'update_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>


text:
define("appkit/tests/acceptance/component-test",
  [],
  function() {
    "use strict";
    var App;

    module('Acceptances - Component', {
      setup: function(){
        App = startApp();
      },
      teardown: function() {
        Ember.run(App, 'destroy');
      }
    });

    test('component output is rendered', function(){
      expect(2);

      visit('/component-test').then(function(){
        var list = find('.pretty-color');
        equal(list.length, 3);
        equal(list.first().text(), 'Pretty Color: purple\n');
      });
    });
  });


text:
<?php

namespace  App\CoreBundle\Libraries\Paginator;

/**
 * sfParameterHolder provides a base class for managing parameters.
 *
 * Parameters, in this case, are used to extend classes with additional data
 * that requires no additional logic to manage.
 *
 * @package symfony
 * @subpackage util
 * @author Fabien Potencier <fabien.potencier@symfony-project.com>
 * @author Sean Kerr <sean@code-box.org>
 * @version SVN: $Id: sfParameterHolder.class.php 23922 2009-11-14 14:58:38Z fabien $
 */
class sfParameterHolder implements \Serializable {

    protected $parameters = array();

    /**
     * The constructor for sfParameterHolder.
     */
    public function __construct() {

    }

    /**
     * Clears all parameters associated with this request.
     */
    public function clear() {
        $this->parameters = array();
    }

    /**
     * Retrieves a parameter.
     *
     * @param string $name A parameter name
     * @param mixed $default A default parameter value
     *
     * @return mixed A parameter value, if the parameter exists, otherwise null
     */
    public function & get($name, $default = null) {
        if (array_key_exists($name, $this->parameters)) {
            $value = & $this->parameters[$name];
        } else {
            $value = $default;
        }

        return $value;
    }

    /**
     * Retrieves an array of parameter names.
     *
     * @return array An indexed array of parameter names
     */
    public function getNames() {
        return array_keys($this->parameters);
    }

    /**
     * Retrieves an array of parameters.
     *
     * @return array An associative array of parameters
     */
    public function & getAll() {
        return $this->parameters;
    }

    /**
     * Indicates whether or not a parameter exists.
     *
     * @param string $name A parameter name
     *
     * @return bool true, if the parameter exists, otherwise false
     */
    public function has($name) {
        return array_key_exists($name, $this->parameters);
    }

    /**
     * Remove a parameter.
     *
     * @param string $name A parameter name
     * @param mixed $default A default parameter value
     *
     * @return string A parameter value, if the parameter was removed, otherwise null
     */
    public function remove($name, $default = null) {
        $retval = $default;

        if (array_key_exists($name, $this->parameters)) {
            $retval = $this->parameters[$name];
            unset($this->parameters[$name]);
        }

        return $retval;
    }

    /**
     * Sets a parameter.
     *
     * If a parameter with the name already exists the value will be overridden.
     *
     * @param string $name A parameter name
     * @param mixed $value A parameter value
     */
    public function set($name, $value) {
        $this->parameters[$name] = $value;
    }

    /**
     * Sets a parameter by reference.
     *
     * If a parameter with the name already exists the value will be overridden.
     *
     * @param string $name A parameter name
     * @param mixed $value A reference to a parameter value
     */
    public function setByRef($name, & $value) {
        $this->parameters[$name] = & $value;
    }

    /**
     * Sets an array of parameters.
     *
     * If an existing parameter name matches any of the keys in the supplied
     * array, the associated value will be overridden.
     *
     * @param array $parameters An associative array of parameters and their associated values
     */
    public function add($parameters) {
        if (null === $parameters) {
            return;
        }

        foreach ($parameters as $key => $value) {
            $this->parameters[$key] = $value;
        }
    }

    /**
     * Sets an array of parameters by reference.
     *
     * If an existing parameter name matches any of the keys in the supplied
     * array, the associated value will be overridden.
     *
     * @param array $parameters An associative array of parameters and references to their associated values
     */
    public function addByRef(& $parameters) {
        foreach ($parameters as $key => &$value) {
            $this->parameters[$key] = & $value;
        }
    }

    /**
     * Serializes the current instance.
     *
     * @return array Objects instance
     */
    public function serialize() {
        return serialize($this->parameters);
    }

    /**
     * Unserializes a sfParameterHolder instance.
     *
     * @param string $serialized A serialized sfParameterHolder instance
     */
    public function unserialize($serialized) {
        $this->parameters = unserialize($serialized);
    }

}


text:
package io.fabric8.forge.camel.commands.jolokia;

import javax.inject.Inject;

import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.input.UIInput;
import org.jboss.forge.addon.ui.metadata.UICommandMetadata;
import org.jboss.forge.addon.ui.metadata.WithAttributes;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;

public class EndpointListCommand extends AbstractJolokiaCommand {

    @Inject
    @WithAttributes(label = "name", required = true, description = "The name of the Camel context")
    private UIInput<String> name;

    @Inject
    @WithAttributes(label = "decode", required = false, defaultValue = "true", description = "Whether to decode the endpoint uri so its human readable")
    private UIInput<String> decode;

    @Inject
    @WithAttributes(label = "explain", required = false, defaultValue = "false", description = "Whether to explain the endpoint options")
    private UIInput<String> explain;

    @Inject
    @WithAttributes(label = "verbose", required = false, defaultValue = "false", description = "Verbose output")
    private UIInput<String> verbose;

    @Override
    public UICommandMetadata getMetadata(UIContext context) {
        return Metadata.forCommand(ConnectCommand.class).name(
                "camel-endpoint-list").category(Categories.create(CATEGORY))
                .description("List all endpoints available in a CamelContext");
    }

    @Override
    public void initializeUI(UIBuilder builder) throws Exception {
        name.setCompleter(new CamelContextCompleter(getController()));
        builder.add(name).add(decode).add(explain).add(verbose);
    }

    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        String url = getJolokiaUrl();
        if (url == null) {
            return Results.fail("Not connected to remote jolokia agent. Use camel-connect command first");
        }

        boolean val = "true".equals(decode.getValue());
        boolean val2 = "true".equals(verbose.getValue());
        boolean val3 = "true".equals(explain.getValue());

        org.apache.camel.commands.EndpointListCommand command = new org.apache.camel.commands.EndpointListCommand(name.getValue(), val, val2, val3);
        command.execute(getController(), getOutput(context), getError(context));

        return Results.success();
    }
}


text:
<?php
session_destroy();
echo "
You have successfully logged out.
";

?>


text:
/*
 * scope.cpp
 *
 *  Created on: Jun 16, 2019
 *      Author: iconmaster
 */

#include "ccl/scope.hpp"
#include "ccl/object.hpp"
#include "ccl/classes.hpp"

using namespace std;
using namespace ccl;

ccl::_Scope::_Scope() : input{_ClassNil::NIL}
{
}

ccl::_Scope::_Scope(Scope& parent) : parent{parent}, input{_ClassNil::NIL}
{
}

ccl::_Scope::_Scope(Scope& parent, Object& input) : parent{parent}, input{input}
{
}

ccl::_Scope::~_Scope() {}

std::optional<Object> ccl::_Scope::get(const std::string& name)
{
	return optional<Object>();
}

void ccl::_Scope::set(const std::string& name, Object value)
{
}

void ccl::_Scope::setLocal(const std::string& name, Object value)
{
}

bool ccl::_Scope::canSet(const std::string& name)
{
	return false;
}


text:
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;

namespace CSharpGL
{
    /// <summary>
    /// Supports shadow volume.
    /// </summary>
    [Editor(typeof(PropertyGridEditor), typeof(UITypeEditor))]
    public interface ISupportShadowVolume
    {
        /// <summary>
        /// Is shadow volume technique for this object and its children?
        /// </summary>
        TwoFlags EnableShadowVolume { get; set; }

        /// <summary>
        /// Add ambient color effect at last.
        /// </summary>
        /// <param name="arg"></param>
        void RenderAmbientColor(ShadowVolumeAmbientEventArgs arg);

        /// <summary>
        /// Is extruding shadow enabled for this object and its children?
        /// </summary>
        TwoFlags EnableExtrude { get; set; }

        /// <summary>
        /// Extrude shadow volume for stencil operation.
        /// </summary>
        /// <param name="arg"></param>
        void ExtrudeShadow(ShadowVolumeExtrudeEventArgs arg);

        /// <summary>
        /// Is extruding shadow enabled for this object and its children?
        /// </summary>
        TwoFlags EnableRenderUnderLight { get; set; }

        /// <summary>
        /// Render the node under the specified light.
        /// </summary>
        /// <param name="arg"></param>
        void RenderUnderLight(ShadowVolumeUnderLightEventArgs arg);

    }

    /// <summary>
    ///
    /// </summary>
    public class ShadowVolumeAmbientEventArgs : RenderEventArgs
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        /// <param name="camera"></param>
        /// <param name="ambient"></param>
        public ShadowVolumeAmbientEventArgs(ActionParams param, ICamera camera, vec3 ambient)
            : base(param, camera)
        {
            this.Ambient = ambient;
        }

        /// <summary>
        ///
        /// </summary>
        public vec3 Ambient { get; private set; }

    }

    /// <summary>
    ///
    /// </summary>
    public class ShadowVolumeExtrudeEventArgs : RenderEventArgs
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        /// <param name="camera"></param>
        /// <param name="light"></param>
        public ShadowVolumeExtrudeEventArgs(ActionParams param, ICamera camera, LightBase light)
            : base(param, camera)
        {
            this.Light = light;
        }

        /// <summary>
        ///
        /// </summary>
        public LightBase Light { get; set; }

    }

    /// <summary>
    /// </summary>
    public class ShadowVolumeUnderLightEventArgs : RenderEventArgs
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        /// <param name="camera"></param>
        /// <param name="light"></param>
        public ShadowVolumeUnderLightEventArgs(ActionParams param, ICamera camera, LightBase light)
            : base(param, camera)
        {
            this.Light = light;
        }

        /// <summary>
        ///
        /// </summary>
        public LightBase Light { get; set; }

    }
}


text:
package org.sbbs.demo.dao;

import java.util.List;

import org.junit.Assert;
import org.junit.Test;
import org.sbbs.base.dao.BaseDaoTestCase;
import org.sbbs.base.dao.GeneralDao;
import org.sbbs.base.dao.hibernate.CallReturn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;

public class GeneralDaoCallTest extends BaseDaoTestCase {
	@Autowired
	GeneralDao generalDao;

	@Test
	public void dummyTest() {
		Assert.assertTrue(true);
	}

	// @Test
	// @Rollback(false)
	public void testCommonCall() {
		Object[] args = { 10, 10 };

		CallReturn cr = this.generalDao.procedureCall("commonProcedure", args);
		// this.flush();
		Assert.assertTrue(cr.getReturnCode() == 0);
		Assert.assertTrue(cr.getReturnMessage().equals("20"));
	}

	// @Test
	// @Rollback(false)
	public void testQueryCall() {
		Object[] args = {};

		List list = this.generalDao.callQuery("queryProcedure", args);
		// this.flush();
		Assert.assertTrue(list.size() > 0);
		// Assert.assertTrue(cr.getReturnMessage().equals("20"));
	}

	// @Test
	public void testIHOSCall() {
		Object[] args = { "201307" };

		CallReturn cr = this.generalDao.procedureCall("sp_deptkeyCalc_1", args);

		System.out.println(cr.getReturnCode());
		System.out.println(cr.getReturnMessage());
		// Assert.assertTrue(cr.getReturnCode()==0);
		// Assert.assertTrue(cr.getReturnMessage().equals("20"));
	}

}


text:
tasks.us.ny package
===================

Subpackages
-----------

.. toctree::

    tasks.us.ny.nyc

Module contents
---------------

.. automodule:: tasks.us.ny
    :members:
    :undoc-members:
    :show-inheritance:


text:
package org.apache.hadoop.mapreduce.v2.app.job.impl;

import java.util.Map;

import org.junit.Assert;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.MRConfig;
import org.apache.hadoop.mapreduce.MRJobConfig;
import org.apache.hadoop.mapreduce.v2.api.records.JobState;
import org.apache.hadoop.mapreduce.v2.app.AppContext;
import org.apache.hadoop.mapreduce.v2.app.MRApp;
import org.apache.hadoop.mapreduce.v2.app.job.Job;
import org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncher;
import org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherEvent;
import org.apache.hadoop.mapreduce.v2.app.launcher.ContainerRemoteLaunchEvent;
import org.apache.hadoop.mapreduce.v2.util.MRApps;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
import org.junit.Test;

public class TestMapReduceChildJVM {

  private static final Log LOG = LogFactory.getLog(TestMapReduceChildJVM.class);

  @Test (timeout = 30000)
  public void testCommandLine() throws Exception {

    MyMRApp app = new MyMRApp(1, 0, true, this.getClass().getName(), true);
    Configuration conf = new Configuration();
    conf.setBoolean(MRConfig.MAPREDUCE_APP_SUBMISSION_CROSS_PLATFORM, true);
    Job job = app.submit(conf);
    app.waitForState(job, JobState.SUCCEEDED);
    app.verifyCompleted();

    Assert.assertEquals(
      "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" +
      " -Djava.net.preferIPv4Stack=true" +
      " -Dhadoop.metrics.log.level=WARN" +
      "  -Xmx200m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" +
      " -Dlog4j.configuration=container-log4j.properties" +
      " -Dyarn.app.container.log.dir=<LOG_DIR>" +
      " -Dyarn.app.container.log.filesize=0" +
      " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" +
      " org.apache.hadoop.mapred.YarnChild 127.0.0.1" +
      " 54321" +
      " attempt_0_0000_m_000000_0" +
      " 0" +
      " 1><LOG_DIR>/stdout" +
      " 2><LOG_DIR>/stderr ]", app.myCommandLine);

    Assert.assertTrue("HADOOP_ROOT_LOGGER not set for job",
      app.cmdEnvironment.containsKey("HADOOP_ROOT_LOGGER"));
    Assert.assertEquals("INFO,console",
      app.cmdEnvironment.get("HADOOP_ROOT_LOGGER"));
    Assert.assertTrue("HADOOP_CLIENT_OPTS not set for job",
      app.cmdEnvironment.containsKey("HADOOP_CLIENT_OPTS"));
    Assert.assertEquals("", app.cmdEnvironment.get("HADOOP_CLIENT_OPTS"));
  }

  @Test (timeout = 30000)
  public void testReduceCommandLineWithSeparateShuffle() throws Exception {
    final Configuration conf = new Configuration();
    conf.setBoolean(MRJobConfig.REDUCE_SEPARATE_SHUFFLE_LOG, true);
    testReduceCommandLine(conf);
  }

  @Test (timeout = 30000)
  public void testReduceCommandLineWithSeparateCRLAShuffle() throws Exception {
    final Configuration conf = new Configuration();
    conf.setBoolean(MRJobConfig.REDUCE_SEPARATE_SHUFFLE_LOG, true);
    conf.setLong(MRJobConfig.SHUFFLE_LOG_KB, 1L);
    conf.setInt(MRJobConfig.SHUFFLE_LOG_BACKUPS, 3);
    testReduceCommandLine(conf);
  }

  @Test (timeout = 30000)
  public void testReduceCommandLine() throws Exception {
    final Configuration conf = new Configuration();
    testReduceCommandLine(conf);
  }

  private void testReduceCommandLine(Configuration conf)
      throws Exception {

    MyMRApp app = new MyMRApp(0, 1, true, this.getClass().getName(), true);
    conf.setBoolean(MRConfig.MAPREDUCE_APP_SUBMISSION_CROSS_PLATFORM, true);
    Job job = app.submit(conf);
    app.waitForState(job, JobState.SUCCEEDED);
    app.verifyCompleted();

    final long shuffleLogSize =
        conf.getLong(MRJobConfig.SHUFFLE_LOG_KB, 0L) * 1024L;
    final int shuffleBackups = conf.getInt(MRJobConfig.SHUFFLE_LOG_BACKUPS, 0);
    final String appenderName = shuffleLogSize > 0L && shuffleBackups > 0
        ? "shuffleCRLA"
        : "shuffleCLA";

    Assert.assertEquals(
        "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" +
            " -Djava.net.preferIPv4Stack=true" +
            " -Dhadoop.metrics.log.level=WARN" +
            "  -Xmx200m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" +
            " -Dlog4j.configuration=container-log4j.properties" +
            " -Dyarn.app.container.log.dir=<LOG_DIR>" +
            " -Dyarn.app.container.log.filesize=0" +
            " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" +
            " -Dyarn.app.mapreduce.shuffle.logger=INFO," + appenderName +
            " -Dyarn.app.mapreduce.shuffle.logfile=syslog.shuffle" +
            " -Dyarn.app.mapreduce.shuffle.log.filesize=" + shuffleLogSize +
            " -Dyarn.app.mapreduce.shuffle.log.backups=" + shuffleBackups +
            " org.apache.hadoop.mapred.YarnChild 127.0.0.1" +
            " 54321" +
            " attempt_0_0000_r_000000_0" +
            " 0" +
            " 1><LOG_DIR>/stdout" +
            " 2><LOG_DIR>/stderr ]", app.myCommandLine);

    Assert.assertTrue("HADOOP_ROOT_LOGGER not set for job",
        app.cmdEnvironment.containsKey("HADOOP_ROOT_LOGGER"));
    Assert.assertEquals("INFO,console",
        app.cmdEnvironment.get("HADOOP_ROOT_LOGGER"));
    Assert.assertTrue("HADOOP_CLIENT_OPTS not set for job",
        app.cmdEnvironment.containsKey("HADOOP_CLIENT_OPTS"));
    Assert.assertEquals("", app.cmdEnvironment.get("HADOOP_CLIENT_OPTS"));
  }

  @Test (timeout = 30000)
  public void testCommandLineWithLog4JConifg() throws Exception {

    MyMRApp app = new MyMRApp(1, 0, true, this.getClass().getName(), true);
    Configuration conf = new Configuration();
    conf.setBoolean(MRConfig.MAPREDUCE_APP_SUBMISSION_CROSS_PLATFORM, true);
    String testLogPropertieFile = "test-log4j.properties";
    String testLogPropertiePath = "../"+"test-log4j.properties";
    conf.set(MRJobConfig.MAPREDUCE_JOB_LOG4J_PROPERTIES_FILE, testLogPropertiePath);
    Job job = app.submit(conf);
    app.waitForState(job, JobState.SUCCEEDED);
    app.verifyCompleted();

    Assert.assertEquals(
      "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" +
      " -Djava.net.preferIPv4Stack=true" +
      " -Dhadoop.metrics.log.level=WARN" +
      "  -Xmx200m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" +
      " -Dlog4j.configuration=" + testLogPropertieFile +
      " -Dyarn.app.container.log.dir=<LOG_DIR>" +
      " -Dyarn.app.container.log.filesize=0" +
      " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" +
      " org.apache.hadoop.mapred.YarnChild 127.0.0.1" +
      " 54321" +
      " attempt_0_0000_m_000000_0" +
      " 0" +
      " 1><LOG_DIR>/stdout" +
      " 2><LOG_DIR>/stderr ]", app.myCommandLine);
  }

  private static final class MyMRApp extends MRApp {

    private String myCommandLine;
    private Map<String, String> cmdEnvironment;

    public MyMRApp(int maps, int reduces, boolean autoComplete,
        String testName, boolean cleanOnStart) {
      super(maps, reduces, autoComplete, testName, cleanOnStart);
    }

    @Override
    protected ContainerLauncher createContainerLauncher(AppContext context) {
      return new MockContainerLauncher() {
        @Override
        public void handle(ContainerLauncherEvent event) {
          if (event.getType() == EventType.CONTAINER_REMOTE_LAUNCH) {
            ContainerRemoteLaunchEvent launchEvent = (ContainerRemoteLaunchEvent) event;
            ContainerLaunchContext launchContext =
                launchEvent.getContainerLaunchContext();
            String cmdString = launchContext.getCommands().toString();
            LOG.info("launchContext " + cmdString);
            myCommandLine = cmdString;
            cmdEnvironment = launchContext.getEnvironment();
          }
          super.handle(event);
        }
      };
    }
  }

  @Test
  public void testEnvironmentVariables() throws Exception {
    MyMRApp app = new MyMRApp(1, 0, true, this.getClass().getName(), true);
    Configuration conf = new Configuration();
    conf.set(JobConf.MAPRED_MAP_TASK_ENV, "HADOOP_CLIENT_OPTS=test");
    conf.setStrings(MRJobConfig.MAP_LOG_LEVEL, "WARN");
    conf.setBoolean(MRConfig.MAPREDUCE_APP_SUBMISSION_CROSS_PLATFORM, false);
    Job job = app.submit(conf);
    app.waitForState(job, JobState.SUCCEEDED);
    app.verifyCompleted();

    Assert.assertTrue("HADOOP_ROOT_LOGGER not set for job",
      app.cmdEnvironment.containsKey("HADOOP_ROOT_LOGGER"));
    Assert.assertEquals("WARN,console",
      app.cmdEnvironment.get("HADOOP_ROOT_LOGGER"));
    Assert.assertTrue("HADOOP_CLIENT_OPTS not set for job",
      app.cmdEnvironment.containsKey("HADOOP_CLIENT_OPTS"));
    Assert.assertEquals("test", app.cmdEnvironment.get("HADOOP_CLIENT_OPTS"));

    // Try one more.
    app = new MyMRApp(1, 0, true, this.getClass().getName(), true);
    conf = new Configuration();
    conf.set(JobConf.MAPRED_MAP_TASK_ENV, "HADOOP_ROOT_LOGGER=trace");
    job = app.submit(conf);
    app.waitForState(job, JobState.SUCCEEDED);
    app.verifyCompleted();

    Assert.assertTrue("HADOOP_ROOT_LOGGER not set for job",
      app.cmdEnvironment.containsKey("HADOOP_ROOT_LOGGER"));
    Assert.assertEquals("trace",
      app.cmdEnvironment.get("HADOOP_ROOT_LOGGER"));
  }
}


text:
tigertrace.queues package
=========================

Module contents
---------------

.. automodule:: tigertrace.queues
    :members:
    :undoc-members:
    :show-inheritance:


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace VoiceModel
{
    public class OneOf
    {
        //[XmlElement("item")]
        public List<Item> Items { get; set; }

        public OneOf()
        {
            Items = new List<Item>();
        }

        public OneOf(List<string> uterances)
        {
            Items = new List<Item>();
            foreach (string uterance in uterances)
                Items.Add(new Item(uterance));
        }

        public void AddItem(Item item)
        {
            Items.Add(item);
        }
    }
}


text:
package com.alium.nibo.autocompletesearchbar.animation;

import android.animation.Animator;
import android.annotation.TargetApi;
import android.graphics.Rect;
import android.os.Build;
import android.util.Property;
import android.view.View;

import java.lang.ref.WeakReference;

/**
 * @hide
 */
public interface CircularRevealAnimator {

    RevealRadius CLIP_RADIUS = new RevealRadius();

    /**
     * Listen when animation start/end/cancel
     * and setup view for it
     */
    void onRevealAnimationStart();
    void onRevealAnimationEnd();
    void onRevealAnimationCancel();

    /**
     * Used with animator to animate view clipping
     *
     * @param value clip radius
     */
    void setRevealRadius(float value);

    /**
     * Used with animator to animate view clipping
     *
     * @return current radius
     */
    float getRevealRadius();

    /**
     * Invalidate certain rectangle
     *
     * @param bounds bounds to redraw
     * @see View#invalidate(Rect)
     */
    void invalidate(Rect bounds);

    /**
     * {@link ViewAnimationUtilties#createCircularReveal(View, int, int, float, float)} is
     * called it creates new {@link CircularRevealAnimator.RevealInfo}
     * and attaches to parent, here is necessary data about animation
     *
     * @param info reveal information
     *
     * @see CircularRevealAnimator.RevealInfo
     */
    void attachRevealInfo(RevealInfo info);

    /**
     * Returns new {@link BaseSupportAnimator} that plays
     * reversed animation of current one
     *
     * This method might be temporary, you should call
     * {@link BaseSupportAnimator#reverse()} instead
     *
     * @hide
     * @return reverse {@link BaseSupportAnimator}
     *
     * @see BaseSupportAnimator#reverse()
     */
    BaseSupportAnimator startReverseAnimation();

    class RevealInfo{
        public final int centerX;
        public final int centerY;
        public final float startRadius;
        public final float endRadius;
        public final WeakReference<View> target;

        public RevealInfo(int centerX, int centerY, float startRadius, float endRadius,
                          WeakReference<View> target) {
            this.centerX = centerX;
            this.centerY = centerY;
            this.startRadius = startRadius;
            this.endRadius = endRadius;
            this.target = target;
        }

        public View getTarget(){
            return target.get();
        }

        public boolean hasTarget(){
            return getTarget() != null;
        }
    }

    class RevealFinishedGingerbread extends ViewAnimationUtilties.SimpleAnimationListener {
        WeakReference<CircularRevealAnimator> mReference;

        RevealFinishedGingerbread(CircularRevealAnimator target) {
            mReference = new WeakReference<>(target);
        }

        @Override
        public void onAnimationStart(Animator animation) {
            CircularRevealAnimator target = mReference.get();
            target.onRevealAnimationStart();
        }

        @Override
        public void onAnimationCancel(Animator animation) {
            CircularRevealAnimator target = mReference.get();
            target.onRevealAnimationCancel();
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            CircularRevealAnimator target = mReference.get();
            target.onRevealAnimationEnd();
        }
    }

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    class RevealFinishedIceCreamSandwich extends RevealFinishedGingerbread {
        int mFeaturedLayerType;
        int mLayerType;

        RevealFinishedIceCreamSandwich(CircularRevealAnimator target) {
            super(target);

            mLayerType = ((View) target).getLayerType();
            mFeaturedLayerType = View.LAYER_TYPE_SOFTWARE;
        }

        @Override
        public void onAnimationCancel(Animator animation) {
            ((View) mReference.get()).setLayerType(mLayerType, null);
            super.onAnimationEnd(animation);
        }

        @Override
        public void onAnimationStart(Animator animation) {
            ((View) mReference.get()).setLayerType(mFeaturedLayerType, null);
            super.onAnimationStart(animation);
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            ((View) mReference.get()).setLayerType(mLayerType, null);
            super.onAnimationEnd(animation);
        }
    }

    class RevealFinishedJellyBeanMr2 extends RevealFinishedIceCreamSandwich {

        @TargetApi(Build.VERSION_CODES.HONEYCOMB)
        RevealFinishedJellyBeanMr2(CircularRevealAnimator target) {
            super(target);

            mFeaturedLayerType = View.LAYER_TYPE_HARDWARE;
        }
    }

    class RevealRadius extends Property<CircularRevealAnimator, Float> {

        public RevealRadius() {
            super(Float.TYPE, "revealRadius");
        }

        @Override
        public void set(CircularRevealAnimator object, Float value) {
            object.setRevealRadius(value);
        }

        @Override
        public Float get(CircularRevealAnimator object) {
            return object.getRevealRadius();
        }
    }
}


text:
var searchData=
[
  ['hotshotfunccoverage',['HotShotFuncCoverage',['../classsrc_1_1util_1_1profilehooks_1_1_hot_shot_func_coverage.html',1,'src::util::profilehooks']]],
  ['hotshotfuncprofile',['HotShotFuncProfile',['../classsrc_1_1util_1_1profilehooks_1_1_hot_shot_func_profile.html',1,'src::util::profilehooks']]]
];


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit2e15b21f2e35ee052987ef80c34a7d58::getLoader();


text:
module Pos.Util.Log.LoggerName
       ( LoggerName
       , HasLoggerName'(..)
       , askLoggerNameDefault
       , modifyLoggerNameDefault
       ) where

import           Universum

type LoggerName = Text

class HasLoggerName' ctx where
    loggerName :: Lens' ctx LoggerName

askLoggerNameDefault
    :: (MonadReader ctx m, HasLoggerName' ctx)
    => m LoggerName
askLoggerNameDefault = view loggerName

modifyLoggerNameDefault
    :: (MonadReader ctx m, HasLoggerName' ctx)
    => (LoggerName -> LoggerName)
    -> m a
    -> m a
modifyLoggerNameDefault f = local (loggerName %~ f)


text:
package com.amazonaws.services.mediaconvert.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * Ignore this setting unless your input captions format is SCC. To have the service compensate for differing frame
 * rates between your input captions and input video, specify the frame rate of the captions file. Specify this value as
 * a fraction. When you work directly in your JSON job specification, use the settings framerateNumerator and
 * framerateDenominator. For example, you might specify 24 / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976
 * fps, or 30000 / 1001 for 29.97 fps.
 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CaptionSourceFramerate implements Serializable, Cloneable, StructuredPojo {

    /**
     * Specify the denominator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator (framerateNumerator).
     */
    private Integer framerateDenominator;
    /**
     * Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator (framerateDenominator).
     */
    private Integer framerateNumerator;

    /**
     * Specify the denominator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator (framerateNumerator).
     *
     * @param framerateDenominator
     *        Specify the denominator of the fraction that represents the frame rate for the setting Caption source
     *        frame rate (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator
     *        (framerateNumerator).
     */

    public void setFramerateDenominator(Integer framerateDenominator) {
        this.framerateDenominator = framerateDenominator;
    }

    /**
     * Specify the denominator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator (framerateNumerator).
     *
     * @return Specify the denominator of the fraction that represents the frame rate for the setting Caption source
     *         frame rate (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator
     *         (framerateNumerator).
     */

    public Integer getFramerateDenominator() {
        return this.framerateDenominator;
    }

    /**
     * Specify the denominator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator (framerateNumerator).
     *
     * @param framerateDenominator
     *        Specify the denominator of the fraction that represents the frame rate for the setting Caption source
     *        frame rate (CaptionSourceFramerate). Use this setting along with the setting Framerate numerator
     *        (framerateNumerator).
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CaptionSourceFramerate withFramerateDenominator(Integer framerateDenominator) {
        setFramerateDenominator(framerateDenominator);
        return this;
    }

    /**
     * Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator (framerateDenominator).
     *
     * @param framerateNumerator
     *        Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame
     *        rate (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator
     *        (framerateDenominator).
     */

    public void setFramerateNumerator(Integer framerateNumerator) {
        this.framerateNumerator = framerateNumerator;
    }

    /**
     * Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator (framerateDenominator).
     *
     * @return Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame
     *         rate (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator
     *         (framerateDenominator).
     */

    public Integer getFramerateNumerator() {
        return this.framerateNumerator;
    }

    /**
     * Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame rate
     * (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator (framerateDenominator).
     *
     * @param framerateNumerator
     *        Specify the numerator of the fraction that represents the frame rate for the setting Caption source frame
     *        rate (CaptionSourceFramerate). Use this setting along with the setting Framerate denominator
     *        (framerateDenominator).
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CaptionSourceFramerate withFramerateNumerator(Integer framerateNumerator) {
        setFramerateNumerator(framerateNumerator);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getFramerateDenominator() != null)
            sb.append("FramerateDenominator: ").append(getFramerateDenominator()).append(",");
        if (getFramerateNumerator() != null)
            sb.append("FramerateNumerator: ").append(getFramerateNumerator());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CaptionSourceFramerate == false)
            return false;
        CaptionSourceFramerate other = (CaptionSourceFramerate) obj;
        if (other.getFramerateDenominator() == null ^ this.getFramerateDenominator() == null)
            return false;
        if (other.getFramerateDenominator() != null && other.getFramerateDenominator().equals(this.getFramerateDenominator()) == false)
            return false;
        if (other.getFramerateNumerator() == null ^ this.getFramerateNumerator() == null)
            return false;
        if (other.getFramerateNumerator() != null && other.getFramerateNumerator().equals(this.getFramerateNumerator()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getFramerateDenominator() == null) ? 0 : getFramerateDenominator().hashCode());
        hashCode = prime * hashCode + ((getFramerateNumerator() == null) ? 0 : getFramerateNumerator().hashCode());
        return hashCode;
    }

    @Override
    public CaptionSourceFramerate clone() {
        try {
            return (CaptionSourceFramerate) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.mediaconvert.model.transform.CaptionSourceFramerateMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:project="http://www.example.com/schema/projectwithxsdinphar"
    xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
                        http://www.example.com/schema/projectwithxsdinphar http://www.example.com/schema/projectwithxsdinphar/project-1.0.xsd">

    <project:bar bar="foo" />

</container>


text:
<?php

/**
 * Generated by PHPUnit_SkeletonGenerator on 2013-07-30 at 19:05:22.
 */
class Mageflow_Connect_Model_Api2_Help_Rest_Admin_V1Test extends PHPUnit_Framework_TestCase
{

    /**
     * @var Mageflow_Connect_Model_Api2_Help_Rest_Admin_V1
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new Mageflow_Connect_Model_Api2_Help_Rest_Admin_V1;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {

    }

    /**
     * @covers Mageflow_Connect_Model_Api2_Help_Rest_Admin_V1::_retrieve
     * @todo   Implement test_retrieve().
     */
    public function test_retrieve()
    {
        $this->object->_retrieve();
    }

}


text:
Sponsorship
=============

Sponsorship currently provides no blocks, actions, or other integration with other plugins.


text:
Write-Output "Running tests..."

$commonTestPath="$PSScriptRoot\..\CloudStorage\test"
$dotnetPath="$PSScriptRoot\Tools\dotnet.exe"

dir "$commonTestPath" | % { &"$dotnetPath" test "$commonTestPath\$_\$_.csproj" }

Write-Output "Tests done."


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Helpful.BDD;
using Helpful.CircuitBreaker;
using Helpful.CircuitBreaker.Config;
using Helpful.CircuitBreaker.Exceptions;
using NUnit.Framework;

namespace when_executing_async_code_via_the_breaker.when_tolerating_open_events
{
    class when_receiving_blacklisted_exceptions_within_tolerance : TestBase
    {
        private CircuitBreakerConfig _config;
        private CircuitBreaker _circuitBreaker;
        private List<Exception> _caughtExceptions;
        private ArgumentNullException _thrownException;
        private int _toleratedOpenEventCount;

        protected override void Given()
        {
            base.Given();
            _caughtExceptions = new List<Exception>();
            _config = new CircuitBreakerConfig
            {
                ExpectedExceptionListType = ExceptionListType.BlackList,
                OpenEventTolerance = 2
            };
            _config.ExpectedExceptionList.Add(typeof(ArgumentNullException));
            _circuitBreaker = new CircuitBreaker(_config);
            _circuitBreaker.ToleratedOpenCircuitBreaker += (sender, args) => _toleratedOpenEventCount++;
            _thrownException = new ArgumentNullException();
        }

        protected override void When()
        {
            CallExecuteAsync();
            CallExecuteAsync();
        }

        private void CallExecuteAsync()
        {
            Task.Run(async () =>
            {
                try
                {
                    Func<Task> action = async () =>
                    {
                        await Task.Yield();
                        throw _thrownException;
                    };

                    await _circuitBreaker.ExecuteAsync(action);
                }
                catch (Exception e)
                {
                    _caughtExceptions.Add(e);
                }
            }).Wait();
        }

        [Then]
        public void an_exception_should_be_thrown_for_each_call()
        {
            Assert.That(_caughtExceptions.Count, Is.EqualTo(2));
        }

        [Then]
        public void no_exceptions_should_be_breaker_open_exceptions()
        {
            Assert.That(_caughtExceptions, Has.No.TypeOf<CircuitBreakerOpenException>());
        }

        [Then]
        public void the_caught_exceptions_should_be_execution_error_exceptions()
        {
            Assert.That(_caughtExceptions, Has.No.TypeOf<CircuitBreakerExecutionErrorException>());
        }

        [Then]
        public void the_breaker_should_remain_closed()
        {
            Assert.That(_circuitBreaker.State, Is.EqualTo(BreakerState.Closed));
        }

        [Then]
        public void two_tolerated_open_events_should_be_raised()
        {
            Assert.That(_toleratedOpenEventCount, Is.EqualTo(2));
        }
    }
}


text:
package ru.job4j.loop;

import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Test.
 * @author Aleksey Sidorenko (mailto:sidorenko.aleksey@gmail.com)
 * @since 23.10.2017
 */
public class CounterTest {
    /**
     * Test add.
     */
    @Test
    public void whenSumEvenNumbersFromOneToTenThenThirty() {
        Counter counter = new Counter();
        int result = counter.add(1, 10);
        int expected = 30;
        assertThat(result, is(expected));
    }
}