text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var _distIndexJs = require('./dist/index.js');

var _distIndexJs2 = _interopRequireDefault(_distIndexJs);

if (navigator.requestMIDIAccess) {
	navigator.requestMIDIAccess().then(onMIDIInit, onMIDIReject);
} else {
	console.error("DOH! No MIDI support present in your browser.");
}

function onMIDIInit(midi) {
	// midi.inputs
	// midi.onstatechange
	// midi.outputs
	// midi.sysexEnabled
	console.log("Successfully Initialized MIDI");
	var foundString = "Found " + midi.inputs.size + " inputs and " + midi.outputs.size + " outputs.";
	console.log(foundString);
	console.log("Sysex is", midi.sysexEnabled ? "enabled" : "disabled");
	onMIDIConect(midi);

	midi.onstatechange = function (event) {
		console.log("MIDIConnectionEvent on port", event.port);
		if (event.port.type === "input" && event.port.connection === "open") {
			onMIDIConect(midi);
		}
	};
}

function onMIDIConect(midi) {
	var _iteratorNormalCompletion = true;
	var _didIteratorError = false;
	var _iteratorError = undefined;

	try {

		for (var _iterator = midi.inputs.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
			var input = _step.value;

			console.log("Input id:", input.id, input);
			input.onmidimessage = function (event) {
				var midiMessage = (0, _distIndexJs2["default"])(event);
				console.log("Parsed", midiMessage);
			};
		}
	} catch (err) {
		_didIteratorError = true;
		_iteratorError = err;
	} finally {
		try {
			if (!_iteratorNormalCompletion && _iterator["return"]) {
				_iterator["return"]();
			}
		} finally {
			if (_didIteratorError) {
				throw _iteratorError;
			}
		}
	}

	var _iteratorNormalCompletion2 = true;
	var _didIteratorError2 = false;
	var _iteratorError2 = undefined;

	try {
		for (var _iterator2 = midi.outputs.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
			var output = _step2.value;

			console.log("Output id:", output.id, output);
		}
	} catch (err) {
		_didIteratorError2 = true;
		_iteratorError2 = err;
	} finally {
		try {
			if (!_iteratorNormalCompletion2 && _iterator2["return"]) {
				_iterator2["return"]();
			}
		} finally {
			if (_didIteratorError2) {
				throw _iteratorError2;
			}
		}
	}
}

function onMIDIReject(error) {
	console.error(error);
	return;
}

},{"./dist/index.js":2}],2:[function(require,module,exports){
(function (global){
"use strict";

(function (f) {
	if (typeof exports === "object" && typeof module !== "undefined") {
		module.exports = f();
	} else if (typeof define === "function" && define.amd) {
		define([], f);
	} else {
		var g;if (typeof window !== "undefined") {
			g = window;
		} else if (typeof global !== "undefined") {
			g = global;
		} else if (typeof self !== "undefined") {
			g = self;
		} else {
			g = this;
		}g.midimessage = f();
	}
})(function () {
	var define, module, exports;return (function e(t, n, r) {
		function s(o, u) {
			if (!n[o]) {
				if (!t[o]) {
					var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw (f.code = "MODULE_NOT_FOUND", f);
				}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
					var n = t[o][1][e];return s(n ? n : e);
				}, l, l.exports, e, t, n, r);
			}return n[o].exports;
		}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) s(r[o]);return s;
	})({ 1: [function (require, module, exports) {
			"use strict";

			Object.defineProperty(exports, "__esModule", {
				value: true
			});

			exports["default"] = function (event) {
				function MIDIMessage(event) {
					this._event = event;
					this._data = event.data;
					this.receivedTime = event.receivedTime;

					if (this._data && this._data.length < 2) {
						console.warn("Illegal MIDI message of length", this._data.length);
						return;
					}

					this._messageCode = event.data[0] & 0xf0;
					this.channel = event.data[0] & 0x0f;

					switch (this._messageCode) {

						// Note Off
						case 0x80:
							this.messageType = "noteoff";
							this.key = event.data[1] & 0x7F;
							this.velocity = event.data[2] & 0x7F;
							break;

						// Note On
						case 0x90:
							this.messageType = "noteon";
							this.key = event.data[1] & 0x7F;
							this.velocity = event.data[2] & 0x7F;
							break;

						// Polyphonic Key Pressure
						case 0xA0:
							this.messageType = "keypressure";
							this.key = event.data[1] & 0x7F;
							this.pressure = event.data[2] & 0x7F;
							break;

						// Control Change
						case 0xB0:
							this.messageType = "controlchange";
							this.controllerNumber = event.data[1] & 0x7F;
							this.controllerValue = event.data[2] & 0x7F;

							if (this.controllerNumber === 120 && this.controllerValue === 0) {
								this.channelModeMessage = "allsoundoff";
							} else if (this.controllerNumber === 121) {
								this.channelModeMessage = "resetallcontrollers";
							} else if (this.controllerNumber === 122) {
								if (this.controllerValue === 0) {
									this.channelModeMessage = "localcontroloff";
								} else {
									this.channelModeMessage = "localcontrolon";
								}
							} else if (this.controllerNumber === 123 && this.controllerValue === 0) {
								this.channelModeMessage = "allnotesoff";
							} else if (this.controllerNumber === 124 && this.controllerValue === 0) {
								this.channelModeMessage = "omnimodeoff";
							} else if (this.controllerNumber === 125 && this.controllerValue === 0) {
								this.channelModeMessage = "omnimodeon";
							} else if (this.controllerNumber === 126) {
								this.channelModeMessage = "monomodeon";
							} else if (this.controllerNumber === 127) {
								this.channelModeMessage = "polymodeon";
							}
							break;

						// Program Change
						case 0xC0:
							this.messageType = "programchange";
							this.program = event.data[1];
							break;

						// Channel Pressure
						case 0xD0:
							this.messageType = "channelpressure";
							this.pressure = event.data[1] & 0x7F;
							break;

						// Pitch Bend Change
						case 0xE0:
							this.messageType = "pitchbendchange";
							var msb = event.data[2] & 0x7F;
							var lsb = event.data[1] & 0x7F;
							this.pitchBend = (msb << 8) + lsb;
							break;
					}
				}

				return new MIDIMessage(event);
			};

			module.exports = exports["default"];
		}, {}] }, {}, [1])(1);
});

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1]);


text:
package de.windowsfreak.testjni.reader;

import org.openni.*;

import javax.swing.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lazer_000 on 25.06.2015.
 */
public class OniStreamReader implements ImageReader {
    private Device device;
    private VideoStream videoStream;
    SensorType type = SensorType.DEPTH;
    private ArrayList<VideoMode> supportedModes = new ArrayList<VideoMode>();

    public void initialize() {
        System.loadLibrary("OpenNI2");
        System.loadLibrary("OpenNI2.jni");
        OpenNI.initialize();

        String uri;

        List<DeviceInfo> devicesInfo = OpenNI.enumerateDevices();
        if (devicesInfo.isEmpty()) {
            new Exception("Error! There is no connected device.").printStackTrace();
            return;
        }
        uri = devicesInfo.get(0).getUri();

        device = Device.open(uri);
    }

    public void start(int x, int y) {
        videoStream = VideoStream.create(device, type);
        List<VideoMode> modes = videoStream.getSensorInfo().getSupportedVideoModes();
        supportedModes = new ArrayList<VideoMode>();

        // now only keep the ones that our application supports
        for (VideoMode mode : modes) {
            if (mode.getResolutionX() != x || mode.getResolutionY() != y) continue;
            if (mode.getFps() != 30) continue;
            switch (mode.getPixelFormat()) {
                case DEPTH_1_MM:
                case DEPTH_100_UM:
                case GRAY16:
                    supportedModes.add(mode);
                    break;
            }
        }

        //VideoMode mode = supportedModes.get(0); // 1mm
        VideoMode mode = supportedModes.get(supportedModes.size() - 1); // 100um
        videoStream.setVideoMode(mode);
        videoStream.start();

    }

    public void stop() {
        if (videoStream != null) {
            videoStream.stop();
            videoStream.destroy();
            videoStream = null;
        }
    }

    public void shutDown() {
        device.close();
        OpenNI.shutdown();
    }

    @Override
    public boolean readImage(int x, int y, ByteBuffer out) {
        if (videoStream == null) return false;
        VideoFrameRef lastFrame = videoStream.readFrame();
        synchronized(out) {
            out.clear();
            out.order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().put(lastFrame.getData().order(ByteOrder.BIG_ENDIAN).asShortBuffer());
            out.limit(lastFrame.getData().limit());
        }
        lastFrame.release();
        return true;

    }
}

redpajama_set_name: RedPajamaGithub


text:
package de.wannawork.jcalendar;

import java.applet.Applet;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Font;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.AWTEventListener;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSpinner;
import javax.swing.JSpinner.DateEditor;
import javax.swing.JToolBar;
import javax.swing.JWindow;
import javax.swing.SpinnerDateModel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.DateFormatter;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.PlainDocument;

/**
 * This Class creates a ComboBox for selecting the Date. If pressed, it shows a
 * Popup that contains a JCalendarPanel.
 *
 * You can add a ChangeListener to this ComboBox to receive change events.
 *
 * It is possible to change the Text on the ComboBox using the
 * DateFormat-Parameter.
 *
 * @author Bodo Tasche, David Freels
 */
public class JCalendarComboBox extends JPanel implements AncestorListener, ChangeListener, SwingConstants {

    public void setDateFormat(SimpleDateFormat aFormat) {
        _calendarPanel = null;
        panelDateFormat = aFormat;
        createGUI();
    }

    protected class CalendarPanelComponentListener implements ComponentListener {

        @Override
        public void componentResized(ComponentEvent e) {
        }

        @Override
        public void componentMoved(ComponentEvent e) {
        }

        @Override
        public void componentShown(ComponentEvent e) {
        }

        @Override
        public void componentHidden(ComponentEvent e) {
            if (e.getComponent() == _calendarPanel) {
                _changed = false;
                hideCalendar();
            }
        }
    }
    private static JCalendarComboBox comboWithPopupShown = null;
    private static AWTEventListener awtMonitor = new AWTEventListener() {
        @Override
        public void eventDispatched(AWTEvent event) {
            if (event instanceof MouseEvent) {
                MouseEvent me = (MouseEvent) event;
                Component src = me.getComponent();
                switch (me.getID()) {
                    case MouseEvent.MOUSE_PRESSED:
                        if (!isInPopup(src, me.getPoint())) {
                            cancelPopupCalendar();
                        }
                        break;
                    case MouseEvent.MOUSE_RELEASED:
                        if (!isInPopup(src, me.getPoint())) {
                            cancelPopupCalendar();
                        }
                        break;
                    case MouseEvent.MOUSE_DRAGGED:
                        if (!isInPopup(src, me.getPoint())) {
                            cancelPopupCalendar();
                        }
                        break;
                    case MouseEvent.MOUSE_WHEEL:
                        if (!isInPopup(src, me.getPoint())) {
                            cancelPopupCalendar();
                        }
                        break;
                }
            }
        }

        boolean isInPopup(Component src, Point aPt) {
            for (Component c = src; c != null; c = c instanceof JPopupMenu ? ((JPopupMenu) c).getInvoker() : c.getParent()) {
                if (c instanceof Applet || (c instanceof Window && !(c instanceof JCalendarPopupWindow))) {
                    break;
                } else if (c instanceof JCalendarPopupWindow || c instanceof JCalendarInvokerButton) {
                    return true;
                }
            }
            if (comboWithPopupShown != null && comboWithPopupShown.isCalendarShown()) {
                Point converted = SwingUtilities.convertPoint(src, aPt, comboWithPopupShown.getCalendarPanel());
                Rectangle bounds = comboWithPopupShown.getCalendarPanel().getBounds();
                bounds.setLocation(0, 0);
                if (converted != null && bounds.contains(converted)) {
                    return true;
                }
                JCalendarInvokerButton lbtn = comboWithPopupShown.getDropDownButton();
                bounds = lbtn.getBounds();
                bounds.setLocation(0, 0);
                converted = SwingUtilities.convertPoint(src, aPt, lbtn);
                if (converted != null && bounds.contains(converted)) {
                    return true;
                }
            }
            return false;
        }
    };

    static {
        Toolkit.getDefaultToolkit().addAWTEventListener(awtMonitor,
                AWTEvent.MOUSE_EVENT_MASK
                | AWTEvent.MOUSE_MOTION_EVENT_MASK
                | AWTEvent.MOUSE_WHEEL_EVENT_MASK
                | AWTEvent.WINDOW_EVENT_MASK);
    }

    public static void cancelPopupCalendar() {
        if (comboWithPopupShown != null && comboWithPopupShown.isCalendarShown()) {
            comboWithPopupShown.hideCalendar();
            assert comboWithPopupShown == null;
        }
    }

    private static class WindowWatchDog implements WindowListener, ComponentListener {

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

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

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

        @Override
        public void windowDeactivated(WindowEvent e) {
            cancelPopupCalendar();
        }

        @Override
        public void windowOpened(WindowEvent e) {
            cancelPopupCalendar();
        }

        @Override
        public void windowDeiconified(WindowEvent e) {
            cancelPopupCalendar();
        }

        @Override
        public void windowActivated(WindowEvent e) {
            cancelPopupCalendar();
        }

        @Override
        public void componentResized(ComponentEvent e) {
            cancelPopupCalendar();
        }

        @Override
        public void componentMoved(ComponentEvent e) {
            if (targetLocation == null || !targetLocation.equals(e.getComponent().getLocation())) {
                cancelPopupCalendar();
            }
        }

        @Override
        public void componentShown(ComponentEvent e) {
            cancelPopupCalendar();
        }

        @Override
        public void componentHidden(ComponentEvent e) {
            cancelPopupCalendar();
        }
        private Point targetLocation;

        private void setTargetSize(Point aPt) {
            targetLocation = aPt;
        }
    }
    private WindowWatchDog calendarWatchDog = new WindowWatchDog();

    /**
     * Creates a Calendar using the current Date and current Local settings.
     */
    public JCalendarComboBox() {
        panelCal = (Calendar) Calendar.getInstance().clone();
        panelLocale = Locale.getDefault();
        panelDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
        panelFlat = true;
        panelCalendarPanelDialogStyle = false;

        //_calendarPanel = new JCalendarPanel();
        createGUI();
    }

    /**
     * Creates a Calendar using the current Date and current Local settings.
     *
     * @param calendarPanelDialogStyle
     */
    public JCalendarComboBox(boolean calendarPanelDialogStyle) {
        panelCal = (Calendar) Calendar.getInstance().clone();
        panelLocale = Locale.getDefault();
        panelDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
        panelFlat = true;
        panelCalendarPanelDialogStyle = calendarPanelDialogStyle;
        //_calendarPanel = new JCalendarPanel();
        createGUI();
    }

    /**
     * Creates a Calendar using the cal-Date and current Locale Settings. It
     * doesn't use the Locale in the Calendar-Object !
     *
     * @param cal Calendar to use
     */
    public JCalendarComboBox(Calendar cal) {
        panelCal = cal;
        panelLocale = Locale.getDefault();
        panelDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
        panelFlat = true;
        panelCalendarPanelDialogStyle = false;

        //_calendarPanel = new JCalendarPanel(cal);
        createGUI();
    }

    /**
     * Creates a Calendar using the current Date and the given Locale Settings.
     *
     * @param locale Locale to use
     */
    public JCalendarComboBox(Locale locale) {
        panelCal = (Calendar) Calendar.getInstance().clone();
        panelLocale = locale;
        panelDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
        panelFlat = true;
        panelCalendarPanelDialogStyle = false;

        //_calendarPanel = new JCalendarPanel(locale);
        createGUI();
    }

    /**
     * Creates a Calender using the given Date and Locale
     *
     * @param cal Calendar to use
     * @param locale Locale to use
     */
    public JCalendarComboBox(Calendar cal, Locale locale) {
        panelCal = cal;
        panelLocale = locale;
        panelDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
        panelFlat = true;
        panelCalendarPanelDialogStyle = false;

        _calendarPanel = new JCalendarPanel(cal, locale);
        createGUI();
    }

    /**
     * Creates a Calender using the given Calendar, Locale and DateFormat.
     *
     * @param cal Calendar to use
     * @param locale Locale to use
     * @param dateFormat DateFormat for the ComboBox
     */
    public JCalendarComboBox(Calendar cal, Locale locale, DateFormat dateFormat) {
        panelCal = cal;
        panelLocale = locale;
        panelDateFormat = dateFormat;
        panelFlat = true;
        panelCalendarPanelDialogStyle = false;

        //_calendarPanel = new JCalendarPanel(cal, locale, dateFormat);
        createGUI();
    }

    /**
     * Creates a Calender using the given Calendar, Locale and DateFormat.
     *
     * @param cal Calendar to use
     * @param locale Locale to use
     * @param dateFormat DateFormat for the ComboBox
     * @param location Location of the Popup (LEFT, CENTER or RIGHT)
     */
    public JCalendarComboBox(Calendar cal, Locale locale,
            DateFormat dateFormat, int location) {
        panelCal = cal;
        panelLocale = locale;
        panelDateFormat = dateFormat;
        panelFlat = true;
        panelCalendarPanelDialogStyle = false;

        //_calendarPanel = new JCalendarPanel(cal, locale, dateFormat);
        _popupLocation = location;
        createGUI();
    }

    /**
     * Creates a Calender using the given Calendar, Locale and DateFormat.
     *
     * @param cal Calendar to use
     * @param locale Locale to use
     * @param dateFormat DateFormat for the ComboBox
     * @param location Location of the Popup (LEFT, CENTER or RIGHT)
     * @param flat Flat Buttons for next/last Month/Year
     */
    public JCalendarComboBox(Calendar cal, Locale locale,
            DateFormat dateFormat, int location, boolean flat) {
        panelCal = cal;
        panelLocale = locale;
        panelDateFormat = dateFormat;
        panelFlat = flat;
        panelCalendarPanelDialogStyle = false;

        //_calendarPanel = new JCalendarPanel(cal, locale, dateFormat, flat);
        _popupLocation = location;
        createGUI();
    }

    /**
     * Creates a Calender using the given Calendar, Locale and DateFormat.
     *
     * @param cal Calendar to use
     * @param locale Locale to use
     * @param dateFormat DateFormat for the ComboBox
     * @param location Location of the Popup (LEFT, CENTER or RIGHT)
     * @param flat Flat Buttons for next/last Month/Year
     * @param calendarPanelDialogStyle
     */
    public JCalendarComboBox(Calendar cal, Locale locale,
            DateFormat dateFormat, int location, boolean flat, boolean calendarPanelDialogStyle) {
        panelCal = cal;
        panelLocale = locale;
        panelDateFormat = dateFormat;
        panelFlat = flat;
        panelCalendarPanelDialogStyle = calendarPanelDialogStyle;

        _popupLocation = location;
        createGUI();
    }

    private Calendar panelCal;
    private Locale panelLocale;
    private DateFormat panelDateFormat;
    private boolean panelFlat;
    private boolean panelCalendarPanelDialogStyle;

    private void checkDialogGUI() {
        if (_calendarPanel == null) {
            createDialogGUI();
        }
    }

    /**
     * Creates the GUI for drop down part
     */
    private void createDialogGUI() {
        _calendarPanel = new JCalendarPanel(panelCal, panelLocale, panelDateFormat, panelFlat, panelCalendarPanelDialogStyle);

        _calendarPanel.setListenerModus(JCalendarPanel.FIRE_DAYCHANGES);
        _calendarPanel.setCalendar(_selected);
        _calendarPanel.addChangeListener(this);
        _calendarPanel.addComponentListener(new CalendarPanelComponentListener());
        _calendarPanel.setBorder(BorderFactory.createLineBorder(Color.black));
    }

    /**
     * Creates the GUI for the JCalendarComboBox
     */
    private void createGUI() {
        _selected = (Calendar) panelCal.clone();
        setLayout(new BorderLayout());
        _spinner = new JSpinner();
        _spinner.setModel(new NullableSpinnerDateModel());
        _spinner.setFont(getFont());
        SimpleDateFormat lFormat = (SimpleDateFormat) panelDateFormat;
        final JSpinner.DateEditor dEditor = new JSpinner.DateEditor(_spinner, lFormat.toPattern());
        DateFormatter df = new OptimisticDateFormatter(lFormat);
        df.setAllowsInvalid(false);
        df.setOverwriteMode(true);
        dEditor.getTextField().setFormatterFactory(new DefaultFormatterFactory(df));
        dEditor.getTextField().setEditable(editable);
        dEditor.getTextField().setDocument(new PlainDocument() {
            @Override
            public void remove(int offs, int len) throws BadLocationException {
                super.remove(offs, len);
                dEditor.getTextField().getCaret().setDot(offs);
            }
        });

        _spinner.setEditor(dEditor);
        _spinner.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                Date date = (Date) _spinner.getModel().getValue();
                if (date != null) {
                    if (_selected == null) {
                        _selected = (Calendar) Calendar.getInstance().clone();
                    }
                    _selected.setTime(date);
                } else {
                    _selected = null;
                }
                if (_calendarPanel != null) {
                    _calendarPanel.setCalendar(_selected);
                }
                fireChangeEvent();
            }
        });

        ((JSpinner.DefaultEditor) _spinner.getEditor()).getTextField().addFocusListener(new FocusAdapter() {
            @Override
            public void focusLost(FocusEvent e) {
                Date date = (Date) _spinner.getModel().getValue();
                if (date != null) {
                    if (_selected == null) {
                        _selected = (Calendar) Calendar.getInstance().clone();
                    }
                    _selected.setTime(date);
                } else {
                    _selected = null;
                }
                if (_calendarPanel != null) {
                    _calendarPanel.setCalendar(_selected);
                }
                fireChangeEvent();
            }
        });

        add(_spinner, BorderLayout.CENTER);
        JToolBar btns = new JToolBar();
        btns.setRollover(true);
        btns.setFloatable(false);
        btns.setBorderPainted(false);
        btns.setBorder(null);
        URL url = JCalendarComboBox.class.getClassLoader().getResource("de/wannawork/jcalendar/calendar.png");
        ImageIcon icon = new ImageIcon(url);
        _dropDownButton = new JCalendarInvokerButton();
        _dropDownButton.setIcon(icon);
        _dropDownButton.setBorderPainted(false);
        _dropDownButton.setBorder(new EmptyBorder(0, 1, 0, 1));
        _dropDownButton.setEnabled(editable && isEnabled());
        btns.add(_dropDownButton);
        add(btns, BorderLayout.EAST);
        _dropDownButton.setFocusable(false);
        _dropDownButton.addMouseListener(new MouseAdapter() {

            @Override
            public void mousePressed(MouseEvent e) {
                if (_dropDownButton.isEnabled()) {
                    if (!isCalendarShown()) {
                        showCalendar();
                    } else {
                        hideCalendar();
                    }
                } else {
                    cancelPopupCalendar();
                }
            }

        });
    }

    public void setBorderless(boolean aBorderless) {
        isBorderless = aBorderless;
        if (isBorderless) {
            _spinner.setBorder(null);
        }
    }

    public boolean isEditable() {
        return editable;
    }

    public void setEditable(boolean aEditable) {
        editable = aEditable;
        if (_spinner != null && _spinner.getEditor() instanceof JSpinner.DateEditor) {
            JSpinner.DateEditor dEditor = (JSpinner.DateEditor) _spinner.getEditor();
            if (dEditor != null && dEditor.getTextField() != null) {
                dEditor.getTextField().setEditable(editable);
            }
        }
        if (_spinner != null) {
            _spinner.setEnabled(editable && isEnabled());
        }
        if (_dropDownButton != null) {
            _dropDownButton.setEnabled(editable && isEnabled());
        }
    }

    @Override
    public void updateUI() {
        super.updateUI();
        if (isBorderless) {
            _spinner.setBorder(null);
        }
    }

    @Override
    public void setFont(Font font) {
        super.setFont(font);
        if (_spinner != null) {
            _spinner.setFont(font);
        }
    }

    @Override
    public void setToolTipText(String aText) {
        super.setToolTipText(aText);
        if (_spinner != null) {
            _spinner.setToolTipText(aText);
        }
        if (_dropDownButton != null) {
            _dropDownButton.setToolTipText(aText);
        }
    }

    @Override
    public void setCursor(Cursor aCursor) {
        super.setCursor(aCursor);
        if (_spinner != null) {
            _spinner.setCursor(aCursor);
            if (_spinner.getEditor() != null) {
                JComponent comp = _spinner.getEditor();
                comp.setCursor(getCursor());
                for (int i = 0; i < comp.getComponentCount(); i++) {
                    if (comp.getComponent(i) != null) {
                        comp.getComponent(i).setCursor(getCursor());
                    }
                }
            }
        }
        if (_dropDownButton != null) {
            _dropDownButton.setCursor(aCursor);
        }
    }

    @Override
    public void setBackground(Color bg) {
        super.setBackground(bg);
        if (_spinner != null) {
            _spinner.setBackground(bg);
            if (_spinner.getEditor() != null && _spinner.getEditor() instanceof JSpinner.DateEditor) {
                JSpinner.DateEditor de = (JSpinner.DateEditor) _spinner.getEditor();
                if (de.getTextField() != null) {
                    de.getTextField().setBackground(bg);
                }
            }
        }
    }

    @Override
    public void setForeground(Color fg) {
        super.setForeground(fg);
        if (_spinner != null) {
            _spinner.setForeground(fg);
            if (_spinner.getEditor() != null && _spinner.getEditor() instanceof JSpinner.DateEditor) {
                JSpinner.DateEditor de = (JSpinner.DateEditor) _spinner.getEditor();
                if (de.getTextField() != null) {
                    de.getTextField().setForeground(fg);
                }
            }
        }
    }

    /**
     * Creates the CalendarWindow-Popup
     */
    private void createCalendarWindow() {
        createCalendarWindow(null);
    }

    private void createCalendarWindow(Window aAncestor) {
        if (aAncestor != null) {
            _calendarWindow = new JCalendarPopupWindow(aAncestor);
        } else {
            _calendarWindow = new JCalendarPopupWindow();
        }

        JPanel contentPanel = (JPanel) _calendarWindow.getContentPane();
        contentPanel.setLayout(new BorderLayout());
        contentPanel.add(_calendarPanel, BorderLayout.CENTER);

        _calendarWindow.pack();
    }

    /**
     * Returns the current seleted Date as Calendar
     *
     * @return current selected Date
     */
    public Calendar getCalendar() {
        return _calendarPanel.getCalendar();
    }

    /**
     * Sets the current selected Date
     *
     * @param cal Date to select
     */
    public void setCalendar(Calendar cal) {
        _calendarPanel.setCalendar(cal);
        _spinner.getModel().setValue(cal != null ? cal.getTime() : null);
    }

    /**
     * Returns the JCalendarPanel that is shown in the PopUp
     *
     * @return JCalendarPanel in the PopUp
     */
    public JCalendarPanel getCalendarPanel() {
        return _calendarPanel;
    }

    /**
     * Sets the Popup Location (Left/Right/Center)
     *
     * @param location
     */
    public void setPopUpLocation(int location) {
        _popupLocation = location;
    }

    /**
     * Returns the Popup Location
     *
     * @return Location of the Popup
     */
    public int getPopUpLocation() {
        return _popupLocation;
    }

    /**
     * Sets the horizontal Position of the Text in the Button
     *
     * @param value RIGHT, LEFT, CENTER, LEADING, TRAILING for horizontal
     * Alignment
     */
    public void setHorizontalAlignment(int value) {
        ((JSpinner.DefaultEditor) _spinner.getEditor()).getTextField().setHorizontalAlignment(value);
    }

    /**
     * Hides the Calendar PopUp and fires a ChangeEvent if a change was made
     */
    public void hideCalendar() {
        if (_calendarPanel != null) {
            if (_calendarWindow.isVisible()) {
                _calendarWindow.setVisible(false);
                _calendarWindow.dispose();

                if (!_calendarPanel.isDialogStyle() && !_calendarPanel.getCalendar().getTime().equals(_spinner.getModel().getValue())) {
                    _changed = true;
                }

                if (_changed) {
                    if (_calendarPanel.getCalendar() != null) {
                        _spinner.getModel().setValue(_calendarPanel.getCalendar().getTime());
                        _selected = (Calendar) _calendarPanel.getCalendar().clone();
                    } else {
                        _spinner.getModel().setValue(null);
                        _selected = null;
                    }
                    _changed = false;
                    fireChangeEvent();
                }
                if (comboWithPopupShown == this) {
                    comboWithPopupShown = null;
                }
            }
        }
    }

    public boolean isCalendarShown() {
        return _calendarWindow != null && _calendarWindow.isVisible();
    }

    /**
     * Shows the Calendar Popup
     */
    public void showCalendar() {
        checkDialogGUI();

        Window ancestor = (Window) this.getTopLevelAncestor();

        if ((_calendarWindow == null) || (ancestor != _calendarWindow.getOwner())) {
            if (ancestor instanceof JDialog) {
                createCalendarWindow(ancestor);
            } else {
                createCalendarWindow();
            }
        }

        //Update the date from the spinner model
        Date date = (Date) _spinner.getModel().getValue();
        if (_selected != null) {
            _selected.setTime(date != null ? date : ((Calendar) Calendar.getInstance().clone()).getTime());
        }
        _calendarPanel.setCalendar(_selected);

        Point location = getLocationOnScreen();

        int x;

        if (_popupLocation == RIGHT) {
            x = (int) location.getX() + getSize().width - _calendarWindow.getSize().width;
        } else if (_popupLocation == CENTER) {
            x = (int) location.getX() + ((getSize().width - _calendarWindow.getSize().width) / 2);
        } else {
            x = (int) location.getX();
        }

        int y = (int) location.getY() + getHeight() - 1;

        Rectangle screenSize = getDesktopBounds();

        if (x < 0) {
            x = 0;
        }

        if (y < 0) {
            y = 0;
        }

        if (x + _calendarWindow.getWidth() > screenSize.width) {
            x = screenSize.width - _calendarWindow.getWidth();
        }

        if (y + 30 + _calendarWindow.getHeight() > screenSize.height) {
            y = (int) location.getY() - _calendarWindow.getHeight();
        }

        _calendarWindow.setBounds(x, y, _calendarWindow.getWidth(),
                _calendarWindow.getHeight());
        _calendarWindow.setVisible(true);

        if (comboWithPopupShown != null && comboWithPopupShown != this && comboWithPopupShown.isCalendarShown()) {
            comboWithPopupShown.hideCalendar();
            assert comboWithPopupShown == null;
        }
        comboWithPopupShown = this;

        Window w = SwingUtilities.getWindowAncestor(this);
        w.removeWindowListener(calendarWatchDog);
        w.removeComponentListener(calendarWatchDog);
        w.addWindowListener(calendarWatchDog);
        calendarWatchDog.setTargetSize(new Point(w.getLocation()));
        w.addComponentListener(calendarWatchDog);
    }

    public static void setFocusableRecursive(Component aComp, boolean aValue) {
        aComp.setFocusable(aValue);
        if (aComp instanceof JComponent) {
            JComponent jComp = (JComponent) aComp;
            for (int i = 0; i < jComp.getComponentCount(); i++) {
                setFocusableRecursive(jComp.getComponent(i), aValue);
            }
        }
    }

    /**
     * Gets the screensize. Takes into account multi-screen displays.
     *
     * @return a union of the bounds of the various screen devices present
     */
    private Rectangle getDesktopBounds() {
        final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        final GraphicsDevice[] gd = ge.getScreenDevices();
        final Rectangle[] screenDeviceBounds = new Rectangle[gd.length];
        Rectangle desktopBounds = new Rectangle();
        for (int i = 0; i < gd.length; i++) {
            final GraphicsConfiguration gc = gd[i].getDefaultConfiguration();
            screenDeviceBounds[i] = gc.getBounds();
            desktopBounds = desktopBounds.union(screenDeviceBounds[i]);
        }

        return desktopBounds;
    }

    public JCalendarInvokerButton getDropDownButton() {
        return _dropDownButton;
    }

    /*
     * (non-Javadoc)
     *
     * @see javax.swing.event.AncestorListener#ancestorAdded(javax.swing.event.AncestorEvent)
     */
    @Override
    public void ancestorAdded(AncestorEvent event) {
        hideCalendar();
    }

    /*
     * (non-Javadoc)
     *
     * @see javax.swing.event.AncestorListener#ancestorMoved(javax.swing.event.AncestorEvent)
     */
    @Override
    public void ancestorMoved(AncestorEvent event) {
        //hideCalendar();
    }

    /*
     * (non-Javadoc)
     *
     * @see javax.swing.event.AncestorListener#ancestorRemoved(javax.swing.event.AncestorEvent)
     */
    @Override
    public void ancestorRemoved(AncestorEvent event) {
        hideCalendar();
    }

    /**
     * Listens to ChangeEvents of the JCalendarPanel and rembers if something
     * was changed.
     *
     * If the Day was changed, the PopUp is closed.
     *
     * @param e ChangeEvent
     * @see
     * javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
     */
    @Override
    public void stateChanged(ChangeEvent e) {
        _changed = true;
        hideCalendar();
    }

    /**
     * Adds a Changelistener to this JCalendarComboBox.
     *
     * It will be called everytime the ComboBox is closed and the Date was
     * changed
     *
     * @param listener ChangeListener
     */
    public void addChangeListener(ChangeListener listener) {
        _changeListener.add(listener);
    }

    /**
     * Removes a ChangeListener from this JCalendarComboBox
     *
     * @param listener listener to remove
     */
    public void removeChangeListener(ChangeListener listener) {
        _changeListener.remove(listener);
    }

    /**
     * Gets all ChangeListeners
     *
     * @return all ChangeListeners
     */
    public ChangeListener[] getChangeListener() {
        return (ChangeListener[]) _changeListener.toArray();
    }

    /**
     * Fires the ChangeEvent
     */
    protected void fireChangeEvent() {
        if (!_fireingChangeEvent) {
            _fireingChangeEvent = true;
            ChangeEvent event = new ChangeEvent(this);

            for (int i = 0; i < _changeListener.size(); i++) {
                ((ChangeListener) _changeListener.get(i)).stateChanged(event);
            }

            _fireingChangeEvent = false;
        }

    }

    /**
     * Enables/Disables the ComboBox
     *
     * @param enabled Enabled ?
     */
    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        _spinner.setEnabled(enabled);
        _dropDownButton.setEnabled(editable && enabled);
        for (int i = 0; i < _spinner.getComponentCount(); i++) {
            _spinner.getComponent(i).setEnabled(enabled);
        }
    }

    /**
     * Gets the Popup Location
     *
     * @return location of the Popup
     */
    public int getPopupLocation() {
        return _popupLocation;
    }

    /**
     * Sets the Location of the Popup (LEFT, CENTER or RIGHT)
     *
     * @param location Location of the PopUp
     */
    public void setPopupLocation(int location) {
        _popupLocation = location;
    }

    /**
     * Returns the model used to hold the Date object
     *
     * @return
     */
    public SpinnerDateModel getModel() {
        return (SpinnerDateModel) _spinner.getModel();
    }

    public JFormattedTextField getEditorComponent() {
        if (_spinner.getEditor() instanceof JSpinner.DateEditor) {
            return ((JSpinner.DateEditor) _spinner.getEditor()).getTextField();
        }
        return null;
    }

    /**
     * Sets the model used to hold the Date object
     *
     * @param model A SpinnerDateModel to be used by the spinner control.
     */
    public void setSpinnerDateModel(SpinnerDateModel model) {
        _spinner.setModel(model);
    }

    @Override
    public void setOpaque(boolean aValue) {
        super.setOpaque(aValue);
        if (_spinner != null) {
            _spinner.setOpaque(aValue);
            JComponent editor = _spinner.getEditor();
            if (editor != null) {
                editor.setOpaque(aValue);
                if (editor instanceof DateEditor) {
                    if (((DateEditor) editor).getTextField() != null) {
                        ((DateEditor) editor).getTextField().setOpaque(aValue);
                    }
                }
            }
        }
    }
    /**
     * Where should be the Popup?
     */
    private int _popupLocation = LEFT;
    protected Date _date2Hide;
    /**
     * Current selected Day
     */
    private Calendar _selected;
    private boolean isBorderless;
    private boolean editable = true;
    /**
     * The text field that holds the date
     */
    private JSpinner _spinner;
    private JCalendarInvokerButton _dropDownButton;
    /**
     * The JWindow for the Popup
     */
    private JWindow _calendarWindow;
    /**
     * The JCalendarPanel inside the PopUp
     */
    private JCalendarPanel _calendarPanel;
    /**
     * The list of ChangeListeners
     */
    private ArrayList _changeListener = new ArrayList();
    /**
     * Currently firing an ChangeEvent?
     */
    private boolean _fireingChangeEvent = false;
    /**
     * Something changed in the JCalendarPanel ?
     */
    private boolean _changed = false;
}


text:
import express from 'express';
import * as overlayCtrl from '../controllers/overlay';

const router = express.Router();

/* GET home page. */
router.get('/', overlayCtrl.overlayIndex);

export default router;


text: % qMT using Balanced Steady State Free Precession acquisition


text:
body {
	text-align: center;
	align-items: center;
}
.img-space-for-sale,
.img-black-hole,
.man-on-the-moon {
	width: 300px;
	height: auto;
}
#two-buttons {
    text-align: center;
}
.button {
    background-color: purple;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}
.button,
.btn button {
	font-family: 'Rozha One', serif;
	font-size: 18px;
}
.btn {
	margin-bottom: 10px;
}
.btn-linkedin-share img {
	width: 50%;
}
.btn-social-media {
	display: flex;
	justify-content: center;
	align-items: center;
}
.line {
	width: 100px;
	height: 2px;
	border-radius: 20px;
	background-color: purple;
	margin-left: auto;
	margin-right: auto;
}
section {
	margin-top: 20px;
	margin-bottom: 20px;
}


text:
Icarus is a responsive and customizable theme for bloggers. It's a port of the same-named theme for [Hexo](//hexo.io) made by [Ruipeng Zhang](https://github.com/ppoffice). Noteworthy features of this Hugo theme are the integration of a comment-system powered by Disqus, localization (l10n) support, syntax highlighting for source code, optional widgets for the sidebar and a handful [shortcodes](http://gohugo.io/extras/shortcodes/) to make your life easier.

![](https://raw.githubusercontent.com/digitalcraftsman/hugo-icarus-theme/master/images/screenshot.png)

## Get the theme

I assume you've Git installed. Inside the folder of your Hugo site run

    $ mkdir themes
    $ cd themes
    $ git clone https://github.com/digitalcraftsman/hugo-icarus-theme.git

You should see a folder called `hugo-icarus-theme` inside the `themes` directory that we created a few moments ago. For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo.

## Setup

In the next step navigate to the `exampleSite` folder at `themes/hugo-icarus-theme/exampleSite/`. Its structure should look similar to this:

    exampleSite
    ├── config.toml
    ├── content
    │   └── post
    │       ├── creating-a-new-theme.md
    │       ├── go-is-for-lovers.md
    │       ├── hugo-is-for-lovers.md
    │       ├── introducing-icarus-and-its-features.md
    │       ├── linked-post.md
    │       └── migrate-from-jekyll.md
    ├── data
    │   └── l10n.toml
    └── static
        └── banners
            └── placeholder.png

In order to get your site running, you need to copy `config.toml` and `data/l10n.toml` into the root folders.

## The config file

Now, let us take a look into the `config.toml`. Feel free to play around with the settings.

### Comments

The optional comment system is powered by Disqus. Enter your shortname to enable the comment section under your posts.

    disqusShortname = ""

Tip: you can disable the comment section for a single page in its frontmatter:

```toml
+++
disable_comments = true
+++
```

### Menu

You can also define the items menu entries as you like. First, let us link a post that you've written. We can do this in the frontmatter of the post's content file by setting `menu` to `main`.

    +++
    menu = "main"
    +++

Furthermore, we can add entries that don't link to posts. Back in the `config.toml` you'll find a section for the menus:

    [[params.menu]]
        before = true
        label  = "Home"
        link   = "/"

Define a label and enter the URL to resource you want to link. With `before` you can decide whether the link should appear before **or** after all linked posts in the menu. Therefore, `Home` appears before the linked post.

### Sidebars

In order to use the full width of the website you can disable the profile on the left and / or the widgets on the right for a single page in the frontmatter:

```toml
+++
disable_profile = true
disable_widgets = true
+++
```

### Tell me who you are

This theme also provides a profile section on the left. Add your social network accounts to the profile section on the left by entering your username under `social`. The links to your account will be create automatically.

### Widgets

Beside the profile section you can add widgets on the right sidebar. The following widgets are available:

- recent articles
- category list
- tag list
- tag cloud

You can deactivate them under `params.widgets`:

    [params.widgets]
        recent_articles = false
        categories = true
        tags = true
        tag_cloud = true

## Localization (l10n)

You don't blog in English and you want to translate the theme into your native locale? No problem. Take a look in the `data` folder and you'll find a file `l10n.toml` that we've copied at the beginning. It contains all strings related to the theme. Just replace the original strings with your own.

## Linking thumbnails

After creating a new post you can define a banner by entering the relative path to the image.

    banner = "banners/placeholder.png"

This way you can store them either next to the content file or in the `static` folder.

## Mathematical equations

Mathematical equations in form of LaTeX or MathML code can be rendered with the support of [MathJax](https://www.mathjax.org). MathML works out of the box. If you're using LaTeX you need to wrap your equation with `$$`.

You can also print formulas inline. In this case wrap the formula only once with `$`.

## Shortcodes

Last but not least I included some useful [shortcodes](http://gohugo.io/extras/shortcodes/) to make your life easier.

### Gallery

This way you can include a gallery into your post. Copy the code below into your content file and enter the relative paths to your images.

    {{< gallery
        "/banners/placeholder.png"
        "/banners/placeholder.png"
        "/banners/placeholder.png"
    >}}

### JSFiddle

It works the same with JSFiddle examples you want to showcase. The parameter `id` consists of the username and id of the example.

    {{< jsfiddle id="zalun/NmudS" >}}

As descibed in the [docs of JSFiddle](http://doc.jsfiddle.net/use/embedding.html), you can define which tabs will be shown. Enter the tabs you want to see separated by a comma in the `tabs` parameter.

    {{< jsfiddle id="zalun/NmudS" tabs="html,result" >}}

## Nearly finished

In order to see your site in action, run Hugo's built-in local server.

    $ hugo server

Now enter [`localhost:1313`](http://localhost:1313) in the address bar of your browser.

## Contributing

Have you found a bug or got an idea for a new feature? Feel free to use the [issue tracker](//github.com/digitalcraftsman/hugo-icarus-theme/issues) to let me know. Or make directly a [pull request](//github.com/digitalcraftsman/hugo-icarus-theme/pulls).

## License

This theme is released under the MIT license. For more information read the [license](https://github.com/digitalcraftsman/hugo-icarus-theme/blob/master/LICENSE.md).

## Acknowledgements

Thanks to

- [Ruipeng Zhang](https://github.com/ppoffice) for creating this theme
- [Steve Francia](//github.com/spf13) for creating Hugo and the awesome community around the project


text:
namespace Common
{
    public enum Receipt_Layout
    {
        Standard_Vertical,
    }
}


text:
package com.suchorski.sicpag.models;

import java.sql.Timestamp;

public class SenhaTemporaria extends AbstratoModel {

	private String senha;
	private Timestamp criacao;

	public SenhaTemporaria(int id, String senha, Timestamp criacao) {
		super(id);
		this.senha = senha;
		this.criacao = criacao;
	}

	public String getSenha() {
		return senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	public Timestamp getCriacao() {
		return criacao;
	}

	public void setCriacao(Timestamp criacao) {
		this.criacao = criacao;
	}

}


text:
package solutions.digamma.damas.auth;

/**
 * Access privilege.
 * An access privilege can be granted to a given subject, on given objects.
 * Subjects are users and groups. Objects can be a document or a folder.
 *
 * @author Ahmad Shahwan
 */
public enum AccessRight {
    /**
     * No access right at all.
     */
    NONE,
    /**
     * Access right allowing its owner to read content.
     */
    READ,
    /**
     * Access right allowing its owner to read and modify content.
     *

     * This access right include {@link AccessRight#READ}.
     */
    WRITE,
    /**
     * Access right allowing its owner to read, modify and maintain items.
     * Maintenance include privilege such as access to access right information,
     * sharing and locking.
     *
     *

     * This access right include {@link AccessRight#READ} and {@link
     * AccessRight#WRITE}.
     */
    MAINTAIN
}


text:
#include "ndis56common.h"
#include "ParaNdis_DebugHistory.h"
#include "Trace.h"
#ifdef NETKVM_WPP_ENABLED
#include "ParaNdis_Debug.tmh"
#endif

extern "C"
{
#include "stdarg.h"
#include "ntstrsafe.h"
}

int virtioDebugLevel = 0;
int bDebugPrint = 1;

/* Crash callback support makes SDV to skip all the tests
 * of NDIS entry points and report them as 'Not applicable'
 * Leave it enabled for 8.1 and private builds without WPP
 */
//#define ENABLE_CRASH_CALLBACK       1
#if !NDIS_SUPPORT_NDIS680 || !defined(NETKVM_WPP_ENABLED)
#define ENABLE_CRASH_CALLBACK       1
#endif

static NDIS_SPIN_LOCK CrashLock;

static KBUGCHECK_REASON_CALLBACK_ROUTINE ParaNdis_OnBugCheck;
static VOID ParaNdis_PrepareBugCheckData();

typedef BOOLEAN (*KeRegisterBugCheckReasonCallbackType) (
    __out PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord,
    __in PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine,
    __in KBUGCHECK_CALLBACK_REASON Reason,
    __in PUCHAR Component
    );

typedef BOOLEAN (*KeDeregisterBugCheckReasonCallbackType) (
    __inout PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord
    );

typedef ULONG (*vDbgPrintExType)(
    __in ULONG ComponentId,
    __in ULONG Level,
    __in PCCH Format,
    __in va_list arglist
    );

static ULONG DummyPrintProcedure(
    __in ULONG ComponentId,
    __in ULONG Level,
    __in PCCH Format,
    __in va_list arglist
    )
{
    UNREFERENCED_PARAMETER(ComponentId);
    UNREFERENCED_PARAMETER(Level);
    UNREFERENCED_PARAMETER(Format);
    UNREFERENCED_PARAMETER(arglist);

    return 0;
}
static BOOLEAN KeRegisterBugCheckReasonCallbackDummyProc(
    __out PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord,
    __in PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine,
    __in KBUGCHECK_CALLBACK_REASON Reason,
    __in PUCHAR Component
    )
{
    UNREFERENCED_PARAMETER(CallbackRoutine);
    UNREFERENCED_PARAMETER(Reason);
    UNREFERENCED_PARAMETER(Component);

    CallbackRecord->State = 0;
    return FALSE;
}

BOOLEAN KeDeregisterBugCheckReasonCallbackDummyProc(
    __inout PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord
    )
{
    UNREFERENCED_PARAMETER(CallbackRecord);
    return FALSE;
}

static vDbgPrintExType PrintProcedure = DummyPrintProcedure;
static KeRegisterBugCheckReasonCallbackType BugCheckRegisterCallback = KeRegisterBugCheckReasonCallbackDummyProc;
static KeDeregisterBugCheckReasonCallbackType BugCheckDeregisterCallback = KeDeregisterBugCheckReasonCallbackDummyProc;
KBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord;

#ifndef NETKVM_WPP_ENABLED

static void NetKVMDebugPrint(const char *fmt, ...)
{
    va_list list;
    va_start(list, fmt);
    PrintProcedure(DPFLTR_DEFAULT_ID, 9 | DPFLTR_MASK, fmt, list);
#if defined(VIRTIO_DBG_USE_IOPORT)
    {
        NTSTATUS status;
        // use this way of output only for DISPATCH_LEVEL,
        // higher requires more protection
        if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
        {
            char buf[256];
            size_t len, i;
            buf[0] = 0;
            status = RtlStringCbVPrintfA(buf, sizeof(buf), fmt, list);
            if (status == STATUS_SUCCESS) len = strlen(buf);
            else if (status == STATUS_BUFFER_OVERFLOW) len = sizeof(buf);
            else { memcpy(buf, "Can't print", 11); len = 11; }
            NdisAcquireSpinLock(&CrashLock);
            for (i = 0; i < len; ++i)
            {
                NdisRawWritePortUchar(VIRTIO_DBG_USE_IOPORT, buf[i]);
            }
            NdisRawWritePortUchar(VIRTIO_DBG_USE_IOPORT, '\n');
            NdisReleaseSpinLock(&CrashLock);
        }
    }
#endif
    va_end(list);
}

#else

static void NetKVMDebugPrint(const char *fmt, ...)
{
    va_list list;
    va_start(list, fmt);
    char buf[256];
    buf[0] = 0;
    _vsnprintf_s(buf, sizeof(buf), _TRUNCATE, fmt, list);
    TraceNoPrefix(0, "%s", buf);
}

#endif

tDebugPrintFunc VirtioDebugPrintProc = NetKVMDebugPrint;

void ParaNdis_DebugInitialize()
{
    NDIS_STRING usRegister, usDeregister, usPrint;
    PVOID pr, pd;
    BOOLEAN res = false;

    NdisAllocateSpinLock(&CrashLock);
    KeInitializeCallbackRecord(&CallbackRecord);
    ParaNdis_PrepareBugCheckData();
    NdisInitUnicodeString(&usPrint, L"vDbgPrintEx");
    NdisInitUnicodeString(&usRegister, L"KeRegisterBugCheckReasonCallback");
    NdisInitUnicodeString(&usDeregister, L"KeDeregisterBugCheckReasonCallback");
#ifndef NETKVM_WPP_ENABLED
    pd = MmGetSystemRoutineAddress(&usPrint);
    if (pd) PrintProcedure = (vDbgPrintExType)pd;
#endif
    pr = MmGetSystemRoutineAddress(&usRegister);
    pd = MmGetSystemRoutineAddress(&usDeregister);
    if (pr && pd)
    {
        BugCheckRegisterCallback = (KeRegisterBugCheckReasonCallbackType)pr;
        BugCheckDeregisterCallback = (KeDeregisterBugCheckReasonCallbackType)pd;
    }
#if ENABLE_CRASH_CALLBACK
    res = BugCheckRegisterCallback(&CallbackRecord, ParaNdis_OnBugCheck, KbCallbackSecondaryDumpData, (const PUCHAR)"NetKvm");
#endif
    DPrintf(0, "[%s] Crash callback %sregistered\n", __FUNCTION__, res ? "" : "NOT ");
}

void ParaNdis_DebugCleanup(PDRIVER_OBJECT  pDriverObject)
{
    UNREFERENCED_PARAMETER(pDriverObject);

    BugCheckDeregisterCallback(&CallbackRecord);
}

#define MAX_CONTEXTS    4

#if defined(ENABLE_HISTORY_LOG)
#define MAX_HISTORY     0x40000
#else
#define MAX_HISTORY     2
#endif

#if defined(KEEP_PENDING_NBL)
#define MAX_KEEP_NBLS   1024
#else
#define MAX_KEEP_NBLS   1
#endif

typedef struct _tagBugCheckStaticData
{
    tBugCheckStaticDataHeader Header;
    tBugCheckPerNicDataContent PerNicData[MAX_CONTEXTS];
    tBugCheckStaticDataContent Data;
    tBugCheckHistoryDataEntry  History[MAX_HISTORY];

    RTL_BITMAP          PendingNblsBitmap;
    ULONG               PendingNblsBitmapBuffer[MAX_KEEP_NBLS/32 + !!(MAX_KEEP_NBLS%32)];
    tPendingNBlEntry    PendingNbls[MAX_KEEP_NBLS];
}tBugCheckStaticData;

typedef struct _tagBugCheckData
{
    tBugCheckStaticData     StaticData;
    tBugCheckDataLocation   Location;
}tBugCheckData;

static tBugCheckData BugCheckData;
static BOOLEAN bNative = TRUE;

VOID ParaNdis_PrepareBugCheckData()
{
    BugCheckData.StaticData.Header.StaticDataVersion = PARANDIS_DEBUG_STATIC_DATA_VERSION;
    BugCheckData.StaticData.Header.PerNicDataVersion = PARANDIS_DEBUG_PER_NIC_DATA_VERSION;
    BugCheckData.StaticData.Header.ulMaxContexts = MAX_CONTEXTS;
    BugCheckData.StaticData.Header.SizeOfPointer = sizeof(PVOID);
    BugCheckData.StaticData.Header.PerNicData = (UINT_PTR)(PVOID)BugCheckData.StaticData.PerNicData;
    BugCheckData.StaticData.Header.DataArea = (UINT64)&BugCheckData.StaticData.Data;
    BugCheckData.StaticData.Header.DataAreaSize = sizeof(BugCheckData.StaticData.Data);
    BugCheckData.StaticData.Data.StaticDataV0.HistoryDataVersion = PARANDIS_DEBUG_HISTORY_DATA_VERSION;
    BugCheckData.StaticData.Data.StaticDataV0.SizeOfHistory = MAX_HISTORY;
    BugCheckData.StaticData.Data.StaticDataV0.SizeOfHistoryEntry = sizeof(tBugCheckHistoryDataEntry);
    BugCheckData.StaticData.Data.StaticDataV0.HistoryData = (UINT_PTR)(PVOID)BugCheckData.StaticData.History;
    BugCheckData.StaticData.Data.PendingNblEntryVersion = PARANDIS_DEBUG_PENDING_NBL_ENTRY_VERSION;
    BugCheckData.StaticData.Data.PendingNblData = (UINT_PTR)(PVOID)BugCheckData.StaticData.PendingNbls;
    BugCheckData.StaticData.Data.MaxPendingNbl = MAX_KEEP_NBLS;
    BugCheckData.Location.Address = (UINT64)&BugCheckData;
    BugCheckData.Location.Size = sizeof(BugCheckData);
    RtlInitializeBitMap(&BugCheckData.StaticData.PendingNblsBitmap, BugCheckData.StaticData.PendingNblsBitmapBuffer, MAX_KEEP_NBLS);
}

void ParaNdis_DebugRegisterMiniport(PARANDIS_ADAPTER *pContext, BOOLEAN bRegister)
{
    UINT i;
    NdisAcquireSpinLock(&CrashLock);
    for (i = 0; i < MAX_CONTEXTS; ++i)
    {
        UINT64 val1 = bRegister ? 0 : (UINT_PTR)pContext;
        UINT64 val2 = bRegister ? (UINT_PTR)pContext : 0;
        if (BugCheckData.StaticData.PerNicData[i].Context != val1) continue;
        BugCheckData.StaticData.PerNicData[i].Context = val2;
        break;
    }
    NdisReleaseSpinLock(&CrashLock);
}

#if ENABLE_CRASH_CALLBACK
static UINT FillDataOnBugCheck()
{
    UINT i, n = 0;
    NdisGetCurrentSystemTime(&BugCheckData.StaticData.Header.qCrashTime);
    for (i = 0; i < MAX_CONTEXTS; ++i)
    {
        tBugCheckPerNicDataContent *pSave = &BugCheckData.StaticData.PerNicData[i];
        PARANDIS_ADAPTER *p = (PARANDIS_ADAPTER *)(UINT_PTR)pSave->Context;
        if (!p) continue;

        pSave->nofReadyTxBuffers = 0;
        for (UINT j = 0; j < p->nPathBundles; j++)
        {
            pSave->nofReadyTxBuffers += p->pPathBundles[j].txPath.GetFreeHWBuffers();
        }

        pSave->LastInterruptTimeStamp.QuadPart = PARANDIS_GET_LAST_INTERRUPT_TIMESTAMP(p);
        pSave->LastTxCompletionTimeStamp = p->LastTxCompletionTimeStamp;
        ParaNdis_CallOnBugCheck(p);
        ++n;
    }
    return n;
}

VOID ParaNdis_OnBugCheck(
    IN KBUGCHECK_CALLBACK_REASON Reason,
    IN PKBUGCHECK_REASON_CALLBACK_RECORD Record,
    IN OUT PVOID ReasonSpecificData,
    IN ULONG ReasonSpecificDataLength
    )
{
    KBUGCHECK_SECONDARY_DUMP_DATA *pDump = (KBUGCHECK_SECONDARY_DUMP_DATA *)ReasonSpecificData;

    UNREFERENCED_PARAMETER(Record);

    if (KbCallbackSecondaryDumpData == Reason && ReasonSpecificDataLength >= sizeof(*pDump))
    {
        ULONG dumpSize = sizeof(BugCheckData.Location);
        if (!pDump->OutBuffer)
        {
            UINT nSaved;
            nSaved = FillDataOnBugCheck();
            if (pDump->InBufferLength >= dumpSize)
            {
                pDump->OutBuffer = pDump->InBuffer;
                pDump->OutBufferLength = dumpSize;
            }
            else
            {
                pDump->OutBuffer = &BugCheckData.Location;
                pDump->OutBufferLength = dumpSize;
                bNative = FALSE;
            }
            DPrintf(0, "[%s] system buffer of %d, saving data for %d NIC\n", __FUNCTION__,pDump->InBufferLength, nSaved);
            DPrintf(0, "[%s] using %s buffer\n", __FUNCTION__, bNative ? "native" : "own");
        }
        else if (pDump->OutBuffer == pDump->InBuffer)
        {
            RtlCopyMemory(&pDump->Guid, &ParaNdis_CrashGuid, sizeof(pDump->Guid));
            RtlCopyMemory(pDump->InBuffer, &BugCheckData.Location, dumpSize);
            pDump->OutBufferLength = dumpSize;
            DPrintf(0, "[%s] written %d to 0x%llx\n", __FUNCTION__, (ULONG)BugCheckData.Location.Size, (UINT_PTR)BugCheckData.Location.Address );
            DPrintf(0, "[%s] dump data (%d) at %p\n", __FUNCTION__, pDump->OutBufferLength, pDump->OutBuffer);
        }
    }
}
#endif

#if defined(ENABLE_HISTORY_LOG)
void ParaNdis_DebugHistory(
    PARANDIS_ADAPTER *pContext,
    eHistoryLogOperation op,
    PVOID pParam1,
    ULONG lParam2,
    ULONG lParam3,
    ULONG lParam4)
{
    tBugCheckHistoryDataEntry *phe;
    ULONG index = InterlockedIncrement(&BugCheckData.StaticData.Data.CurrentHistoryIndex);
    index = (index - 1) % MAX_HISTORY;
    phe = &BugCheckData.StaticData.History[index];
    phe->Context = (UINT_PTR)pContext;
    phe->operation = op;
    phe->pParam1 = (UINT_PTR)pParam1;
    phe->lParam2 = lParam2;
    phe->lParam3 = lParam3;
    phe->lParam4 = lParam4;
#if (PARANDIS_DEBUG_HISTORY_DATA_VERSION == 1)
    phe->uIRQL = KeGetCurrentIrql();
    phe->uProcessor = KeGetCurrentProcessorNumber();
#endif
    NdisGetCurrentSystemTime(&phe->TimeStamp);
}

#endif

#if defined(KEEP_PENDING_NBL)

void ParaNdis_DebugNBLIn(PNET_BUFFER_LIST nbl, ULONG& index)
{
    NdisAcquireSpinLock(&CrashLock);
    index = RtlFindClearBitsAndSet(&BugCheckData.StaticData.PendingNblsBitmap, 1, 0);
    NdisReleaseSpinLock(&CrashLock);
    if (index < MAX_KEEP_NBLS)
    {
        BugCheckData.StaticData.PendingNbls[index].NBL = (ULONG_PTR)(PVOID)nbl;
        NdisGetCurrentSystemTime(&BugCheckData.StaticData.PendingNbls[index].TimeStamp);
    }
    else
    {
        // if no free bit in bitmap, ULONG(-1) returned
        BugCheckData.StaticData.Data.fNBLOverflow = 1;
    }
}

void ParaNdis_DebugNBLOut(ULONG index, PNET_BUFFER_LIST nbl)
{
    if (index >= MAX_KEEP_NBLS)
        return;

    NdisAcquireSpinLock(&CrashLock);
    if (!RtlCheckBit(&BugCheckData.StaticData.PendingNblsBitmap, index))
    {
        // simple double free
        RtlAssert(__FUNCTION__, __FILE__, __LINE__, NULL);
    }
    else if (BugCheckData.StaticData.PendingNbls[index].NBL != (ULONG_PTR)(PVOID)nbl)
    {
        // complicated double free
        RtlAssert(__FUNCTION__, __FILE__, __LINE__, NULL);
    }
    else
    {
        RtlClearBit(&BugCheckData.StaticData.PendingNblsBitmap, index);
        BugCheckData.StaticData.PendingNbls[index].NBL = 0;
    }
    NdisReleaseSpinLock(&CrashLock);
}
#endif


text:
package hive.view;

import java.util.HashMap;

import hive.actions.Action;
import hive.actions.Action.ActionType;
import hive.engine.Coordinate;
import hive.engine.Game;
import hive.pieces.Piece;
import hive.player.IPlayer;
import hive.positions.PositionUtils;

public class Table {

	private final int w = 14;
	private final int h = 9;
	public final HashMap<IPlayer.Color, Hand> hands = new HashMap<>();
	public final PlayingField field = new PlayingField(w, h, hands);

	public Game game;

	public void setGame(Game game) {

		this.game = game;

		initHands();

		game.subscribeView(field);
	}

	private void initHands() {
		hands.clear();
		int topY = -h / 2;

		int topLeftX = 0 - w / 2;
		int topLeftY = topY + (w + 1) / 4;

//		int topRightX = -topLeftX;
//		int topRightY = topLeftY - w / 2;

		hands.put(IPlayer.Color.BLACK, new Hand(game.position(), Coordinate.axial(topLeftX, topLeftY), false));
		hands.put(IPlayer.Color.WHITE, new Hand(game.position(), Coordinate.axial(topLeftX, topLeftY), true));

		for(IPlayer.Color color : game.players.keySet()) {
			IPlayer pl = game.players.get(color);
			pl.remaining((Piece p, Integer num) -> {
				for(int i = 0; i < num; ++i)
					field.insertPiece(p, hands.get(color).placeInHand(p));
			});
		}
	}

	public Hand getPlayersHand(IPlayer.Color c) {
		return hands.get(c);
	}

//	public void onTileSelected(Tile t) {
//		if(t == null) {
//			game.clearSelection();
//			return;
//		}
//
//		// First, find out where the tile is selected
//		if(game.players.get(t.piece.color()).getPieces().contains(t.piece)) {
//			System.out.println("Choosen piece on the hand of: " + game.players.get(t.piece.color()));
//			game.onPieceChoosenInHand(t.pos);
//		} else {
//			System.out.println("Choosen piece on the field!");
//			game.onPieceChoosenInField(t.pos);
//		}
//	}

	public void onPieceChoosenInHand(Piece p, Coordinate c) {
		if(p.color() == game.nextPlayer().color()) {
			System.out.println("Showing possible moves (insertion)");
			field.showPossibleMoves(PositionUtils.getPossibleInsertionCells(game.position(), game.nextPlayer().color()));
		} else {
			System.out.println("Showing adversary possible moves (insertion)");
			field.showAdversaryMoves(PositionUtils.getPossibleInsertionCells(game.position(), p.color()));
		}
		field.setSelected(c);
	}

	public void onPieceChoosenInField(Piece p, Coordinate c) {
		if(p.color() == game.nextPlayer().color()) {
			System.out.println("Showing possible moves");
			field.showPossibleMoves(p.getPossibleMoves(game.position(), c));
		} else {
			System.out.println("Showing adversary possible moves");
			field.showAdversaryMoves(p.getPossibleMoves(game.position(), c));
		}
		field.setSelected(c);
	}

	public void clearSelection() {
		field.showPossibleMoves(null);
		field.showAdversaryMoves(null);
		field.setSelected(null);
	}

	public void displayExternalBorder() {
		field.displayExternalBorder(PositionUtils.getExternalBorder(game.position()));
	}

}


text:
"""
Unit tests for the sumatra.parameters module
"""
from __future__ import with_statement
from __future__ import unicode_literals
from builtins import str

import unittest
import os
import textwrap
from copy import deepcopy
import json
from textwrap import dedent
from sumatra.parameters import SimpleParameterSet, JSONParameterSet, \
        NTParameterSet, ConfigParserParameterSet, build_parameters, \
        YAMLParameterSet, yaml_loaded

class TestNTParameterSet(unittest.TestCase):

    def setUp(self):
        self.example = {
            "y": {
                "a": -2,
                "b": [4, 5, 6],
                "c": 5,
            },
            "x": 2.9,
            "z": 100,
            "mylabel": "camelot",
            "have_horse": False,
        }

    def test__json_should_be_accepted(self):
        P = NTParameterSet(json.dumps(self.example))
        self.assertEqual(P.y.a, -2)
        self.assertEqual(P.y.b, [4, 5, 6])
        self.assertEqual(P.x, 2.9)
        self.assertEqual(P.mylabel, "camelot")

    def test__str(self):
        P = NTParameterSet(self.example)
        as_string = str(P)
        self.assertIsInstance(as_string, str)
        self.assertEqual(P, NTParameterSet(as_string))

    def test__pop(self):
        P = NTParameterSet(self.example)
        self.assertEqual(P.pop('x'), 2.9)
        self.assertEqual(P.pop('have_horse'), False)
        self.assertEqual(P.pop('y'), {"a": -2,
                                      "b": [4, 5, 6],
                                      "c": 5})
        self.assertEqual(P.as_dict(), {'z': 100, 'mylabel': 'camelot'})
        self.assertEqual(P.pop('foo', 42), 42)
        self.assertEqual(P.pop('foo', None), None)

    def test_diff(self):
        P1 = NTParameterSet(self.example)
        P2 = NTParameterSet({
                "y": {
                    "a": -2,
                    "b": [4, 5, 6],
                    "c": 55,
                },
                "x": 2.9,
                "z": 100,
                "mylabel": "Dodge City",
                "have_horse": True})
        self.assertEqual(P1.diff(P2),
                         ({'y': {'c': 5}, 'mylabel': 'camelot', 'have_horse': False},
                          {'y': {'c': 55}, 'mylabel': 'Dodge City', 'have_horse': True}))

class TestSimpleParameterSet(unittest.TestCase):

    def test__init__should_accept_space_around_equals(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        self.assertEqual(P["x"], 2)
        self.assertEqual(P["y"], 3)

    def test__init__should_accept_no_space_around_equals(self):
        P = SimpleParameterSet("x=2")
        self.assertEqual(P["x"], 2)

    def test__init__should_accept_hash_as_comment_character(self):
        P = SimpleParameterSet("x = 2 # this is a comment")
        self.assertEqual(P["x"], 2)

    def test__init__should_accept_an_empty_initializer(self):
        P = SimpleParameterSet("")
        self.assertEqual(P.values, {})

    def test__init__should_accept_dict(self):
        P = SimpleParameterSet({'x': 2, 'y': 3})
        self.assertEqual(P["x"], 2)
        self.assertEqual(P["y"], 3)

    def test__init__should_accept_a_filename_or_string(self):
        init = "x = 2\ny = 3"
        P1 = SimpleParameterSet(init)
        with open("test_file", "w") as f:
            f.write(init)
        P2 = SimpleParameterSet("test_file")
        self.assertEqual(P1.values, P2.values)
        os.remove("test_file")

    def test__init__should_raise_a_TypeError_if_initializer_is_not_a_filename_or_string(self):
        self.assertRaises(TypeError, SimpleParameterSet, [])

    def test__init__should_ignore_empty_lines(self):
        init = "x = 2\n\n\r   \ny = 3\n\n\r\t\t  \n"
        P = SimpleParameterSet(init)
        self.assertEqual(P["x"], 2)
        self.assertEqual(P["y"], 3)

    def test__init__should_ignore_comment_lines(self):
        init = textwrap.dedent("""\
            #some parameters
            x = 2
            # this is a comment at column 0
              # this is an indented comment
              y = 3
            # this is a comment line containing an 'equals' sign: n=42
            """)
        P = SimpleParameterSet(init)
        self.assertEqual(P["x"], 2)
        self.assertEqual(P["y"], 3)
        self.assertEqual(set(P.as_dict().keys()), set(["x", "y"]))

    def test__init__should_raise_syntaxerror_if_line_doesnt_contain_param_or_comment(self):
        init = "# some data\n1.0 2.0 3.0\n4.0 5.0 6.0"
        self.assertRaises(SyntaxError, SimpleParameterSet, init)

    def test__handles_null_bytes(self):
        init = "foo=\x00\na=3\n"
        self.assertRaises(SyntaxError, SimpleParameterSet, init)

    def test__string_parameters_should_be_able_to_contain_equals_signs(self):
        init = 'equation = "e = mc^2"'
        P = SimpleParameterSet(init)
        self.assertEqual(P['equation'], 'e = mc^2')

    def test__string_parameters_should_be_able_to_contain_comment_characters(self):
        P = SimpleParameterSet('char = "#"')
        self.assertEqual(P['char'], '#')
        P = SimpleParameterSet('x = "#abc#"')
        self.assertEqual(P['x'], '#abc#')

    def test__getitem__should_give_access_to_parameters(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        self.assertEqual(P["x"], 2)
        self.assertEqual(P["y"], 3)

    def test__getitem__should_raise_a_KeyError_for_a_nonexistent_parameter(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        self.assertRaises(KeyError, P.__getitem__, "z")

    def test__pretty__should_put_quotes_around_string_parameters(self):
        init = 'y = "hello"'
        P = SimpleParameterSet(init)
        self.assertEqual(P.pretty(), init)

    def test__pretty__should_recreate_comments_in_the_initializer(self):
        init = 'x = 2 # this is a comment'
        P = SimpleParameterSet(init)
        self.assertEqual(P.pretty(), init)

    def test__pretty__output_should_be_useable_to_create_an_identical_parameterset(self):
        init = "x = 2\ny = 3\nz = 'hello'"
        P1 = SimpleParameterSet(init)
        P2 = SimpleParameterSet(P1.pretty())
        self.assertEqual(P1.values, P2.values)

    def test__save__should_backup_an_existing_file_before_overwriting_it(self):
        # not really sure what the desired behaviour is here
        assert not os.path.exists("test_file.orig")
        init = "x = 2\ny = 3"
        with open("test_file", "w") as f:
            f.write(init)
        P = SimpleParameterSet("test_file")
        P.save("test_file")
        self.assert_(os.path.exists("test_file.orig"))
        os.remove("test_file")
        os.remove("test_file.orig")

    def test__update__should_accept_basic_python_types(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        param_values = [("z", "hello"),
                        ("tumoltuae", 42),
                        ("somelist", [1, 2, "a", "b"]),
                        ("sometuple", (3, 4, "c")),
                        ("foo", None),
                        ("isittrue", False)]
        for name, value in param_values:
            P.update({name: value})
            self.assertEqual(P[name], value)

    def test__update__should_not_accept_complex_types(self):
        class CustomClass(object):
            pass
        P = SimpleParameterSet("x = 2\ny = 3")
        self.assertRaises(TypeError, P.update, "somedict", {})
        self.assertRaises(TypeError, P.update, "someclass", CustomClass())

    def test__update_kwargs(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        P.update({}, z="hello")
        self.assertEqual(P["z"], "hello")

    def test__str(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        as_string = str(P)
        self.assertIsInstance(as_string, str)
        self.assertEqual(P, SimpleParameterSet(as_string))

    def test__pop(self):
        P = SimpleParameterSet("x = 2\ny = 3")
        self.assertEqual(P.pop('x'), 2)
        self.assertEqual(P.as_dict(), {'y': 3})
        self.assertEqual(P.pop('foo', 42), 42)
        self.assertEqual(P.pop('foo', None), None)

    def test_diff(self):
        P1 = SimpleParameterSet("x = 2\ny = 3")
        P2 = SimpleParameterSet("x = 3\ny = 3\nz = 4")
        self.assertEqual(P1.diff(P2),
                         ({'x': 2}, {'x': 3, 'z': 4}))
        P3 = JSONParameterSet(dedent("""
                {
                    "x" : 2,
                    "y" : 4,
                    "z": 4
                }"""))
        self.assertEqual(P1.diff(P3),
                         ({'y': 3}, {'y': 4, 'z': 4}))

    def test_long_parameter(self):
        parameters = "x = '{0}'".format(''.join("a" * 250))
        SimpleParameterSet(parameters)

class TestConfigParserParameterSet(unittest.TestCase):
    test_parameters = dedent("""
        # this is a comment

        [sectionA]
        a: 2
        b: 3

        [sectionB]
        c: hello
        d: world
        """)

    def test__init__should_accept_an_empty_initializer(self):
        P = ConfigParserParameterSet("")
        self.assertEqual(P.as_dict(), {})

    def test__init__should_accept_a_filename_or_string(self):
        init = self.__class__.test_parameters
        P1 = ConfigParserParameterSet(init)
        with open("test_file", "w") as f:
            f.write(init)
        P2 = ConfigParserParameterSet("test_file")
        self.assertEqual(P1.as_dict(), P2.as_dict())
        os.remove("test_file")

    def test__pretty__output_should_be_useable_to_create_an_identical_parameterset(self):
        init = self.__class__.test_parameters
        P1 = ConfigParserParameterSet(init)
        P2 = ConfigParserParameterSet(P1.pretty())
        self.assertEqual(P1.as_dict(), P2.as_dict())

    def test__update_should_handle_dots_appropriately(self):
        init = self.__class__.test_parameters
        P = ConfigParserParameterSet(init)
        P.update({"sectionA.a": 5, "sectionA.c": 4, "sectionC.e": 9})
        self.assertEqual(P.as_dict(), {"sectionA": dict(a="5", b="3", c="4"),
                                       "sectionB": dict(c="hello", d="world"),
                                       "sectionC": dict(e="9")})

    def test__deepcopy(self):
        # see ticket:93
        init = self.__class__.test_parameters
        P = ConfigParserParameterSet(init)
        Q = deepcopy(P)

    def test__str(self):
        init = self.__class__.test_parameters
        P = ConfigParserParameterSet(str(init))
        as_string = str(P)
        self.assertIsInstance(as_string, str)
        self.assertEqual(P, ConfigParserParameterSet(as_string))

    def test__pop(self):
        init = self.__class__.test_parameters
        P = ConfigParserParameterSet(init)
        self.assertEqual(P.pop('sectionA.b'), '3')
        self.assertEqual(P.pop('sectionA.foo', 42), 42)

    def test__getitem(self):
        init = self.__class__.test_parameters
        P = ConfigParserParameterSet(init)
        self.assertEqual(P['sectionA'], {'a': '2', 'b': '3'})
        self.assertEqual(P['sectionB.c'], 'hello')

    def test_diff(self):
        P1 = ConfigParserParameterSet(self.__class__.test_parameters)
        P2 = ConfigParserParameterSet(dedent("""
            # this is a comment

            [sectionA]
            a: 3
            b: 3

            [sectionB]
            c: hello
            d: universe

            [sectionC]
            e: zebra
            """))
        self.assertEqual(P1.diff(P2),
                         ({'sectionA': {'a': '2'}, 'sectionB': {'d': 'world'}},
                          {'sectionA': {'a': '3'}, 'sectionB': {'d': 'universe'}, 'sectionC': {'e': 'zebra'}}))

class TestJSONParameterSet(unittest.TestCase):
    test_parameters = dedent("""
        {
            "a" : 2,
            "b" : "hello",
            "c" : {"a":1, "b":2},
            "d" : [1, 2, 3, 4]
        }
        """)

    def test__init__should_accept_an_empty_initializer(self):
        P = JSONParameterSet("")
        self.assertEqual(P.as_dict(), {})

    def test__init__should_accept_a_filename_or_string(self):
        init = self.__class__.test_parameters
        P1 = JSONParameterSet(init)
        with open("test_file", "w") as f:
            f.write(init)
        P2 = JSONParameterSet("test_file")
        self.assertEqual(P1.as_dict(), P2.as_dict())
        os.remove("test_file")

    def test_save(self):
        init = self.__class__.test_parameters
        P1 = JSONParameterSet(init)
        P1.save("test_file")
        P2 = JSONParameterSet("test_file")
        self.assertEqual(P1.as_dict(), P2.as_dict())
        os.remove("test_file")

    def test__pretty__output_should_be_useable_to_create_an_identical_parameterset(self):
        init = self.__class__.test_parameters
        P1 = JSONParameterSet(init)
        P2 = JSONParameterSet(P1.pretty())
        self.assertEqual(P1.as_dict(), P2.as_dict())

    def test__str(self):
        init = self.__class__.test_parameters
        P = JSONParameterSet(init)
        as_string = str(P)
        self.assertIsInstance(as_string, str)

    def test__pop(self):
        init = self.__class__.test_parameters
        P = JSONParameterSet(init)
        self.assertEqual(P.pop('a'), 2)
        self.assertEqual(P.pop('c'), {"a": 1, "b": 2})
        self.assertEqual(P.as_dict(), {'b': "hello", "d": [1, 2, 3, 4]})
        self.assertEqual(P.pop('foo', 42), 42)
        self.assertEqual(P.pop('foo', None), None)

    def test__update(self):
        P = JSONParameterSet(self.__class__.test_parameters)
        P.update([("x", 1), ("y", 2)], z=3)
        self.assertEqual(P["x"], 1)
        self.assertEqual(P["z"], 3)

    def test_diff(self):
        P1 = JSONParameterSet(self.__class__.test_parameters)
        P2 = JSONParameterSet(dedent("""
        {
            "a" : 3,
            "b" : "hello",
            "c" : {"a": 1, "b": 22},
            "d" : [1, 2, 77, 4]
        }
        """))
        self.assertEqual(P1.diff(P2),
                         ({'a': 2, 'c': {'b': 2}, 'd': [1, 2, 3, 4]},
                          {'a': 3, 'c': {'b': 22}, 'd': [1, 2, 77, 4]}))
        try:
            P3 = YAMLParameterSet(TestYAMLParameterSet.test_parameters)
        except ImportError:
            pass
        else:
            self.assertEqual(P2.diff(P3), P2.diff(P1))

class TestYAMLParameterSet(unittest.TestCase):
    test_parameters = dedent("""
            a:   2
            b:   "hello"
            c:
              a: 1
              b: 2
            d:   [1, 2, 3, 4]
        """)

    @unittest.skipUnless(yaml_loaded, "PyYAML not available")
    def setUp(self):
        pass

    def test__init__should_accept_an_empty_initializer(self):
        P = YAMLParameterSet("")
        self.assertEqual(P.as_dict(), {})

    def test__init__should_accept_a_filename_or_string(self):
        init = self.__class__.test_parameters
        P1 = YAMLParameterSet(init)
        with open("test_file", "w") as f:
            f.write(init)
        P2 = YAMLParameterSet("test_file")
        self.assertEqual(P1.as_dict(), P2.as_dict())
        os.remove("test_file")

    def test_save(self):
        init = self.__class__.test_parameters
        P1 = YAMLParameterSet(init)
        P1.save("test_file")
        P2 = YAMLParameterSet("test_file")
        self.assertEqual(P1.as_dict(), P2.as_dict())
        os.remove("test_file")

    def test__pretty__output_should_be_useable_to_create_an_identical_parameterset(self):
        init = self.__class__.test_parameters
        P1 = YAMLParameterSet(init)
        P2 = YAMLParameterSet(P1.pretty())
        self.assertEqual(P1.as_dict(), P2.as_dict())

    def test__as_dict(self):
        init = self.__class__.test_parameters
        P = YAMLParameterSet(init)
        self.assertEqual(P.as_dict(),
                         {
                             "a": 2,
                             "b": "hello",
                             "c": {"a": 1, "b": 2},
                             "d": [1, 2, 3, 4]
                         })

    def test__str(self):
        init = self.__class__.test_parameters
        P = YAMLParameterSet(init)
        as_string = str(P)
        self.assertIsInstance(as_string, str)

    def test__pop(self):
        init = self.__class__.test_parameters
        P = YAMLParameterSet(init)
        self.assertEqual(P.pop('a'), 2)
        self.assertEqual(P.pop('c'), {"a": 1, "b": 2})
        self.assertEqual(P.as_dict(), {'b': "hello", "d": [1, 2, 3, 4]})
        self.assertEqual(P.pop('foo', 42), 42)
        self.assertEqual(P.pop('foo', None), None)

    def test_equality(self):
        P = YAMLParameterSet(self.__class__.test_parameters)
        Q = YAMLParameterSet(self.__class__.test_parameters)
        self.assertEqual(P, Q)
        Q.update({"a": 3})
        self.assertNotEqual(P, Q)

    def test__update(self):
        P = YAMLParameterSet(self.__class__.test_parameters)
        P.update([("x", 1), ("y", 2)], z=3)
        self.assertEqual(P["z"], 3)

    def test_diff(self):
        P1 = YAMLParameterSet(self.__class__.test_parameters)
        P2 = YAMLParameterSet(dedent("""
            a:   3
            b:   "hello"
            c:
              a: 1
              b: 22
            d:   [1, 2, 77, 4]
        """))
        self.assertEqual(P1.diff(P2),
                         ({'a': 2, 'c': {'b': 2}, 'd': [1, 2, 3, 4]},
                          {'a': 3, 'c': {'b': 22}, 'd': [1, 2, 77, 4]}))

class TestModuleFunctions(unittest.TestCase):

    def setUp(self):
        init = "x = 2\ny = 3"
        with open("test_file.simple", "w") as f:
            f.write(init)
        init2 = '{\n  "x": 2,\n  "y": {"a": 3, "b": 4}\n}'
        with open("test_file.hierarchical", "w") as f:
            f.write(init2)
        init3 = "[sectionA]\na = 2\nb = 3\n[sectionB]\nc = hello\nd = world"
        with open("test_file.config", "w") as f:
            f.write(init3)
        with open("test_file.json", "w") as f:
            f.write(init2)
        if yaml_loaded:
            with open("test_file.yaml", "w") as f:
                f.write(init2)

    def tearDown(self):
        os.remove("test_file.simple")
        os.remove("test_file.hierarchical")
        os.remove("test_file.config")
        os.remove("test_file.json")
        if yaml_loaded:
            os.remove("test_file.yaml")

    def test__build_parameters_simple(self):
        P = build_parameters("test_file.simple")
        self.assertEqual(P.as_dict(), {'x': 2, 'y': 3})
        self.assertIsInstance(P, SimpleParameterSet)

    def test__build_parameters_hierarchical(self):
        P = build_parameters("test_file.hierarchical")
        self.assertEqual(P.as_dict(), {'x': 2, 'y': {'a': 3, 'b': 4}})
        self.assertIsInstance(P, (JSONParameterSet, YAMLParameterSet, NTParameterSet))

    def test__build_parameters_config(self):
        P = build_parameters("test_file.config")
        self.assertEqual(P.as_dict(), {'sectionA': {'a': '2', 'b': '3'}, 'sectionB': {'c': 'hello', 'd': 'world'}})
        self.assertIsInstance(P, ConfigParserParameterSet)

    def test__build_parameters_json(self):
        P = build_parameters("test_file.json")
        self.assertEqual(P.as_dict(), {'x': 2, 'y': {'a': 3, 'b': 4}})
        self.assertIsInstance(P, JSONParameterSet)

    @unittest.skipUnless(yaml_loaded, "PyYAML not available")
    def test__build_parameters_yaml(self):
        P = build_parameters("test_file.yaml")
        self.assertEqual(P.as_dict(), {'x': 2, 'y': {'a': 3, 'b': 4}})
        self.assertIsInstance(P, YAMLParameterSet)

# these tests should now be applied to commands.parse_arguments and/or commands.parse_command_line_parameter()
    #def test__build_parameters__should_add_new_command_line_parameters_to_the_file_parameters(self):
    #    P = build_parameters("test_file", ["z=42", "foo=bar"])
    #    self.assertEqual(P.values, {"x": 2, "y": 3, "z": 42, "foo": "bar"})
    #    P = build_parameters("test_file3", ["sectionA.c=42", "sectionC.foo=bar"])
    #    self.assertEqual(P["sectionA.c"], "42")
    #    self.assertEqual(P["sectionC.foo"], "bar")
    #
    #def test__build_parameters__should_overwrite_file_parameters_if_command_line_parameters_have_the_same_name(self):
    #    P = build_parameters("test_file", ["x=12", "y=13"])
    #    self.assertEqual(P.values, {"x": 12, "y": 13})
    #    P = build_parameters("test_file3", ["sectionA.a=999"])
    #    self.assertEqual(P["sectionA.a"], "999")
    #
    #def test__build_parameters__should_insert_dotted_parameters_in_the_appropriate_place_in_the_hierarchy(self):
    #    P = build_parameters("test_file2", ["z=100", "y.c=5", "y.a=-2"])
    #    assert isinstance(P, NTParameterSet), type(P)
    #    self.assertEqual(P.as_dict(), {
    #                                    "y": {
    #                                        "a": -2,
    #                                        "b": 4,
    #                                        "c": 5,
    #                                    },
    #                                    "x": 2,
    #                                    "z": 100,
    #                                  })
    #
    #
    #def test__build_parameters__should_cast_string_representations_of_numbers_within_lists_to_numeric_type(self):
    #    # unless they are in quotes
    #    # also applies to tuples
    #    # what about dicts or sets?
    #    P = build_parameters("test_file", ["M=[1,2,3,4,5]", "N=['1', '2', 3, 4, '5']"])
    #    self.assertEqual(P.values, {"x": 2, "y": 3, "M": [1,2,3,4,5], "N": ['1', '2', 3, 4, '5']})

if __name__ == '__main__':
    unittest.main()


text:
package org.apache.calcite.adapter.enumerable;

import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.plan.RelRule;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.core.CorrelationId;
import org.apache.calcite.rel.core.Join;
import org.apache.calcite.rel.core.JoinRelType;
import org.apache.calcite.rel.logical.LogicalJoin;
import org.apache.calcite.rex.RexBuilder;
import org.apache.calcite.rex.RexCorrelVariable;
import org.apache.calcite.rex.RexInputRef;
import org.apache.calcite.rex.RexNode;
import org.apache.calcite.rex.RexShuttle;
import org.apache.calcite.tools.RelBuilder;
import org.apache.calcite.tools.RelBuilderFactory;
import org.apache.calcite.util.ImmutableBeans;
import org.apache.calcite.util.ImmutableBitSet;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/** Rule to convert a {@link LogicalJoin} to an {@link EnumerableBatchNestedLoopJoin}.
 * You may provide a custom config to convert other nodes that extend {@link Join}.
 *
 * @see EnumerableRules#ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
 */
public class EnumerableBatchNestedLoopJoinRule
    extends RelRule<EnumerableBatchNestedLoopJoinRule.Config> {
  /** Creates an EnumerableBatchNestedLoopJoinRule. */
  protected EnumerableBatchNestedLoopJoinRule(Config config) {
    super(config);
  }

  @Deprecated // to be removed before 2.0
  protected EnumerableBatchNestedLoopJoinRule(Class<? extends Join> clazz,
      RelBuilderFactory relBuilderFactory, int batchSize) {
    this(Config.DEFAULT.withRelBuilderFactory(relBuilderFactory)
        .withOperandSupplier(b -> b.operand(clazz).anyInputs())
        .as(Config.class)
        .withBatchSize(batchSize));
  }

  @Deprecated // to be removed before 2.0
  public EnumerableBatchNestedLoopJoinRule(RelBuilderFactory relBuilderFactory) {
    this(Config.DEFAULT.withRelBuilderFactory(relBuilderFactory)
        .as(Config.class));
  }

  @Deprecated // to be removed before 2.0
  public EnumerableBatchNestedLoopJoinRule(RelBuilderFactory relBuilderFactory,
      int batchSize) {
    this(Config.DEFAULT.withRelBuilderFactory(relBuilderFactory)
        .as(Config.class)
        .withBatchSize(batchSize));
  }

  @Override public boolean matches(RelOptRuleCall call) {
    Join join = call.rel(0);
    JoinRelType joinType = join.getJoinType();
    return joinType == JoinRelType.INNER
        || joinType == JoinRelType.LEFT
        || joinType == JoinRelType.ANTI
        || joinType == JoinRelType.SEMI;
  }

  @Override public void onMatch(RelOptRuleCall call) {
    final Join join = call.rel(0);
    final int leftFieldCount = join.getLeft().getRowType().getFieldCount();
    final RelOptCluster cluster = join.getCluster();
    final RexBuilder rexBuilder = cluster.getRexBuilder();
    final RelBuilder relBuilder = call.builder();

    final Set<CorrelationId> correlationIds = new HashSet<>();
    final List<RexNode> corrVarList = new ArrayList<>();

    final int batchSize = config.batchSize();
    for (int i = 0; i < batchSize; i++) {
      CorrelationId correlationId = cluster.createCorrel();
      correlationIds.add(correlationId);
      corrVarList.add(
          rexBuilder.makeCorrel(join.getLeft().getRowType(),
              correlationId));
    }
    final RexNode corrVar0 = corrVarList.get(0);

    final ImmutableBitSet.Builder requiredColumns = ImmutableBitSet.builder();

    // Generate first condition
    final RexNode condition = join.getCondition().accept(new RexShuttle() {
      @Override public RexNode visitInputRef(RexInputRef input) {
        int field = input.getIndex();
        if (field >= leftFieldCount) {
          return rexBuilder.makeInputRef(input.getType(),
              input.getIndex() - leftFieldCount);
        }
        requiredColumns.set(field);
        return rexBuilder.makeFieldAccess(corrVar0, field);
      }
    });

    final List<RexNode> conditionList = new ArrayList<>();
    conditionList.add(condition);

    // Add batchSize-1 other conditions
    for (int i = 1; i < batchSize; i++) {
      final int corrIndex = i;
      final RexNode condition2 = condition.accept(new RexShuttle() {
        @Override public RexNode visitCorrelVariable(RexCorrelVariable variable) {
          return variable.equals(corrVar0) ? corrVarList.get(corrIndex) : variable;
        }
      });
      conditionList.add(condition2);
    }

    // Push a filter with batchSize disjunctions
    relBuilder.push(join.getRight()).filter(relBuilder.or(conditionList));
    final RelNode right = relBuilder.build();

    call.transformTo(
        EnumerableBatchNestedLoopJoin.create(
            convert(join.getLeft(), join.getLeft().getTraitSet()
                .replace(EnumerableConvention.INSTANCE)),
            convert(right, right.getTraitSet()
                .replace(EnumerableConvention.INSTANCE)),
            join.getCondition(),
            requiredColumns.build(),
            correlationIds,
            join.getJoinType()));
  }

  /** Rule configuration. */
  public interface Config extends RelRule.Config {
    Config DEFAULT = EMPTY
        .withOperandSupplier(b -> b.operand(LogicalJoin.class).anyInputs())
        .withDescription("EnumerableBatchNestedLoopJoinRule")
        .as(Config.class);

    @Override default EnumerableBatchNestedLoopJoinRule toRule() {
      return new EnumerableBatchNestedLoopJoinRule(this);
    }

    /** Batch size.
     *
     * <p>Warning: if the batch size is around or bigger than 1000 there
     * can be an error because the generated code exceeds the size limit. */
    @ImmutableBeans.Property
    @ImmutableBeans.IntDefault(100)
    int batchSize();

    /** Sets {@link #batchSize()}. */
    Config withBatchSize(int batchSize);
  }
}


text:
package io.reactivex.internal.operators.single;

import java.util.concurrent.Callable;

import io.reactivex.*;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.internal.disposables.EmptyDisposable;

public final class SingleFromCallable<T> extends Single<T> {

    final Callable<? extends T> callable;

    public SingleFromCallable(Callable<? extends T> callable) {
        this.callable = callable;
    }

    @Override
    protected void subscribeActual(SingleObserver<? super T> s) {

        s.onSubscribe(EmptyDisposable.INSTANCE);
        try {
            T v = callable.call();
            if (v != null) {
                s.onSuccess(v);
            } else {
                s.onError(new NullPointerException("The callable returned a null value"));
            }
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            s.onError(e);
        }
    }

}


text:
package com.plexobject.yodlee.domain;

public class MFARequest {
    private String cobSessionToken;
    private String userSessionToken;
    private Long itemId;

    public MFARequest() {

    }

    public MFARequest(String cobSessionToken, String userSessionToken,
            Long itemId) {
        this.cobSessionToken = cobSessionToken;
        this.userSessionToken = userSessionToken;
        this.itemId = itemId;
    }

    public String getCobSessionToken() {
        return cobSessionToken;
    }

    public void setCobSessionToken(String cobSessionToken) {
        this.cobSessionToken = cobSessionToken;
    }

    public String getUserSessionToken() {
        return userSessionToken;
    }

    public void setUserSessionToken(String userSessionToken) {
        this.userSessionToken = userSessionToken;
    }

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

}


text:
Config
=======
These are various files used in this project that are static.