text:
namespace Playthrough2.UI
{
    partial class ConfigurationForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.routesTabPage = new System.Windows.Forms.TabPage();
            this.actionsGroupBox = new System.Windows.Forms.GroupBox();
            this.clearButton = new System.Windows.Forms.Button();
            this.routeList = new System.Windows.Forms.ListBox();
            this.stopButton = new System.Windows.Forms.Button();
            this.startButton = new System.Windows.Forms.Button();
            this.inputGroupBox = new System.Windows.Forms.GroupBox();
            this.inputSourceComboBox = new System.Windows.Forms.ComboBox();
            this.inputFormatPanel = new System.Windows.Forms.TableLayoutPanel();
            this.inputFormatChLabel = new System.Windows.Forms.Label();
            this.inputFormatEnable = new System.Windows.Forms.CheckBox();
            this.inputFormatFrequency = new System.Windows.Forms.TextBox();
            this.inputFormatHzLabel = new System.Windows.Forms.Label();
            this.inputFormatChannels = new System.Windows.Forms.TextBox();
            this.inputDeviceBufferCountPanel = new System.Windows.Forms.TableLayoutPanel();
            this.inputBufferCountValueLabel = new System.Windows.Forms.Label();
            this.inputBufferCountLabel = new System.Windows.Forms.Label();
            this.inputBufferCountSlider = new System.Windows.Forms.TrackBar();
            this.inputDeviceBufferSizePanel = new System.Windows.Forms.TableLayoutPanel();
            this.inputBufferSizeValueLabel = new System.Windows.Forms.Label();
            this.inputBufferSizeLabel = new System.Windows.Forms.Label();
            this.inputBufferSizeSlider = new System.Windows.Forms.TrackBar();
            this.inputDeviceComboBox = new System.Windows.Forms.ComboBox();
            this.outputGroupBox = new System.Windows.Forms.GroupBox();
            this.outputSourceComboBox = new System.Windows.Forms.ComboBox();
            this.outputDeviceBufferSizePanel = new System.Windows.Forms.TableLayoutPanel();
            this.outputLatencyValueLabel = new System.Windows.Forms.Label();
            this.outputTargetLatencyLabel = new System.Windows.Forms.Label();
            this.outputLatencySlider = new System.Windows.Forms.TrackBar();
            this.outputDeviceBufferCountPanel = new System.Windows.Forms.TableLayoutPanel();
            this.outputBufferCountSlider = new System.Windows.Forms.TrackBar();
            this.outputBufferCountValueLabel = new System.Windows.Forms.Label();
            this.outputBufferCountLabel = new System.Windows.Forms.Label();
            this.outputDeviceComboBox = new System.Windows.Forms.ComboBox();
            this.configurationTabPage = new System.Windows.Forms.TabPage();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.button4 = new System.Windows.Forms.Button();
            this.button5 = new System.Windows.Forms.Button();
            this.button6 = new System.Windows.Forms.Button();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.button3 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.optionsGroupBox = new System.Windows.Forms.GroupBox();
            this.discardDataCheckBox = new System.Windows.Forms.CheckBox();
            this.backgroundThreadCheckBox = new System.Windows.Forms.CheckBox();
            this.devicesTabPage = new System.Windows.Forms.TabPage();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.deviceInfoTreeView = new System.Windows.Forms.TreeView();
            this.deviceInfoTextBox = new System.Windows.Forms.TextBox();
            this.toolTip = new System.Windows.Forms.ToolTip(this.components);
            this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
            this.tabControl1.SuspendLayout();
            this.routesTabPage.SuspendLayout();
            this.actionsGroupBox.SuspendLayout();
            this.inputGroupBox.SuspendLayout();
            this.inputFormatPanel.SuspendLayout();
            this.inputDeviceBufferCountPanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.inputBufferCountSlider)).BeginInit();
            this.inputDeviceBufferSizePanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.inputBufferSizeSlider)).BeginInit();
            this.outputGroupBox.SuspendLayout();
            this.outputDeviceBufferSizePanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.outputLatencySlider)).BeginInit();
            this.outputDeviceBufferCountPanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.outputBufferCountSlider)).BeginInit();
            this.configurationTabPage.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.optionsGroupBox.SuspendLayout();
            this.devicesTabPage.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            this.SuspendLayout();
            //
            // tabControl1
            //
            this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons;
            this.tabControl1.Controls.Add(this.routesTabPage);
            this.tabControl1.Controls.Add(this.configurationTabPage);
            this.tabControl1.Controls.Add(this.devicesTabPage);
            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tabControl1.Location = new System.Drawing.Point(3, 3);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(414, 356);
            this.tabControl1.TabIndex = 0;
            //
            // routesTabPage
            //
            this.routesTabPage.Controls.Add(this.actionsGroupBox);
            this.routesTabPage.Controls.Add(this.inputGroupBox);
            this.routesTabPage.Controls.Add(this.outputGroupBox);
            this.routesTabPage.Location = new System.Drawing.Point(4, 25);
            this.routesTabPage.Name = "routesTabPage";
            this.routesTabPage.Size = new System.Drawing.Size(406, 327);
            this.routesTabPage.TabIndex = 0;
            this.routesTabPage.Text = "Routing";
            this.routesTabPage.UseVisualStyleBackColor = true;
            //
            // actionsGroupBox
            //
            this.actionsGroupBox.Controls.Add(this.clearButton);
            this.actionsGroupBox.Controls.Add(this.routeList);
            this.actionsGroupBox.Controls.Add(this.stopButton);
            this.actionsGroupBox.Controls.Add(this.startButton);
            this.actionsGroupBox.Location = new System.Drawing.Point(0, 220);
            this.actionsGroupBox.Name = "actionsGroupBox";
            this.actionsGroupBox.Size = new System.Drawing.Size(406, 107);
            this.actionsGroupBox.TabIndex = 7;
            this.actionsGroupBox.TabStop = false;
            this.actionsGroupBox.Text = "Active &Routes";
            //
            // clearButton
            //
            this.clearButton.Location = new System.Drawing.Point(303, 77);
            this.clearButton.Name = "clearButton";
            this.clearButton.Size = new System.Drawing.Size(97, 23);
            this.clearButton.TabIndex = 3;
            this.clearButton.Text = "&Clear All";
            this.clearButton.UseVisualStyleBackColor = true;
            //
            // routeList
            //
            this.routeList.FormattingEnabled = true;
            this.routeList.IntegralHeight = false;
            this.routeList.Location = new System.Drawing.Point(6, 19);
            this.routeList.Name = "routeList";
            this.routeList.Size = new System.Drawing.Size(291, 81);
            this.routeList.TabIndex = 0;
            //
            // stopButton
            //
            this.stopButton.Enabled = false;
            this.stopButton.Location = new System.Drawing.Point(303, 48);
            this.stopButton.Name = "stopButton";
            this.stopButton.Size = new System.Drawing.Size(97, 23);
            this.stopButton.TabIndex = 2;
            this.stopButton.Text = "S&top";
            this.stopButton.UseVisualStyleBackColor = true;
            //
            // startButton
            //
            this.startButton.Location = new System.Drawing.Point(303, 19);
            this.startButton.Name = "startButton";
            this.startButton.Size = new System.Drawing.Size(97, 23);
            this.startButton.TabIndex = 1;
            this.startButton.Text = "&Start";
            this.startButton.UseVisualStyleBackColor = true;
            //
            // inputGroupBox
            //
            this.inputGroupBox.Controls.Add(this.inputSourceComboBox);
            this.inputGroupBox.Controls.Add(this.inputFormatPanel);
            this.inputGroupBox.Controls.Add(this.inputDeviceBufferCountPanel);
            this.inputGroupBox.Controls.Add(this.inputDeviceBufferSizePanel);
            this.inputGroupBox.Controls.Add(this.inputDeviceComboBox);
            this.inputGroupBox.Location = new System.Drawing.Point(0, 0);
            this.inputGroupBox.Name = "inputGroupBox";
            this.inputGroupBox.Size = new System.Drawing.Size(200, 214);
            this.inputGroupBox.TabIndex = 4;
            this.inputGroupBox.TabStop = false;
            this.inputGroupBox.Text = "&Input";
            //
            // inputSourceComboBox
            //
            this.inputSourceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.inputSourceComboBox.DropDownWidth = 300;
            this.inputSourceComboBox.FormattingEnabled = true;
            this.inputSourceComboBox.Location = new System.Drawing.Point(6, 46);
            this.inputSourceComboBox.Name = "inputSourceComboBox";
            this.inputSourceComboBox.Size = new System.Drawing.Size(188, 21);
            this.inputSourceComboBox.Sorted = true;
            this.inputSourceComboBox.TabIndex = 4;
            this.inputSourceComboBox.SelectedIndexChanged += new System.EventHandler(this.OnInputSourceChanged);
            //
            // inputFormatPanel
            //
            this.inputFormatPanel.ColumnCount = 5;
            this.inputFormatPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.inputFormatPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 66.66666F));
            this.inputFormatPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.inputFormatPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
            this.inputFormatPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.inputFormatPanel.Controls.Add(this.inputFormatChLabel, 4, 0);
            this.inputFormatPanel.Controls.Add(this.inputFormatEnable, 0, 0);
            this.inputFormatPanel.Controls.Add(this.inputFormatFrequency, 1, 0);
            this.inputFormatPanel.Controls.Add(this.inputFormatHzLabel, 2, 0);
            this.inputFormatPanel.Controls.Add(this.inputFormatChannels, 3, 0);
            this.inputFormatPanel.Location = new System.Drawing.Point(6, 73);
            this.inputFormatPanel.Name = "inputFormatPanel";
            this.inputFormatPanel.RowCount = 1;
            this.inputFormatPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.inputFormatPanel.Size = new System.Drawing.Size(188, 26);
            this.inputFormatPanel.TabIndex = 1;
            //
            // inputFormatChLabel
            //
            this.inputFormatChLabel.AutoSize = true;
            this.inputFormatChLabel.Location = new System.Drawing.Point(141, 8);
            this.inputFormatChLabel.Margin = new System.Windows.Forms.Padding(0, 8, 0, 0);
            this.inputFormatChLabel.Name = "inputFormatChLabel";
            this.inputFormatChLabel.Size = new System.Drawing.Size(46, 13);
            this.inputFormatChLabel.TabIndex = 5;
            this.inputFormatChLabel.Text = "Channel";
            //
            // inputFormatEnable
            //
            this.inputFormatEnable.AutoSize = true;
            this.inputFormatEnable.Checked = true;
            this.inputFormatEnable.CheckState = System.Windows.Forms.CheckState.Checked;
            this.inputFormatEnable.Location = new System.Drawing.Point(3, 3);
            this.inputFormatEnable.Name = "inputFormatEnable";
            this.inputFormatEnable.Padding = new System.Windows.Forms.Padding(0, 5, 0, 0);
            this.inputFormatEnable.Size = new System.Drawing.Size(15, 19);
            this.inputFormatEnable.TabIndex = 0;
            this.toolTip.SetToolTip(this.inputFormatEnable, "If checked, override the default sampling rate.");
            this.inputFormatEnable.UseVisualStyleBackColor = true;
            //
            // inputFormatFrequency
            //
            this.inputFormatFrequency.Dock = System.Windows.Forms.DockStyle.Top;
            this.inputFormatFrequency.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.inputFormatFrequency.Location = new System.Drawing.Point(24, 3);
            this.inputFormatFrequency.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
            this.inputFormatFrequency.Name = "inputFormatFrequency";
            this.inputFormatFrequency.Size = new System.Drawing.Size(62, 21);
            this.inputFormatFrequency.TabIndex = 1;
            this.inputFormatFrequency.Text = "44100";
            this.inputFormatFrequency.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.toolTip.SetToolTip(this.inputFormatFrequency, "Frequency (in Hz) at which to record. Common values are 44100 and 48000.");
            //
            // inputFormatHzLabel
            //
            this.inputFormatHzLabel.AutoSize = true;
            this.inputFormatHzLabel.Location = new System.Drawing.Point(86, 8);
            this.inputFormatHzLabel.Margin = new System.Windows.Forms.Padding(0, 8, 3, 0);
            this.inputFormatHzLabel.Name = "inputFormatHzLabel";
            this.inputFormatHzLabel.Size = new System.Drawing.Size(20, 13);
            this.inputFormatHzLabel.TabIndex = 3;
            this.inputFormatHzLabel.Text = "Hz";
            //
            // inputFormatChannels
            //
            this.inputFormatChannels.Dock = System.Windows.Forms.DockStyle.Top;
            this.inputFormatChannels.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.inputFormatChannels.Location = new System.Drawing.Point(112, 3);
            this.inputFormatChannels.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
            this.inputFormatChannels.Name = "inputFormatChannels";
            this.inputFormatChannels.Size = new System.Drawing.Size(29, 21);
            this.inputFormatChannels.TabIndex = 2;
            this.inputFormatChannels.Text = "2";
            this.inputFormatChannels.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.toolTip.SetToolTip(this.inputFormatChannels, "Number of channels to record. Use 1 for mono or 2 for stereo.");
            //
            // inputDeviceBufferCountPanel
            //
            this.inputDeviceBufferCountPanel.ColumnCount = 2;
            this.inputDeviceBufferCountPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.inputDeviceBufferCountPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.inputDeviceBufferCountPanel.Controls.Add(this.inputBufferCountValueLabel, 1, 0);
            this.inputDeviceBufferCountPanel.Controls.Add(this.inputBufferCountLabel, 0, 0);
            this.inputDeviceBufferCountPanel.Controls.Add(this.inputBufferCountSlider, 0, 1);
            this.inputDeviceBufferCountPanel.Location = new System.Drawing.Point(6, 159);
            this.inputDeviceBufferCountPanel.Name = "inputDeviceBufferCountPanel";
            this.inputDeviceBufferCountPanel.RowCount = 2;
            this.inputDeviceBufferCountPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.inputDeviceBufferCountPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.inputDeviceBufferCountPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.inputDeviceBufferCountPanel.Size = new System.Drawing.Size(188, 48);
            this.inputDeviceBufferCountPanel.TabIndex = 3;
            //
            // inputBufferCountValueLabel
            //
            this.inputBufferCountValueLabel.AutoSize = true;
            this.inputBufferCountValueLabel.Dock = System.Windows.Forms.DockStyle.Right;
            this.inputBufferCountValueLabel.Location = new System.Drawing.Point(172, 0);
            this.inputBufferCountValueLabel.Name = "inputBufferCountValueLabel";
            this.inputBufferCountValueLabel.Size = new System.Drawing.Size(13, 13);
            this.inputBufferCountValueLabel.TabIndex = 11;
            this.inputBufferCountValueLabel.Text = "0";
            //
            // inputBufferCountLabel
            //
            this.inputBufferCountLabel.AutoSize = true;
            this.inputBufferCountLabel.Dock = System.Windows.Forms.DockStyle.Left;
            this.inputBufferCountLabel.Location = new System.Drawing.Point(3, 0);
            this.inputBufferCountLabel.Name = "inputBufferCountLabel";
            this.inputBufferCountLabel.Size = new System.Drawing.Size(66, 13);
            this.inputBufferCountLabel.TabIndex = 9;
            this.inputBufferCountLabel.Text = "Buffer Count";
            //
            // inputBufferCountSlider
            //
            this.inputBufferCountSlider.AutoSize = false;
            this.inputDeviceBufferCountPanel.SetColumnSpan(this.inputBufferCountSlider, 2);
            this.inputBufferCountSlider.LargeChange = 3;
            this.inputBufferCountSlider.Location = new System.Drawing.Point(3, 16);
            this.inputBufferCountSlider.Minimum = 1;
            this.inputBufferCountSlider.Name = "inputBufferCountSlider";
            this.inputBufferCountSlider.Size = new System.Drawing.Size(182, 27);
            this.inputBufferCountSlider.TabIndex = 8;
            this.inputBufferCountSlider.Value = 2;
            //
            // inputDeviceBufferSizePanel
            //
            this.inputDeviceBufferSizePanel.ColumnCount = 2;
            this.inputDeviceBufferSizePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.inputDeviceBufferSizePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.inputDeviceBufferSizePanel.Controls.Add(this.inputBufferSizeValueLabel, 1, 0);
            this.inputDeviceBufferSizePanel.Controls.Add(this.inputBufferSizeLabel, 0, 0);
            this.inputDeviceBufferSizePanel.Controls.Add(this.inputBufferSizeSlider, 0, 1);
            this.inputDeviceBufferSizePanel.Location = new System.Drawing.Point(6, 105);
            this.inputDeviceBufferSizePanel.Name = "inputDeviceBufferSizePanel";
            this.inputDeviceBufferSizePanel.RowCount = 2;
            this.inputDeviceBufferSizePanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.inputDeviceBufferSizePanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.inputDeviceBufferSizePanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.inputDeviceBufferSizePanel.Size = new System.Drawing.Size(188, 48);
            this.inputDeviceBufferSizePanel.TabIndex = 2;
            //
            // inputBufferSizeValueLabel
            //
            this.inputBufferSizeValueLabel.AutoSize = true;
            this.inputBufferSizeValueLabel.Dock = System.Windows.Forms.DockStyle.Right;
            this.inputBufferSizeValueLabel.Location = new System.Drawing.Point(159, 0);
            this.inputBufferSizeValueLabel.Name = "inputBufferSizeValueLabel";
            this.inputBufferSizeValueLabel.Size = new System.Drawing.Size(26, 13);
            this.inputBufferSizeValueLabel.TabIndex = 11;
            this.inputBufferSizeValueLabel.Text = "0ms";
            //
            // inputBufferSizeLabel
            //
            this.inputBufferSizeLabel.AutoSize = true;
            this.inputBufferSizeLabel.Dock = System.Windows.Forms.DockStyle.Left;
            this.inputBufferSizeLabel.Location = new System.Drawing.Point(3, 0);
            this.inputBufferSizeLabel.Name = "inputBufferSizeLabel";
            this.inputBufferSizeLabel.Size = new System.Drawing.Size(58, 13);
            this.inputBufferSizeLabel.TabIndex = 9;
            this.inputBufferSizeLabel.Text = "Buffer Size";
            //
            // inputBufferSizeSlider
            //
            this.inputBufferSizeSlider.AutoSize = false;
            this.inputDeviceBufferSizePanel.SetColumnSpan(this.inputBufferSizeSlider, 2);
            this.inputBufferSizeSlider.Location = new System.Drawing.Point(3, 16);
            this.inputBufferSizeSlider.Maximum = 300;
            this.inputBufferSizeSlider.Minimum = 1;
            this.inputBufferSizeSlider.Name = "inputBufferSizeSlider";
            this.inputBufferSizeSlider.Size = new System.Drawing.Size(182, 27);
            this.inputBufferSizeSlider.TabIndex = 8;
            this.inputBufferSizeSlider.TickFrequency = 10;
            this.inputBufferSizeSlider.Value = 50;
            //
            // inputDeviceComboBox
            //
            this.inputDeviceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.inputDeviceComboBox.DropDownWidth = 300;
            this.inputDeviceComboBox.FormattingEnabled = true;
            this.inputDeviceComboBox.Location = new System.Drawing.Point(6, 19);
            this.inputDeviceComboBox.Name = "inputDeviceComboBox";
            this.inputDeviceComboBox.Size = new System.Drawing.Size(188, 21);
            this.inputDeviceComboBox.Sorted = true;
            this.inputDeviceComboBox.TabIndex = 0;
            //
            // outputGroupBox
            //
            this.outputGroupBox.Controls.Add(this.outputSourceComboBox);
            this.outputGroupBox.Controls.Add(this.outputDeviceBufferSizePanel);
            this.outputGroupBox.Controls.Add(this.outputDeviceBufferCountPanel);
            this.outputGroupBox.Controls.Add(this.outputDeviceComboBox);
            this.outputGroupBox.Location = new System.Drawing.Point(206, 0);
            this.outputGroupBox.Name = "outputGroupBox";
            this.outputGroupBox.Size = new System.Drawing.Size(200, 214);
            this.outputGroupBox.TabIndex = 5;
            this.outputGroupBox.TabStop = false;
            this.outputGroupBox.Text = "&Output";
            //
            // outputSourceComboBox
            //
            this.outputSourceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.outputSourceComboBox.DropDownWidth = 300;
            this.outputSourceComboBox.FormattingEnabled = true;
            this.outputSourceComboBox.Location = new System.Drawing.Point(6, 46);
            this.outputSourceComboBox.Name = "outputSourceComboBox";
            this.outputSourceComboBox.Size = new System.Drawing.Size(188, 21);
            this.outputSourceComboBox.Sorted = true;
            this.outputSourceComboBox.TabIndex = 5;
            this.outputSourceComboBox.SelectedIndexChanged += new System.EventHandler(this.OnOutputSourceChanged);
            //
            // outputDeviceBufferSizePanel
            //
            this.outputDeviceBufferSizePanel.ColumnCount = 2;
            this.outputDeviceBufferSizePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.outputDeviceBufferSizePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.outputDeviceBufferSizePanel.Controls.Add(this.outputLatencyValueLabel, 1, 0);
            this.outputDeviceBufferSizePanel.Controls.Add(this.outputTargetLatencyLabel, 0, 0);
            this.outputDeviceBufferSizePanel.Controls.Add(this.outputLatencySlider, 0, 1);
            this.outputDeviceBufferSizePanel.Location = new System.Drawing.Point(6, 105);
            this.outputDeviceBufferSizePanel.Name = "outputDeviceBufferSizePanel";
            this.outputDeviceBufferSizePanel.RowCount = 2;
            this.outputDeviceBufferSizePanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.outputDeviceBufferSizePanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.outputDeviceBufferSizePanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.outputDeviceBufferSizePanel.Size = new System.Drawing.Size(188, 48);
            this.outputDeviceBufferSizePanel.TabIndex = 1;
            //
            // outputLatencyValueLabel
            //
            this.outputLatencyValueLabel.AutoSize = true;
            this.outputLatencyValueLabel.Dock = System.Windows.Forms.DockStyle.Right;
            this.outputLatencyValueLabel.Location = new System.Drawing.Point(159, 0);
            this.outputLatencyValueLabel.Name = "outputLatencyValueLabel";
            this.outputLatencyValueLabel.Size = new System.Drawing.Size(26, 13);
            this.outputLatencyValueLabel.TabIndex = 11;
            this.outputLatencyValueLabel.Text = "0ms";
            //
            // outputTargetLatencyLabel
            //
            this.outputTargetLatencyLabel.AutoSize = true;
            this.outputTargetLatencyLabel.Dock = System.Windows.Forms.DockStyle.Left;
            this.outputTargetLatencyLabel.Location = new System.Drawing.Point(3, 0);
            this.outputTargetLatencyLabel.Name = "outputTargetLatencyLabel";
            this.outputTargetLatencyLabel.Size = new System.Drawing.Size(58, 13);
            this.outputTargetLatencyLabel.TabIndex = 9;
            this.outputTargetLatencyLabel.Text = "Buffer Size";
            //
            // outputLatencySlider
            //
            this.outputLatencySlider.AutoSize = false;
            this.outputDeviceBufferSizePanel.SetColumnSpan(this.outputLatencySlider, 2);
            this.outputLatencySlider.Location = new System.Drawing.Point(3, 16);
            this.outputLatencySlider.Maximum = 300;
            this.outputLatencySlider.Minimum = 1;
            this.outputLatencySlider.Name = "outputLatencySlider";
            this.outputLatencySlider.Size = new System.Drawing.Size(182, 27);
            this.outputLatencySlider.TabIndex = 8;
            this.outputLatencySlider.TickFrequency = 10;
            this.outputLatencySlider.Value = 50;
            //
            // outputDeviceBufferCountPanel
            //
            this.outputDeviceBufferCountPanel.ColumnCount = 2;
            this.outputDeviceBufferCountPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.outputDeviceBufferCountPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.outputDeviceBufferCountPanel.Controls.Add(this.outputBufferCountSlider, 0, 1);
            this.outputDeviceBufferCountPanel.Controls.Add(this.outputBufferCountValueLabel, 1, 0);
            this.outputDeviceBufferCountPanel.Controls.Add(this.outputBufferCountLabel, 0, 0);
            this.outputDeviceBufferCountPanel.Location = new System.Drawing.Point(6, 159);
            this.outputDeviceBufferCountPanel.Name = "outputDeviceBufferCountPanel";
            this.outputDeviceBufferCountPanel.RowCount = 2;
            this.outputDeviceBufferCountPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.outputDeviceBufferCountPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.outputDeviceBufferCountPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.outputDeviceBufferCountPanel.Size = new System.Drawing.Size(188, 48);
            this.outputDeviceBufferCountPanel.TabIndex = 2;
            //
            // outputBufferCountSlider
            //
            this.outputBufferCountSlider.AutoSize = false;
            this.outputDeviceBufferCountPanel.SetColumnSpan(this.outputBufferCountSlider, 2);
            this.outputBufferCountSlider.LargeChange = 3;
            this.outputBufferCountSlider.Location = new System.Drawing.Point(3, 16);
            this.outputBufferCountSlider.Minimum = 1;
            this.outputBufferCountSlider.Name = "outputBufferCountSlider";
            this.outputBufferCountSlider.Size = new System.Drawing.Size(182, 27);
            this.outputBufferCountSlider.TabIndex = 12;
            this.outputBufferCountSlider.Value = 2;
            //
            // outputBufferCountValueLabel
            //
            this.outputBufferCountValueLabel.AutoSize = true;
            this.outputBufferCountValueLabel.Dock = System.Windows.Forms.DockStyle.Right;
            this.outputBufferCountValueLabel.Location = new System.Drawing.Point(172, 0);
            this.outputBufferCountValueLabel.Name = "outputBufferCountValueLabel";
            this.outputBufferCountValueLabel.Size = new System.Drawing.Size(13, 13);
            this.outputBufferCountValueLabel.TabIndex = 11;
            this.outputBufferCountValueLabel.Text = "0";
            //
            // outputBufferCountLabel
            //
            this.outputBufferCountLabel.AutoSize = true;
            this.outputBufferCountLabel.Dock = System.Windows.Forms.DockStyle.Left;
            this.outputBufferCountLabel.Location = new System.Drawing.Point(3, 0);
            this.outputBufferCountLabel.Name = "outputBufferCountLabel";
            this.outputBufferCountLabel.Size = new System.Drawing.Size(66, 13);
            this.outputBufferCountLabel.TabIndex = 9;
            this.outputBufferCountLabel.Text = "Buffer Count";
            //
            // outputDeviceComboBox
            //
            this.outputDeviceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.outputDeviceComboBox.DropDownWidth = 300;
            this.outputDeviceComboBox.FormattingEnabled = true;
            this.outputDeviceComboBox.Location = new System.Drawing.Point(6, 19);
            this.outputDeviceComboBox.Name = "outputDeviceComboBox";
            this.outputDeviceComboBox.Size = new System.Drawing.Size(188, 21);
            this.outputDeviceComboBox.Sorted = true;
            this.outputDeviceComboBox.TabIndex = 0;
            //
            // configurationTabPage
            //
            this.configurationTabPage.Controls.Add(this.groupBox2);
            this.configurationTabPage.Controls.Add(this.groupBox1);
            this.configurationTabPage.Controls.Add(this.optionsGroupBox);
            this.configurationTabPage.Location = new System.Drawing.Point(4, 25);
            this.configurationTabPage.Name = "configurationTabPage";
            this.configurationTabPage.Padding = new System.Windows.Forms.Padding(3);
            this.configurationTabPage.Size = new System.Drawing.Size(406, 327);
            this.configurationTabPage.TabIndex = 1;
            this.configurationTabPage.Text = "Configuration";
            this.configurationTabPage.UseVisualStyleBackColor = true;
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.button4);
            this.groupBox2.Controls.Add(this.button5);
            this.groupBox2.Controls.Add(this.button6);
            this.groupBox2.Location = new System.Drawing.Point(0, 193);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(200, 109);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "&User Profile Configuration (Primary)";
            this.groupBox2.Visible = false;
            //
            // button4
            //
            this.button4.Location = new System.Drawing.Point(6, 77);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(188, 23);
            this.button4.TabIndex = 2;
            this.button4.Text = "Delete";
            this.button4.UseVisualStyleBackColor = true;
            //
            // button5
            //
            this.button5.Location = new System.Drawing.Point(6, 48);
            this.button5.Name = "button5";
            this.button5.Size = new System.Drawing.Size(188, 23);
            this.button5.TabIndex = 1;
            this.button5.Text = "Save";
            this.button5.UseVisualStyleBackColor = true;
            //
            // button6
            //
            this.button6.Location = new System.Drawing.Point(6, 19);
            this.button6.Name = "button6";
            this.button6.Size = new System.Drawing.Size(188, 23);
            this.button6.TabIndex = 0;
            this.button6.Text = "Load";
            this.button6.UseVisualStyleBackColor = true;
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.button3);
            this.groupBox1.Controls.Add(this.button2);
            this.groupBox1.Controls.Add(this.button1);
            this.groupBox1.Location = new System.Drawing.Point(206, 193);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(200, 109);
            this.groupBox1.TabIndex = 2;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "&Local Folder Configuration";
            this.groupBox1.Visible = false;
            //
            // button3
            //
            this.button3.Location = new System.Drawing.Point(6, 77);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(188, 23);
            this.button3.TabIndex = 2;
            this.button3.Text = "Delete";
            this.button3.UseVisualStyleBackColor = true;
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(6, 48);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(188, 23);
            this.button2.TabIndex = 1;
            this.button2.Text = "Save";
            this.button2.UseVisualStyleBackColor = true;
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(6, 19);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(188, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "Load";
            this.button1.UseVisualStyleBackColor = true;
            //
            // optionsGroupBox
            //
            this.optionsGroupBox.Controls.Add(this.discardDataCheckBox);
            this.optionsGroupBox.Controls.Add(this.backgroundThreadCheckBox);
            this.optionsGroupBox.Location = new System.Drawing.Point(0, 0);
            this.optionsGroupBox.Name = "optionsGroupBox";
            this.optionsGroupBox.Size = new System.Drawing.Size(200, 68);
            this.optionsGroupBox.TabIndex = 0;
            this.optionsGroupBox.TabStop = false;
            this.optionsGroupBox.Text = "&Performance Options";
            //
            // discardDataCheckBox
            //
            this.discardDataCheckBox.AutoSize = true;
            this.discardDataCheckBox.Location = new System.Drawing.Point(6, 42);
            this.discardDataCheckBox.Name = "discardDataCheckBox";
            this.discardDataCheckBox.Size = new System.Drawing.Size(148, 17);
            this.discardDataCheckBox.TabIndex = 1;
            this.discardDataCheckBox.Text = "&Discard Data to Catch Up";
            this.toolTip.SetToolTip(this.discardDataCheckBox, "If checked, when output falls behind input, start discarding samples to catch up." +
        "");
            this.discardDataCheckBox.UseVisualStyleBackColor = true;
            //
            // backgroundThreadCheckBox
            //
            this.backgroundThreadCheckBox.AutoSize = true;
            this.backgroundThreadCheckBox.Checked = true;
            this.backgroundThreadCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.backgroundThreadCheckBox.Location = new System.Drawing.Point(6, 19);
            this.backgroundThreadCheckBox.Name = "backgroundThreadCheckBox";
            this.backgroundThreadCheckBox.Size = new System.Drawing.Size(143, 17);
            this.backgroundThreadCheckBox.TabIndex = 0;
            this.backgroundThreadCheckBox.Text = "Use &Background Thread";
            this.toolTip.SetToolTip(this.backgroundThreadCheckBox, "If checked, record on a background thread. This generally performs better, but is" +
        " less compatible.");
            this.backgroundThreadCheckBox.UseVisualStyleBackColor = true;
            //
            // devicesTabPage
            //
            this.devicesTabPage.Controls.Add(this.splitContainer1);
            this.devicesTabPage.Location = new System.Drawing.Point(4, 25);
            this.devicesTabPage.Name = "devicesTabPage";
            this.devicesTabPage.Size = new System.Drawing.Size(406, 327);
            this.devicesTabPage.TabIndex = 2;
            this.devicesTabPage.Text = "Devices";
            this.devicesTabPage.UseVisualStyleBackColor = true;
            //
            // splitContainer1
            //
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
            this.splitContainer1.Name = "splitContainer1";
            //
            // splitContainer1.Panel1
            //
            this.splitContainer1.Panel1.Controls.Add(this.deviceInfoTreeView);
            //
            // splitContainer1.Panel2
            //
            this.splitContainer1.Panel2.Controls.Add(this.deviceInfoTextBox);
            this.splitContainer1.Size = new System.Drawing.Size(406, 327);
            this.splitContainer1.SplitterDistance = 135;
            this.splitContainer1.TabIndex = 0;
            //
            // deviceInfoTreeView
            //
            this.deviceInfoTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.deviceInfoTreeView.Location = new System.Drawing.Point(0, 0);
            this.deviceInfoTreeView.Name = "deviceInfoTreeView";
            this.deviceInfoTreeView.Size = new System.Drawing.Size(135, 327);
            this.deviceInfoTreeView.TabIndex = 0;
            //
            // deviceInfoTextBox
            //
            this.deviceInfoTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.deviceInfoTextBox.Location = new System.Drawing.Point(0, 0);
            this.deviceInfoTextBox.Multiline = true;
            this.deviceInfoTextBox.Name = "deviceInfoTextBox";
            this.deviceInfoTextBox.ReadOnly = true;
            this.deviceInfoTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.deviceInfoTextBox.Size = new System.Drawing.Size(267, 327);
            this.deviceInfoTextBox.TabIndex = 0;
            //
            // notifyIcon
            //
            this.notifyIcon.Visible = true;
            //
            // ConfigurationForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(420, 362);
            this.Controls.Add(this.tabControl1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "ConfigurationForm";
            this.Padding = new System.Windows.Forms.Padding(3);
            this.ShowInTaskbar = false;
            this.tabControl1.ResumeLayout(false);
            this.routesTabPage.ResumeLayout(false);
            this.actionsGroupBox.ResumeLayout(false);
            this.inputGroupBox.ResumeLayout(false);
            this.inputFormatPanel.ResumeLayout(false);
            this.inputFormatPanel.PerformLayout();
            this.inputDeviceBufferCountPanel.ResumeLayout(false);
            this.inputDeviceBufferCountPanel.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.inputBufferCountSlider)).EndInit();
            this.inputDeviceBufferSizePanel.ResumeLayout(false);
            this.inputDeviceBufferSizePanel.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.inputBufferSizeSlider)).EndInit();
            this.outputGroupBox.ResumeLayout(false);
            this.outputDeviceBufferSizePanel.ResumeLayout(false);
            this.outputDeviceBufferSizePanel.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.outputLatencySlider)).EndInit();
            this.outputDeviceBufferCountPanel.ResumeLayout(false);
            this.outputDeviceBufferCountPanel.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.outputBufferCountSlider)).EndInit();
            this.configurationTabPage.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox1.ResumeLayout(false);
            this.optionsGroupBox.ResumeLayout(false);
            this.optionsGroupBox.PerformLayout();
            this.devicesTabPage.ResumeLayout(false);
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            this.splitContainer1.Panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TabControl tabControl1;
        private System.Windows.Forms.TabPage routesTabPage;
        private System.Windows.Forms.ToolTip toolTip;
        private System.Windows.Forms.GroupBox actionsGroupBox;
        private System.Windows.Forms.Button clearButton;
        private System.Windows.Forms.ListBox routeList;
        private System.Windows.Forms.Button stopButton;
        private System.Windows.Forms.Button startButton;
        private System.Windows.Forms.GroupBox inputGroupBox;
        private System.Windows.Forms.TableLayoutPanel inputFormatPanel;
        private System.Windows.Forms.Label inputFormatChLabel;
        private System.Windows.Forms.CheckBox inputFormatEnable;
        private System.Windows.Forms.TextBox inputFormatFrequency;
        private System.Windows.Forms.Label inputFormatHzLabel;
        private System.Windows.Forms.TextBox inputFormatChannels;
        private System.Windows.Forms.TableLayoutPanel inputDeviceBufferCountPanel;
        private System.Windows.Forms.Label inputBufferCountValueLabel;
        private System.Windows.Forms.Label inputBufferCountLabel;
        private System.Windows.Forms.TrackBar inputBufferCountSlider;
        private System.Windows.Forms.TableLayoutPanel inputDeviceBufferSizePanel;
        private System.Windows.Forms.Label inputBufferSizeValueLabel;
        private System.Windows.Forms.Label inputBufferSizeLabel;
        private System.Windows.Forms.TrackBar inputBufferSizeSlider;
        private System.Windows.Forms.ComboBox inputDeviceComboBox;
        private System.Windows.Forms.GroupBox outputGroupBox;
        private System.Windows.Forms.TableLayoutPanel outputDeviceBufferSizePanel;
        private System.Windows.Forms.Label outputLatencyValueLabel;
        private System.Windows.Forms.Label outputTargetLatencyLabel;
        private System.Windows.Forms.TrackBar outputLatencySlider;
        private System.Windows.Forms.TableLayoutPanel outputDeviceBufferCountPanel;
        private System.Windows.Forms.TrackBar outputBufferCountSlider;
        private System.Windows.Forms.Label outputBufferCountValueLabel;
        private System.Windows.Forms.Label outputBufferCountLabel;
        private System.Windows.Forms.ComboBox outputDeviceComboBox;
        private System.Windows.Forms.TabPage configurationTabPage;
        private System.Windows.Forms.NotifyIcon notifyIcon;
        private System.Windows.Forms.GroupBox optionsGroupBox;
        private System.Windows.Forms.CheckBox discardDataCheckBox;
        private System.Windows.Forms.CheckBox backgroundThreadCheckBox;
        private System.Windows.Forms.TabPage devicesTabPage;
        private System.Windows.Forms.SplitContainer splitContainer1;
        private System.Windows.Forms.TreeView deviceInfoTreeView;
        private System.Windows.Forms.TextBox deviceInfoTextBox;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.Button button4;
        private System.Windows.Forms.Button button5;
        private System.Windows.Forms.Button button6;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.ComboBox inputSourceComboBox;
        private System.Windows.Forms.ComboBox outputSourceComboBox;
    }
}


text:
package templates;

public class Foo {
  void m(Foo foo) {
    foo.opt<caret>
  }
}

redpajama_set_name: RedPajamaGithub


text:
@class NSDateFormatter, NSString;

@interface GSDK_GTMLogStandardFormatter : GSDK_GTMLogBasicFormatter
{
    NSDateFormatter *dateFormatter_;
    NSString *pname_;
    int pid_;
}

- (id)stringForFunc:(id)arg1 withFormat:(id)arg2 valist:(char *)arg3 level:(int)arg4;
- (void)dealloc;
- (id)init;

@end


text:
<?php

/*
 * This file is part of the overtrue/wechat.
 *
 * (c) overtrue <i@overtrue.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace EasyWeChat\Work;

use EasyWeChat\Kernel\ServiceContainer;
use EasyWeChat\Work\MiniProgram\Application as MiniProgram;

/**
 * Application.
 *
 * @author mingyoung <mingyoungcheung@gmail.com>
 *
 * @property \EasyWeChat\Work\OA\Client                   $oa
 * @property \EasyWeChat\Work\Auth\AccessToken            $access_token
 * @property \EasyWeChat\Work\Agent\Client                $agent
 * @property \EasyWeChat\Work\Department\Client           $department
 * @property \EasyWeChat\Work\Media\Client                $media
 * @property \EasyWeChat\Work\Menu\Client                 $menu
 * @property \EasyWeChat\Work\Message\Client              $message
 * @property \EasyWeChat\Work\Message\Messenger           $messenger
 * @property \EasyWeChat\Work\User\Client                 $user
 * @property \EasyWeChat\Work\User\TagClient              $tag
 * @property \EasyWeChat\Work\Server\ServiceProvider      $server
 * @property \EasyWeChat\BasicService\Jssdk\Client        $jssdk
 * @property \Overtrue\Socialite\Providers\WeWorkProvider $oauth
 * @property \EasyWeChat\Work\Invoice\Client              $invoice
 *
 * @method mixed getCallbackIp()
 */
class Application extends ServiceContainer
{
    /**
     * @var array
     */
    protected $providers = [
        OA\ServiceProvider::class,
        Auth\ServiceProvider::class,
        Base\ServiceProvider::class,
        Menu\ServiceProvider::class,
        OAuth\ServiceProvider::class,
        User\ServiceProvider::class,
        Agent\ServiceProvider::class,
        Media\ServiceProvider::class,
        Message\ServiceProvider::class,
        Department\ServiceProvider::class,
        Server\ServiceProvider::class,
        Jssdk\ServiceProvider::class,
        Invoice\ServiceProvider::class,
    ];

    /**
     * @var array
     */
    protected $defaultConfig = [
        // http://docs.guzzlephp.org/en/stable/request-options.html
        'http' => [
            'base_uri' => 'https://qyapi.weixin.qq.com/',
        ],
    ];

    /**
     * Creates the miniProgram application.
     *
     * @return \EasyWeChat\Work\MiniProgram\Application
     */
    public function miniProgram(): MiniProgram
    {
        return new MiniProgram($this->getConfig());
    }

    /**
     * @param string $method
     * @param array  $arguments
     *
     * @return mixed
     */
    public function __call($method, $arguments)
    {
        return $this['base']->$method(...$arguments);
    }
}


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TopicController extends Controller
{
    public function index()
    {
        return view('topicDtl.index');
    }
}


text: class RcsError < StandardError; end


text:
<?php
Yii::app ()->assets->registerGlobalCss ( "global.style/css/css.css" );

Yii::app ()->assets->registerGlobalCss ( "global.style/css/da84.css" );

Yii::app ()->assets->registerGlobalCss ( "global.style/css/normalize.css" );

Yii::app ()->assets->registerGlobalCss ( "global.style/css/default.css" );

Yii::app ()->clientScript->registerMetaTag ( ' text/html;charset=utf-8', null, 'Content-Type' );

$code = '!';

?>
<!DOCTYPE html>

<html style=""
	class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths"
	lang="en-US">

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>error|错误</title>

<meta name="description" content="Our 404 page">

<meta name="viewport" content="width=device-width, initial-scale=1">

					<?php echo $code;?>

				Sorry | 抱歉

				<lable class="description">Access check failed or Internet error|
				验证失败或网络异常</lable>

请检查App Key、App Secret和账户激活状态

<a class="btn btn-primary"
					href="<?php

					echo Yii::app ()->request->hostInfo . Yii::app ()->homeUrl;

					?>">Re-try | 重试

<a class="btn btn-primary"
					href="<?php

					echo Yii::app ()->request->hostInfo . Yii::app ()->homeUrl . 'backend/logout';

					?>"
					id="punch-a-moose">Change Account | 更换账户


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Duss, Enum. Champ. Guadeloupe (Lons-le-Saunier) (1903)

#### Original name
Phoma macromphala Pat.

### Remarks
null


text:
package com.jboss.sample.bv.domain;

import javax.validation.groups.Default;

/**
 * Can validate the order without seeing the intermediate screens
 * A user has to be shippable, billable and should be valid
 *
 * @author Emmanuel Bernard
 */
public interface StraightToOrderValidation
		extends ShippableAutomatically,
		BillableAutomatically,
		Default {
}


text:
package com.softniac.connectfour.core.model;

public class ConnectFourWinningConditionCheckerTestDataPreparator {

    public static Board prepareBoardWithFourEqualTokensInDiagonalBottomLeftToTopRight(int startAtRowIndex,
	    int startAtColumnIndex) {
	String token = "token";
	Board board = new Board();

	int desiredNumberOfTokensInLine = 4;

	int finishRowIndex = startAtRowIndex - desiredNumberOfTokensInLine;
	int finishColumnIndex = desiredNumberOfTokensInLine + startAtColumnIndex;

	for (int rowIndex = startAtRowIndex, columnIndex = startAtColumnIndex; rowIndex > finishRowIndex
		&& columnIndex < finishColumnIndex; rowIndex--, columnIndex++) {
	    board.putTokenAt(token, rowIndex, columnIndex);
	}

	return board;
    }

    public static Board prepareBoardWithFourEqualTokensInDiagonalBottomRightToTopLeft(int startAtRowIndex,
	    int startAtColumnIndex) {
	String token = "token";
	Board board = new Board();

	int desiredNumberOfTokensInLine = 4;

	int finishBeforeRowIndex = startAtRowIndex - desiredNumberOfTokensInLine;
	int finishBeforeColumnIndex = startAtColumnIndex - desiredNumberOfTokensInLine;

	for (int rowIndex = startAtRowIndex, columnIndex = startAtColumnIndex; rowIndex > finishBeforeRowIndex
		&& columnIndex > finishBeforeColumnIndex; rowIndex--, columnIndex--) {
	    board.putTokenAt(token, rowIndex, columnIndex);
	}

	return board;
    }

    public static Board prepareBoardWithFourEqualTokensInLineInRow(int equalTokensRowIndex) {
	String token = "token";
	Board board = new Board();

	for (int rowCount = 0; rowCount <= equalTokensRowIndex; rowCount++) {
	    for (int columnIndex = 1; columnIndex < 5; columnIndex++) {

		if (rowCount != equalTokensRowIndex) {
		    board.putTokenInColumn(token + columnIndex, columnIndex);
		} else {
		    board.putTokenInColumn(token, columnIndex);
		}

	    }
	}
	return board;
    }

    public static Board prepareBoardWithFourEqualTokensInLineInColumn(int equalTokensColumnIndex) {
	String token = "token";
	String differentToken = "differentToken";
	Board board = new Board();

	board.putTokenInColumn(differentToken, equalTokensColumnIndex);

	for (int tokensCount = 0; tokensCount < 4; tokensCount++) {
	    board.putTokenInColumn(token, equalTokensColumnIndex);
	}
	return board;
    }

    public static Board prepareBoardWithFourEqualTokensOnTwoDiagonalBordersBottomRightToTopLeft() {
	String token = "token";
	Board board = new Board();

	board.putTokenAt(token, 1, 0);
	board.putTokenAt(token, 2, 1);
	board.putTokenAt(token, 4, 2);
	board.putTokenAt(token, 5, 3);

	return board;
    }

    public static Board prepareBoardWithFourEqualTokensOnTwoDiagonalBordersBottomLeftToTopRight() {
	String token = "token";
	Board board = new Board();

	board.putTokenAt(token, 5, 3);
	board.putTokenAt(token, 4, 4);
	board.putTokenAt(token, 1, 6);
	board.putTokenAt(token, 2, 5);

	return board;
    }
}


text:
layout: post
title: Pheidippides (Part 1)
header-img: img/pheidippides.jpg
tags: [Pheidippides, Configuration Management]
author: James Humphrey
github: leafknode
---

<!--excerpt.start-->
Besides all the math and modeling, the Activision Game Science team also does a bunch of big data engineering at Activision. At this year's [MesosCon](http://events.linuxfoundation.org/events/mesoscon-north-america), we'll be giving a [talk](https://mesosconna2016.sched.org/event/6jtX/all-marathons-need-a-runner-introducing-pheidippides-james-humphrey-john-dennison-activision-publishing) on an application configuration and deploy tool we built called Pheidippides (named after the apocryphal [Marathon-to-Athens runner](https://en.wikipedia.org/wiki/Pheidippides)). Pheidippides was initially designed to help us more easily deploy our services into [Marathon](https://mesosphere.github.io/marathon/), but with use it has evolved into something more.

Part 1 of this series is an abstract on our issues with configuration management, how we chose to solve these issues, and the resulting Pheidippides specification.  No code yet, but in Part 2 we'll continue with how exactly we implemented the Pheidippides specification and also provide some code that we use to glue it all together.

# Problem Statement

In any given software system, configuration is an important component to
the successful operation of that system. This is especially true in a
service-oriented system that is dominated by micro-services. In these
types of systems, micro-services can proliferate very rapidly and, as
they proliferate, the total amount of configuration across the system
can grow exponentially.
<!--excerpt.end--><!--more-->

This configuration proliferation phenomenon isn't necessarily the
problem, though. The actual problem is somewhat subtler... How do you
manage it all? In other words:

* How and where do you store the configuration?
* How do you share configuration between different services?
* How do you provide for different sets of configuration for different
    environments (e.g. development/staging/production)?
* How do you add/edit/delete configuration and how does that impact
    existing service runtimes?

It's these types of questions that characterize the deeper issues
associated with configuration management in a micro-service oriented
architecture and help frame the problem we're trying to solve.

# Motivation

The primary motivation behind solving this problem is to reduce our
service runtime-deployment risk. By 'runtime-deployment risk' I mean the
likelihood of a misconfigured service negatively impacting a runtime
environment on deployment. With the right configuration management
solution in place, there's less chance for a developer to make a mistake
when configuring a service for deployment and, therefore, less overall
risk of system regression or degradation.

# Approach

After some initial build vs. buy analysis we decided to build our own
solution. At a high level, our custom-build approach was more of an
organic process rather than conventional one. We came up with a set of
requirements and evolved those over time as new features and
improvements were made. This strategy was immensely successful for a
couple of reasons:

1. The changes were so small that there was very little regression on
the existing, legacy deployment mechanism.

2. This type of process provided us time to mature in the space, which
facilitated rapid iteration on our requirements with little-to-no wasted
effort.

Even though there were many factors that were important to us during
this process, the most critical ones we measured were: time-to-deploy
and risk-of-deploy. These two variables helped measure success and
helped refine and redefine our requirements.

# Results

The solution we built is a product we call Pheidippides, although
calling it a product is arguably a mischaracterization. Even though
there is some actual source code, Pheidippides is really more of a
*specification* for managing configuration. The source code that does
exist is primarily glue code that facilitates wiring together different components of the
Pheidippides specification.

At its core, the specification requires that micro service configuration
management be the following:

* Centralized
* Hierarchical
* Immutable

The details of which are explained below.

## Centralized

This requirement specifies that all configurations reside in and are
accessible via one location, primarily to reduce the cost of maintaining
configurations as the system evolves. This might seem like an obvious
requirement but it's not uncommon for deployment systems to do
quite the opposite. By that I mean store configurations within
individual deployment scripts that are unique to the service it's
deploying. As more and more services are added to the system, so are
more and more scripts needed for deployment. Eventually, the
configurations are no longer centralized to a few files but
decentralized across many different files. Over time this becomes very
difficult to maintain and, consequently, increases risk of deployment
failure.

For our implementation, we choose ZooKeeper as our centralized store for
our entire set of configuration properties.  We could have easily chosen some other
key-value store solution (e.g. etcd, consul, etc) but ZooKeeper was already a
core component to our stack so it made the most sense.  In Part 2, we'll go into much more detail on how exactly
ZooKeeper is used and why it was the best choice for us.

## Hierarchical

Another requirement was to design the system in such a way so that
services could share configuration from one to another. For example,
groups of services might share the same PostgreSQL database server, all
of which need to know the exact same information such as host and port.
Without any way to share information, it's common to see many, identical
key-value pairs defined and distributed across many different
configuration sets in many different files. In this scenario, if, for
instance, the PostgreSQL host and port change, then changes need to be
made in more than one place. This type of change-process is very
inefficient and incredibly error prone.

In a hierarchical system, however, being able to share configuration
between services facilitates managing these types of properties and
reduces overall risk of deployment failure.

### Configuration Path

The Pheidippides specification defines this hierarchy by requiring that
each service be uniquely identified by a *configuration path*
(what we sometimes call the *application id*), which is
a URI-like path that conforms to the following [Extended Backus-Norm
Form](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form)
(EBNF) notation:

    letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";

    digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";

    symbol = "_" | "-";

    character = letter | digit | symbol;

    name = character, {character};

    delimeter = "/";

    configuration path = delimeter, name, {configuration path};

Example *configuration paths* for different services might look like the
following:

* /foo/bar/service-1
* /foo/bar/service-2
* /baz/waldo/service-1
* /baz/service-2
* /baz/service-3

If not already obvious, the *configuration path* scheme is nearly
identical in design to how directory structures are defined. Both are
recursive in nature and provide a very natural method for grouping
concepts together. Reading left to right; each successor path is a child
of its predecessor, which provides for inheriting (or sharing)
information from predecessor to successor.

### Configuration Sets

Within each *configuration path* there exists zero-to-one *configuration
set*, and each *configuration set* is composed of zero-to-many key-value
pair properties. Additionally, each successor in the *configuration
path* inherits *configuration sets* from all of its predecessors.

To help illustrate this, consider the following configuration path taken
from the earlier examples:

*/foo/bar/service-1*

As previously defined, all *configuration paths* are naturally
recursive, which means that */foo/bar/service-1* can be broken down into
the following three distinct paths:

* /foo
* /foo/bar
* /foo/bar/service-1

Within each of these paths, there can exist zero to one *configuration
set*, which is composed of zero-to-many key-value pair properties. For
example:

* /foo
  * x=1
* /foo/bar
  * y=2
  * z=3
* /foo/bar/service-1
  * w=4
  * s=${z}
  * x=6

The Pheidippides specification dictates that each successor in the path
inherits properties from its predecessor. Following this rule, the total
*configuration set* of key-value pair properties for the
*/foo/bar/service-1* service would then look as follows:

* /foo/bar/service-1
  * x=6
  * y=2
  * z=3
  * w=4
  * s=3

### Overrides

Property value overriding is another important requirement of the
specification. Pheidippides defines this specifically as: *Any successor
in the configuration path can override the value of one of its
predecessors.*

In the previous example, you might have noticed the fact that 'x equals
'6' not '1'. This is because it was overridden in the
*/foo/bar/service-1* configuration set. This is one example of a
successor overriding a value previously defined by a predecessor.

### Variable Substitution

Another important requirement of the Pheidippides specification is to
allow successors to use values already defined by predecessors. One
example of this is illustrated earlier by setting *s=${z}* in the
*/foo/bar/service-1* configuration set.

### Immutable

Once a *configuration path* uniquely identifies a service and that
service is configured for deployment, Pheidippides requires that
any future change to a *configuration set* for that service is only
applied on next service deployment. Ultimately, this means that a
*configuration set* for any given service deployment is immutable until
next deployment.

# Conclusions

In our humble opinion, for what it's solving, Pheidippides is an
evolutionary idea that fills a critical gap that a lot service-oriented
systems have with configuration management. It not only has
significantly lessened our runtime-deployment risk but also has
dramatically reduced the brain damage of maintaining many different and
similar configuration sets across many distinct services. Ultimately, Pheidippides
increases our confidence in the quality of our deployments, which contributes positively
to the health of our systems.

In 'Part 2' of our Pheidippides series we'll go into much more detail on how exactly we implemented the spec.
For example, how we use ZooKeeper znodes to represent our configuration paths and also how we configure our Docker
containers to run within our mesos-marathon cluster.


text:
<include file="Public/head"/>

群发信息

<include file="Share:header"/>

下面为{gr-$days}日内分享数据统计

					 模块
					次数

			  <volist name="list" id="list">

                   {gr-$list.moduleName}
                  {gr-$list.count}

      			</volist>

<include file="Public/footer"/>


text:
"""Routing stats

Revision ID: 44d0e2c403b0
Revises: 3852cd2f413d
Create Date: 2017-11-27 11:53:14.575759

"""

# revision identifiers, used by Alembic.
revision = '44d0e2c403b0'
down_revision = '3852cd2f413d'
branch_labels = None
depends_on = None

import datetime
from alembic import op, context
import sqlalchemy as sa
from sqlalchemy import Column
from sqlalchemy.types import Unicode, Integer

def upgrade():
    schema = context.get_context().config.get_main_option("schema")
    schema_stats = schema + '_stats'
    op.create_table(
        "routing",
        Column("id", Integer, primary_key=True, autoincrement=True, nullable=False),
        Column("transport_criteria", Integer, nullable=False),
        Column('transport_mode', Integer, nullable=False),
        Column('date', sa.DateTime(), nullable=False, default=datetime.datetime.now),
        schema=schema_stats,
    )

def downgrade():
    schema = context.get_context().config.get_main_option('schema')
    schema_stats = schema + '_stats'
    op.drop_table('routing', schema=schema_stats)


text:
import { applyMiddleware, compose, createStore } from 'redux';
import thunkMiddleware from 'redux-thunk';
import { createLogger } from 'redux-logger';
import persistState from 'redux-localstorage';
import reducers from 'Reducers';

const pathsInLocalStorage = require('Constants/settings.json').localStorage;

const enhancer = compose(
  applyMiddleware(thunkMiddleware, createLogger({
    collapsed: true,
  })),
  persistState(pathsInLocalStorage, {
    key: 'redux-localstorage',
  }),
);

export default (preloadedState) => {
  const store = createStore(
    reducers,
    preloadedState,
    enhancer,
  );

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('Reducers');
      store.replaceReducer(nextRootReducer);
    });
  }

  return store;
};


text:
var gulp = require('gulp');
var $ = plugins = require('gulp-load-plugins')();
var config = require('./gulp.config').config;
var browserSync = require('browser-sync');

gulp.task('serve', function() {
  browserSync({
    server: {
      baseDir: './'
    }
  });
});


text:
module EbayTrading # :nodoc:
  module Types # :nodoc:
    # == Attributes
    #  text_node :vendor_name, 'VendorName', :optional => true
    #  text_node :vendor_contact_info, 'VendorContactInfo', :optional => true
    class SellingManagerVendorDetails
      include XML::Mapping
      include Initializer
      root_element_name 'SellingManagerVendorDetails'
      text_node :vendor_name, 'VendorName', :optional => true
      text_node :vendor_contact_info, 'VendorContactInfo', :optional => true
    end
  end
end


text:
Class: `Code16\Sharp\Form\Fields\SharpFormListField`

A List is made of items, and each item contains form fields.

Let's review a simple use case: a museum with all kind of art pieces. In the DB it's a 1-N relationship. If we choose to define a ArtPiece Entity in Sharp, we'll end up with maybe a Select, or an Autocomplete, to designate the Museum. But here, we want to do the opposite: define a Museum Entity, with an ArtPiece list.

Here's how we can build this:

```php
function buildFormFields()
{
    $this->addField(
        SharpFormListField::make("pieces")
            ->setLabel("Art pieces")
            ->setAddable()
            ->setRemovable()
            ->addItemField(
                SharpFormDateField::make("acquisition_date")
                    ->setLabel("Acquisition")
            )
            ->addItemField(
                SharpFormTextField::make("title")
                    ->setLabel("Title")
            )
            ->addItemField(
                SharpFormSelectField::make("artist_id", [...])
                    ->setLabel("Artist")
            )
    );
}
```

## Configuration

### `addItemField(SharpFormField $field)`

Add a SharpFormField in the item, building it like for the regular Form, with `SharpFormField::make()`.

### `setAddable(bool $addable = true)`

Defines if new items can be added to the List.
Default: false.

### `setAddText(string $addText)`

Define the text of the Add item button.
Default: "Add an item".

### `setMaxItemCount(int $maxItemCount)`
### `setMaxItemCountUnlimited()`

If the List is `addable`, you can specify a maximum item count with these.
Default: unlimited.

### `setSortable(bool $sortable = true)`

Defines if items can be sorted by the user.
Default: false.

### `setOrderAttribute(string $orderAttribute)`

This is only useful when using the `WithSharpFormEloquentUpdater` trait. You can define here the name of an numerical order attribute (typically: `order`), and it will be automatically updated in the `save()` process.

### `setCollapsedItemInlineTemplate(string $template)`
### `setCollapsedItemTemplatePath(string $template)`

The UI for a `sortable` List is to add a "reorder" button, which swaps the list in a readonly state. But for big List items it can be useful to define a special template for this reordering state.
For inline template, just write the template as a string, using placeholders for data like this: `{{var}}`.

Example:

```php
$list->setCollapsedItemInlineTemplate(
    "Foreground: <strong>{{color}}</strong>"
)
```

For template path, give the relative path of a template file (stating in the views Laravel folder).
The template will be [interpreted by Vue.js](https://vuejs.org/v2/guide/syntax.html), meaning you can add data placeholders, DOM structure but also directives, and anything that Vue will parse. For instance:

```vue
<div v-if="show">result is {{value}}</div>
<div v-else>result is unknown</div>
```

### `setRemovable(bool $removable = true)`

Defines if items can be removed by the user.
Default: false.

### `setItemIdAttribute(string $itemIdAttribute)`

Defines the id attribute name for items.
Default: id.

### `allowBulkUploadForField(string $itemFieldKey)`
### `doNotAllowBulkUpload()`

If the list item contains an `UploadFormField` field, this option can be used to present a bulk upload area to the user.
The `$itemFieldKey` must refer to the key of the `UploadFormField`.
Default is false (do not allow bulk upload)

### `setBulkUploadFileCountLimitAtOnce(int $limit)`

Sets a file count limit to bulk upload (useful to prevent unwanted mass upload...).
Default: 10

## Layout

The List item layout must be defined like the form itself, in the `buildFormLayout()` function. The item layout is managed as a Form column, with a `FormLayoutColumn` object. To link the column and the item, use the classic `withSingleField()` function with a second argument, a Closure accepting a `FormLayoutColumn`.

Here's an example for the Museum List defined above:

```php
$this->addColumn(6, function(FormLayoutColumn $column) {
     $column->withSingleField("pieces", function(FormLayoutColumn $listItem) {
          $listItem->withSingleField("acquisition_date")
              ->withSingleField("title")
              ->withSingleField("artist_id");
     });
 });
```

## Formatter

### `toFront`

The Formatter expects an array or a `Collection` of models, each one defining attributes for each list item keys at the format expected by the corresponding Field Formatter.

So in our Museum example, we must provide an array of ArtPiece models with at least those attributes: `id`, `title`, `acquisition_date`, `artist_id`.

### `fromFront`

Returns an array with the same shape.
Newly added items will have a `null` id.


text:
package org.iternine.jeppetto.dao;

import java.util.Map;

/**
 * @param <T> Persistent Class
 * @param <ID> ID type of the persistent class.
 */
public interface AccessControlDAO<T, ID> extends GenericDAO<T, ID> {

    void save(T object, AccessControlContext accessControlContext)
            throws OptimisticLockException, AccessControlException, JeppettoException;

    void grantAccess(ID id, String accessId, AccessType accessType)
            throws NoSuchItemException, AccessControlException;

    void grantAccess(ID id, String accessId, AccessType accessType, AccessControlContext accessControlContext)
            throws NoSuchItemException, AccessControlException;

    void revokeAccess(ID id, String accessId)
            throws NoSuchItemException, AccessControlException;

    void revokeAccess(ID id, String accessId, AccessControlContext accessControlContext)
            throws NoSuchItemException, AccessControlException;

    Map<String, AccessType> getGrantedAccesses(ID id)
            throws NoSuchItemException, AccessControlException;

    Map<String, AccessType> getGrantedAccesses(ID id, AccessControlContext accessControlContext)
            throws NoSuchItemException, AccessControlException;

    AccessControlContextProvider getAccessControlContextProvider();
}


text:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/bug.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>

#include <linux/platform_data/ina2xx.h>

/* register definitions */
#define INA209_CONFIGURATION		0x00
#define INA209_STATUS			0x01
#define INA209_STATUS_MASK		0x02
#define INA209_SHUNT_VOLTAGE		0x03
#define INA209_BUS_VOLTAGE		0x04
#define INA209_POWER			0x05
#define INA209_CURRENT			0x06
#define INA209_SHUNT_VOLTAGE_POS_PEAK	0x07
#define INA209_SHUNT_VOLTAGE_NEG_PEAK	0x08
#define INA209_BUS_VOLTAGE_MAX_PEAK	0x09
#define INA209_BUS_VOLTAGE_MIN_PEAK	0x0a
#define INA209_POWER_PEAK		0x0b
#define INA209_SHUNT_VOLTAGE_POS_WARN	0x0c
#define INA209_SHUNT_VOLTAGE_NEG_WARN	0x0d
#define INA209_POWER_WARN		0x0e
#define INA209_BUS_VOLTAGE_OVER_WARN	0x0f
#define INA209_BUS_VOLTAGE_UNDER_WARN	0x10
#define INA209_POWER_OVER_LIMIT		0x11
#define INA209_BUS_VOLTAGE_OVER_LIMIT	0x12
#define INA209_BUS_VOLTAGE_UNDER_LIMIT	0x13
#define INA209_CRITICAL_DAC_POS		0x14
#define INA209_CRITICAL_DAC_NEG		0x15
#define INA209_CALIBRATION		0x16

#define INA209_REGISTERS		0x17

#define INA209_CONFIG_DEFAULT		0x3c47	/* PGA=8, full range */
#define INA209_SHUNT_DEFAULT		10000	/* uOhm */

struct ina209_data {
	struct i2c_client *client;

	struct mutex update_lock;
	bool valid;
	unsigned long last_updated;	/* in jiffies */

	u16 regs[INA209_REGISTERS];	/* All chip registers */

	u16 config_orig;		/* Original configuration */
	u16 calibration_orig;		/* Original calibration */
	u16 update_interval;
};

static struct ina209_data *ina209_update_device(struct device *dev)
{
	struct ina209_data *data = dev_get_drvdata(dev);
	struct i2c_client *client = data->client;
	struct ina209_data *ret = data;
	s32 val;
	int i;

	mutex_lock(&data->update_lock);

	if (!data->valid ||
	    time_after(jiffies, data->last_updated + data->update_interval)) {
		for (i = 0; i < ARRAY_SIZE(data->regs); i++) {
			val = i2c_smbus_read_word_swapped(client, i);
			if (val < 0) {
				ret = ERR_PTR(val);
				goto abort;
			}
			data->regs[i] = val;
		}
		data->last_updated = jiffies;
		data->valid = true;
	}
abort:
	mutex_unlock(&data->update_lock);
	return ret;
}

/*
 * Read a value from a device register and convert it to the
 * appropriate sysfs units
 */
static long ina209_from_reg(const u8 reg, const u16 val)
{
	switch (reg) {
	case INA209_SHUNT_VOLTAGE:
	case INA209_SHUNT_VOLTAGE_POS_PEAK:
	case INA209_SHUNT_VOLTAGE_NEG_PEAK:
	case INA209_SHUNT_VOLTAGE_POS_WARN:
	case INA209_SHUNT_VOLTAGE_NEG_WARN:
		/* LSB=10 uV. Convert to mV. */
		return DIV_ROUND_CLOSEST(val, 100);

	case INA209_BUS_VOLTAGE:
	case INA209_BUS_VOLTAGE_MAX_PEAK:
	case INA209_BUS_VOLTAGE_MIN_PEAK:
	case INA209_BUS_VOLTAGE_OVER_WARN:
	case INA209_BUS_VOLTAGE_UNDER_WARN:
	case INA209_BUS_VOLTAGE_OVER_LIMIT:
	case INA209_BUS_VOLTAGE_UNDER_LIMIT:
		/* LSB=4 mV, last 3 bits unused */
		return (val >> 3) * 4;

	case INA209_CRITICAL_DAC_POS:
		/* LSB=1 mV, in the upper 8 bits */
		return val >> 8;

	case INA209_CRITICAL_DAC_NEG:
		/* LSB=1 mV, in the upper 8 bits */
		return -1 * (val >> 8);

	case INA209_POWER:
	case INA209_POWER_PEAK:
	case INA209_POWER_WARN:
	case INA209_POWER_OVER_LIMIT:
		/* LSB=20 mW. Convert to uW */
		return val * 20 * 1000L;

	case INA209_CURRENT:
		/* LSB=1 mA (selected). Is in mA */
		return val;
	}

	/* programmer goofed */
	WARN_ON_ONCE(1);
	return 0;
}

/*
 * Take a value and convert it to register format, clamping the value
 * to the appropriate range.
 */
static int ina209_to_reg(u8 reg, u16 old, long val)
{
	switch (reg) {
	case INA209_SHUNT_VOLTAGE_POS_WARN:
	case INA209_SHUNT_VOLTAGE_NEG_WARN:
		/* Limit to +- 320 mV, 10 uV LSB */
		return clamp_val(val, -320, 320) * 100;

	case INA209_BUS_VOLTAGE_OVER_WARN:
	case INA209_BUS_VOLTAGE_UNDER_WARN:
	case INA209_BUS_VOLTAGE_OVER_LIMIT:
	case INA209_BUS_VOLTAGE_UNDER_LIMIT:
		/*
		 * Limit to 0-32000 mV, 4 mV LSB
		 *
		 * The last three bits aren't part of the value, but we'll
		 * preserve them in their original state.
		 */
		return (DIV_ROUND_CLOSEST(clamp_val(val, 0, 32000), 4) << 3)
		  | (old & 0x7);

	case INA209_CRITICAL_DAC_NEG:
		/*
		 * Limit to -255-0 mV, 1 mV LSB
		 * Convert the value to a positive value for the register
		 *
		 * The value lives in the top 8 bits only, be careful
		 * and keep original value of other bits.
		 */
		return (clamp_val(-val, 0, 255) << 8) | (old & 0xff);

	case INA209_CRITICAL_DAC_POS:
		/*
		 * Limit to 0-255 mV, 1 mV LSB
		 *
		 * The value lives in the top 8 bits only, be careful
		 * and keep original value of other bits.
		 */
		return (clamp_val(val, 0, 255) << 8) | (old & 0xff);

	case INA209_POWER_WARN:
	case INA209_POWER_OVER_LIMIT:
		/* 20 mW LSB */
		return DIV_ROUND_CLOSEST(val, 20 * 1000);
	}

	/* Other registers are read-only, return access error */
	return -EACCES;
}

static int ina209_interval_from_reg(u16 reg)
{
	return 68 >> (15 - ((reg >> 3) & 0x0f));
}

static u16 ina209_reg_from_interval(u16 config, long interval)
{
	int i, adc;

	if (interval <= 0) {
		adc = 8;
	} else {
		adc = 15;
		for (i = 34 + 34 / 2; i; i >>= 1) {
			if (i < interval)
				break;
			adc--;
		}
	}
	return (config & 0xf807) | (adc << 3) | (adc << 7);
}

static ssize_t ina209_set_interval(struct device *dev,
				   struct device_attribute *da,
				   const char *buf, size_t count)
{
	struct ina209_data *data = ina209_update_device(dev);
	long val;
	u16 regval;
	int ret;

	if (IS_ERR(data))
		return PTR_ERR(data);

	ret = kstrtol(buf, 10, &val);
	if (ret < 0)
		return ret;

	mutex_lock(&data->update_lock);
	regval = ina209_reg_from_interval(data->regs[INA209_CONFIGURATION],
					  val);
	i2c_smbus_write_word_swapped(data->client, INA209_CONFIGURATION,
				     regval);
	data->regs[INA209_CONFIGURATION] = regval;
	data->update_interval = ina209_interval_from_reg(regval);
	mutex_unlock(&data->update_lock);
	return count;
}

static ssize_t ina209_show_interval(struct device *dev,
				    struct device_attribute *da, char *buf)
{
	struct ina209_data *data = dev_get_drvdata(dev);

	return snprintf(buf, PAGE_SIZE, "%d\n", data->update_interval);
}

/*
 * History is reset by writing 1 into bit 0 of the respective peak register.
 * Since more than one peak register may be affected by the scope of a
 * reset_history attribute write, use a bit mask in attr->index to identify
 * which registers are affected.
 */
static u16 ina209_reset_history_regs[] = {
	INA209_SHUNT_VOLTAGE_POS_PEAK,
	INA209_SHUNT_VOLTAGE_NEG_PEAK,
	INA209_BUS_VOLTAGE_MAX_PEAK,
	INA209_BUS_VOLTAGE_MIN_PEAK,
	INA209_POWER_PEAK
};

static ssize_t ina209_reset_history(struct device *dev,
				    struct device_attribute *da,
				    const char *buf,
				    size_t count)
{
	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
	struct ina209_data *data = dev_get_drvdata(dev);
	struct i2c_client *client = data->client;
	u32 mask = attr->index;
	long val;
	int i, ret;

	ret = kstrtol(buf, 10, &val);
	if (ret < 0)
		return ret;

	mutex_lock(&data->update_lock);
	for (i = 0; i < ARRAY_SIZE(ina209_reset_history_regs); i++) {
		if (mask & (1 << i))
			i2c_smbus_write_word_swapped(client,
					ina209_reset_history_regs[i], 1);
	}
	data->valid = false;
	mutex_unlock(&data->update_lock);
	return count;
}

static ssize_t ina209_set_value(struct device *dev,
				struct device_attribute *da,
				const char *buf,
				size_t count)
{
	struct ina209_data *data = ina209_update_device(dev);
	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
	int reg = attr->index;
	long val;
	int ret;

	if (IS_ERR(data))
		return PTR_ERR(data);

	ret = kstrtol(buf, 10, &val);
	if (ret < 0)
		return ret;

	mutex_lock(&data->update_lock);
	ret = ina209_to_reg(reg, data->regs[reg], val);
	if (ret < 0) {
		count = ret;
		goto abort;
	}
	i2c_smbus_write_word_swapped(data->client, reg, ret);
	data->regs[reg] = ret;
abort:
	mutex_unlock(&data->update_lock);
	return count;
}

static ssize_t ina209_show_value(struct device *dev,
				 struct device_attribute *da,
				 char *buf)
{
	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
	struct ina209_data *data = ina209_update_device(dev);
	long val;

	if (IS_ERR(data))
		return PTR_ERR(data);

	val = ina209_from_reg(attr->index, data->regs[attr->index]);
	return snprintf(buf, PAGE_SIZE, "%ld\n", val);
}

static ssize_t ina209_show_alarm(struct device *dev,
				 struct device_attribute *da,
				 char *buf)
{
	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
	struct ina209_data *data = ina209_update_device(dev);
	const unsigned int mask = attr->index;
	u16 status;

	if (IS_ERR(data))
		return PTR_ERR(data);

	status = data->regs[INA209_STATUS];

	/*
	 * All alarms are in the INA209_STATUS register. To avoid a long
	 * switch statement, the mask is passed in attr->index
	 */
	return snprintf(buf, PAGE_SIZE, "%u\n", !!(status & mask));
}

/* Shunt voltage, history, limits, alarms */
static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, ina209_show_value, NULL,
			  INA209_SHUNT_VOLTAGE);
static SENSOR_DEVICE_ATTR(in0_input_highest, S_IRUGO, ina209_show_value, NULL,
			  INA209_SHUNT_VOLTAGE_POS_PEAK);
static SENSOR_DEVICE_ATTR(in0_input_lowest, S_IRUGO, ina209_show_value, NULL,
			  INA209_SHUNT_VOLTAGE_NEG_PEAK);
static SENSOR_DEVICE_ATTR(in0_reset_history, S_IWUSR, NULL,
			  ina209_reset_history, (1 << 0) | (1 << 1));
static SENSOR_DEVICE_ATTR(in0_max, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_SHUNT_VOLTAGE_POS_WARN);
static SENSOR_DEVICE_ATTR(in0_min, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_SHUNT_VOLTAGE_NEG_WARN);
static SENSOR_DEVICE_ATTR(in0_crit_max, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_CRITICAL_DAC_POS);
static SENSOR_DEVICE_ATTR(in0_crit_min, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_CRITICAL_DAC_NEG);

static SENSOR_DEVICE_ATTR(in0_min_alarm,  S_IRUGO, ina209_show_alarm, NULL,
			  1 << 11);
static SENSOR_DEVICE_ATTR(in0_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 12);
static SENSOR_DEVICE_ATTR(in0_crit_min_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 6);
static SENSOR_DEVICE_ATTR(in0_crit_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 7);

/* Bus voltage, history, limits, alarms */
static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, ina209_show_value, NULL,
			  INA209_BUS_VOLTAGE);
static SENSOR_DEVICE_ATTR(in1_input_highest, S_IRUGO, ina209_show_value, NULL,
			  INA209_BUS_VOLTAGE_MAX_PEAK);
static SENSOR_DEVICE_ATTR(in1_input_lowest, S_IRUGO, ina209_show_value, NULL,
			  INA209_BUS_VOLTAGE_MIN_PEAK);
static SENSOR_DEVICE_ATTR(in1_reset_history, S_IWUSR, NULL,
			  ina209_reset_history, (1 << 2) | (1 << 3));
static SENSOR_DEVICE_ATTR(in1_max, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_BUS_VOLTAGE_OVER_WARN);
static SENSOR_DEVICE_ATTR(in1_min, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_BUS_VOLTAGE_UNDER_WARN);
static SENSOR_DEVICE_ATTR(in1_crit_max, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_BUS_VOLTAGE_OVER_LIMIT);
static SENSOR_DEVICE_ATTR(in1_crit_min, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_BUS_VOLTAGE_UNDER_LIMIT);

static SENSOR_DEVICE_ATTR(in1_min_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 14);
static SENSOR_DEVICE_ATTR(in1_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 15);
static SENSOR_DEVICE_ATTR(in1_crit_min_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 9);
static SENSOR_DEVICE_ATTR(in1_crit_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 10);

/* Power */
static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, ina209_show_value, NULL,
			  INA209_POWER);
static SENSOR_DEVICE_ATTR(power1_input_highest, S_IRUGO, ina209_show_value,
			  NULL, INA209_POWER_PEAK);
static SENSOR_DEVICE_ATTR(power1_reset_history, S_IWUSR, NULL,
			  ina209_reset_history, 1 << 4);
static SENSOR_DEVICE_ATTR(power1_max, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_POWER_WARN);
static SENSOR_DEVICE_ATTR(power1_crit, S_IRUGO | S_IWUSR, ina209_show_value,
			  ina209_set_value, INA209_POWER_OVER_LIMIT);

static SENSOR_DEVICE_ATTR(power1_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 13);
static SENSOR_DEVICE_ATTR(power1_crit_alarm, S_IRUGO, ina209_show_alarm, NULL,
			  1 << 8);

/* Current */
static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, ina209_show_value, NULL,
			  INA209_CURRENT);

static SENSOR_DEVICE_ATTR(update_interval, S_IRUGO | S_IWUSR,
			  ina209_show_interval, ina209_set_interval, 0);

/*
 * Finally, construct an array of pointers to members of the above objects,
 * as required for sysfs_create_group()
 */
static struct attribute *ina209_attrs[] = {
	&sensor_dev_attr_in0_input.dev_attr.attr,
	&sensor_dev_attr_in0_input_highest.dev_attr.attr,
	&sensor_dev_attr_in0_input_lowest.dev_attr.attr,
	&sensor_dev_attr_in0_reset_history.dev_attr.attr,
	&sensor_dev_attr_in0_max.dev_attr.attr,
	&sensor_dev_attr_in0_min.dev_attr.attr,
	&sensor_dev_attr_in0_crit_max.dev_attr.attr,
	&sensor_dev_attr_in0_crit_min.dev_attr.attr,
	&sensor_dev_attr_in0_max_alarm.dev_attr.attr,
	&sensor_dev_attr_in0_min_alarm.dev_attr.attr,
	&sensor_dev_attr_in0_crit_max_alarm.dev_attr.attr,
	&sensor_dev_attr_in0_crit_min_alarm.dev_attr.attr,

	&sensor_dev_attr_in1_input.dev_attr.attr,
	&sensor_dev_attr_in1_input_highest.dev_attr.attr,
	&sensor_dev_attr_in1_input_lowest.dev_attr.attr,
	&sensor_dev_attr_in1_reset_history.dev_attr.attr,
	&sensor_dev_attr_in1_max.dev_attr.attr,
	&sensor_dev_attr_in1_min.dev_attr.attr,
	&sensor_dev_attr_in1_crit_max.dev_attr.attr,
	&sensor_dev_attr_in1_crit_min.dev_attr.attr,
	&sensor_dev_attr_in1_max_alarm.dev_attr.attr,
	&sensor_dev_attr_in1_min_alarm.dev_attr.attr,
	&sensor_dev_attr_in1_crit_max_alarm.dev_attr.attr,
	&sensor_dev_attr_in1_crit_min_alarm.dev_attr.attr,

	&sensor_dev_attr_power1_input.dev_attr.attr,
	&sensor_dev_attr_power1_input_highest.dev_attr.attr,
	&sensor_dev_attr_power1_reset_history.dev_attr.attr,
	&sensor_dev_attr_power1_max.dev_attr.attr,
	&sensor_dev_attr_power1_crit.dev_attr.attr,
	&sensor_dev_attr_power1_max_alarm.dev_attr.attr,
	&sensor_dev_attr_power1_crit_alarm.dev_attr.attr,

	&sensor_dev_attr_curr1_input.dev_attr.attr,

	&sensor_dev_attr_update_interval.dev_attr.attr,

	NULL,
};
ATTRIBUTE_GROUPS(ina209);

static void ina209_restore_conf(struct i2c_client *client,
				struct ina209_data *data)
{
	/* Restore initial configuration */
	i2c_smbus_write_word_swapped(client, INA209_CONFIGURATION,
				     data->config_orig);
	i2c_smbus_write_word_swapped(client, INA209_CALIBRATION,
				     data->calibration_orig);
}

static int ina209_init_client(struct i2c_client *client,
			      struct ina209_data *data)
{
	struct ina2xx_platform_data *pdata = dev_get_platdata(&client->dev);
	u32 shunt;
	int reg;

	reg = i2c_smbus_read_word_swapped(client, INA209_CALIBRATION);
	if (reg < 0)
		return reg;
	data->calibration_orig = reg;

	reg = i2c_smbus_read_word_swapped(client, INA209_CONFIGURATION);
	if (reg < 0)
		return reg;
	data->config_orig = reg;

	if (pdata) {
		if (pdata->shunt_uohms <= 0)
			return -EINVAL;
		shunt = pdata->shunt_uohms;
	} else if (!of_property_read_u32(client->dev.of_node, "shunt-resistor",
					 &shunt)) {
		if (shunt == 0)
			return -EINVAL;
	} else {
		shunt = data->calibration_orig ?
		  40960000 / data->calibration_orig : INA209_SHUNT_DEFAULT;
	}

	i2c_smbus_write_word_swapped(client, INA209_CONFIGURATION,
				     INA209_CONFIG_DEFAULT);
	data->update_interval = ina209_interval_from_reg(INA209_CONFIG_DEFAULT);

	/*
	 * Calibrate current LSB to 1mA. Shunt is in uOhms.
	 * See equation 13 in datasheet.
	 */
	i2c_smbus_write_word_swapped(client, INA209_CALIBRATION,
				     clamp_val(40960000 / shunt, 1, 65535));

	/* Clear status register */
	i2c_smbus_read_word_swapped(client, INA209_STATUS);

	return 0;
}

static int ina209_probe(struct i2c_client *client,
			const struct i2c_device_id *id)
{
	struct i2c_adapter *adapter = client->adapter;
	struct ina209_data *data;
	struct device *hwmon_dev;
	int ret;

	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA))
		return -ENODEV;

	data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
	if (!data)
		return -ENOMEM;

	i2c_set_clientdata(client, data);
	data->client = client;
	mutex_init(&data->update_lock);

	ret = ina209_init_client(client, data);
	if (ret)
		return ret;

	hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
							   client->name,
							   data, ina209_groups);
	if (IS_ERR(hwmon_dev)) {
		ret = PTR_ERR(hwmon_dev);
		goto out_restore_conf;
	}

	return 0;

out_restore_conf:
	ina209_restore_conf(client, data);
	return ret;
}

static int ina209_remove(struct i2c_client *client)
{
	struct ina209_data *data = i2c_get_clientdata(client);

	ina209_restore_conf(client, data);

	return 0;
}

static const struct i2c_device_id ina209_id[] = {
	{ "ina209", 0 },
	{ }
};
MODULE_DEVICE_TABLE(i2c, ina209_id);

/* This is the driver that will be inserted */
static struct i2c_driver ina209_driver = {
	.class		= I2C_CLASS_HWMON,
	.driver = {
		.name	= "ina209",
	},
	.probe		= ina209_probe,
	.remove		= ina209_remove,
	.id_table	= ina209_id,
};

module_i2c_driver(ina209_driver);

MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>, Paul Hays <Paul.Hays@cattail.ca>, Guenter Roeck <linux@roeck-us.net>");
MODULE_DESCRIPTION("INA209 driver");
MODULE_LICENSE("GPL");


text:
layout: post
title:  Carciofi
cover: /images/cardboard/stool/landscape-cover.jpg
order: 5
---

![Close-Up One](/images/cardboard/stool/sketch-1.jpg)
By experimenting with a low value, everyday material, the task was to manipulate the material in such a way to enhance its perceived quality.

As cardboard is one of the most recycled materials around, I wanted to find a more exiting way of giving it a second life. The process of manipulating the cardboard dictated the shape of the final design. Shaving down the edges of the cardboard rolls revealed the pattern of the corrugated layers, which reminded me of African patterns seen on low stools or poufs. By laminating and rolling the cardboard, my intention was to give the material a new visual language.

Carciofi won the Pure Talents Award during IMM Cologne 2016. It was exhibited at the Aram  Gallery in London and in the Cappellini showroom during Salone del Mobile 2016 as part of Cappellini Next.

![Close-Up One](/images/cardboard/stool/IMG_2979.jpg)
![Close-Up One](/images/cardboard/stool/mint.jpg)
![Close-Up One](/images/cardboard/stool/closeup-1.jpg)
![Close-Up One](/images/cardboard/stool/closeup-2.jpg)
![Close-Up One](/images/cardboard/stool/aram-gallery.jpg)