text:
#ifndef OGR_CLOUDANT_H_INCLUDED
#define OGR_CLOUDANT_H_INCLUDED

#include "ogr_couchdb.h"

typedef enum
{
    CLOUDANT_TABLE_LAYER
} CloudantLayerType;

class OGRCloudantDataSource;

/************************************************************************/
/*                      OGRCloudantTableLayer                         */
/************************************************************************/

class OGRCloudantTableLayer : public OGRCouchDBTableLayer
{
    int                       bHasStandardSpatial;
    const char*               pszSpatialView;
    char*                     pszSpatialDDoc;

    protected:
            virtual int               GetFeaturesToFetch() {
               return atoi(CPLGetConfigOption("CLOUDANT_PAGE_SIZE", "200"));
            }

            virtual int               RunSpatialFilterQueryIfNecessary();
            virtual void              GetSpatialView();
            virtual void              WriteMetadata();
            virtual void              LoadMetadata();

    public:
            OGRCloudantTableLayer(OGRCloudantDataSource* poDS,
                                 const char* pszName);
            ~OGRCloudantTableLayer();
};

/************************************************************************/
/*                         OGRCloudantDataSource                        */
/************************************************************************/

class OGRCloudantDataSource : public OGRCouchDBDataSource
{
  protected:
            OGRLayer*    OpenDatabase(const char* pszLayerName = NULL);
  public:
                        OGRCloudantDataSource();
                        ~OGRCloudantDataSource();
    virtual int Open( const char * pszFilename, int bUpdateIn);
    virtual OGRLayer   *ICreateLayer( const char *pszName,
             OGRSpatialReference *poSpatialRef = NULL,
             OGRwkbGeometryType eGType = wkbUnknown,
             char ** papszOptions = NULL );
};

/************************************************************************/
/*                           OGRCloudantDriver                          */
/************************************************************************/

class OGRCloudantDriver : public OGRCouchDBDriver
{
  public:
                ~OGRCloudantDriver();

    virtual const char*         GetName();
    virtual OGRDataSource*      Open( const char *, int );
    virtual OGRDataSource*      CreateDataSource( const char * pszName,
                                                  char **papszOptions );
    virtual int                 TestCapability( const char * );

};

#endif /* ndef OGR_CLOUDANT_H_INCLUDED */


text:
class MagicStandard < ActiveRecord::Base
  belongs_to :army
  has_many :army_list_unit_magic_standards, dependent: :destroy
  has_many :army_list_units, through: :army_list_unit_magic_standards
  has_one :override, class_name: 'MagicStandard', foreign_key: 'override_id'

  validates :value_points, numericality: { greater_than_or_equal_to: 0 }

  scope :available_for, lambda { |army, value_points_limit|
    if value_points_limit.nil?
      where('army_id = :army_id OR (army_id IS NULL AND id NOT IN (SELECT override_id FROM magic_standards WHERE army_id = :army_id AND override_id IS NOT NULL))', army_id: army).order('value_points DESC', 'name')
    else
      where('army_id = :army_id OR (army_id IS NULL AND id NOT IN (SELECT override_id FROM magic_standards WHERE army_id = :army_id AND override_id IS NOT NULL))', army_id: army).where('value_points <= ?', value_points_limit).order('value_points DESC', 'name')
    end
  }
end

redpajama_set_name: RedPajamaGithub


text:
/** PURE_IMPORTS_START ._Subscriber PURE_IMPORTS_END */
var __extends = (this && this.__extends) || /*@__PURE__*/ (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b)
            if (b.hasOwnProperty(p))
                d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { Subscriber } from './Subscriber';
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var OuterSubscriber = /*@__PURE__*/ (/*@__PURE__*/ function (_super) {
    __extends(OuterSubscriber, _super);
    function OuterSubscriber() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.destination.next(innerValue);
    };
    OuterSubscriber.prototype.notifyError = function (error, innerSub) {
        this.destination.error(error);
    };
    OuterSubscriber.prototype.notifyComplete = function (innerSub) {
        this.destination.complete();
    };
    return OuterSubscriber;
}(Subscriber));
export { OuterSubscriber };
//# sourceMappingURL=OuterSubscriber.js.map


text:
<?php

/**
 * sfRenderException is thrown when a view's pre-render check fails.
 *
 * @package    symfony
 * @subpackage exception
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @author     Sean Kerr <sean@code-box.org>
 * @version    SVN: $Id: sfRenderException.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfRenderException extends sfException
{
}


text:
namespace CJia.PIVAS.App.UI.Label
{
    partial class LabelScanning
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if(disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region 组件设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LabelScanning));
            this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
            this.btnPrintLabel = new DevExpress.XtraEditors.SimpleButton();
            this.btnSelect = new DevExpress.XtraEditors.SimpleButton();
            this.txtPrintDarCode = new System.Windows.Forms.TextBox();
            this.labelControl6 = new DevExpress.XtraEditors.LabelControl();
            this.btnDelect = new DevExpress.XtraEditors.SimpleButton();
            this.btnScenning = new DevExpress.XtraEditors.SimpleButton();
            this.txbBarCode = new System.Windows.Forms.TextBox();
            this.labelControl5 = new DevExpress.XtraEditors.LabelControl();
            this.pbLabelPreview = new System.Windows.Forms.PictureBox();
            this.txtSpeak = new System.Windows.Forms.TextBox();
            this.cbSpeak = new System.Windows.Forms.CheckBox();
            this.groupControl2 = new DevExpress.XtraEditors.GroupControl();
            this.panel2 = new System.Windows.Forms.Panel();
            this.rbAll = new System.Windows.Forms.RadioButton();
            this.rbNo = new System.Windows.Forms.RadioButton();
            this.rbYes = new System.Windows.Forms.RadioButton();
            this.gdcLabel = new DevExpress.XtraGrid.GridControl();
            this.gdvLabelCollect = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn14 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn15 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn16 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.btnLabelPrint = new DevExpress.XtraEditors.SimpleButton();
            this.btnNoGroupScanning = new DevExpress.XtraEditors.SimpleButton();
            this.groupControl7 = new DevExpress.XtraEditors.GroupControl();
            this.lblMessage = new System.Windows.Forms.Label();
            this.cbIffield = new System.Windows.Forms.ComboBox();
            this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
            this.cbBatch = new System.Windows.Forms.ComboBox();
            this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
            this.btnRefresh = new DevExpress.XtraEditors.SimpleButton();
            this.cbScanning = new System.Windows.Forms.ComboBox();
            this.labelControl4 = new DevExpress.XtraEditors.LabelControl();
            this.panel1 = new System.Windows.Forms.Panel();
            this.rbAllPrint = new System.Windows.Forms.RadioButton();
            this.rbNoPrint = new System.Windows.Forms.RadioButton();
            this.rbYesPrint = new System.Windows.Forms.RadioButton();
            this.groupControl4 = new DevExpress.XtraEditors.GroupControl();
            this.panel4 = new System.Windows.Forms.Panel();
            this.ckceBatch = new DevExpress.XtraEditors.CheckedComboBoxEdit();
            this.ckceIllfield = new DevExpress.XtraEditors.CheckedComboBoxEdit();
            this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
            this.panel5 = new System.Windows.Forms.Panel();
            this.rbOld = new System.Windows.Forms.RadioButton();
            this.rbNew = new System.Windows.Forms.RadioButton();
            this.dtpStartTime = new System.Windows.Forms.DateTimePicker();
            this.panel3 = new System.Windows.Forms.Panel();
            this.rbTemporary = new System.Windows.Forms.RadioButton();
            this.rbLong = new System.Windows.Forms.RadioButton();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
            this.groupControl1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pbLabelPreview)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl2)).BeginInit();
            this.groupControl2.SuspendLayout();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gdcLabel)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gdvLabelCollect)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl7)).BeginInit();
            this.groupControl7.SuspendLayout();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl4)).BeginInit();
            this.groupControl4.SuspendLayout();
            this.panel4.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.ckceBatch.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ckceIllfield.Properties)).BeginInit();
            this.panel5.SuspendLayout();
            this.panel3.SuspendLayout();
            this.SuspendLayout();
            //
            // groupControl1
            //
            this.groupControl1.AllowTouchScroll = true;
            this.groupControl1.AlwaysScrollActiveControlIntoView = false;
            this.groupControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.groupControl1.Appearance.BackColor = System.Drawing.Color.White;
            this.groupControl1.Appearance.Options.UseBackColor = true;
            this.groupControl1.Controls.Add(this.btnPrintLabel);
            this.groupControl1.Controls.Add(this.btnSelect);
            this.groupControl1.Controls.Add(this.txtPrintDarCode);
            this.groupControl1.Controls.Add(this.labelControl6);
            this.groupControl1.Controls.Add(this.btnDelect);
            this.groupControl1.Controls.Add(this.btnScenning);
            this.groupControl1.Controls.Add(this.txbBarCode);
            this.groupControl1.Controls.Add(this.labelControl5);
            this.groupControl1.Controls.Add(this.pbLabelPreview);
            this.groupControl1.Location = new System.Drawing.Point(1220, 3);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new System.Drawing.Size(276, 501);
            this.groupControl1.TabIndex = 4;
            this.groupControl1.Text = "瓶贴详情";
            //
            // btnPrintLabel
            //
            this.btnPrintLabel.Image = ((System.Drawing.Image)(resources.GetObject("btnPrintLabel.Image")));
            this.btnPrintLabel.Location = new System.Drawing.Point(13, 465);
            this.btnPrintLabel.Name = "btnPrintLabel";
            this.btnPrintLabel.Size = new System.Drawing.Size(258, 23);
            this.btnPrintLabel.TabIndex = 28;
            this.btnPrintLabel.Text = "重打";
            this.btnPrintLabel.Click += new System.EventHandler(this.btnPrint_Click);
            //
            // btnSelect
            //
            this.btnSelect.Location = new System.Drawing.Point(193, 64);
            this.btnSelect.Name = "btnSelect";
            this.btnSelect.Size = new System.Drawing.Size(75, 23);
            this.btnSelect.TabIndex = 27;
            this.btnSelect.Text = "查询";
            this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
            //
            // txtPrintDarCode
            //
            this.txtPrintDarCode.Location = new System.Drawing.Point(62, 65);
            this.txtPrintDarCode.Name = "txtPrintDarCode";
            this.txtPrintDarCode.Size = new System.Drawing.Size(125, 22);
            this.txtPrintDarCode.TabIndex = 26;
            this.txtPrintDarCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPrintDarCode_KeyDown);
            //
            // labelControl6
            //
            this.labelControl6.Location = new System.Drawing.Point(13, 68);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new System.Drawing.Size(48, 14);
            this.labelControl6.TabIndex = 25;
            this.labelControl6.Text = "条形码:";
            //
            // btnDelect
            //
            this.btnDelect.Image = ((System.Drawing.Image)(resources.GetObject("btnDelect.Image")));
            this.btnDelect.Location = new System.Drawing.Point(13, 465);
            this.btnDelect.Name = "btnDelect";
            this.btnDelect.Size = new System.Drawing.Size(124, 23);
            this.btnDelect.TabIndex = 22;
            this.btnDelect.Text = "作废";
            this.btnDelect.Click += new System.EventHandler(this.btnDelect_Click);
            //
            // btnScenning
            //
            this.btnScenning.Location = new System.Drawing.Point(193, 32);
            this.btnScenning.Name = "btnScenning";
            this.btnScenning.Size = new System.Drawing.Size(75, 23);
            this.btnScenning.TabIndex = 20;
            this.btnScenning.Text = "扫描";
            this.btnScenning.Click += new System.EventHandler(this.btnScenning_Click);
            //
            // txbBarCode
            //
            this.txbBarCode.Location = new System.Drawing.Point(62, 33);
            this.txbBarCode.Name = "txbBarCode";
            this.txbBarCode.Size = new System.Drawing.Size(125, 22);
            this.txbBarCode.TabIndex = 18;
            this.txbBarCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txbBarCode_KeyDown);
            //
            // labelControl5
            //
            this.labelControl5.Location = new System.Drawing.Point(13, 36);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new System.Drawing.Size(48, 14);
            this.labelControl5.TabIndex = 17;
            this.labelControl5.Text = "条形码:";
            //
            // pbLabelPreview
            //
            this.pbLabelPreview.Location = new System.Drawing.Point(7, 96);
            this.pbLabelPreview.Name = "pbLabelPreview";
            this.pbLabelPreview.Size = new System.Drawing.Size(264, 358);
            this.pbLabelPreview.TabIndex = 0;
            this.pbLabelPreview.TabStop = false;
            //
            // txtSpeak
            //
            this.txtSpeak.Location = new System.Drawing.Point(96, 23);
            this.txtSpeak.Name = "txtSpeak";
            this.txtSpeak.Size = new System.Drawing.Size(174, 22);
            this.txtSpeak.TabIndex = 24;
            this.txtSpeak.TextChanged += new System.EventHandler(this.txtSpeak_TextChanged);
            //
            // cbSpeak
            //
            this.cbSpeak.AutoSize = true;
            this.cbSpeak.BackColor = System.Drawing.Color.Transparent;
            this.cbSpeak.Checked = true;
            this.cbSpeak.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbSpeak.Location = new System.Drawing.Point(13, 24);
            this.cbSpeak.Name = "cbSpeak";
            this.cbSpeak.Size = new System.Drawing.Size(74, 18);
            this.cbSpeak.TabIndex = 23;
            this.cbSpeak.Text = "语音提示";
            this.cbSpeak.UseVisualStyleBackColor = false;
            //
            // groupControl2
            //
            this.groupControl2.AllowTouchScroll = true;
            this.groupControl2.AlwaysScrollActiveControlIntoView = false;
            this.groupControl2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.groupControl2.Controls.Add(this.panel2);
            this.groupControl2.Controls.Add(this.gdcLabel);
            this.groupControl2.Location = new System.Drawing.Point(3, 117);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new System.Drawing.Size(1213, 575);
            this.groupControl2.TabIndex = 5;
            this.groupControl2.Text = "瓶贴预览";
            //
            // panel2
            //
            this.panel2.BackColor = System.Drawing.Color.Transparent;
            this.panel2.Controls.Add(this.rbAll);
            this.panel2.Controls.Add(this.rbNo);
            this.panel2.Controls.Add(this.rbYes);
            this.panel2.Location = new System.Drawing.Point(6, 24);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(303, 26);
            this.panel2.TabIndex = 42;
            //
            // rbAll
            //
            this.rbAll.AutoSize = true;
            this.rbAll.BackColor = System.Drawing.Color.Transparent;
            this.rbAll.Checked = true;
            this.rbAll.Location = new System.Drawing.Point(4, 5);
            this.rbAll.Name = "rbAll";
            this.rbAll.Size = new System.Drawing.Size(66, 18);
            this.rbAll.TabIndex = 3;
            this.rbAll.TabStop = true;
            this.rbAll.Text = "全部(0)";
            this.rbAll.UseVisualStyleBackColor = false;
            this.rbAll.CheckedChanged += new System.EventHandler(this.Check_CheckedChanged);
            //
            // rbNo
            //
            this.rbNo.AutoSize = true;
            this.rbNo.BackColor = System.Drawing.Color.Transparent;
            this.rbNo.Location = new System.Drawing.Point(196, 5);
            this.rbNo.Name = "rbNo";
            this.rbNo.Size = new System.Drawing.Size(78, 18);
            this.rbNo.TabIndex = 5;
            this.rbNo.Text = "未扫描(0)";
            this.rbNo.UseVisualStyleBackColor = false;
            this.rbNo.CheckedChanged += new System.EventHandler(this.Check_CheckedChanged);
            //
            // rbYes
            //
            this.rbYes.AutoSize = true;
            this.rbYes.BackColor = System.Drawing.Color.Transparent;
            this.rbYes.Location = new System.Drawing.Point(93, 5);
            this.rbYes.Name = "rbYes";
            this.rbYes.Size = new System.Drawing.Size(78, 18);
            this.rbYes.TabIndex = 4;
            this.rbYes.Text = "已扫描(0)";
            this.rbYes.UseVisualStyleBackColor = false;
            this.rbYes.CheckedChanged += new System.EventHandler(this.Check_CheckedChanged);
            //
            // gdcLabel
            //
            this.gdcLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.gdcLabel.Location = new System.Drawing.Point(2, 53);
            this.gdcLabel.MainView = this.gdvLabelCollect;
            this.gdcLabel.Name = "gdcLabel";
            this.gdcLabel.Size = new System.Drawing.Size(1209, 515);
            this.gdcLabel.TabIndex = 2;
            this.gdcLabel.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
            this.gdvLabelCollect});
            //
            // gdvLabelCollect
            //
            this.gdvLabelCollect.Appearance.FocusedRow.BackColor = System.Drawing.Color.Transparent;
            this.gdvLabelCollect.Appearance.FocusedRow.BackColor2 = System.Drawing.Color.White;
            this.gdvLabelCollect.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumn1,
            this.gridColumn2,
            this.gridColumn3,
            this.gridColumn4,
            this.gridColumn13,
            this.gridColumn5,
            this.gridColumn14,
            this.gridColumn6,
            this.gridColumn7,
            this.gridColumn12,
            this.gridColumn8,
            this.gridColumn10,
            this.gridColumn11,
            this.gridColumn9,
            this.gridColumn15,
            this.gridColumn16});
            this.gdvLabelCollect.GridControl = this.gdcLabel;
            this.gdvLabelCollect.GroupCount = 2;
            this.gdvLabelCollect.Name = "gdvLabelCollect";
            this.gdvLabelCollect.OptionsBehavior.Editable = false;
            this.gdvLabelCollect.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;
            this.gdvLabelCollect.OptionsView.ShowGroupPanel = false;
            this.gdvLabelCollect.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] {
            new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gridColumn1, DevExpress.Data.ColumnSortOrder.Ascending),
            new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gridColumn2, DevExpress.Data.ColumnSortOrder.Ascending),
            new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gridColumn16, DevExpress.Data.ColumnSortOrder.Ascending)});
            this.gdvLabelCollect.RowStyle += new DevExpress.XtraGrid.Views.Grid.RowStyleEventHandler(this.gdvLabelCollect_RowStyle);
            this.gdvLabelCollect.DoubleClick += new System.EventHandler(this.gdvLabelCollect_DoubleClick);
            //
            // gridColumn1
            //
            this.gridColumn1.Caption = "病区";
            this.gridColumn1.FieldName = "ILLFIELD_NAME";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            //
            // gridColumn2
            //
            this.gridColumn2.Caption = "批次";
            this.gridColumn2.FieldName = "BATCH_NAME";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 0;
            //
            // gridColumn3
            //
            this.gridColumn3.Caption = "床号";
            this.gridColumn3.FieldName = "BED_ID";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 0;
            this.gridColumn3.Width = 97;
            //
            // gridColumn4
            //
            this.gridColumn4.Caption = "病人";
            this.gridColumn4.FieldName = "PATIENT_NAME";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 1;
            this.gridColumn4.Width = 77;
            //
            // gridColumn13
            //
            this.gridColumn13.Caption = "病人id";
            this.gridColumn13.FieldName = "PATIENT_ID";
            this.gridColumn13.Name = "gridColumn13";
            this.gridColumn13.Visible = true;
            this.gridColumn13.VisibleIndex = 2;
            this.gridColumn13.Width = 63;
            //
            // gridColumn5
            //
            this.gridColumn5.Caption = "医嘱id";
            this.gridColumn5.FieldName = "GROUP_INDEX";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 3;
            this.gridColumn5.Width = 85;
            //
            // gridColumn14
            //
            this.gridColumn14.Caption = "瓶贴号";
            this.gridColumn14.FieldName = "LABEL_BAR_ID";
            this.gridColumn14.Name = "gridColumn14";
            this.gridColumn14.Visible = true;
            this.gridColumn14.VisibleIndex = 4;
            this.gridColumn14.Width = 95;
            //
            // gridColumn6
            //
            this.gridColumn6.Caption = "医嘱类型";
            this.gridColumn6.FieldName = "PHARM_TYPE_NAME";
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 5;
            this.gridColumn6.Width = 71;
            //
            // gridColumn7
            //
            this.gridColumn7.Caption = "页码";
            this.gridColumn7.FieldName = "PAGE_NO";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 6;
            this.gridColumn7.Width = 71;
            //
            // gridColumn12
            //
            this.gridColumn12.Caption = "打印人";
            this.gridColumn12.FieldName = "GEN_NAME";
            this.gridColumn12.Name = "gridColumn12";
            this.gridColumn12.Visible = true;
            this.gridColumn12.VisibleIndex = 7;
            this.gridColumn12.Width = 50;
            //
            // gridColumn8
            //
            this.gridColumn8.Caption = "打印时间";
            this.gridColumn8.DisplayFormat.FormatString = "yyyy/MM/dd HH:mm:ss";
            this.gridColumn8.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            this.gridColumn8.FieldName = "GEN_DATE";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 8;
            this.gridColumn8.Width = 166;
            //
            // gridColumn10
            //
            this.gridColumn10.Caption = "扫描人";
            this.gridColumn10.FieldName = "SCNNING_NAME";
            this.gridColumn10.Name = "gridColumn10";
            this.gridColumn10.Visible = true;
            this.gridColumn10.VisibleIndex = 9;
            this.gridColumn10.Width = 45;
            //
            // gridColumn11
            //
            this.gridColumn11.Caption = "扫描时间";
            this.gridColumn11.DisplayFormat.FormatString = "yyyy/MM/dd HH:mm:ss";
            this.gridColumn11.FieldName = "SCNNING_DATE";
            this.gridColumn11.Name = "gridColumn11";
            this.gridColumn11.Visible = true;
            this.gridColumn11.VisibleIndex = 10;
            this.gridColumn11.Width = 163;
            //
            // gridColumn9
            //
            this.gridColumn9.Caption = "状态";
            this.gridColumn9.FieldName = "LABEL_TYPE";
            this.gridColumn9.Name = "gridColumn9";
            this.gridColumn9.Visible = true;
            this.gridColumn9.VisibleIndex = 11;
            this.gridColumn9.Width = 74;
            //
            // gridColumn15
            //
            this.gridColumn15.Caption = "执行日期";
            this.gridColumn15.DisplayFormat.FormatString = "d";
            this.gridColumn15.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            this.gridColumn15.FieldName = "PHARM_TIME";
            this.gridColumn15.Name = "gridColumn15";
            this.gridColumn15.Visible = true;
            this.gridColumn15.VisibleIndex = 12;
            this.gridColumn15.Width = 134;
            //
            // gridColumn16
            //
            this.gridColumn16.Caption = "BED_NO";
            this.gridColumn16.FieldName = "BED_NO";
            this.gridColumn16.Name = "gridColumn16";
            //
            // btnLabelPrint
            //
            this.btnLabelPrint.Appearance.Font = new System.Drawing.Font("Tahoma", 14F);
            this.btnLabelPrint.Appearance.Options.UseFont = true;
            this.btnLabelPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnLabelPrint.Image")));
            this.btnLabelPrint.Location = new System.Drawing.Point(547, 44);
            this.btnLabelPrint.Name = "btnLabelPrint";
            this.btnLabelPrint.Size = new System.Drawing.Size(111, 31);
            this.btnLabelPrint.TabIndex = 45;
            this.btnLabelPrint.Text = "瓶贴明细";
            this.btnLabelPrint.Visible = false;
            this.btnLabelPrint.Click += new System.EventHandler(this.btnLabelPrint_Click);
            //
            // btnNoGroupScanning
            //
            this.btnNoGroupScanning.Appearance.Font = new System.Drawing.Font("Tahoma", 12F);
            this.btnNoGroupScanning.Appearance.Options.UseFont = true;
            this.btnNoGroupScanning.Image = ((System.Drawing.Image)(resources.GetObject("btnNoGroupScanning.Image")));
            this.btnNoGroupScanning.Location = new System.Drawing.Point(430, 43);
            this.btnNoGroupScanning.Name = "btnNoGroupScanning";
            this.btnNoGroupScanning.Size = new System.Drawing.Size(111, 31);
            this.btnNoGroupScanning.TabIndex = 22;
            this.btnNoGroupScanning.Text = "批量扫描";
            this.btnNoGroupScanning.Click += new System.EventHandler(this.btnNoGroupScanning_Click);
            //
            // groupControl7
            //
            this.groupControl7.AllowTouchScroll = true;
            this.groupControl7.AlwaysScrollActiveControlIntoView = false;
            this.groupControl7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.groupControl7.Controls.Add(this.lblMessage);
            this.groupControl7.Controls.Add(this.txtSpeak);
            this.groupControl7.Controls.Add(this.cbSpeak);
            this.groupControl7.Location = new System.Drawing.Point(1220, 510);
            this.groupControl7.Name = "groupControl7";
            this.groupControl7.Size = new System.Drawing.Size(276, 183);
            this.groupControl7.TabIndex = 6;
            this.groupControl7.Text = "信息提示";
            //
            // lblMessage
            //
            this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.lblMessage.BackColor = System.Drawing.Color.Transparent;
            this.lblMessage.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
            this.lblMessage.ForeColor = System.Drawing.Color.White;
            this.lblMessage.Location = new System.Drawing.Point(2, 49);
            this.lblMessage.Name = "lblMessage";
            this.lblMessage.Size = new System.Drawing.Size(272, 131);
            this.lblMessage.TabIndex = 0;
            this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // cbIffield
            //
            this.cbIffield.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbIffield.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbIffield.FormattingEnabled = true;
            this.cbIffield.Location = new System.Drawing.Point(373, 0);
            this.cbIffield.Name = "cbIffield";
            this.cbIffield.Size = new System.Drawing.Size(129, 22);
            this.cbIffield.TabIndex = 15;
            this.cbIffield.Visible = false;
            this.cbIffield.SelectedValueChanged += new System.EventHandler(this.Filter_ValueChanged);
            //
            // labelControl2
            //
            this.labelControl2.Location = new System.Drawing.Point(114, 52);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new System.Drawing.Size(36, 14);
            this.labelControl2.TabIndex = 16;
            this.labelControl2.Text = "病区:";
            //
            // cbBatch
            //
            this.cbBatch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbBatch.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbBatch.FormattingEnabled = true;
            this.cbBatch.Location = new System.Drawing.Point(551, 0);
            this.cbBatch.Name = "cbBatch";
            this.cbBatch.Size = new System.Drawing.Size(92, 22);
            this.cbBatch.TabIndex = 17;
            this.cbBatch.Visible = false;
            this.cbBatch.SelectedValueChanged += new System.EventHandler(this.Filter_ValueChanged);
            //
            // labelControl3
            //
            this.labelControl3.Location = new System.Drawing.Point(292, 52);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new System.Drawing.Size(36, 14);
            this.labelControl3.TabIndex = 18;
            this.labelControl3.Text = "批次:";
            //
            // btnRefresh
            //
            this.btnRefresh.Appearance.Font = new System.Drawing.Font("Tahoma", 14F);
            this.btnRefresh.Appearance.Options.UseFont = true;
            this.btnRefresh.Image = ((System.Drawing.Image)(resources.GetObject("btnRefresh.Image")));
            this.btnRefresh.Location = new System.Drawing.Point(430, 7);
            this.btnRefresh.Name = "btnRefresh";
            this.btnRefresh.Size = new System.Drawing.Size(111, 31);
            this.btnRefresh.TabIndex = 19;
            this.btnRefresh.Text = "刷新";
            this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
            //
            // cbScanning
            //
            this.cbScanning.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbScanning.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbScanning.FormattingEnabled = true;
            this.cbScanning.Items.AddRange(new object[] {
            "入仓扫描",
            "出仓扫描"});
            this.cbScanning.Location = new System.Drawing.Point(329, 13);
            this.cbScanning.Name = "cbScanning";
            this.cbScanning.Size = new System.Drawing.Size(92, 22);
            this.cbScanning.TabIndex = 20;
            this.cbScanning.SelectedValueChanged += new System.EventHandler(this.Filter_ValueChanged);
            //
            // labelControl4
            //
            this.labelControl4.Location = new System.Drawing.Point(292, 16);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new System.Drawing.Size(36, 14);
            this.labelControl4.TabIndex = 21;
            this.labelControl4.Text = "扫描:";
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.Transparent;
            this.panel1.Controls.Add(this.rbAllPrint);
            this.panel1.Controls.Add(this.rbNoPrint);
            this.panel1.Controls.Add(this.rbYesPrint);
            this.panel1.Location = new System.Drawing.Point(3, 61);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(229, 45);
            this.panel1.TabIndex = 41;
            //
            // rbAllPrint
            //
            this.rbAllPrint.AutoSize = true;
            this.rbAllPrint.BackColor = System.Drawing.Color.Transparent;
            this.rbAllPrint.Font = new System.Drawing.Font("Tahoma", 15F);
            this.rbAllPrint.Location = new System.Drawing.Point(155, 8);
            this.rbAllPrint.Name = "rbAllPrint";
            this.rbAllPrint.Size = new System.Drawing.Size(68, 28);
            this.rbAllPrint.TabIndex = 33;
            this.rbAllPrint.Text = "全部";
            this.rbAllPrint.UseVisualStyleBackColor = false;
            this.rbAllPrint.Visible = false;
            this.rbAllPrint.CheckedChanged += new System.EventHandler(this.Print_CheckedChanged);
            //
            // rbNoPrint
            //
            this.rbNoPrint.AutoSize = true;
            this.rbNoPrint.BackColor = System.Drawing.Color.Transparent;
            this.rbNoPrint.Font = new System.Drawing.Font("Tahoma", 15F);
            this.rbNoPrint.Location = new System.Drawing.Point(81, 8);
            this.rbNoPrint.Name = "rbNoPrint";
            this.rbNoPrint.Size = new System.Drawing.Size(68, 28);
            this.rbNoPrint.TabIndex = 32;
            this.rbNoPrint.Text = "单组";
            this.rbNoPrint.UseVisualStyleBackColor = false;
            this.rbNoPrint.CheckedChanged += new System.EventHandler(this.Print_CheckedChanged);
            //
            // rbYesPrint
            //
            this.rbYesPrint.AutoSize = true;
            this.rbYesPrint.BackColor = System.Drawing.Color.Transparent;
            this.rbYesPrint.Checked = true;
            this.rbYesPrint.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Bold);
            this.rbYesPrint.ForeColor = System.Drawing.Color.Blue;
            this.rbYesPrint.Location = new System.Drawing.Point(5, 8);
            this.rbYesPrint.Name = "rbYesPrint";
            this.rbYesPrint.Size = new System.Drawing.Size(70, 28);
            this.rbYesPrint.TabIndex = 31;
            this.rbYesPrint.TabStop = true;
            this.rbYesPrint.Text = "配置";
            this.rbYesPrint.UseVisualStyleBackColor = false;
            this.rbYesPrint.CheckedChanged += new System.EventHandler(this.Print_CheckedChanged);
            //
            // groupControl4
            //
            this.groupControl4.AllowTouchScroll = true;
            this.groupControl4.AlwaysScrollActiveControlIntoView = false;
            this.groupControl4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.groupControl4.Appearance.BackColor = System.Drawing.Color.White;
            this.groupControl4.Appearance.Options.UseBackColor = true;
            this.groupControl4.Controls.Add(this.panel4);
            this.groupControl4.Controls.Add(this.panel1);
            this.groupControl4.Controls.Add(this.panel3);
            this.groupControl4.Controls.Add(this.cbIffield);
            this.groupControl4.Controls.Add(this.cbBatch);
            this.groupControl4.Location = new System.Drawing.Point(4, 3);
            this.groupControl4.Name = "groupControl4";
            this.groupControl4.Size = new System.Drawing.Size(1212, 110);
            this.groupControl4.TabIndex = 3;
            this.groupControl4.Text = "筛选条件";
            //
            // panel4
            //
            this.panel4.BackColor = System.Drawing.Color.Transparent;
            this.panel4.Controls.Add(this.ckceBatch);
            this.panel4.Controls.Add(this.ckceIllfield);
            this.panel4.Controls.Add(this.labelControl1);
            this.panel4.Controls.Add(this.panel5);
            this.panel4.Controls.Add(this.btnLabelPrint);
            this.panel4.Controls.Add(this.btnNoGroupScanning);
            this.panel4.Controls.Add(this.labelControl2);
            this.panel4.Controls.Add(this.dtpStartTime);
            this.panel4.Controls.Add(this.labelControl3);
            this.panel4.Controls.Add(this.labelControl4);
            this.panel4.Controls.Add(this.btnRefresh);
            this.panel4.Controls.Add(this.cbScanning);
            this.panel4.Location = new System.Drawing.Point(222, 25);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(745, 80);
            this.panel4.TabIndex = 46;
            //
            // ckceBatch
            //
            this.ckceBatch.Location = new System.Drawing.Point(329, 49);
            this.ckceBatch.Name = "ckceBatch";
            this.ckceBatch.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.ckceBatch.Size = new System.Drawing.Size(92, 20);
            this.ckceBatch.TabIndex = 68;
            //
            // ckceIllfield
            //
            this.ckceIllfield.Location = new System.Drawing.Point(151, 49);
            this.ckceIllfield.Name = "ckceIllfield";
            this.ckceIllfield.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.ckceIllfield.Size = new System.Drawing.Size(129, 20);
            this.ckceIllfield.TabIndex = 67;
            //
            // labelControl1
            //
            this.labelControl1.Location = new System.Drawing.Point(90, 18);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new System.Drawing.Size(60, 14);
            this.labelControl1.TabIndex = 46;
            this.labelControl1.Text = "执行日期:";
            //
            // panel5
            //
            this.panel5.BackColor = System.Drawing.Color.Transparent;
            this.panel5.Controls.Add(this.rbOld);
            this.panel5.Controls.Add(this.rbNew);
            this.panel5.Location = new System.Drawing.Point(5, 1);
            this.panel5.Name = "panel5";
            this.panel5.Size = new System.Drawing.Size(97, 78);
            this.panel5.TabIndex = 66;
            //
            // rbOld
            //
            this.rbOld.AutoSize = true;
            this.rbOld.BackColor = System.Drawing.Color.Transparent;
            this.rbOld.Checked = true;
            this.rbOld.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Bold);
            this.rbOld.ForeColor = System.Drawing.Color.Green;
            this.rbOld.Location = new System.Drawing.Point(13, 7);
            this.rbOld.Name = "rbOld";
            this.rbOld.Size = new System.Drawing.Size(70, 28);
            this.rbOld.TabIndex = 32;
            this.rbOld.TabStop = true;
            this.rbOld.Text = "隔日";
            this.rbOld.UseVisualStyleBackColor = false;
            this.rbOld.CheckedChanged += new System.EventHandler(this.rbOldNew_CheckedChanged);
            //
            // rbNew
            //
            this.rbNew.AutoSize = true;
            this.rbNew.BackColor = System.Drawing.Color.Transparent;
            this.rbNew.Font = new System.Drawing.Font("Tahoma", 15F);
            this.rbNew.ForeColor = System.Drawing.Color.Black;
            this.rbNew.Location = new System.Drawing.Point(13, 43);
            this.rbNew.Name = "rbNew";
            this.rbNew.Size = new System.Drawing.Size(68, 28);
            this.rbNew.TabIndex = 31;
            this.rbNew.Text = "当日";
            this.rbNew.UseVisualStyleBackColor = false;
            this.rbNew.CheckedChanged += new System.EventHandler(this.rbOldNew_CheckedChanged);
            //
            // dtpStartTime
            //
            this.dtpStartTime.Location = new System.Drawing.Point(151, 14);
            this.dtpStartTime.Name = "dtpStartTime";
            this.dtpStartTime.Size = new System.Drawing.Size(129, 22);
            this.dtpStartTime.TabIndex = 44;
            //
            // panel3
            //
            this.panel3.BackColor = System.Drawing.Color.Transparent;
            this.panel3.Controls.Add(this.rbTemporary);
            this.panel3.Controls.Add(this.rbLong);
            this.panel3.Location = new System.Drawing.Point(3, 25);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(152, 45);
            this.panel3.TabIndex = 42;
            //
            // rbTemporary
            //
            this.rbTemporary.AutoSize = true;
            this.rbTemporary.BackColor = System.Drawing.Color.Transparent;
            this.rbTemporary.Font = new System.Drawing.Font("Tahoma", 15F);
            this.rbTemporary.Location = new System.Drawing.Point(81, 8);
            this.rbTemporary.Name = "rbTemporary";
            this.rbTemporary.Size = new System.Drawing.Size(68, 28);
            this.rbTemporary.TabIndex = 32;
            this.rbTemporary.Text = "临时";
            this.rbTemporary.UseVisualStyleBackColor = false;
            this.rbTemporary.CheckedChanged += new System.EventHandler(this.rbLongTemporary_CheckedChanged);
            //
            // rbLong
            //
            this.rbLong.AutoSize = true;
            this.rbLong.BackColor = System.Drawing.Color.Transparent;
            this.rbLong.Checked = true;
            this.rbLong.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Bold);
            this.rbLong.ForeColor = System.Drawing.Color.Red;
            this.rbLong.Location = new System.Drawing.Point(5, 8);
            this.rbLong.Name = "rbLong";
            this.rbLong.Size = new System.Drawing.Size(70, 28);
            this.rbLong.TabIndex = 31;
            this.rbLong.TabStop = true;
            this.rbLong.Text = "长期";
            this.rbLong.UseVisualStyleBackColor = false;
            this.rbLong.CheckedChanged += new System.EventHandler(this.rbLongTemporary_CheckedChanged);
            //
            // LabelScanning
            //
            this.Appearance.BackColor = System.Drawing.Color.White;
            this.Appearance.Options.UseBackColor = true;
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.groupControl7);
            this.Controls.Add(this.groupControl2);
            this.Controls.Add(this.groupControl1);
            this.Controls.Add(this.groupControl4);
            this.Name = "LabelScanning";
            this.Size = new System.Drawing.Size(1500, 700);
            ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
            this.groupControl1.ResumeLayout(false);
            this.groupControl1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pbLabelPreview)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl2)).EndInit();
            this.groupControl2.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gdcLabel)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gdvLabelCollect)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl7)).EndInit();
            this.groupControl7.ResumeLayout(false);
            this.groupControl7.PerformLayout();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.groupControl4)).EndInit();
            this.groupControl4.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.panel4.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.ckceBatch.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ckceIllfield.Properties)).EndInit();
            this.panel5.ResumeLayout(false);
            this.panel5.PerformLayout();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private DevExpress.XtraEditors.GroupControl groupControl1;
        private DevExpress.XtraEditors.GroupControl groupControl2;
        private DevExpress.XtraEditors.GroupControl groupControl7;
        private DevExpress.XtraGrid.GridControl gdcLabel;
        private DevExpress.XtraGrid.Views.Grid.GridView gdvLabelCollect;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn4;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn5;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn6;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn7;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn8;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn9;
        private System.Windows.Forms.PictureBox pbLabelPreview;
        private System.Windows.Forms.TextBox txbBarCode;
        private DevExpress.XtraEditors.LabelControl labelControl5;
        private DevExpress.XtraEditors.SimpleButton btnScenning;
        private System.Windows.Forms.Label lblMessage;
        private DevExpress.XtraEditors.SimpleButton btnDelect;
        private System.Windows.Forms.CheckBox cbSpeak;
        private System.Windows.Forms.TextBox txtSpeak;
        private DevExpress.XtraEditors.SimpleButton btnPrintLabel;
        private DevExpress.XtraEditors.SimpleButton btnSelect;
        private System.Windows.Forms.TextBox txtPrintDarCode;
        private DevExpress.XtraEditors.LabelControl labelControl6;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn10;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn11;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn12;
        private System.Windows.Forms.ComboBox cbIffield;
        private DevExpress.XtraEditors.LabelControl labelControl2;
        private System.Windows.Forms.ComboBox cbBatch;
        private DevExpress.XtraEditors.LabelControl labelControl3;
        private DevExpress.XtraEditors.SimpleButton btnRefresh;
        private System.Windows.Forms.ComboBox cbScanning;
        private DevExpress.XtraEditors.LabelControl labelControl4;
        private System.Windows.Forms.RadioButton rbAll;
        private System.Windows.Forms.RadioButton rbYes;
        private DevExpress.XtraEditors.SimpleButton btnNoGroupScanning;
        private System.Windows.Forms.RadioButton rbNo;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.RadioButton rbNoPrint;
        private System.Windows.Forms.RadioButton rbYesPrint;
        private DevExpress.XtraEditors.GroupControl groupControl4;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.RadioButton rbTemporary;
        private System.Windows.Forms.RadioButton rbLong;
        private System.Windows.Forms.DateTimePicker dtpStartTime;
        private DevExpress.XtraEditors.SimpleButton btnLabelPrint;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn13;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn14;
        private System.Windows.Forms.RadioButton rbAllPrint;
        private System.Windows.Forms.Panel panel4;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn15;
        private DevExpress.XtraEditors.LabelControl labelControl1;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn16;
        private System.Windows.Forms.Panel panel5;
        private System.Windows.Forms.RadioButton rbOld;
        private System.Windows.Forms.RadioButton rbNew;
        private DevExpress.XtraEditors.CheckedComboBoxEdit ckceIllfield;
        private DevExpress.XtraEditors.CheckedComboBoxEdit ckceBatch;
    }
}


text:
footer > .container, /* Footer */
.header > .container, /* Site header */
.pagehead > .container, /* All pageheads */
.site-container > .container, /* List view */
.site-container + .container /* Gist view */ {
  width: 100% !important;
  padding-left: 30px !important;
  padding-right: 30px !important;
}

.gist {
  padding-right: 0 !important;
}

.gist-sidebar {
  position: relative;
  margin-left: -170px;
}

.gist-with-sidebar .gist-content {
  width: 100% !important;
  padding-right: 200px;
}

.edit.container {
  width: 100% !important;
}


text:
<?php

namespace Magento\Framework\App\Config;

use Magento\Framework\App\Config;
use Magento\Framework\App\ObjectManager;

class DataTest extends \PHPUnit_Framework_TestCase
{
    const SAMPLE_CONFIG_PATH = 'web/unsecure/base_url';

    const SAMPLE_VALUE = 'http://example.com/';

    /**
     * @var \Magento\Framework\App\Config\Value
     */
    protected $_model;

    public static function setUpBeforeClass()
    {
        \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
            'Magento\Framework\App\Config\Storage\WriterInterface'
        )->save(
            self::SAMPLE_CONFIG_PATH,
            self::SAMPLE_VALUE
        );
        self::_refreshConfiguration();
    }

    public static function tearDownAfterClass()
    {
        \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
            'Magento\Framework\App\Config\Storage\WriterInterface'
        )->delete(
            self::SAMPLE_CONFIG_PATH
        );
        self::_refreshConfiguration();
    }

    /**
     * Remove cached configuration and reinitialize the application
     */
    protected static function _refreshConfiguration()
    {
        \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\CacheInterface')
            ->clean([\Magento\Framework\App\Config::CACHE_TAG]);
        \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize();
        $appConfig = ObjectManager::getInstance()->get(Config::class);
        $appConfig->clean();
    }

    protected function setUp()
    {
        $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
            'Magento\Framework\App\Config\Value'
        );
    }

    public function testIsValueChanged()
    {
        // load the model
        $collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
            'Magento\Config\Model\ResourceModel\Config\Data\Collection'
        );
        $collection->addFieldToFilter(
            'path',
            self::SAMPLE_CONFIG_PATH
        )->addFieldToFilter(
            'scope_id',
            0
        )->addFieldToFilter(
            'scope',
            'default'
        );
        foreach ($collection as $configData) {
            $this->_model = $configData;
            break;
        }
        $this->assertNotEmpty($this->_model->getId());

        // assert
        $this->assertFalse($this->_model->isValueChanged());
        $this->_model->setValue(uniqid());
        $this->assertTrue($this->_model->isValueChanged());
    }

    public function testGetOldValue()
    {
        $this->_model->setPath(self::SAMPLE_CONFIG_PATH);
        $this->assertEquals(self::SAMPLE_VALUE, $this->_model->getOldValue());

        $this->_model->setWebsiteCode('base');
        $this->assertEquals(self::SAMPLE_VALUE, $this->_model->getOldValue());

        $this->_model->setStoreCode('default');
        $this->assertEquals(self::SAMPLE_VALUE, $this->_model->getOldValue());
    }

    public function testGetFieldsetDataValue()
    {
        $this->assertNull($this->_model->getFieldsetDataValue('key'));
        $this->_model->setFieldsetData(['key' => 'value']);
        $this->assertEquals('value', $this->_model->getFieldsetDataValue('key'));
    }

    public function testCRUD()
    {
        $this->_model->setData(
            ['scope' => 'default', 'scope_id' => 0, 'path' => 'test/config/path', 'value' => 'test value']
        );
        $crud = new \Magento\TestFramework\Entity($this->_model, ['value' => 'new value']);
        $crud->testCrud();
    }

    public function testCollection()
    {
        $collection = $this->_model->getCollection();
        $collection->addScopeFilter(
            'test',
            0,
            'test'
        )->addPathFilter(
            'not_existing_path'
        )->addValueFilter(
            'not_existing_value'
        );
        $this->assertEmpty($collection->getItems());
    }
}


text:
package main

import (
	"sync"
	"time"
	"fmt"
)

// SafeCounter is safe to use concurrently
type SafeCounter struct {
	v   map[string]int
	mux sync.Mutex
}

// Inc Increments the counter for the given key
func (c *SafeCounter) Inc(key string) {
  c.mux.Lock()
  // Lock so only one goroutine at a time can access the map c.v.
  c.v[key]++
  c.mux.Unlock()
}

// Value returns the current value of the counter for the given key
func (c *SafeCounter) Value(key string) int {
  c.mux.Lock()
  // Lock so only one goroutine at a time can access the map c.v.
  defer c.mux.Unlock()
  return c.v[key]
}

func main() {
  c := SafeCounter{v: make(map[string]int)}
  for index := 0; index < 1000; index++ {
    go c.Inc("somekey")
  }

  time.Sleep(time.Second)
  fmt.Println(c.Value("somekey"))
}


text:
<?php
namespace SilexFriends\Di;

use Silex\Application;
use Silex\ServiceProviderInterface;

/**
 * Dependency Injection Container
 *
 * @author Thiago Paes <mrprompt@gmail.com>
 */
final class Container implements ContainerInterface, ServiceProviderInterface
{
    /**
     * @var $array
     */
    private $services;

    /**
     * Constructor
     */
    public function __construct(array $container)
    {
        $this->services = $container;
    }

    /**
     * @see \Silex\ServiceProviderInterface::register()
     */
    public function register(Application $app)
    {
        foreach ($this->services as $serviceName => $serviceDetails) {
            /* @var $classService string */
            $service = array_shift($serviceDetails);

            /* @var $args array */
            $args = array_map(function($row) use($app) {
                if (!is_numeric($row) && !is_string($row)) {
                    return $row;
                }

                if ($app->offsetExists($row)) {
                    return $app[$row];
                }

                return $row;
            }, $serviceDetails);

            $app[$serviceName] = $app->share(
                function () use ($service, $args) {
                    return new $service(... $args);
                }
            );
        }
    }

    /**
     * @see \Silex\ServiceProviderInterface::boot()
     */
    public function boot(Application $app)
    {
        // :)
    }
}


text:
module Monimoni
  class Model < ActiveRecord::Base
    self.table_name = 'monimonis'
  end
end


text:
from __future__ import division, absolute_import, print_function

import sys
from nose import SkipTest

def test_import():
    if sys.version_info[0] >= 3:
        raise SkipTest("traitsdoc not ported to Python3")
    import numpydoc.traitsdoc

# No tests at the moment...


text:
PO.L.RealPlayer = {

	options: {
		upgrade_url	: 'http://www.real.com/',
		class_id	: 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
		mime_type	: 'audio/x-pn-realaudio-plugin',
		bgcolor		: null,
		bgcolour	: null
	},

// 	best info available
// 	http://www.w3schools.com/media/media_realvideo.asp
	params: {
// 		backgroundcolor : null,
// 		center 			: 'true',
// 		controls		: 'All', //  see below
// 		console			: null,
// 		autostart 		: false,
// 		nolabels 		: false,
// 		reset 			: false,
// 		autogotoURL		: null
	},
	attributes: {},

	create: function(src, o, p)
	{
		o = PO.U.merge(o, PO.L.RealPlayer.options);

		o.params = PO.U.merge(o.params || {}, PO.L.RealPlayer.params);
		o.attributes = PO.U.merge(o.attributes || {}, PO.L.RealPlayer.attributes);

		var bg = o.params.backgroundcolor ? o.params.backgroundcolor : (o.bgcolour ? o.bgcolour : (o.bgcolor ? o.bgcolor : '#FFFFFF'));
		if(bg.charAt(0) != '#' && bg.length == 6) bg = '#' + bg;
		o.params.backgroundcolor = bg;

		if(!o.params.console) o.params.console = PO.U.hash(8);

		if(o.placeholder && o.placeholder_autoplay) o.params.autostart = true;

		return new PO.ObjectEmbed(src, o, PO.L.RealPlayer, p);
	},

	_installed_version: false,
	detectVersion: function(o, rv)
	{
		if(PO.L.RealPlayer._installed_version) return PO.L.RealPlayer._installed_version;
		var pv = false;
		if(navigator.plugins && navigator.mimeTypes.length)
		{
			for (var i=0; i < navigator.plugins.length; i++)
			{
				var x = navigator.plugins[i];
				if (x.name.indexOf('RealPlayer') > -1)
				{
					pv = true;
				}
			}
		}
		else
		{
			execScript('on error resume next: rp1 = IsObject(CreateObject("rmocx.RealPlayer G2 Control"))', 'VBScript');
			execScript('on error resume next: rp2 = IsObject(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)"))', 'VBScript');
			execScript('on error resume next: rp3 = IsObject(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)"))', 'VBScript');
			pv = (rp1 || rp2 || rp3);
		}
		pv = new PO.U.PlayerVersion([(pv === true) ? 1 : 0, 0, 0]);
		PO.L.RealPlayer._installed_version = pv;
		return pv;
	}

};
PO.Plugins.RealPlayer.loaded = 1;


text:
//
//  QYTest3ViewController.m
//  CopyWeibo
//
//  Created by qingyun on 16/1/24.
//  Copyright © 2016年 河南青云信息技术有限公司. All rights reserved.
//

#import "QYTest3ViewController.h"

@interface QYTest3ViewController ()

@end

@implementation QYTest3ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
from __future__ import print_function

import sqlite3

import sys
from generate_db import DEFAULT_DB

def get_high_score_for(details, run_pts):
    r"""
    Find and return the high score for the given details:
        (id, is_distance, value)
    Otherwise, return None

    run_pts are given as: (distance, time)

    Return is (from_f, to_f, score)
    """

    high_score = None
    best_from = None
    best_to = None

    expected_value = details[2]

    # For time
    if details[1] == 0:
        check_id = 1 # id to check
        save_id = 0
        is_distance = False
    # For distance
    else:
        check_id = 0
        save_id = 1
        is_distance = True

    # Consider all the possible starting points
    num_pts = len(run_pts)
    current_to = 0
    for current_from in range(num_pts):
        # Is it still possible to reach that time/distance from that point?
        if run_pts[num_pts-1][check_id] - run_pts[current_from][check_id] \
                < expected_value:
            break #NO

        # Find the first id - current_to - that satisfies:
        #   run_pts[current_to][check_id] - run_pts[current_from][check_id]
        #       >= expected_value
        # By previous check we know that such point exists
        while run_pts[current_to][check_id] - run_pts[current_from][check_id] \
                < expected_value:
            current_to += 1

        # if the value is equal to the expected one no problem
        if run_pts[current_to][check_id] - run_pts[current_from][check_id] \
                == expected_value:
            score = run_pts[current_to][save_id] - run_pts[current_from][save_id]
            from_f = current_from
            to_f = current_to
        # otherwise we need to reduce the interval (on the left or on the right)
        # the left part can reach at most current_from +1
        #       more will be next one job
        # for the right part to_from -1
        #       less will not meet the requirements
        else:
            # eg. We want the best on 5km, we have:
            # |1|3|3| which is 7km long
            # we can remove part#1 (left) or part#3 (right)

            # we can always reach the requirements by reducing on the right
            # it has been built for that

            # Reduce RIGHT
            # * size of the remaining part if we remove right part
            missing_right = expected_value - run_pts[current_to-1][check_id] \
                    + run_pts[current_from][check_id]
            # * size of removed part
            last_right = run_pts[current_to][check_id] - run_pts[current_to-1][check_id]
            ratio_right = float(missing_right) / float(last_right)
            score_right = run_pts[current_to-1][save_id] - run_pts[current_from][save_id] \
                    + ratio_right * (run_pts[current_to][save_id] - run_pts[current_to-1][save_id])

            # Reduce LEFT
            # reducing only on the left can be not enough
            # eg. target=5:
            #   |1|3|3| removing only left part will still be too much
            # if left is not enough it we be done in loop (current_from+1)
            missing_left = expected_value - run_pts[current_to][check_id] \
                    + run_pts[current_from+1][check_id]
            if missing_left > 0:
                first_left = run_pts[current_from+1][check_id] - run_pts[current_from][check_id]
                ratio_left = float(missing_left) / float(first_left)
                score_left = run_pts[current_to][save_id] - run_pts[current_from+1][save_id] \
                        + ratio_left * (run_pts[current_from+1][save_id] - run_pts[current_from][save_id])
                if is_distance != (score_left < score_right):
                    score = score_left
                    from_f = current_from +1 - ratio_left
                    to_f = current_to
                else:
                    score = score_right
                    from_f = current_from
                    to_f = current_to -1 + ratio_right
            else:
                score = score_right
                from_f = current_from
                to_f = current_to -1 + ratio_right

        # Is the score better than previous one?
        if high_score is None or (is_distance != (high_score < score)):
            high_score = score
            best_from = from_f
            best_to = to_f

    if high_score is None:
        return None

    return (best_from, best_to, high_score)

def get_high_scores_for_run(run_id, c):
    r"""
    Get the high scores for a given run
    Compute them if necessary
    """

    # Get scores to measure (missing scores)
    c.execute('''SELECT hsd.id, hsd.is_distance, hsd.value, hsl.score,
                        hsl.from_f, hsl.to_f
                    FROM high_scores_details AS hsd
                    LEFT JOIN high_scores_list AS hsl
                        ON hsd.id=hsl.high_id AND hsl.run_id=?''', (run_id,))
    high_scores = c.fetchall()
    run_pts = None

    high_scores_return = list()

    # Measure high scores for this run
    high_scores_list = list()
    for details in high_scores:
        # If no high score has been measured for that high_scores_details entry
        if details[3] is None:
            if run_pts is None:
                c.execute('''SELECT distance_m, (julianday(datetime)-2440587.5)*86400.0
                                FROM points WHERE run_id=?''', (run_id,))
                run_pts = c.fetchall()
            # Measure the highscore and add it to the list
            high_score = get_high_score_for(details, run_pts)
            if high_score is not None:
                high_scores_list.append((details[0], run_id, high_score[0],
                        high_score[1], high_score[2],))
                high_scores_return.append({
                        "id": details[0],
                        "is_distance": details[1],
                        "value": details[2],
                        "score": high_score[2],
                        "from": high_score[0],
                        "to": high_score[1],
                })
            else:
                # store fake value to avoid future re-checks
                high_scores_list.append((details[0], run_id, -1, -1, -1,))
        # Else, high score already known
        elif details[3] > 0:
            high_scores_return.append({
                    "id": details[0],
                    "is_distance": details[1],
                    "value": details[2],
                    "score": details[3],
                    "from": details[4],
                    "to": details[5],
            })

    if len(high_scores_list) > 0:
        c.executemany('''INSERT INTO high_scores_list (high_id, run_id,
                                from_f, to_f, score) VALUES
                            (?,?,?,?,?)''', high_scores_list)
    return high_scores_return

def update_high_scores_for_run(run_id, db=DEFAULT_DB):
    r"""
    Update the high scores for a given run
    Start by removing previous high scores related to this run
    """

    print('''FINDING HIGH SCORES FOR RUN ({})'''.format(run_id))
    conn = sqlite3.connect(db)
    with conn:
        c = conn.cursor()

        # Delete previous best scores
        print(''' - Delete previous high scores for this run''')
        c.execute('''DELETE FROM high_scores_list WHERE run_id=?''', (run_id,))

        # Get scores to measure
        print(''' - Open high scores checklist''')
        c.execute('''SELECT id, is_distance, value FROM high_scores_details''')
        high_scores_details = c.fetchall()

        # Get the run points
        print(''' - Retrieve run points''')
        c.execute('''SELECT distance_m, (julianday(datetime)-2440587.5)*86400.0
                        FROM points WHERE run_id=?''', (run_id,))
        run_pts = c.fetchall()

        # Measure high scores for this run
        high_scores_list = list()
        for details in high_scores_details:
            if details[1] == 0:
                print(''' - High score for: {} mins'''.format(details[2]/60))
            else:
                print(''' - High score for: {} km'''.format(details[2]/1000))
            high_score = get_high_score_for(details, run_pts)
            if high_score is not None:
                if details[1] == 0:
                    print(''' - - Found {} km [{}-{}]'''
                            .format(high_score[2]/1000, high_score[0], high_score[1]))
                else:
                    print(''' - - Found {} mins [{}-{}]'''
                            .format(high_score[2]/60, high_score[0], high_score[1]))
                high_scores_list.append((details[0], run_id, high_score[0],
                        high_score[1], high_score[2],))
            else:
                high_scores_list.append((details[0], run_id, -1, -1, -1,))
        c.executemany('''INSERT INTO high_scores_list (high_id, run_id,
                                from_f, to_f, score) VALUES
                            (?,?,?,?,?)''', high_scores_list)

        conn.commit()

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print('''Syntax: ./high_scores.py <run_id>''')
        exit(1)

    try:
        run_id = int(sys.argv[1])
    except TypeError, e:
        print('''ERROR: {}'''.format(e))
        print('''Syntax: ./high_scores.py <run_id>''')
        exit(2)
    except ValueError, e:
        print('''ERROR: {}'''.format(e))
        print('''Syntax: ./high_scores.py <run_id>''')
        exit(3)

    update_high_scores_for_run(run_id, DEFAULT_DB)


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <title></title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <meta name="format-detection" content="telephone=no" />

    This is where the inbox preview text goes

                                        *|FNAME|*, Here's your next career move

                                        *|ROLE|*

                                        *|COMPANY|*, *|LOCATION|*

                                              Apply Now

                                      *|RNAME|*

                                      This position has been shortlisted for you by *|RNAME|*. *|RBIO|*.

                                Key Highlights of this Position

                                The following are the key aspects of this role that *|RNAME|* thinks would be most suitable for your skillset.

                                "This position would be perfect for Sebastian as it would give him the leverage to use his decision and people management skills."

                                Dora Matthews, Recruitments Ltd

                                      Senior Analyst Developer

                                      Goldman Sachs, London

                                        Apply Now

                                © 2015 Specky. Unsubscribe


text:
# Using NanoEngine for systems with low resources

***

[tocstart]: # (toc start)

  * [Introduction](#introduction)
  * [Main idea of NanoEngine](#main-idea-of-nanoengine)
  * [Simple NanoEngine demo](#simple-nanoengine-demo)
  * [Reading keys with NanoEngine](#reading-keys-with-nanoengine)
  * [Draw monochrome bitmap](#draw-monochrome-bitmap)
  * [Draw moving bitmap](#draw-moving-bitmap)
  * [What if not to use draw callbacks](#what-if-not-to-use-draw-callbacks)
  * [Using Adafruit GFX with NanoEngine](#using-adafruit-gfx-with-nanoengine)
  * [To upper level](@ref index)

[tocend]: # (toc end)

## Introduction

Many applications use double-buffered output to physical display to avoid flickering effect, when a user observed non-completed picture for a short time. When working with color OLED/LCD displays like ssd1331, some micro-controllers do not have enough RAM to fit display buffer in. For example, in 8-bit mode ssd1331 OLED display needs 6144 bytes (`96*64`). But simple micro-controller like Atmega328 has only 2KiB, and Attiny85 has only 512B of RAM. But with ssd1306 library you still can create applications for those ones with good graphics.
ssd1306 library represents NanoEngine8, intended to be used with color OLED displays. Digit 8 means that engine implements 8-bit color mode. Refer to arkanoid8 as example, which can be run even on small Attiny85 with color ssd1331 display. The system supports NanoEngine1 for monochrome OLED displays, NanoEngine8 for 8-bit RGB OLED displays, NanoEngine16 for 16-bit RGB OLED displays.

## Main idea of NanoEngine

There are 2 issues with tiny controllers:
  * they have a little RAM
  * they support low frequencies

The first problem is solved in NanoEngine by using double-buffer to redraw only part of display content at once. By default NanoEngine uses 8x8 small buffer (64 bytes) and 24 bytes to store information on areas, which need to be refreshed.
The second problem is solved almost the same way: refresh only those part of display content, which were changed since last frame update. For example, ssd1331 oled display work on SPI at 8MHz frequency, that means in ideal conditions the screen content can be refreshed 162 times per second (`8000000/(96*64*8)`). But with the data, you need to send also commands to the display and to do some other stuff. And real tests with Atmega328p show that `ssd1306_clearScreen()` can run only at 58 FPS, coping data from buffer to OLED memory runs slower.
There is no such issue for Arduboy, since it uses monochrome OLED ssd1306 with only 1KiB of RAM buffer, and theoretical fps can be up to 976. For color display and small controllers the main solution is to refresh only part of display content. Arkanoid8 can give easily 60 fps with NanoEngine8

## Simple NanoEngine demo

```cpp
#include "ssd1306.h"
#include "nano_engine.h"

NanoEngine8 engine;

bool drawAll()
{
    engine.canvas.clear();
    engine.canvas.setColor(RGB_COLOR8(255,255,0));
    engine.canvas.drawRect(15,12,70,55);
    return true;   // if to return false, the engine will skip this part of screen update
}

void setup()
{
    /* Init SPI 96x64 RBG oled. 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C */
    ssd1331_96x64_spi_init(3, 4, 5);

    engine.begin();
    engine.setFrameRate(30);
    /* Set callback to draw parts, when NanoEngine8 asks */
    engine.drawCallback( drawAll );
}

void loop()
{
    if (!engine.nextFrame()) return;
    engine.refresh();  // Makes engine to refresh whole display content
    engine.display();
}
```

## Reading keys with NanoEngine

What, if we want to move yellow rectangle. There is easy way to do this with NanoEngine8. The engine supports up-to 6 keys: `BUTTON_DOWN`, `BUTTON_LEFT`, `BUTTON_RIGHT`, `BUTTON_UP`, `BUTTON_A`, `BUTTON_B`. All you need is to say the engine how it can get buttons state on your board. There are already 2 built-in implementations: `connectArduboyKeys()` allows using Arduboy platform hardware (remember that you need to replace ssd1306 oled with color ssd1331 oled), and `connectZKeypad()` allows using standard 5-keys Z-keypad (you can find it on E-bay). Or you can set custom key processing handler via `connectCustomKeys()` and implement your own hardware driver.

Example of using Z-keypad to move rectangle.
```cpp
#include "ssd1306.h"
#include "nano_engine.h"

NanoEngine8 engine;

NanoRect rect = { {15,12}, {60,35} }; // Lets make rect smaller than in previous example

bool drawAll()
{
    engine.canvas.clear();
    engine.canvas.setColor(RGB_COLOR8(255,255,0));
    engine.canvas.drawRect(rect);   // draw rect in buffer
    return true;
}

void setup()
{
    /* Init SPI 96x64 RBG oled. 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C */
    ssd1331_96x64_spi_init(3, 4, 5);

    engine.begin();
    engine.setFrameRate(30);
    engine.drawCallback( drawAll );  // Set callback to draw parts, when NanoEngine8 asks
    engine.connectZKeypad(0);        // Connect ADC-buttons Z-keypad to analog A0 pin
    engine.refresh();                // Makes engine to refresh whole display content at start-up
}

void loop()
{
    if (!engine.nextFrame()) return;
    NanoPoint point = {0,0};
    if (engine.pressed( BUTTON_RIGHT )) point.x = +1;
    if (engine.pressed( BUTTON_LEFT ))  point.x = -1;
    if (engine.pressed( BUTTON_UP ))    point.y = -1;
    if (engine.pressed( BUTTON_DOWN ))  point.y = +1;
    engine.refresh(rect);            // Update screen content at old rect position
    rect += point;                   // Move rect according to pressed keys
    engine.refresh(rect);            // Update screen content at new rect position
    engine.display();                // refresh display content
}
```

## Draw monochrome bitmap

```cpp
#include "ssd1306.h"
#include "nano_engine.h"

NanoEngine8 engine;

const uint8_t heartSprite[8] PROGMEM =
{
    0B00001110,
    0B00011111,
    0B00111111,
    0B01111110,
    0B01111110,
    0B00111101,
    0B00011001,
    0B00001110
};

bool drawAll()
{
    engine.canvas.clear();
    engine.canvas.setMode(0);  // We want to draw non-transparent bitmap
    engine.canvas.setColor(RGB_COLOR8(255,0,0));  // draw with red color
    engine.canvas.drawBitmap1(10, 20, 8, 8, heartSprite);
    return true;
}

void setup()
{
    /* Init SPI 96x64 RBG oled. 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C */
    ssd1331_96x64_spi_init(3, 4, 5);
    engine.begin();
    engine.drawCallback( drawAll );  // Set callback to draw parts, when NanoEngine8 asks
    engine.refresh();                // Makes engine to refresh whole display content at start-up
}

void loop()
{
    if (!engine.nextFrame()) return;
    engine.display();                // refresh display content
}
```

## Draw moving bitmap

In some applications like games, there is need to move bitmaps. It is easy to do this with ssd1306 library using NanoSprite objects. NanoSprite object is responsible for refreshing areas, touched by sprite. So, you need only to move sprite, where you want, the engine will take care of updating display content.

```cpp
#include "ssd1306.h"
#include "nano_engine.h"

const uint8_t heartSprite[8] PROGMEM =
{
    0B00001110,
    0B00011111,
    0B00111111,
    0B01111110,
    0B01111110,
    0B00111101,
    0B00011001,
    0B00001110
};

NanoEngine8 engine;
NanoSprite<NanoEngine8, engine> sprite( {0, 0}, {8, 8}, heartSprite );

bool drawAll()
{
    engine.canvas.clear();
    engine.canvas.setMode(0);  // We want to draw non-transparent bitmap
    engine.canvas.setColor(RGB_COLOR8(255,0,0));  // draw with red color
    sprite.draw();
    return true;
}

void setup()
{
    /* Init SPI 96x64 RBG oled. 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C */
    ssd1331_96x64_spi_init(3, 4, 5);
    engine.begin();
    engine.drawCallback( drawAll );  // Set callback to draw parts, when NanoEngine8 asks
    engine.refresh();                // Makes engine to refresh whole display content at start-up
}

void loop()
{
    if (!engine.nextFrame()) return;
    // You will see horizontal flying heart
    sprite.moveBy( { 1, 0 } );
    engine.display();                // refresh display content
}
```

## What if not to use draw callbacks

If you don't want to use draw callbacks in your application, but still need a power of NanoEngine, then there is one way for you: to use full-screen double-buffering with NanoEngine. The example, you will find below, shows how to use full-screen double buffering for monochrome 128x64 ssd1306 oled display. This example can be run on Atmega328p and more powerful micro controllers. It clears back-buffer every time engine says to redraw the frame. But you can preserve previously prepared image by removing call to `engine.canvas.clear()`.

```cpp
#include "ssd1306.h"
#include "nano_engine.h"

NanoEngine<BUFFER_128x64_MONO> engine;

void setup()
{
    // Init SPI 128x64 monochrome oled.
    // 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C
    ssd1306_128x64_spi_init(3, 4, 5);

    engine.begin();
    engine.setFrameRate(30);
}

void loop()
{
    if (!engine.nextFrame()) return;
    engine.canvas.clear();    // This step can be removed, if you don't want to clear buffer
    engine.canvas.drawRect(15,12,70,55);
    engine.display();
}
```

## Using Adafruit GFX with NanoEngine

Many developers are familiar with nice AdafruitGFX library. It provides rich set of graphics functions. Starting with 1.7.0 ssd1306 library it is possible to use AdafruiGFX api in combination with NanoEngine. And it is really easy.
You need to remember only, that AdafruitGFX uses different approach, when working with rectangles and monochrome images. NanoCanvas expects monochrome bitmaps in native ssd1306 format, while Adafruit uses more native format for human. If you compare an example below with examples above you will understand, what's the difference (heartImage). Refer to AdafruitGFX documentation.

```cpp
// Define this before including library header, this will give Adafruit GFX support
// !!! Don't forget to install AdafruitGFX library to your Arduino IDE !!!
#define CONFIG_ADAFRUIT_GFX_ENABLE

#include "ssd1306.h"
#include "nano_engine.h"

// Now you can use AdafruitGFX by referencing engine.canvas
NanoEngine<ADATILE_8x8_RGB8> engine;

const PROGMEM uint8_t heartImage[8] =
{
    0B01100110,
    0B11111001,
    0B11111101,
    0B11111111,
    0B01111110,
    0B00111100,
    0B00011000,
    0B00000000
};

bool drawAll()
{
    engine.canvas.fillScreen( 0 );
    engine.canvas.drawBitmap(10, 20, heartSprite, 8, 8, RGB_COLOR8(255,0,0)); // draw bitmap with red color
    return true;
}

void setup()
{
    /* Init SPI 96x64 RBG oled. 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C */
    ssd1331_96x64_spi_init(3, 4, 5);
    engine.begin();
    engine.drawCallback( drawAll );  // Set callback to draw parts, when NanoEngine8 asks
    engine.refresh();                // Makes engine to refresh whole display content at start-up
}

void loop()
{
    if (!engine.nextFrame()) return;
    engine.display();                // refresh display content
}
```


text:
from tests.test_actions import *
from ltk.actions.download_action import *
from ltk.actions.clean_action import CleanAction
from ltk.actions.request_action import RequestAction
from ltk.actions.config_action import ConfigAction
from ltk.actions.pull_action import PullAction
from ltk.actions.rm_action import RmAction
from io import BytesIO
from io import StringIO
import sys
import unittest

class TestDownload(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        create_config()

    @classmethod
    def tearDownClass(cls):
        cleanup()

    def setUp(self):
        self.config_action = ConfigAction(os.getcwd())
        self.config_action.config_action(clone_option='off')
        self.config_action.config_action(download_folder='--none')
        self.downloaded_files = []
        self.locales = ['ja-JP', 'zh-CN']
        self.action = DownloadAction(os.getcwd())
        self.clean_action = CleanAction(os.getcwd())
        self.request_action = RequestAction(os.getcwd(), None, None, self.locales, False, False, None, None)
        self.pull_action = PullAction(os.getcwd(), self.action)
        self.clean_action.clean_action(False, False, None)
        self.files = ['sample.txt', 'sample1.txt']
        self.first_doc = 'sample.txt'
        for fn in self.files:
            create_txt_file(fn)
        os.system('ltk add sample*.txt -o') # Let the command line handle parsing the file pattern
        self.doc_ids = self.action.doc_manager.get_doc_ids()
        for doc_id in self.doc_ids:
            assert poll_doc(self.action, doc_id)
        self.request_action.target_action()

    def tearDown(self):
        self.rm_action = RmAction(os.getcwd())
        for curr_file in self.files:
            self.rm_action.rm_action([curr_file], remote=True, force=True)
        self.clean_action.clean_action(False, False, None)
        for dl_file in self.downloaded_files:
            if os.path.exists(dl_file):
                os.remove(dl_file)
        self.rm_action.close()
        self.clean_action.close()
        self.action.close()

    def get_dl_path(self, locale, document):
        name_parts = document.split('.')
        if len(name_parts) > 1:
            name_parts.insert(-1, locale)
            downloaded_name = '.'.join(part for part in name_parts)
        else:
            downloaded_name = name_parts[0] + '.' + locale
        dl_path = os.path.join(self.action.path, downloaded_name)
        return dl_path

    def test_download_name(self):

        self.action.download_by_path(self.first_doc, self.locales[0], False, False, False, False)
        dl_file = self.get_dl_path(self.locales[0], self.first_doc)

        assert self.locales[0] in dl_file

        assert os.path.isfile(dl_file)

        self.downloaded_files.append(dl_file)

    def test_pull_all(self):
        for document in self.files:
            for locale in self.locales:
                dl_file = self.get_dl_path(locale, document)
                self.downloaded_files.append(dl_file)

        self.pull_action.pull_translations(None, False, False, False)
        for path in self.downloaded_files:
            assert os.path.isfile(path)

    def test_pull_locale(self):
        for document in self.files:
            dl_file = self.get_dl_path(self.locales[0], document)
            self.downloaded_files.append(dl_file)
        self.pull_action.pull_translations(self.locales[0], False, False, False)
        for path in self.downloaded_files:
            assert os.path.isfile(path)


text:
package migrations

import (
	"database/sql"
	"io/ioutil"
	"os"
	"path"
	"testing"
)

var stm = `PRAGMA key = 'letmein';create table sales (orderID text primary key not null, contract blob, state integer, read integer, timestamp integer, total integer, thumbnail text, buyerID text, buyerHandle text, title text, shippingName text, shippingAddress text, paymentAddr text, funded integer, transactions blob);`

func TestMigration004(t *testing.T) {
	var dbPath string
	os.Mkdir("./datastore", os.ModePerm)
	dbPath = path.Join("./", "datastore", "mainnet.db")
	db, err := sql.Open("sqlite3", dbPath)
	if err != nil {
		t.Error(err)
	}
	db.Exec(stm)
	_, err = db.Exec("INSERT INTO sales (orderID, contract, state, read, timestamp, total, thumbnail, buyerID, buyerHandle, title, shippingName, shippingAddress, paymentAddr, funded, transactions) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", "asdf", "{}", 3, 1, 12345, 100000, "zasfd", "Qm...", "name.id", "Listing title", "Peter Griffin", "1234 Quhog st.", "1btc..", 0, []byte("[]"))
	if err != nil {
		t.Error(err)
		return
	}
	var m Migration004
	err = m.Up("./", "letmein", false)
	if err != nil {
		t.Error(err)
	}
	_, err = db.Exec("UPDATE sales set needsSync=? WHERE orderID=?", 1, "asdf")
	if err != nil {
		t.Error(err)
		return
	}
	repoVer, err := ioutil.ReadFile("./repover")
	if err != nil {
		t.Error(err)
	}
	if string(repoVer) != "5" {
		t.Error("Failed to write new repo version")
	}

	err = m.Down("./", "letmein", false)
	if err != nil {
		t.Error(err)
		return
	}
	_, err = db.Exec("UPDATE sales set needsSync=? WHERE orderID=?", 1, "asdf")
	if err == nil {
		t.Error("Failed to drop columns")
		return
	}
	repoVer, err = ioutil.ReadFile("./repover")
	if err != nil {
		t.Error(err)
	}
	if string(repoVer) != "4" {
		t.Error("Failed to write new repo version")
	}
	os.RemoveAll("./datastore")
	os.RemoveAll("./repover")
}


text:
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package org.jetbrains.kotlin.idea.navigation;

import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.test.TestRoot;
import org.junit.runner.RunWith;

/*
 * This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}.
 * DO NOT MODIFY MANUALLY.
 */
@SuppressWarnings("all")
@TestRoot("idea/tests")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public abstract class KotlinGotoTestGenerated extends AbstractKotlinGotoTest {
    @RunWith(JUnit3RunnerWithInners.class)
    @TestMetadata("testData/navigation/gotoClass")
    public static class GotoClass extends AbstractKotlinGotoTest {
        private void runTest(String testDataFilePath) throws Exception {
            KotlinTestUtils.runTest(this::doClassTest, this, testDataFilePath);
        }

        @TestMetadata("builtInAny.kt")
        public void testBuiltInAny() throws Exception {
            runTest("testData/navigation/gotoClass/builtInAny.kt");
        }

        @TestMetadata("builtInInt.kt")
        public void testBuiltInInt() throws Exception {
            runTest("testData/navigation/gotoClass/builtInInt.kt");
        }

        @TestMetadata("enumEntries.kt")
        public void testEnumEntries() throws Exception {
            runTest("testData/navigation/gotoClass/enumEntries.kt");
        }

        @TestMetadata("inClassObject.kt")
        public void testInClassObject() throws Exception {
            runTest("testData/navigation/gotoClass/inClassObject.kt");
        }

        @TestMetadata("innerClass.kt")
        public void testInnerClass() throws Exception {
            runTest("testData/navigation/gotoClass/innerClass.kt");
        }

        @TestMetadata("localDeclarations.kt")
        public void testLocalDeclarations() throws Exception {
            runTest("testData/navigation/gotoClass/localDeclarations.kt");
        }

        @TestMetadata("noImplementationTrait.kt")
        public void testNoImplementationTrait() throws Exception {
            runTest("testData/navigation/gotoClass/noImplementationTrait.kt");
        }

        @TestMetadata("simpleClass.kt")
        public void testSimpleClass() throws Exception {
            runTest("testData/navigation/gotoClass/simpleClass.kt");
        }

        @TestMetadata("simpleObject.kt")
        public void testSimpleObject() throws Exception {
            runTest("testData/navigation/gotoClass/simpleObject.kt");
        }

        @TestMetadata("traitWithFunImplement.kt")
        public void testTraitWithFunImplement() throws Exception {
            runTest("testData/navigation/gotoClass/traitWithFunImplement.kt");
        }

        @TestMetadata("typealias.kt")
        public void testTypealias() throws Exception {
            runTest("testData/navigation/gotoClass/typealias.kt");
        }
    }

    @RunWith(JUnit3RunnerWithInners.class)
    @TestMetadata("testData/navigation/gotoSymbol")
    public static class GotoSymbol extends AbstractKotlinGotoTest {
        private void runTest(String testDataFilePath) throws Exception {
            KotlinTestUtils.runTest(this::doSymbolTest, this, testDataFilePath);
        }

        @TestMetadata("builtInArrayOfNulls.kt")
        public void testBuiltInArrayOfNulls() throws Exception {
            runTest("testData/navigation/gotoSymbol/builtInArrayOfNulls.kt");
        }

        @TestMetadata("builtInInt.kt")
        public void testBuiltInInt() throws Exception {
            runTest("testData/navigation/gotoSymbol/builtInInt.kt");
        }

        @TestMetadata("enumConstants.kt")
        public void testEnumConstants() throws Exception {
            runTest("testData/navigation/gotoSymbol/enumConstants.kt");
        }

        @TestMetadata("functions.kt")
        public void testFunctions() throws Exception {
            runTest("testData/navigation/gotoSymbol/functions.kt");
        }

        @TestMetadata("javaMethods.kt")
        public void testJavaMethods() throws Exception {
            runTest("testData/navigation/gotoSymbol/javaMethods.kt");
        }

        @TestMetadata("jvmNameAnnotatedFile.kt")
        public void testJvmNameAnnotatedFile() throws Exception {
            runTest("testData/navigation/gotoSymbol/jvmNameAnnotatedFile.kt");
        }

        @TestMetadata("jvmNameAnnotatedFunctions.kt")
        public void testJvmNameAnnotatedFunctions() throws Exception {
            runTest("testData/navigation/gotoSymbol/jvmNameAnnotatedFunctions.kt");
        }

        @TestMetadata("jvmNameAnnotatedProperties.kt")
        public void testJvmNameAnnotatedProperties() throws Exception {
            runTest("testData/navigation/gotoSymbol/jvmNameAnnotatedProperties.kt");
        }

        @TestMetadata("localFunction.kt")
        public void testLocalFunction() throws Exception {
            runTest("testData/navigation/gotoSymbol/localFunction.kt");
        }

        @TestMetadata("privateTopLevelDeclarations.kt")
        public void testPrivateTopLevelDeclarations() throws Exception {
            runTest("testData/navigation/gotoSymbol/privateTopLevelDeclarations.kt");
        }

        @TestMetadata("properties.kt")
        public void testProperties() throws Exception {
            runTest("testData/navigation/gotoSymbol/properties.kt");
        }

        @TestMetadata("stdLibArrayListOf.kt")
        public void testStdLibArrayListOf() throws Exception {
            runTest("testData/navigation/gotoSymbol/stdLibArrayListOf.kt");
        }

        @TestMetadata("stdLibArrayListOfNoSources.kt")
        public void testStdLibArrayListOfNoSources() throws Exception {
            runTest("testData/navigation/gotoSymbol/stdLibArrayListOfNoSources.kt");
        }

        @TestMetadata("stdLibJoinToString.kt")
        public void testStdLibJoinToString() throws Exception {
            runTest("testData/navigation/gotoSymbol/stdLibJoinToString.kt");
        }

        @TestMetadata("typealias.kt")
        public void testTypealias() throws Exception {
            runTest("testData/navigation/gotoSymbol/typealias.kt");
        }
    }
}


text:
from kapteyn import maputils
from matplotlib import pyplot as plt

f = maputils.FITSimage("m101.fits")
mplim = f.Annotatedimage()
im = mplim.Image()
mplim.plot()

plt.show()


text:
HTMLWidgets.widget({

  name: 'sortableR',

  type: 'output',

  initialize: function(el, width, height) {

    // for now set display to none if height and width = 0
    //  however eventually might add option to wrap
    //  a list or vector within sortableR
    if(width === 0 && height === 0){
      el.style.display = "none"
    }

    return { };

  },

  renderValue: function(el, x, instance) {

    instance.sortable = Sortable.create(
      document.getElementById( x.selector ),
      x.options
    )

  },

  resize: function(el, width, height, instance) {

  }

});