text:
function CGame(oData, board){
    var _bUpdate;
    var _bNoCellSelected;
    var _iScore;
    var _oppScore = null;
    var _iCurLevel;
    var _iTimeElaps;
    var _iCurStageX;
    var _iCurStageY;
    var _szCurWord;
    var _aWordList;
    var _aCellsSelected;
    var _aWrittenWords;
    var _aMatrixCells;
    var _aSelectableCells;
    var _oLineGfx;
    var _oLineDrawing;
    var _oAttachMatrix;

    var _oBg;
    var _oInterface;
    var _oEndPanel = null;

    this._init = function(){

        /*--------------add event lisener---------------*/
        s_oMain.s_con_.addEventListener('gameStart', Delegate.create(this, this.onGameStart_));
        s_oMain.s_con_.addEventListener('partnerRight', Delegate.create(this, this.onPartnerRight_));
        s_oMain.s_con_.addEventListener('refreshOpScore', Delegate.create(this, this.onRefreshOpScore_));
        _iScore = 0;

        _oBg = new createjs.Bitmap(s_oSpriteLibrary.getSprite('bg_game'));
        s_oStage.addChild(_oBg);

        _oAttachMatrix = new createjs.Container();
        _oAttachMatrix.x = 58;
        _oAttachMatrix.y = 126;
        s_oStage.addChild(_oAttachMatrix);

        _oInterface = new CInterface();

        _aWordList = s_oWordListSelected.getWordList();
        _iCurLevel=1;

        s_oStage.on("pressup" , this._onStageRelease);

        this._reset();

        if(s_oMain.name == 'slave'|| s_oMain.name == 'host'){
            _oppScore = 0;
        }else{
            _oppScore = null;
        }
        if(s_oMain.name == 'slave' && board != null){
            this._createMatrix(board);
            this._populateMatrix(board);
            s_oMain.s_con_.slaveFinished();
        }else{
            this._createMatrix();
            this._populateMatrix();
            this.onHostMakeFinished_();
        }

        _bUpdate= true;
    };

    this.onGameStart_ = function(){
        _bUpdate=true;
    };

    this.onPartnerRight_ = function(e){
        this._displayPartnerRightOnCell(e.body);
    };

    this.onRefreshOpScore_ = function(e){
        _oppScore =  e.body.opScore;
        _oInterface.displayOpAnswer(e.body.opScore);
    };
    this.serializeToJSON = function() {
        var raw = [];
        for(var i=0;i<NUM_ROWS;i++){
            raw[i] = [];
            for(var j=0;j<NUM_COLS;j++){
                raw[i][j] = [];
                raw[i][j].push(_aMatrixCells[i][j].getValue());
                raw[i][j].push(_aMatrixCells[i][j].getText());
            }
        }

        return raw;
    };

    this.unload = function(){
        s_oStage.off("pressup" , this._onStageRelease);

        if(_oEndPanel){
            _oEndPanel.unload();
        }
        _oInterface.unload();

        s_oStage.removeAllChildren();
    };

    this._reset = function(){
        _iTimeElaps = TIME_LEVEL;
        _aCellsSelected = new Array();
        _szCurWord = "";
        _bNoCellSelected = true;
        _iScore = 0;
        _aWrittenWords = new Array();
    };

    this._createMatrix = function(board){
        var iXOffset = 0;
        var iYOffset = 0;

        _aMatrixCells = new Array();
        for(var i=0;i<NUM_ROWS;i++){
            _aMatrixCells[i] = new Array();
            for(var j=0;j<NUM_COLS;j++){
                    var iRandValue = board ? board[i][j][0] : Math.floor(Math.random() * (MAX_CHAR_VALUE)) + 1;
                    var oCell = new CCell(iXOffset,iYOffset,i,j,iRandValue,_oAttachMatrix );

                    iXOffset += CELL_WIDTH + 4;

                    _aMatrixCells[i][j] = oCell;
            }
            iXOffset = 0;
            iYOffset += CELL_HEIGHT + 4;
        }
    };

    this._populateMatrix = function(board){
        var iRand;
        var aConsonant = s_oWordListSelected.getConsonants();
        var aVowel     = s_oWordListSelected.getVowel();

        var iCont=0;

        for(var i=0;i<NUM_ROWS;i++){
            for(var j=0;j<NUM_COLS;j++){
                if(iCont === 2){
                        iCont=0;
                        iRand=Math.floor(Math.random()*(aVowel.length));
                        _aMatrixCells[i][j].setText(aVowel[iRand]);
                }else{
                        iRand=Math.floor(Math.random() * (aConsonant.length));
                        _aMatrixCells[i][j].setText(aConsonant[iRand]);
                }
                iCont++;

                if(board) {
                    _aMatrixCells[i][j].setText(board[i][j][1]);
                }
            }
        }
    };

    this._gameOver = function(){
        _bUpdate=false;

        if(DISABLE_SOUND_MOBILE === false || s_bMobile === false){
            createjs.Sound.play("gameover");
        }
        s_oMain.s_con_.gameFinished({iScore: _iScore,oppScore:_oppScore});
        var szLongest = "";
        var szBestWord = "";
        var iBestWordIndex;
        var iBestScore = 0;

        if(_aWrittenWords.length>0){
            //FIND LONGEST AND BEST WORD
            szLongest = _aWrittenWords[0].word;
            szBestWord= _aWrittenWords[0].score;
            iBestWordIndex = 0;

            for(var i=1;i<_aWrittenWords.length;i++){
                    if(szLongest.length<_aWrittenWords[i].word.length){
                            szLongest=_aWrittenWords[i].word;
                    }

                    if(szBestWord<_aWrittenWords[i].score){
                            szBestWord=_aWrittenWords[i].score;
                            iBestWordIndex=i;
                    }
            }

            szBestWord = _aWrittenWords[iBestWordIndex].word;
            iBestScore = _aWrittenWords[iBestWordIndex].score;
        }

	_oEndPanel = CEndPanel();
        _oEndPanel.show(_iScore,_oppScore,_aWrittenWords.length,szLongest,szBestWord,iBestScore);
    };

    this.onCellSelected = function(oCellSelected,iCellSelectedRow,iCellSelectedCol){

        if(_bNoCellSelected){
                _bNoCellSelected=false;

                _aCellsSelected.push(oCellSelected);
                oCellSelected.select();
                _szCurWord += oCellSelected.getText();

                _oInterface.setWordComposing(_szCurWord);
                this.retrieveSelectableCells(iCellSelectedRow,iCellSelectedCol,oCellSelected);

                _oLineGfx = new createjs.Graphics();
                _oLineGfx.setStrokeStyle(5);
                _oLineGfx.beginStroke("rgba(0,0,0,0.7)");
                _oLineGfx.moveTo(oCellSelected.getX() + (CELL_WIDTH/2), oCellSelected.getY()+(CELL_HEIGHT/2));

                _oLineDrawing = new createjs.Shape(_oLineGfx);
                _oAttachMatrix.addChild(_oLineDrawing);

                s_oStage.addEventListener("stagemousemove" , this._onStageMouseMove);

        }
    };

    this.onCellOver = function(oCellSelected,iCellSelectedRow,iCellSelectedCol){
        if(_bNoCellSelected){
            return;
        }

        //MAX WORD LENGTH REACHED
        if(_szCurWord.length === MAX_WORD_LENGTH){
            this._onStageRelease();
            return;
        }

        for(var k=0;k<_aSelectableCells.length;k++){
            if(_aSelectableCells[k] === oCellSelected){
                _aCellsSelected.push(oCellSelected);
                oCellSelected.select();

                _szCurWord += oCellSelected.getText();
                _oInterface.setWordComposing(_szCurWord);

                this.retrieveSelectableCells(iCellSelectedRow,iCellSelectedCol,oCellSelected);

                _oLineGfx.lineTo(oCellSelected.getX()+(CELL_WIDTH/2), oCellSelected.getY()+(CELL_HEIGHT/2));
                break;
            }
        }

    };

    this.retrieveSelectableCells = function(iCellRow,iCellCol,oCellSelected){
        _aSelectableCells = new Array();
        for(var i=(iCellRow-1);i<(iCellRow+2);i++){
                for(var j=(iCellCol-1);j<(iCellCol+2);j++){
                        if(i>-1 && i<NUM_ROWS && j>-1 && j<NUM_COLS){
                                if(_aMatrixCells[i][j].isActive() === false && _aMatrixCells[i][j] !== oCellSelected){
                                        _aSelectableCells.push(_aMatrixCells[i][j]);
                                }
                        }
                }
        }
    };

    this._onStageRelease = function(){
        if(_bNoCellSelected){
                return;
        }

        s_oStage.removeEventListener("stagemousemove" , s_oGame._onStageMouseMove);

        _bNoCellSelected=true;

        if(_oLineDrawing){
            _oLineGfx.clear();
            s_oGame._onCheckWord();
        }
    };

    this._clearMatrix = function() {
        for(var i=0;i<NUM_ROWS;i++){
            for (var j = 0; j < NUM_COLS; j++) {
                _aMatrixCells[i][j].deselect();
            }
        }

        _aCellsSelected=new Array();
        _bNoCellSelected = true;
        _szCurWord = "";
        _oInterface.clearWordComposing();
    };

    this._displayRightOnCell = function(){
        for(var i=0;i<_aCellsSelected.length;i++){
            _aCellsSelected[i].showRight();
        }

        if(DISABLE_SOUND_MOBILE === false || s_bMobile === false){
            createjs.Sound.play("right");
        }

    };

    /**
     *
     * @param {Array} rightWord
     */
    this._displayPartnerRightOnCell = function(rightWord){
        for(var i=0;i<rightWord.length;i++){
            _aMatrixCells[rightWord[i].row][rightWord[i].col].showRight();
        }

        /*if(DISABLE_SOUND_MOBILE === false || s_bMobile === false){
            createjs.Sound.play("right");
        }*/

    };

    this._displayWrongOnCell = function(){
        for(var i=0;i<_aCellsSelected.length;i++){
                _aCellsSelected[i].showWrong();
        }

        if(DISABLE_SOUND_MOBILE === false || s_bMobile === false){
            createjs.Sound.play("wrong");
        }
    };

    this._onCheckWord = function(){
        if(_szCurWord.length<3){
            this._clearMatrix();
            return;
        }

        var iRes = binarySearch(_aWordList, _szCurWord.toLowerCase(), 0,_aWordList.length);

        if(iRes === -1){
                //WORD NOT FOUND
                _iScore += SCORE_WORD_WRONG;
                if(_iScore<0){
                    _iScore=0;
                }

                this._displayWrongOnCell();
                s_oMain.s_con_.refreshOpScore(_iScore);
                _oInterface.displayAnswer(_iScore);
        }else{
                //WORD FOUND
                var bFound=false;
                for(var k=0;k<_aWrittenWords.length;k++){
                    if(_aWrittenWords[k].word === _szCurWord){
                        bFound=true;
                        break;
                    }
                }
                if(bFound){
                        //THIS WORD HAS BEEN ALREADY WRITTEN
                        _iScore += SCORE_WORD_WRONG;
                        if(_iScore<0){
                            _iScore=0;
                        }

                        this._displayWrongOnCell();
                        s_oMain.s_con_.refreshOpScore(_iScore);
                        _oInterface.displayAnswer(_iScore);
                }else{
                        var iTmpScore = 0;
                        var rightCell = [];
                        for(var t=0;t<_aCellsSelected.length;t++){
                            iTmpScore+=_aCellsSelected[t].getValue();
                            rightCell.push({row:_aCellsSelected[t].getRow(),col:_aCellsSelected[t].getCol()});
                        }

                        _iScore += (_szCurWord.length*iTmpScore);
                        this._displayRightOnCell();
                        s_oMain.s_con_.selectRightCell(rightCell);
                        s_oMain.s_con_.refreshOpScore(_iScore);
                        _oInterface.displayAnswer(_iScore);

                        _aWrittenWords.push({word:_szCurWord,score:(_szCurWord.length*iTmpScore)});

                        _oInterface.refreshWordWritten(_aWrittenWords);
                }
        }

        this._clearMatrix();
    };

    this.onExit = function(isReplay, data){
        s_oMain.s_con_.playerLeftGame();
        this.unload();
        s_oMain.gotoMenu(isReplay, data);
        $(s_oMain).trigger("restart");
    };

    this._onStageMouseMove = function(evt){
        _iCurStageX = evt.stageX;
        _iCurStageY = evt.stageY;
        for(var i=0;i<NUM_ROWS;i++){
            for(var j=0;j<NUM_COLS;j++){
                if( _aMatrixCells[i][j].isActive() === false && pointInRectangle(_iCurStageX,_iCurStageY,_aMatrixCells[i][j].getRectPos())){
                    s_oGame.onCellOver(_aMatrixCells[i][j],_aMatrixCells[i][j].getRow(),_aMatrixCells[i][j].getCol());
                    break;
                }
            }
        }
    };

    this.update = function(){
        if(_bUpdate === false){
            return;
        }

        _iTimeElaps -= s_iTimeElaps;

        if(_iTimeElaps > 0){
            _oInterface.updateTime(_iTimeElaps);
        }else{
            this._gameOver();
        }
    };

    this.onHostMakeFinished_ = function(){
       s_oMain.s_con_.hostFinished(s_szLangSelected, this.serializeToJSON());
    };

    s_oGame=this;

    TIME_LEVEL = oData.time_level;
    MAX_CHAR_VALUE = oData.max_char_value;
    SCORE_WORD_WRONG = oData.score_wrong;

    this._init();
}

var s_oGame;


text:
+++
title = "Encrypt"
weight = 3
+++

## Resource Operation

```sql
ADD RESOURCE ds_0 (
    HOST=127.0.0.1,
    PORT=3306,
    DB=ds_0,
    USER=root,
    PASSWORD=root
);
```

## Rule Operation

- Create encrypt rule

```sql
CREATE ENCRYPT RULE t_encrypt (
    COLUMNS(
        (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME=AES,PROPERTIES('aes-key-value'='123456abc'))),
        (NAME=order_id,PLAIN=order_plain,CIPHER =order_cipher,TYPE(NAME=RC4,PROPERTIES('rc4-key-value'='123456abc')))
));
```

- Create encrypt table

```sql
CREATE TABLE `t_encrypt` (
    `id` int(11) NOT NULL,
    `user_id` varchar(45) DEFAULT NULL,
    `order_id` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
```

- Alter encrypt rule

```sql
ALTER ENCRYPT RULE t_encrypt (
    COLUMNS(
        (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME=AES,PROPERTIES('aes-key-value'='123456abc')))
));
```

- Drop encrypt rule

```sql
DROP ENCRYPT RULE t_encrypt;
```

- Drop resource

```sql
DROP RESOURCE ds_0;
```

- Drop distributed database

```sql
DROP DATABASE encrypt_db;
```

redpajama_set_name: RedPajamaGithub


text:
import csv
import matplotlib.pyplot as plt
import numpy as np
import os

from analysis_basin_plotting import plot_overlap_grid
from singlecell_constants import DATADIR, MEMORIESDIR, RUNS_FOLDER
from singlecell_simsetup import singlecell_simsetup
from singlecell_simsetup_query import collect_mygene_hits, write_genelist_id_csv, read_gene_list_csv, check_target_in_gene_id_dict
from singlecell_visualize import plot_as_radar, plot_as_bar

def write_celltype_csv(gene_labels, celltype_state, csvpath):
    with open(csvpath, 'w') as f:
        for idx, label in enumerate(gene_labels):
            line = '%s,%d\n' % (label, celltype_state[idx])
            f.write(line)
    return csvpath

def load_external_celltype(csvpath):
    gene_labels_raw = []
    gene_states_raw = []
    with open(csvpath, 'r') as f:
        reader = csv.reader(f)
        for r in reader:
            assert len(r) == 2
            gene_labels_raw.append(r[0])
            gene_states_raw.append(float(r[1]))
    return gene_labels_raw, gene_states_raw

def build_entrez_synonyms_for_celltype(gene_labels_raw, entrez_name='entrez_id_ext_celltype.csv'):
    entrez_path = DATADIR + os.sep + 'misc' + os.sep + 'genelist_entrezids' + os.sep + entrez_name
    if os.path.exists(entrez_path):
        print "Warning, path %s exists" % entrez_path
        print "Delete file to have it be remade (using existing one)"
    else:
        gene_hits, hitcounts = collect_mygene_hits(gene_labels_raw)
        write_genelist_id_csv(gene_labels_raw, gene_hits, outpath=entrez_path)
    return entrez_path

def truncate_celltype_data(matches, simsetup, gene_labels_raw, gene_states_raw):
    print 'Loaded gene count from external celltype:', len(gene_labels_raw)
    print 'Loaded gene count from memories:', len(simsetup['GENE_LABELS'])
    print 'Number of matches, with possible redundancies:', len(matches)
    print 'NOTE: choosing FIRST gene match in cases of degenerate matches'
    new_memory_rows = []
    new_celltype_rows = []
    for match in matches:
        matched_memory_gene = match[0]
        matched_celltype_gene = match[1]
        matched_memory_gene_idx = simsetup['GENE_ID'][matched_memory_gene]
        matched_celltype_gene_idx = gene_labels_raw.index(matched_celltype_gene)
        if matched_celltype_gene_idx in new_celltype_rows or matched_memory_gene_idx in new_memory_rows:
            continue
        else:
            new_memory_rows.append(matched_memory_gene_idx)
            new_celltype_rows.append(matched_celltype_gene_idx)
    assert len(new_memory_rows) == len(new_celltype_rows)
    print 'Number of genes which match simsetup gene list:', len(new_memory_rows)
    xi_truncated = simsetup['XI'][new_memory_rows, :]
    ext_gene_states_truncated = np.array(gene_states_raw)[new_celltype_rows]
    print xi_truncated.shape, ext_gene_states_truncated.shape
    return xi_truncated, ext_gene_states_truncated

def truncate_celltype_data_for_dual_npz(matches, simsetup_A, simsetup_B):
    print 'Loaded gene count from npz A:', len(simsetup_A['GENE_LABELS'])
    print 'Loaded gene count from npz B:', len(simsetup_B['GENE_LABELS'])
    print 'Number of matches, with possible redundancies:', len(matches)
    print 'NOTE: choosing FIRST gene match in cases of degenerate matches'
    new_npzA_rows = []
    new_npzB_rows = []
    for match in matches:
        matched_A_gene = match[0]
        matched_B_gene = match[1]
        matched_A_gene_idx = simsetup_A['GENE_ID'][matched_A_gene]
        matched_B_gene_idx = simsetup_B['GENE_ID'][matched_B_gene]
        if matched_B_gene_idx in new_npzB_rows or matched_A_gene_idx in new_npzA_rows:
            continue
        else:
            new_npzA_rows.append(matched_A_gene_idx)
            new_npzB_rows.append(matched_B_gene_idx)
    assert len(new_npzA_rows) == len(new_npzB_rows)
    print 'Number of genes which match both simsetup gene lists:', len(new_npzA_rows)
    xi_truncated_A = simsetup_A['XI'][new_npzA_rows, :]
    xi_truncated_B = simsetup_B['XI'][new_npzB_rows, :]
    print xi_truncated_A.shape, xi_truncated_B.shape
    return xi_truncated_A, xi_truncated_B

def compute_and_plot_score(simsetup, xi_truncated, ext_gene_states_truncated, celltype_name='unspecified_celltype', use_proj=False):
    scorelabel = 'Overlaps'
    filemod = 'overlap'
    scores = np.dot(xi_truncated.T, ext_gene_states_truncated) / ext_gene_states_truncated.shape[0]
    if use_proj:
        scorelabel = 'Projections'
        filemod = 'proj'
        scores = np.dot(simsetup['A_INV'], scores)
    for idx, label in enumerate(simsetup['CELLTYPE_LABELS']):
        print "Celltype %s, %s %.3f" % (label, scorelabel, scores[idx])
    # plot overlaps
    plot_as_bar(scores, simsetup['CELLTYPE_LABELS'])
    plt.title('%s between %s and loaded memories (num matching genes: %d)' % (scorelabel, celltype_name, len(ext_gene_states_truncated)))
    plt.savefig(os.path.join(os.path.dirname(external_celltype), 'score_%s_vs_mems_%s.png' % (celltype_name, filemod)))
    plt.show()
    return

def score_similarity(external_celltype, memories_npz, memories_entrez_path, celltype_name='unspecified_celltype', use_proj=False):
    # load external celltype gene labels and states
    gene_labels_raw, gene_states_raw = load_external_celltype(external_celltype)
    # build synonym list from the gene labels
    ext_entrez_path = build_entrez_synonyms_for_celltype(gene_labels_raw,
                                                          entrez_name='entrez_id_ext_celltype_%s.csv' % celltype_name)
    # reload synonym lists for memories and ext celltype
    target_genes_id = read_gene_list_csv(ext_entrez_path, aliases=True)
    memories_genes_id = read_gene_list_csv(memories_entrez_path, aliases=True)
    # compare synonym lists to get matches
    matches = check_target_in_gene_id_dict(memories_genes_id, target_genes_id,
                                           outpath='tmp_matches_%s_vs_memories.txt' % (celltype_name))
    # use matches to truncate ext gene states to match truncated memory states and
    simsetup = singlecell_simsetup(npzpath=memories_npz)
    xi_truncated, ext_gene_states_truncated = truncate_celltype_data(matches, simsetup, gene_labels_raw, gene_states_raw)
    # use truncated data to score overlaps
    compute_and_plot_score(simsetup, xi_truncated, ext_gene_states_truncated, use_proj=use_proj, celltype_name=celltype_name)
    return simsetup, xi_truncated, ext_gene_states_truncated

def plot_overlaps_for_npz(xi, celltypes, plotname, outdir, namemod='_orig_overlap'):
    grid_data = np.dot(xi.T, xi) / xi.shape[0]
    plot_overlap_grid(grid_data, celltypes, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=plotname, ext='.pdf', vforce=None, namemod=namemod)
    return

def plot_all_grids(simsetup_A, simsetup_B, xi_truncated_A, xi_truncated_B, A_label, B_label, outdir=RUNS_FOLDER):
    """
    Creates the following grids
    - A auto orig            - overlap only (skip proj, just diagonal)
    - B auto orig            - overlap only (skip proj, just diagonal)
    - A auto truncated       - overlaps + untruncated projection measure (re-created proj would be diagonal)
    - B auto truncated       - overlaps + untruncated projection measure (re-created proj would be diagonal)
    - A vs B                 - overlaps + proj_A + proj_B
    """
    xi_A = simsetup_A['XI']
    xi_B = simsetup_B['XI']
    celltypes_A = simsetup_A['CELLTYPE_LABELS']
    celltypes_B = simsetup_B['CELLTYPE_LABELS']
    # plot A auto orig
    grid_data_overlap_A = np.dot(xi_A.T, xi_A) / xi_A.shape[0]
    plot_overlap_grid(grid_data_overlap_A, celltypes_A, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=A_label, ext='.pdf', vforce=None, namemod='_orig_overlap')
    # plot B auto orig
    grid_data_overlap_B = np.dot(xi_B.T, xi_B) / xi_B.shape[0]
    plot_overlap_grid(grid_data_overlap_B, celltypes_B, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=B_label, ext='.pdf', vforce=None, namemod='_orig_overlap')
    # plot A auto truncated
    grid_data_overlap_A_trunc = np.dot(xi_truncated_A.T, xi_truncated_A) / xi_truncated_A.shape[0]
    grid_data_pseudoproj_A_trunc = np.dot(simsetup_A['A_INV'], grid_data_overlap_A_trunc)
    plot_overlap_grid(grid_data_overlap_A_trunc, celltypes_A, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=A_label, ext='.pdf', vforce=None, namemod='_overlap_truncated')
    plot_overlap_grid(grid_data_pseudoproj_A_trunc, celltypes_A, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=A_label, ext='.pdf', vforce=None, namemod='_pseudoproj_truncated')
    # plot B auto truncated
    grid_data_overlap_B_trunc = np.dot(xi_truncated_B.T, xi_truncated_B) / xi_truncated_B.shape[0]
    grid_data_pseudoproj_B_trunc = np.dot(simsetup_B['A_INV'], grid_data_overlap_B_trunc)
    plot_overlap_grid(grid_data_overlap_B_trunc, celltypes_B, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=B_label, ext='.pdf', vforce=None, namemod='_overlap_truncated')
    plot_overlap_grid(grid_data_pseudoproj_B_trunc, celltypes_B, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=B_label, ext='.pdf', vforce=None, namemod='_pseudoproj_truncated')
    # plot A vs B
    grid_data_overlap_B_trunc = np.dot(xi_truncated_B.T, xi_truncated_B) / xi_truncated_B.shape[0]
    grid_data_pseudoproj_B_trunc = np.dot(simsetup_B['A_INV'], grid_data_overlap_B_trunc)
    plot_overlap_grid(grid_data_overlap_B_trunc, celltypes_B, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=B_label, ext='.pdf', vforce=None, namemod='_overlap_truncated')
    plot_overlap_grid(grid_data_pseudoproj_B_trunc, celltypes_B, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=B_label, ext='.pdf', vforce=None, namemod='_pseudoproj_truncated',)
    # memory_labels_y=celltypes_B
    # gen AB data
    grid_B_overlap_A = np.dot(xi_truncated_A.T, xi_truncated_B) / np.sqrt(xi_truncated_A.shape[0] * xi_truncated_B.shape[0])
    grid_B_apply_proj_A = np.dot(simsetup_A['A_INV'], grid_B_overlap_A)
    grid_A_apply_proj_B = np.dot(simsetup_B['A_INV'], grid_B_overlap_A.T)
    # plot AB data
    label_1 = '%s_overlap_%s' % (B_label, A_label)
    label_2 = '%s_apply_proj_%s' % (B_label, A_label)
    label_3 = '%s_apply_proj_%s' % (A_label, B_label)
    plot_overlap_grid(grid_B_overlap_A, celltypes_A, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=label_1, ext='.pdf', vforce=None, namemod='_matching', memory_labels_x=celltypes_B)
    plot_overlap_grid(grid_B_apply_proj_A, celltypes_A, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=label_2, ext='.pdf', vforce=None, namemod='_matching', memory_labels_x=celltypes_B)
    plot_overlap_grid(grid_A_apply_proj_B, celltypes_B, outdir, ax=None, N=None, normalize=True, fs=9, relmax=True,
                      extragrid=False, plotname=label_3, ext='.pdf', vforce=None, namemod='_matching', memory_labels_x=celltypes_A)
    return

if __name__ == '__main__':
    create_ext_celltype = False
    score_ext_celltype = False
    score_local_celltype = False
    check_npz_grids = True
    compare_two_npz = False

    # local constants
    outdir = RUNS_FOLDER + os.sep + 'celltype_similarity'
    external_celltypes_dir = DATADIR + os.sep + 'misc' + os.sep + 'external_celltypes'
    use_proj = True

    if create_ext_celltype:
        celltype_choice = 'fibroblast - skin'
        csvpath = external_celltypes_dir + os.sep + '2014mehta_dermal_fibroblast.csv'
        memories_npz = MEMORIESDIR + os.sep + '2014_mehta_mems_genes_types_boolean_compressed_pruned_A.npz'
        simsetup = singlecell_simsetup(npzpath=memories_npz)
        gene_labels = simsetup['GENE_LABELS']
        celltype_choice_idx = simsetup['CELLTYPE_ID'][celltype_choice]
        celltype_state = simsetup['XI'][:, celltype_choice_idx]
        write_celltype_csv(gene_labels, celltype_state, csvpath)

    if score_ext_celltype:
        # settings
        ext_celltype_name = 'dermal_fibroblast'
        external_celltype = external_celltypes_dir + os.sep + '2014mehta_dermal_fibroblast.csv'
        memories_npz = MEMORIESDIR + os.sep + '2018_scmca_mems_genes_types_boolean_compressed_pruned_A_TFonly.npz'
        memories_entrez_path = DATADIR + os.sep + 'misc' + os.sep + 'genelist_entrezids' + os.sep + 'entrez_id_2018scMCA_pruned_TFonly.csv'
        # scoring
        print 'Scoring similarity between %s and celltypes in %s...' % (external_celltype, memories_npz)
        simsetup, xi_truncated, ext_gene_states_truncated = \
            score_similarity(external_celltype, memories_npz, memories_entrez_path, celltype_name=ext_celltype_name, use_proj=True)
        compute_and_plot_score(simsetup, xi_truncated, ext_gene_states_truncated, celltype_name=ext_celltype_name, use_proj=False)

    if score_local_celltype:
        memories_npz = MEMORIESDIR + os.sep + '2014_mehta_mems_genes_types_boolean_compressed_pruned_A.npz'
        simsetup = singlecell_simsetup(npzpath=memories_npz)
        local_celltype = 'fibroblast - skin'
        local_celltype_idx = simsetup['CELLTYPE_ID'][local_celltype]
        # use truncated data to score overlaps
        local_celltype_data = simsetup['XI'][:, local_celltype_idx]
        compute_and_plot_score(simsetup, simsetup['XI'], local_celltype_data, celltype_name=local_celltype, use_proj=True)
        compute_and_plot_score(simsetup, simsetup['XI'], local_celltype_data, celltype_name=local_celltype, use_proj=False)

    if check_npz_grids:
        npzs = {'2014': MEMORIESDIR + os.sep + '2014_mehta_mems_genes_types_boolean_compressed.npz',
                '2014pruneA': MEMORIESDIR + os.sep + '2014_mehta_mems_genes_types_boolean_compressed_pruned_A.npz',
                '2018': MEMORIESDIR + os.sep + '2018_scmca_mems_genes_types_boolean_compressed.npz',
                '2018pruneA': MEMORIESDIR + os.sep + '2018_scmca_mems_genes_types_boolean_compressed_pruned_A.npz',
                '2018_TF': MEMORIESDIR + os.sep + '2018_scmca_mems_genes_types_boolean_compressed_TFonly.npz',
                '2018pruneA_TF': MEMORIESDIR + os.sep + '2018_scmca_mems_genes_types_boolean_compressed_pruned_A_TFonly.npz'}
        for k, v in npzs.iteritems():
            simsetup = singlecell_simsetup(npzpath=v)
            plot_overlaps_for_npz(simsetup['XI'], simsetup['CELLTYPE_LABELS'], k, outdir, namemod='_orig_overlap')

    if compare_two_npz:
        # settings
        label_A = '2018pruneA_TF'
        label_B = '2014pruneA'
        npz_A = MEMORIESDIR + os.sep + '2018_scmca_mems_genes_types_boolean_compressed_pruned_A_TFonly.npz'
        npz_B = MEMORIESDIR + os.sep + '2014_mehta_mems_genes_types_boolean_compressed_pruned_A.npz'
        entrez_name_A = 'entrez_id_2018scMCA_pruned_TFonly.csv'
        entrez_name_B = 'entrez_id_2014mehta.csv'
        # perform simsetup
        simsetup_A = singlecell_simsetup(npzpath=npz_A)
        simsetup_B = singlecell_simsetup(npzpath=npz_B)
        # create synonym list if needed (for Mehta and scMCA they should exist already)
        entrez_path_A = build_entrez_synonyms_for_celltype(simsetup_A['GENE_LABELS'], entrez_name=entrez_name_A)
        entrez_path_B = build_entrez_synonyms_for_celltype(simsetup_B['GENE_LABELS'], entrez_name=entrez_name_B)
        # reload synonym lists for memories and ext celltype
        gene_synonyms_A = read_gene_list_csv(entrez_path_A, aliases=True)
        gene_synonyms_B = read_gene_list_csv(entrez_path_B, aliases=True)
        # compare synonym lists to get matches
        matches = check_target_in_gene_id_dict(gene_synonyms_A, gene_synonyms_B, outpath='tmp_matches_npz_A_vs_B.txt')
        # use matches to truncate ext gene states to match truncated memory states and
        xi_truncated_A, xi_truncated_B = truncate_celltype_data_for_dual_npz(matches, simsetup_A, simsetup_B)
        # do proj and overlaps for both
        plot_all_grids(simsetup_A, simsetup_B, xi_truncated_A, xi_truncated_B, label_A, label_B, outdir=outdir)


text:
namespace Shared {

  export const sharedModule = angular
    .module('hawtio-shared', [])
    .component('hawtioActionBar', hawtioActionBarComponent)
    .component('hawtioLoading', hawtioLoadingComponent)
    .name;

}


text:
using Pandaros.Settlers.Items;
using Recipes;
using System;
using System.Collections.Generic;
using System.Text;

namespace Pandaros.Settlers.Extender.Providers
{
    public class RecipeProvider : IAfterWorldLoad
    {
        public List<Type> LoadedAssembalies { get; } = new List<Type>();

        public string InterfaceName => nameof(ICSRecipe);
        public Type ClassType => null;

        public void AfterWorldLoad()
        {
            StringBuilder sb = new StringBuilder();
            PandaLogger.Log(ChatColor.lime, "-------------------Recipes Loaded----------------------");
            var i = 0;

            foreach (var item in LoadedAssembalies)
            {
                if (Activator.CreateInstance(item) is ICSRecipe recipe &&
                    !string.IsNullOrEmpty(recipe.name))
                {
                    var requirements = new List<InventoryItem>();
                    var results = new List<ItemTypes.ItemTypeDrops>();
                    recipe.JsonSerialize();

                    foreach (var ri in recipe.requires)
                        if (ItemTypes.IndexLookup.TryGetIndex(ri.type, out var itemIndex))
                            requirements.Add(new InventoryItem(itemIndex, ri.amount));

                    foreach (var ri in recipe.results)
                        if (ItemTypes.IndexLookup.TryGetIndex(ri.type, out var itemIndex))
                            results.Add(new ItemTypes.ItemTypeDrops(itemIndex, ri.amount));

                    var newRecipe = new Recipe(recipe.name, requirements, results, recipe.defaultLimit, recipe.isOptional, (int)recipe.defaultPriority);

                    if (recipe.isOptional)
                        ServerManager.RecipeStorage.AddOptionalLimitTypeRecipe(recipe.Job, newRecipe);
                    else
                        ServerManager.RecipeStorage.AddDefaultLimitTypeRecipe(recipe.Job, newRecipe);

                    sb.Append($"{recipe.name}, ");
                    i++;

                    if (i > 5)
                    {
                        sb.Append("</color>");
                        i = 0;
                        sb.AppendLine();
                        sb.Append("<color=lime>");
                    }
                }
            }

            PandaLogger.Log(ChatColor.lime, sb.ToString());
            PandaLogger.Log(ChatColor.lime, "---------------------------------------------------------");
        }
    }
}


text:
const
  appPaths = require('../../app-paths'),
  PwaManifestPlugin = require('./plugin.pwa-manifest')

module.exports = function (chain, cfg) {
  // write manifest.json file
  chain.plugin('pwa-manifest')
    .use(PwaManifestPlugin, [ cfg ])

  let defaultOptions
  const
    WorkboxPlugin = require('workbox-webpack-plugin'),
    pluginMode = cfg.pwa.workboxPluginMode,
    log = require('../../helpers/logger')('app:workbox')

  if (pluginMode === 'GenerateSW') {
    const pkg = require(appPaths.resolve.app('package.json'))

    defaultOptions = {
      cacheId: pkg.name || 'quasar-pwa-app'
    }

    log('[GenerateSW] Will generate a service-worker file. Ignoring your custom written one.')
  }
  else {
    defaultOptions = {
      swSrc: appPaths.resolve.app(cfg.sourceFiles.serviceWorker)
    }

    log('[InjectManifest] Using your custom service-worker written file')
  }

  let opts = Object.assign(
    defaultOptions,
    cfg.pwa.workboxOptions
  )

  if (cfg.ctx.mode.ssr) {
    if (!opts.directoryIndex) {
      opts.directoryIndex = '/'
    }

    // if Object form:
    if (cfg.ssr.pwa && cfg.ssr.pwa !== true) {
      const merge = require('webpack-merge')
      opts = merge(opts, cfg.ssr.pwa)
    }

    if (pluginMode === 'GenerateSW') {
      opts.runtimeCaching = opts.runtimeCaching || []
      if (!opts.runtimeCaching.find(entry => entry.urlPattern === '/')) {
        opts.runtimeCaching.unshift({
          urlPattern: '/',
          handler: 'networkFirst'
        })
      }
    }
  }

  if (cfg.ctx.dev) {
    log('⚠  Forcing PWA into the network-first approach to not break Hot Module Replacement while developing.')
    // forcing network-first strategy
    opts.chunks = [ 'quasar-bogus-chunk' ]
    if (opts.excludeChunks) {
      delete opts.excludeChunks
    }

    if (pluginMode === 'GenerateSW') {
      opts.runtimeCaching = opts.runtimeCaching || []
      opts.runtimeCaching.push({
        urlPattern: /^http/,
        handler: 'networkFirst'
      })
    }
  }

  opts.swDest = 'service-worker.js'

  chain.plugin('workbox')
    .use(WorkboxPlugin[pluginMode], [ opts ])

  if (!cfg.ctx.mode.ssr) {
    const HtmlPwaPlugin = require('./plugin.html-pwa').plugin
    chain.plugin('html-pwa')
      .use(HtmlPwaPlugin, [ cfg ])
  }
}


text:
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef FPDFSDK_INCLUDE_FSDK_BASEFORM_H_
#define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_

#if _FX_OS_ == _FX_ANDROID_
#include "time.h"
#else
#include <ctime>
#endif

#include <map>

#include "core/include/fpdfapi/fpdf_parser.h"
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fxcrt/fx_basic.h"
#include "core/include/fxge/fx_dib.h"
#include "fsdk_baseannot.h"

class CFFL_FormFiller;
class CPDFSDK_Annot;
class CPDFSDK_DateTime;
class CPDFSDK_Document;
class CPDFSDK_InterForm;
class CPDFSDK_PageView;
class CPDF_Action;
class CPDF_FormField;
struct CPWL_Color;

#ifdef PDF_ENABLE_XFA
typedef enum _PDFSDK_XFAAActionType {
  PDFSDK_XFA_Click = 0,
  PDFSDK_XFA_Full,
  PDFSDK_XFA_PreOpen,
  PDFSDK_XFA_PostOpen
} PDFSDK_XFAAActionType;
#endif  // PDF_ENABLE_XFA

typedef struct _PDFSDK_FieldAction {
  _PDFSDK_FieldAction() {
    bModifier = FALSE;
    bShift = FALSE;
    nCommitKey = 0;
    bKeyDown = FALSE;
    nSelEnd = nSelStart = 0;
    bWillCommit = FALSE;
    bFieldFull = FALSE;
    bRC = TRUE;
  }

  FX_BOOL bModifier;         // in
  FX_BOOL bShift;            // in
  int nCommitKey;            // in
  CFX_WideString sChange;    // in[out]
  CFX_WideString sChangeEx;  // in
  FX_BOOL bKeyDown;          // in
  int nSelEnd;               // in[out]
  int nSelStart;             // in[out]
  CFX_WideString sValue;     // in[out]
  FX_BOOL bWillCommit;       // in
  FX_BOOL bFieldFull;        // in
  FX_BOOL bRC;               // in[out]
} PDFSDK_FieldAction;

class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
 public:
#ifdef PDF_ENABLE_XFA
  IXFA_Widget* GetMixXFAWidget() const;
  IXFA_Widget* GetGroupMixXFAWidget();
  IXFA_WidgetHandler* GetXFAWidgetHandler() const;

  FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT);
  FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
                       PDFSDK_FieldAction& data,
                       CPDFSDK_PageView* pPageView);

  void Synchronize(FX_BOOL bSynchronizeElse);
  void SynchronizeXFAValue();
  void SynchronizeXFAItems();

  static void SynchronizeXFAValue(IXFA_DocView* pXFADocView,
                                  IXFA_Widget* hWidget,
                                  CPDF_FormField* pFormField,
                                  CPDF_FormControl* pFormControl);
  static void SynchronizeXFAItems(IXFA_DocView* pXFADocView,
                                  IXFA_Widget* hWidget,
                                  CPDF_FormField* pFormField,
                                  CPDF_FormControl* pFormControl);
#endif  // PDF_ENABLE_XFA

  CPDFSDK_Widget(CPDF_Annot* pAnnot,
                 CPDFSDK_PageView* pPageView,
                 CPDFSDK_InterForm* pInterForm);
  ~CPDFSDK_Widget() override;

  // CPDFSDK_Annot
  CFX_ByteString GetSubType() const override;
  CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override;
  FX_BOOL IsAppearanceValid() override;

  int GetLayoutOrder() const override { return 2; }

  int GetFieldType() const;

  // Possible values from PDF 32000-1:2008, table 221.
  // FIELDFLAG_READONLY
  // FIELDFLAG_REQUIRED
  // FIELDFLAG_NOEXPORT
  int GetFieldFlags() const;
  int GetRotate() const;

  FX_BOOL GetFillColor(FX_COLORREF& color) const;
  FX_BOOL GetBorderColor(FX_COLORREF& color) const;
  FX_BOOL GetTextColor(FX_COLORREF& color) const;
  FX_FLOAT GetFontSize() const;

  int GetSelectedIndex(int nIndex) const;
#ifndef PDF_ENABLE_XFA
  CFX_WideString GetValue() const;
#else
  CFX_WideString GetValue(FX_BOOL bDisplay = TRUE) const;
#endif  // PDF_ENABLE_XFA
  CFX_WideString GetDefaultValue() const;
  CFX_WideString GetOptionLabel(int nIndex) const;
  int CountOptions() const;
  FX_BOOL IsOptionSelected(int nIndex) const;
  int GetTopVisibleIndex() const;
  FX_BOOL IsChecked() const;
  /*
  BF_ALIGN_LEFT
  BF_ALIGN_MIDDL
  BF_ALIGN_RIGHT
  */
  int GetAlignment() const;
  int GetMaxLen() const;
#ifdef PDF_ENABLE_XFA
  CFX_WideString GetName() const;
#endif  // PDF_ENABLE_XFA
  CFX_WideString GetAlternateName() const;

  // Set Properties.
  void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify);
  void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify);
  void SetDefaultValue(const CFX_WideString& sValue);
  void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify);
  void ClearSelection(FX_BOOL bNotify);
  void SetTopVisibleIndex(int index);

#ifdef PDF_ENABLE_XFA
  void ResetAppearance(FX_BOOL bValueChanged);
#endif  // PDF_ENABLE_XFA
  void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged);
  void ResetFieldAppearance(FX_BOOL bValueChanged);
  void UpdateField();
  CFX_WideString OnFormat(FX_BOOL& bFormated);

  // Message.
  FX_BOOL OnAAction(CPDF_AAction::AActionType type,
                    PDFSDK_FieldAction& data,
                    CPDFSDK_PageView* pPageView);

  CPDFSDK_InterForm* GetInterForm() const { return m_pInterForm; }
  CPDF_FormField* GetFormField() const;
  CPDF_FormControl* GetFormControl() const;
  static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm,
                                          const CPDF_Dictionary* pAnnotDict);

  void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView);

  void SetAppModified();
  void ClearAppModified();
  FX_BOOL IsAppModified() const;

  int32_t GetAppearanceAge() const;
  int32_t GetValueAge() const;

 private:
  void ResetAppearance_PushButton();
  void ResetAppearance_CheckBox();
  void ResetAppearance_RadioButton();
  void ResetAppearance_ComboBox(const FX_WCHAR* sValue);
  void ResetAppearance_ListBox();
  void ResetAppearance_TextField(const FX_WCHAR* sValue);

  CPDF_Rect GetClientRect() const;
  CPDF_Rect GetRotatedRect() const;

  CFX_ByteString GetBackgroundAppStream() const;
  CFX_ByteString GetBorderAppStream() const;
  CFX_Matrix GetMatrix() const;

  CPWL_Color GetTextPWLColor() const;
  CPWL_Color GetBorderPWLColor() const;
  CPWL_Color GetFillPWLColor() const;

  void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage);
  void RemoveAppearance(const CFX_ByteString& sAPType);

 public:
  FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
  void DrawAppearance(CFX_RenderDevice* pDevice,
                      const CFX_Matrix* pUser2Device,
                      CPDF_Annot::AppearanceMode mode,
                      const CPDF_RenderOptions* pOptions) override;

  FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY);

#ifndef PDF_ENABLE_XFA
 private:
#endif  // PDF_ENABLE_XFA
  CPDFSDK_InterForm* m_pInterForm;
  FX_BOOL m_bAppModified;
  int32_t m_nAppAge;
  int32_t m_nValueAge;

#ifdef PDF_ENABLE_XFA
  mutable IXFA_Widget* m_hMixXFAWidget;
  mutable IXFA_WidgetHandler* m_pWidgetHandler;
#endif  // PDF_ENABLE_XFA
};

#ifdef PDF_ENABLE_XFA
class CPDFSDK_XFAWidget : public CPDFSDK_Annot {
 public:
  CPDFSDK_XFAWidget(IXFA_Widget* pAnnot,
                    CPDFSDK_PageView* pPageView,
                    CPDFSDK_InterForm* pInterForm);
  ~CPDFSDK_XFAWidget() override {}

  FX_BOOL IsXFAField() override;
  IXFA_Widget* GetXFAWidget() const override { return m_hXFAWidget; }
  CFX_ByteString GetType() const override;
  CFX_ByteString GetSubType() const override { return ""; }
  CFX_FloatRect GetRect() const override;

  CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; }

 private:
  CPDFSDK_InterForm* m_pInterForm;
  IXFA_Widget* m_hXFAWidget;
};
#define CPDFSDK_XFAWidgetMap \
  CFX_MapPtrTemplate<IXFA_Widget*, CPDFSDK_XFAWidget*>
#define CPDFSDK_FieldSynchronizeMap CFX_MapPtrTemplate<CPDF_FormField*, int>
#endif  // PDF_ENABLE_XFA

class CPDFSDK_InterForm : public CPDF_FormNotify {
 public:
  explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument);
  ~CPDFSDK_InterForm() override;

  CPDF_InterForm* GetInterForm() const { return m_pInterForm; }
  CPDFSDK_Document* GetDocument() const { return m_pDocument; }

  FX_BOOL HighlightWidgets();

  CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const;
  CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const;
  void GetWidgets(const CFX_WideString& sFieldName,
                  std::vector<CPDFSDK_Widget*>* widgets) const;
  void GetWidgets(CPDF_FormField* pField,
                  std::vector<CPDFSDK_Widget*>* widgets) const;

  void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget);
  void RemoveMap(CPDF_FormControl* pControl);

  void EnableCalculate(FX_BOOL bEnabled);
  FX_BOOL IsCalculateEnabled() const;

#ifdef PDF_ENABLE_XFA
  void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget);
  void RemoveXFAMap(IXFA_Widget* hWidget);
  CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget);
  void XfaEnableCalculate(FX_BOOL bEnabled);
  FX_BOOL IsXfaCalculateEnabled() const;
  FX_BOOL IsXfaValidationsEnabled();
  void XfaSetValidationsEnabled(FX_BOOL bEnabled);
#endif  // PDF_ENABLE_XFA

  void OnKeyStrokeCommit(CPDF_FormField* pFormField,
                         CFX_WideString& csValue,
                         FX_BOOL& bRC);
  void OnValidate(CPDF_FormField* pFormField,
                  CFX_WideString& csValue,
                  FX_BOOL& bRC);
  void OnCalculate(CPDF_FormField* pFormField = NULL);
  CFX_WideString OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated);

  void ResetFieldAppearance(CPDF_FormField* pFormField,
                            const FX_WCHAR* sValue,
                            FX_BOOL bValueChanged);
  void UpdateField(CPDF_FormField* pFormField);

  FX_BOOL DoAction_Hide(const CPDF_Action& action);
  FX_BOOL DoAction_SubmitForm(const CPDF_Action& action);
  FX_BOOL DoAction_ResetForm(const CPDF_Action& action);
  FX_BOOL DoAction_ImportData(const CPDF_Action& action);

  std::vector<CPDF_FormField*> GetFieldFromObjects(
      const std::vector<CPDF_Object*>& objects) const;
  FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict);
  FX_BOOL SubmitFields(const CFX_WideString& csDestination,
                       const std::vector<CPDF_FormField*>& fields,
                       FX_BOOL bIncludeOrExclude,
                       FX_BOOL bUrlEncoded);
  FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded);
  FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf);
  FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields,
                                   FX_BOOL bIncludeOrExclude,
                                   CFX_ByteTextBuf& textBuf);
  CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt);

#ifdef PDF_ENABLE_XFA
  void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse);
#endif  // PDF_ENABLE_XFA

 private:
  // CPDF_FormNotify
  int BeforeValueChange(const CPDF_FormField* pField,
                        CFX_WideString& csValue) override;
  int AfterValueChange(const CPDF_FormField* pField) override;
  int BeforeSelectionChange(const CPDF_FormField* pField,
                            CFX_WideString& csValue) override;
  int AfterSelectionChange(const CPDF_FormField* pField) override;
  int AfterCheckedStatusChange(const CPDF_FormField* pField,
                               const CFX_ByteArray& statusArray) override;
  int BeforeFormReset(const CPDF_InterForm* pForm) override;
  int AfterFormReset(const CPDF_InterForm* pForm) override;
  int BeforeFormImportData(const CPDF_InterForm* pForm) override;
  int AfterFormImportData(const CPDF_InterForm* pForm) override;

  FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile,
                              CFX_WideString csTxtFile);
  FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize);
  int GetPageIndexByAnnotDict(CPDF_Document* pDocument,
                              CPDF_Dictionary* pAnnotDict) const;

  using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>;

  CPDFSDK_Document* m_pDocument;
  CPDF_InterForm* m_pInterForm;
  CPDFSDK_WidgetMap m_Map;
#ifdef PDF_ENABLE_XFA
  CPDFSDK_XFAWidgetMap m_XFAMap;
  CPDFSDK_FieldSynchronizeMap m_FieldSynchronizeMap;
  FX_BOOL m_bXfaCalculate;
  FX_BOOL m_bXfaValidationsEnabled;
#endif  // PDF_ENABLE_XFA
  FX_BOOL m_bCalculate;
  FX_BOOL m_bBusy;

 public:
  FX_BOOL IsNeedHighLight(int nFieldType);
  void RemoveAllHighLight();
  void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; }
  uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; }
  void SetHighlightColor(FX_COLORREF clr, int nFieldType);
  FX_COLORREF GetHighlightColor(int nFieldType);

 private:
#ifndef PDF_ENABLE_XFA
  static const int kNumFieldTypes = 6;
#else   // PDF_ENABLE_XFA
  static const int kNumFieldTypes = 7;
#endif  // PDF_ENABLE_XFA

  FX_COLORREF m_aHighlightColor[kNumFieldTypes];
  uint8_t m_iHighlightAlpha;
  FX_BOOL m_bNeedHightlight[kNumFieldTypes];
};

#define BAI_STRUCTURE 0
#define BAI_ROW 1
#define BAI_COLUMN 2

#define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*>
#define CPDFSDK_SortAnnots CGW_ArrayTemplate<CPDFSDK_Annot*>
class CBA_AnnotIterator {
 public:
  CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
                    const CFX_ByteString& sType,
                    const CFX_ByteString& sSubType);
  ~CBA_AnnotIterator();

  CPDFSDK_Annot* GetFirstAnnot();
  CPDFSDK_Annot* GetLastAnnot();
  CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot);
  CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);

 private:
  void GenerateResults();
  static int CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
  static int CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
  static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot);

  CPDFSDK_PageView* m_pPageView;
  CFX_ByteString m_sType;
  CFX_ByteString m_sSubType;
  int m_nTabs;
  CPDFSDK_Annots m_Annots;
};

#endif  // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_


text:
source ../lib/package.sh

is_archlinux
if [ $? -eq 0 ]; then
    echo -e "success"
else
    echo -e "failed"
fi


text: [x]


text:
set -eux

NOSETESTS=$(which nosetests3 || which nosetests)

$NOSETESTS -v dividebatur

for i in dividebatur-aec/*/*.json; do
    time python3 -m dividebatur.senatecount -v --only-verified "$i" './angular/data/'
done

flake8 --ignore=E501,E731 dividebatur


text:
package com.sicdlib.service;

import java.util.List;

public interface IStopWordsService {
    public List<String> getAllStopWords();
}


text:
from datetime import datetime
from model import *
from utils import *
import prefix
import pfif
import reveal
import sys

# Fields to show for side-by-side comparison.
COMPARE_FIELDS = pfif.PFIF_1_2.fields['person']

class MultiView(Handler):
    def get(self):
        # To handle multiple persons, we create a single object where
        # each property is a list of values, one for each person.
        # This makes page rendering easier.
        person = dict([(prop, []) for prop in COMPARE_FIELDS])
        any = dict([(prop, None) for prop in COMPARE_FIELDS])

        # Get all persons from db.
        # TODO: Can later optimize to use fewer DB calls.
        for i in [1, 2, 3]:
            id = self.request.get('id%d' % i)
            if not id:
                break
            p = Person.get(self.subdomain, id)

            for prop in COMPARE_FIELDS:
                val = getattr(p, prop)
                if prop == 'sex':  # convert enum value to localized text
                    val = get_person_sex_text(p)
                person[prop].append(val)
                any[prop] = any[prop] or val

        # Check if private info should be revealed.
        content_id = 'multiview:' + ','.join(person['person_record_id'])
        reveal_url = reveal.make_reveal_url(self, content_id)
        show_private_info = reveal.verify(content_id, self.params.signature)

        # TODO: Handle no persons found.

        # Add a calculated full name property - used in the title.
        person['full_name'] = [
            fname + ' ' + lname
            for fname, lname in zip(person['first_name'], person['last_name'])]
        standalone = self.request.get('standalone')

        # Note: we're not showing notes and linked persons information
        # here at the moment.
        self.render('templates/multiview.html',
                    person=person, any=any, standalone=standalone,
                    cols=len(person['first_name']) + 1,
                    onload_function='view_page_loaded()', markdup=True,
                    show_private_info=show_private_info, reveal_url=reveal_url)

    def post(self):
        if not self.params.text:
            return self.error(
                200, _('Message is required. Please go back and try again.'))

        if not self.params.author_name:
            return self.error(
                200, _('Your name is required in the "About you" section.  Please go back and try again.'))

        # TODO: To reduce possible abuse, we currently limit to 3 person
        # match. We could guard using e.g. an XSRF token, which I don't know how
        # to build in GAE.

        ids = set()
        for i in [1, 2, 3]:
            id = getattr(self.params, 'id%d' % i)
            if not id:
                break
            ids.add(id)

        if len(ids) > 1:
            notes = []
            for person_id in ids:
                for other_id in ids - set([person_id]):
                    note = Note.create_original(
                        self.subdomain,
                        person_record_id=person_id,
                        linked_person_record_id=other_id,
                        text=self.params.text,
                        author_name=self.params.author_name,
                        author_phone=self.params.author_phone,
                        author_email=self.params.author_email,
                        source_date=datetime.utcnow())
                    notes.append(note)
            db.put(notes)
        self.redirect('/view', id=self.params.id1)

if __name__ == '__main__':
    run(('/multiview', MultiView))


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

<title>Uses of Class cpsr.environment.exceptions.EnvironmentException</title>
<meta name="date" content="2014-01-08">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
cpsr.environment.exceptions.EnvironmentException

Packages that use EnvironmentException

Package
Description

cpsr.environment.components

Uses of EnvironmentException in cpsr.environment.components

Methods in cpsr.environment.components that throw EnvironmentException

Modifier and Type
Method and Description

java.lang.String
Action.toBinaryString()

Returns a binary string representing action with length equal
 to the max length specified by max action hash code of DataSet.

java.lang.String
Observation.toBinaryString()

Returns a binary string representing observation with length equal
 to the max length specified by max observation ID of DataSet.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
require 'faraday'
require 'faraday_middleware'

require 'labelary/label'
require 'labelary/image'

require 'labelary/client'
require 'labelary/configuration'
require 'labelary/version'

module Labelary
  def self.font
    Labelary.configuration.font
  end
end


text:
<?php

namespace Drupal\Tests\hal\Functional\Update;

use Drupal\system\Tests\Update\UpdatePathTestBase;

/**
 * 'link_domain' is migrated from 'rest.settings' to 'hal.settings'.
 *
 * @see https://www.drupal.org/node/2758897
 *
 * @group hal
 */
class MigrateLinkDomainSettingFromRestToHalUpdateTest extends UpdatePathTestBase {

  /**
   * {@inheritdoc}
   */
  public function setDatabaseDumpFiles() {
    $this->databaseDumpFiles = [
      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
      __DIR__ . '/../../../fixtures/update/drupal-8.hal-hal_update_8301.php',
      __DIR__ . '/../../../fixtures/update/drupal-8.rest-hal_update_8301.php',
    ];
  }

  /**
   * Tests hal_update_8301().
   */
  public function testLinkDomainMigratedFromRestSettingsToHalSettings() {
    // Make sure we have the expected values before the update.
    $hal_settings = $this->config('hal.settings');
    $this->assertIdentical([], $hal_settings->getRawData());
    $rest_settings = $this->config('rest.settings');
    $this->assertTrue(array_key_exists('link_domain', $rest_settings->getRawData()));
    $this->assertIdentical('http://example.com', $rest_settings->getRawData()['link_domain']);

    $this->runUpdates();

    // Make sure we have the expected values after the update.
    $hal_settings = \Drupal::configFactory()->get('hal.settings');
    $this->assertTrue(array_key_exists('link_domain', $hal_settings->getRawData()));
    $this->assertIdentical('http://example.com', $hal_settings->getRawData()['link_domain']);
    $rest_settings = $this->config('rest.settings');
    $this->assertFalse(array_key_exists('link_domain', $rest_settings->getRawData()));
  }

}


text:
package com.wegas.core.exception.client;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import javax.ejb.ApplicationException;

/**
 *
 * @author Cyril Junod (cyril.junod at gmail.com)
 */

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@class")
@JsonSubTypes(value = {
    @JsonSubTypes.Type(name = "WegasErrorMessage", value = WegasErrorMessage.class),
    @JsonSubTypes.Type(name = "WegasOutOfBoundException", value = WegasOutOfBoundException.class),
    @JsonSubTypes.Type(name = "WegasScriptException", value = WegasScriptException.class),
    @JsonSubTypes.Type(name = "WegasWrappedException", value = WegasWrappedException.class)
})
@JsonIgnoreProperties({"cause", "stackTrace", "suppressed"})
@ApplicationException(rollback = true)
public abstract class WegasRuntimeException extends RuntimeException {

    private static final long serialVersionUID = 1484932586696706035L;

    /**
     *
     */
    public WegasRuntimeException() {
        super();
    }

    public WegasRuntimeException (final Throwable t){
        super(t);
    }

    /**
     *
     * @param message
     */
    public WegasRuntimeException(String message) {
        super(message);
    }

    /**
     *
     * @param message
     * @param cause
     */
    public WegasRuntimeException(String message, Throwable cause) {
        super(message, cause);
    }
}


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

<title>Precision</title>
<meta name="date" content="2021-01-31">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

numerical

Class Precision

java.lang.Object

numerical.Precision

public final class Precision
extends java.lang.Object

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static class
Precision.CardanEulerSingularityException

static class
Precision.LocalizedFormats

class
Precision.MathArithmeticException

class
Precision.MathIllegalArgumentException

static class
Precision.NotARotationMatrixException

static class
Precision.ZeroException

Field Summary

Fields

Modifier and Type
Field and Description

static double
EPSILON_DOUBLE

static double
EPSILON_FLOAT

static double
SAFE_MIN_DOUBLE

static double
SAFE_MIN_FLOAT

Constructor Summary

Constructors

Constructor and Description

Precision()

Method Summary

All Methods Static Methods Concrete Methods

Modifier and Type
Method and Description

static int
compareTo(double x,
         double y,
         double eps)

static int
compareTo(double x,
         double y,
         int maxUlps)

Compares two numbers given some amount of allowed error.

static boolean
equals(double x,
      double y)

Returns true iff they are equal as defined by
 equals(x, y, 1).

static boolean
equals(double x,
      double y,
      double eps)

Returns true if there is no double value strictly between the
 arguments or the difference between them is within the range of allowed
 error (inclusive).

static boolean
equals(float x,
      float y)

Returns true iff they are equal as defined by
 equals(x, y, 1).

static boolean
equals(float x,
      float y,
      float eps)

Returns true if both arguments are equal or within the range of allowed
 error (inclusive).

static boolean
equalsIncludingNaN(double x,
                  double y)

Returns true if both arguments are NaN or neither is NaN and they are
 equal as defined by equals(x, y, 1).

static boolean
equalsIncludingNaN(float x,
                  float y)

Returns true if both arguments are NaN or neither is NaN and they are
 equal as defined by equals(x, y, 1).

static boolean
equalsIncludingNaN(float x,
                  float y,
                  int maxUlps)

Returns true if both arguments are NaN or if they are equal as defined
 by equals(x, y, maxUlps).

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SAFE_MIN_DOUBLE

public static final double SAFE_MIN_DOUBLE

EPSILON_DOUBLE

public static final double EPSILON_DOUBLE

SAFE_MIN_FLOAT

public static final double SAFE_MIN_FLOAT

EPSILON_FLOAT

public static final double EPSILON_FLOAT

Constructor Detail

Precision

public Precision()

Method Detail

compareTo

public static int compareTo(double x,
                            double y,
                            double eps)

compareTo

public static int compareTo(double x,
                            double y,
                            int maxUlps)

Compares two numbers given some amount of allowed error.
 Two float numbers are considered equal if there are (maxUlps - 1)
 (or fewer) floating point numbers between them, i.e. two adjacent floating
 point numbers are considered equal.
 Adapted from
 Bruce Dawson

Parameters:

x - first value

y - second value

maxUlps - (maxUlps - 1) is the number of floating point
 values between x and y.

Returns:

0 if  equals(x, y, maxUlps)

< 0 if !equals(x, y, maxUlps) && x < y

> 0 if !equals(x, y, maxUlps) && x > y

equals

public static boolean equals(float x,
                             float y)

Returns true iff they are equal as defined by
 equals(x, y, 1).

Parameters:

x - first value

y - second value

Returns:

true if the values are equal.

equalsIncludingNaN

public static boolean equalsIncludingNaN(float x,
                                         float y)

Returns true if both arguments are NaN or neither is NaN and they are
 equal as defined by equals(x, y, 1).

Parameters:

x - first value

y - second value

Returns:

true if the values are equal or both are NaN.

Since:

2.2

equals

public static boolean equals(float x,
                             float y,
                             float eps)

Returns true if both arguments are equal or within the range of allowed
 error (inclusive).

Parameters:

x - first value

y - second value

eps - the amount of absolute error to allow.

Returns:

true if the values are equal or within range of each other.

Since:

2.2

equalsIncludingNaN

public static boolean equalsIncludingNaN(float x,
                                         float y,
                                         int maxUlps)

Returns true if both arguments are NaN or if they are equal as defined
 by equals(x, y, maxUlps).

Parameters:

x - first value

y - second value

maxUlps - (maxUlps - 1) is the number of floating point
 values between x and y.

Returns:

true if both arguments are NaN or if there are less than
 maxUlps floating point values between x and y.

Since:

2.2

equals

public static boolean equals(double x,
                             double y)

Returns true iff they are equal as defined by
 equals(x, y, 1).

Parameters:

x - first value

y - second value

Returns:

true if the values are equal.

equalsIncludingNaN

public static boolean equalsIncludingNaN(double x,
                                         double y)

Returns true if both arguments are NaN or neither is NaN and they are
 equal as defined by equals(x, y, 1).

Parameters:

x - first value

y - second value

Returns:

true if the values are equal or both are NaN.

Since:

2.2

equals

public static boolean equals(double x,
                             double y,
                             double eps)

Returns true if there is no double value strictly between the
 arguments or the difference between them is within the range of allowed
 error (inclusive).

Parameters:

x - First value.

y - Second value.

eps - Amount of allowed absolute error.

Returns:

true if the values are two adjacent floating point
 numbers or they are within range of each other.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package commands

import (
	"fmt"
	"io"

	"github.com/digitalocean/doctl"
	"github.com/digitalocean/doctl/commands/displayers"
	"github.com/digitalocean/doctl/do"
	"github.com/digitalocean/doctl/internal/apps/builder"
	"github.com/spf13/viper"
)

// CmdConfig is a command configuration.
type CmdConfig struct {
	NS   string
	Doit doctl.Config
	Out  io.Writer
	Args []string

	initServices            func(*CmdConfig) error
	getContextAccessToken   func() string
	setContextAccessToken   func(string)
	removeContext           func(string) error
	componentBuilderFactory builder.ComponentBuilderFactory

	// services
	Keys              func() do.KeysService
	Sizes             func() do.SizesService
	Regions           func() do.RegionsService
	Images            func() do.ImagesService
	ImageActions      func() do.ImageActionsService
	LoadBalancers     func() do.LoadBalancersService
	ReservedIPs       func() do.ReservedIPsService
	ReservedIPActions func() do.ReservedIPActionsService
	Droplets          func() do.DropletsService
	DropletActions    func() do.DropletActionsService
	Domains           func() do.DomainsService
	Actions           func() do.ActionsService
	Account           func() do.AccountService
	Balance           func() do.BalanceService
	BillingHistory    func() do.BillingHistoryService
	Invoices          func() do.InvoicesService
	Tags              func() do.TagsService
	Volumes           func() do.VolumesService
	VolumeActions     func() do.VolumeActionsService
	Snapshots         func() do.SnapshotsService
	Certificates      func() do.CertificatesService
	Firewalls         func() do.FirewallsService
	CDNs              func() do.CDNsService
	Projects          func() do.ProjectsService
	Kubernetes        func() do.KubernetesService
	Databases         func() do.DatabasesService
	Registry          func() do.RegistryService
	VPCs              func() do.VPCsService
	OneClicks         func() do.OneClickService
	Apps              func() do.AppsService
	Monitoring        func() do.MonitoringService
	Serverless        func() do.ServerlessService
}

// NewCmdConfig creates an instance of a CmdConfig.
func NewCmdConfig(ns string, dc doctl.Config, out io.Writer, args []string, initGodo bool) (*CmdConfig, error) {

	cmdConfig := &CmdConfig{
		NS:   ns,
		Doit: dc,
		Out:  out,
		Args: args,

		initServices: func(c *CmdConfig) error {
			accessToken := c.getContextAccessToken()
			godoClient, err := c.Doit.GetGodoClient(Trace, accessToken)
			if err != nil {
				return fmt.Errorf("Unable to initialize DigitalOcean API client: %s", err)
			}

			c.Keys = func() do.KeysService { return do.NewKeysService(godoClient) }
			c.Sizes = func() do.SizesService { return do.NewSizesService(godoClient) }
			c.Regions = func() do.RegionsService { return do.NewRegionsService(godoClient) }
			c.Images = func() do.ImagesService { return do.NewImagesService(godoClient) }
			c.ImageActions = func() do.ImageActionsService { return do.NewImageActionsService(godoClient) }
			c.ReservedIPs = func() do.ReservedIPsService { return do.NewReservedIPsService(godoClient) }
			c.ReservedIPActions = func() do.ReservedIPActionsService { return do.NewReservedIPActionsService(godoClient) }
			c.Droplets = func() do.DropletsService { return do.NewDropletsService(godoClient) }
			c.DropletActions = func() do.DropletActionsService { return do.NewDropletActionsService(godoClient) }
			c.Domains = func() do.DomainsService { return do.NewDomainsService(godoClient) }
			c.Actions = func() do.ActionsService { return do.NewActionsService(godoClient) }
			c.Account = func() do.AccountService { return do.NewAccountService(godoClient) }
			c.Balance = func() do.BalanceService { return do.NewBalanceService(godoClient) }
			c.BillingHistory = func() do.BillingHistoryService { return do.NewBillingHistoryService(godoClient) }
			c.Invoices = func() do.InvoicesService { return do.NewInvoicesService(godoClient) }
			c.Tags = func() do.TagsService { return do.NewTagsService(godoClient) }
			c.Volumes = func() do.VolumesService { return do.NewVolumesService(godoClient) }
			c.VolumeActions = func() do.VolumeActionsService { return do.NewVolumeActionsService(godoClient) }
			c.Snapshots = func() do.SnapshotsService { return do.NewSnapshotsService(godoClient) }
			c.Certificates = func() do.CertificatesService { return do.NewCertificatesService(godoClient) }
			c.LoadBalancers = func() do.LoadBalancersService { return do.NewLoadBalancersService(godoClient) }
			c.Firewalls = func() do.FirewallsService { return do.NewFirewallsService(godoClient) }
			c.CDNs = func() do.CDNsService { return do.NewCDNsService(godoClient) }
			c.Projects = func() do.ProjectsService { return do.NewProjectsService(godoClient) }
			c.Kubernetes = func() do.KubernetesService { return do.NewKubernetesService(godoClient) }
			c.Databases = func() do.DatabasesService { return do.NewDatabasesService(godoClient) }
			c.Registry = func() do.RegistryService { return do.NewRegistryService(godoClient) }
			c.VPCs = func() do.VPCsService { return do.NewVPCsService(godoClient) }
			c.OneClicks = func() do.OneClickService { return do.NewOneClickService(godoClient) }
			c.Apps = func() do.AppsService { return do.NewAppsService(godoClient) }
			c.Monitoring = func() do.MonitoringService { return do.NewMonitoringService(godoClient) }
			c.Serverless = func() do.ServerlessService {
				return do.NewServerlessService(godoClient, getServerlessDirectory(), accessToken)
			}

			return nil
		},

		getContextAccessToken: func() string {
			context := Context
			if context == "" {
				context = viper.GetString("context")
			}
			token := ""

			switch context {
			case doctl.ArgDefaultContext:
				token = viper.GetString(doctl.ArgAccessToken)
			default:
				contexts := viper.GetStringMapString("auth-contexts")

				token = contexts[context]
			}

			return token
		},

		setContextAccessToken: func(token string) {
			context := Context
			if context == "" {
				context = viper.GetString("context")
			}

			switch context {
			case doctl.ArgDefaultContext:
				viper.Set(doctl.ArgAccessToken, token)
			default:
				contexts := viper.GetStringMapString("auth-contexts")
				contexts[context] = token

				viper.Set("auth-contexts", contexts)
			}
		},

		removeContext: func(context string) error {
			if context == "default" {
				viper.Set("access-token", "")
				return nil
			}

			contexts := viper.GetStringMapString("auth-contexts")

			_, ok := contexts[context]

			if !ok {
				return fmt.Errorf("Context not found")
			}

			delete(contexts, context)

			viper.Set("auth-contexts", contexts)

			return nil
		},

		componentBuilderFactory: &builder.DefaultComponentBuilderFactory{},
	}

	if initGodo {
		if err := cmdConfig.initServices(cmdConfig); err != nil {
			return nil, err
		}
	}

	return cmdConfig, nil
}

// CmdRunner runs a command and passes in a cmdConfig.
type CmdRunner func(*CmdConfig) error

// Display displays the output from a command.
func (c *CmdConfig) Display(d displayers.Displayable) error {
	dc := &displayers.Displayer{
		Item: d,
		Out:  c.Out,
	}

	columnList, err := c.Doit.GetString(c.NS, doctl.ArgFormat)
	if err != nil {
		return err
	}

	withHeaders, err := c.Doit.GetBool(c.NS, doctl.ArgNoHeader)
	if err != nil {
		return err
	}

	dc.NoHeaders = withHeaders
	dc.ColumnList = columnList
	dc.OutputType = Output

	return dc.Display()
}


text:
package org.hawkular.agent.monitor.protocol.dmr;

import java.io.IOException;

import org.hawkular.agent.monitor.config.AgentCoreEngineConfiguration.EndpointConfiguration;
import org.hawkular.agent.monitor.diagnostics.ProtocolDiagnostics;
import org.hawkular.agent.monitor.inventory.MonitoredEndpoint;
import org.hawkular.agent.monitor.inventory.ResourceTypeManager;
import org.hawkular.agent.monitor.protocol.Driver;
import org.hawkular.agent.monitor.protocol.EndpointService;
import org.hawkular.dmr.api.OperationBuilder;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.dmr.ModelNode;

/**
 * @author Peter Palaga
 * @see EndpointService
 */
public class DMREndpointService
        extends EndpointService<DMRNodeLocation, DMRSession> {

    public static String lookupServerIdentifier(ModelControllerClient client) throws IOException {
        ModelNode rootNode = OperationBuilder.readResource().includeRuntime().execute(client).assertSuccess()
                .getResultNode();

        // Remember we might be running in standalone mode, domain mode, or in a host controller.

        String hostName = null;
        if (rootNode.hasDefined("local-host-name")) {
            hostName = rootNode.get("local-host-name").asString();
        } else if (rootNode.hasDefined("host")) {
            hostName = rootNode.get("host").asString();
        }

        String serverName = null;
        if (rootNode.hasDefined("name")) {
            serverName = rootNode.get("name").asString();
        }

        // this is a new attribute that only exists in Wildfly 10 and up. If we can't get it, just use null.
        String uuid = rootNode.hasDefined("uuid") ? rootNode.get("uuid").asString() : null;

        String nodeName = System.getProperty("jboss.node.name");

        return getServerIdentifier(hostName, serverName, nodeName, uuid);
    }

    static String getServerIdentifier(String hostName, String serverName, String nodeName, String uuid) {
        if (uuid != null) {
            return uuid;
        } else {
            StringBuilder fullId = new StringBuilder();
            if (hostName != null && !hostName.isEmpty()) {
                if (fullId.length() > 0) {
                    fullId.append('.');
                }
                fullId.append(hostName);
            }
            if (serverName != null && !serverName.isEmpty()) {
                if (fullId.length() > 0) {
                    fullId.append('.');
                }
                fullId.append(serverName);
            }
            if (nodeName != null && !nodeName.isEmpty() && !nodeName.equals(serverName)) {
                if (fullId.length() > 0) {
                    fullId.append('.');
                }
                fullId.append(nodeName);
            }
            return fullId.toString();
        }
    }

    private final ModelControllerClientFactory modelControllerClientFactory;

    public DMREndpointService(String feedId, MonitoredEndpoint<EndpointConfiguration> endpoint,
            ResourceTypeManager<DMRNodeLocation> resourceTypeManager,
            ModelControllerClientFactory modelControllerClientFactory, ProtocolDiagnostics diagnostics) {
        super(feedId, endpoint, resourceTypeManager, new DMRLocationResolver(), diagnostics);
        this.modelControllerClientFactory = modelControllerClientFactory;
    }

    @Override
    public DMRSession openSession() {
        ModelControllerClient client = modelControllerClientFactory.createClient();
        Driver<DMRNodeLocation> driver = new DMRDriver(client, getMonitoredEndpoint(), getDiagnostics());
        return new DMRSession(getFeedId(), getMonitoredEndpoint(), getResourceTypeManager(), driver,
                getLocationResolver(), client);
    }

}


text:
var fibersVersion;
if (process.platform === "win32") {
  // We have a fork of fibers off of version 1.0.5 that searches farther for
  // the isolate thread. This problem is a result of antivirus programs messing
  // with the thread counts on Windows.
  // Duplicated in dev-bundle-tool-package.js
  fibersVersion = "https://github.com/meteor/node-fibers/tarball/d519f0c5971c33d99c902dad346b817e84bab001";
} else {
  fibersVersion = "1.0.5";
}

var packageJson = {
  name: "meteor-dev-bundle",
  // Version is not important but is needed to prevent warnings.
  version: "0.0.0",
  dependencies: {
    fibers: fibersVersion,
    "meteor-promise": "0.2.4",
    // Not yet upgrading Underscore from 1.5.2 to 1.7.0 (which should be done
    // in the package too) because we should consider using lodash instead
    // (and there are backwards-incompatible changes either way).
    underscore: "1.5.2",
    "source-map-support": "https://github.com/meteor/node-source-map-support/tarball/1912478769d76e5df4c365e147f25896aee6375e",
    semver: "4.1.0"
  },
  // These are only used in dev mode (by shell.js) so end-users can avoid
  // needing to install them if they use `npm install --production`.
  devDependencies: {
    // 2.4.0 (more or less, the package.json change isn't committed) plus our PR
    // https://github.com/williamwicks/node-eachline/pull/4
    eachline: "https://github.com/meteor/node-eachline/tarball/ff89722ff94e6b6a08652bf5f44c8fffea8a21da",
    chalk: "0.5.1"
  }
};

process.stdout.write(JSON.stringify(packageJson, null, 2) + '\n');


text:
FROM jetty:9-jre8-alpine
USER jetty:jetty

ADD ./target/hapi-fhir-jpaserver-local.war /var/lib/jetty/webapps/root.war
EXPOSE 8080


text:
We're modifying api and apiService.

Changes include:
* overriding of tags to organize new operations
* adding @UnitOfWork
* adding support for containerContext (for content negotiation) and user (for authorization)
* overriding of path
* override tags to GA4GHV20
* adding @JsonValue annotation to modelEnum

Updated selected templates to
Using https://github.com/swagger-api/swagger-codegen-generators/tree/v1.0.25/src/main/resources/handlebars/JavaJaxRS


text:
require 'thread'

class Shoes::TurtleCanvas < Shoes::Widget
  # default values
  WIDTH = 500
  HEIGHT = 500
  SPEED = 4 # power of two

  include Math
  DEG = PI / 180.0

  # para with the next command written on it
  attr_writer :next_command, :pen_info
  attr_accessor :speed # powers of two
  attr_reader :width, :height

  def initialize
    @width = WIDTH
    @height = WIDTH
    style width => @width, :height => @height
    @queue = Queue.new
    @image = image "#{HH::STATIC}/turtle.png"
    @image.transform :center
    @speed = SPEED
    @paused = true
    reset
    move_turtle_to_top
  end

  def start_draw
    @paused = false
    @speed = nil
    @image.hide
  end

  ### user commands ###

  def reset
    clear_orig
    @pendown = true
    @heading = 180*DEG # internal heading is rotated by 180 w.r.t user heading
    @pendown = true
    @turtle_angle = 180
    @bg_color = white
    @fg_color = black
    @pen_size = 1
    background_orig @bg_color
    stroke @fg_color
    strokewidth @pen_size
    update_position(@width/2, @height/2)
    update_turtle_heading
  end

  def forward len=100
    is_step
    x = len*sin(@heading) + @x
    y = len*cos(@heading) + @y
    if @pendown
      l = [@x, @y, x, y]
      line(*l)
    end
    update_position(x, y)
  end
  def backward len=100
    forward(-len)
  end
  def turnleft angle=90
    is_step
    @heading += angle*DEG
    @heading %= 2*PI
    update_turtle_heading
  end
  def turnright angle=90
    turnleft(-angle)
  end
  def setheading direction=180
    is_step
    direction += 180
    direction %= 360
    @heading = direction*DEG
    update_turtle_heading
  end
  def penup
    @pendown = false
  end
  def pendown
    is_step
    @pendown = true
  end
  def pendown?
    return @pendown
  end
  def goto x, y
    is_step
    update_position(x, y)
  end
  def center
    go(width/2, height/2)
  end
  def setx x
    is_step
    update_position(x, @y)
  end
  def sety y
    is_step
    update_position(@x, y)
  end
  def getx
    @x
  end
  def gety
    @y
  end
  def getposition
    [@x, @y]
  end
  def getheading
    degs = @heading/DEG
    degs += 180
    degs % 360
  end

  ### user commands already in shoes (the first two with another name ###

  def pencolor args
    is_step
    stroke args
    @fg_color = args
    update_pen_info
  end

  def pensize args
    is_step
    strokewidth args
    @pen_size = args
    update_pen_info
  end

  alias clear_orig clear
  alias background_orig background

  def clear *args
    in_step
    clear_orig *args
  end
  def background args
    is_step
    background_orig args
    move_turtle_to_top
    @bg_color = args
    update_pen_info
  end

  ## UI commands: should not be used by the user ##

  def step
    @queue.enq nil
  end

  def toggle_pause
    @paused = !@paused
    if !@paused
      @speed = SPEED if @speed.nil?
      step
    end
    @paused # return value
  end

  def save filename
    _snapshot :filename => filename, :format => :pdf
  end

private
  def update_position x, y
    @x, @y = x, y
    @image.move(x.round - 16, y.round - 16) unless drawing?
  end

  def update_turtle_heading
    # update turtle image
    angle_in_degrees = @heading/DEG
    diff = (angle_in_degrees - @turtle_angle).round
    @turtle_angle += diff
    @image.rotate(diff) unless drawing?
  end

  def move_turtle_to_top
    return if drawing?
    s = @image.style
    @image = image "#{HH::STATIC}/turtle.png"
    @image.style s
  end

  def is_step
    return if drawing?
    display
    if @paused
      # wait for step
      @queue.deq
    else
      sleep 1.0/@speed
      if @paused # if it got paused in the meantime
        @queue.deq
      end
    end
  end

  def display
    method = nil
    bt = caller
    1.upto 4 do |i|
      m = bt[i][/`([^']*)'/, 1]
      if m.nil? || m =~ /^block /
        break
      else
        method = m
      end
    end
    @next_command.replace(method)
  end

  # false if drawing directly the final result
  def drawing?
    @speed.nil? and not @paused
  end

  def update_pen_info
    @pen_info.append do
      background_orig @bg_color
      line 5, 10, 35, 10, :stroke => @fg_color, :strokewidth => @pen_size
    end if @pen_info
  end
end

module Turtle
  def self.draw opts={}, &blk
    opts[:draw] = true
    start opts, &blk
  end

  def self.start opts={}, &blk
    w = opts[:width] || Shoes::TurtleCanvas::WIDTH
    h = opts[:height] || Shoes::TurtleCanvas::HEIGHT
    opts[:width] = w + 20
    opts[:height] = h + ( opts[:draw]? 60 : 130)

    Shoes.app opts do
      extend Turtle # add methods back (after self changed)
      @block = blk

      unless opts[:draw]
        para "pen: "
        @pen_info = stack :top => 5, :width => 40, :height => 20 do
          background white
          line 5, 10, 35, 10
        end
      end

      glossb "save...", :color => 'dark', :right => '-0px', :width => 100 do
        filename = ask_save_file
        unless filename.nil?
          filename += '.pdf' unless filename =~ /\.pdf$/
          @canvas.save filename
        end
      end

      stack :height => h + 20 do
        background gray
        stack :top => 10, :left => 10, :width => w, :height => h do
          shape do
            background white
            @canvas = turtle_canvas
          end
        end
      end

      if opts[:draw]
        draw_all
      else
        draw_controls
        @interactive_thread = Thread.new do
          sleep 0.1 # HACK
          @canvas.instance_eval &blk
          @next_command.replace("(END)")
        end
      end
    end
  end

private
  def execute_canvas_code blk
    @canvas.instance_eval do
      shape do
        self.instance_eval &blk
      end
    end
  end

  def draw_controls
    flow do
      stack do
        flow do
          para "next command: "
          @next_command = para 'start', :font => 'Liberation Mono'
          @canvas.next_command = @next_command
        end
      end
      glossb "execute", :color => 'dark', :width => 100, :right => '-0px' do
        @canvas.step
      end
    end

    flow do
      glossb "slower", :color => 'dark', :width => 100 do
        @canvas.speed /= 2 if @canvas.speed > 2
      end
      @toggle_pause = glossb "play", :color => 'dark', :width => 100 do
        paused = @canvas.toggle_pause
        if paused
          @toggle_pause.text = 'play'
        else
          @toggle_pause.text = 'pause'
        end
      end
      glossb "faster", :color => 'dark', :width => 100 do
        @canvas.speed *= 2
      end
      glossb "draw all", :color => 'dark', :right => '-0px', :width => 100 do
        @interactive_thread.kill
        @canvas.reset
        @next_command.replace("(draw all)")
        draw_all
      end
    end
    @canvas.pen_info = @pen_info
  end

  def draw_all
    timer 0.1 do
      @canvas.start_draw
      execute_canvas_code @block
    end
  end
end


text:
<?php

namespace Antares\Foundation\Providers;

use Antares\Model\Role;
use Antares\Model\User;
use Antares\Model\Action;
use Antares\Model\UserRole;
use Antares\Model\Component;
use Antares\Model\Permission;
use Illuminate\Support\ServiceProvider;
use Antares\Foundation\Publisher\PublisherManager;

class SupportServiceProvider extends ServiceProvider
{

    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->registerPublisher();

        $this->registerRoleEloquent();

        $this->registerComponentEloquent();

        $this->registerActionComponentEloquent();

        $this->registerUserRoleEloquent();

        $this->registerComponentPermissionEloquent();

        $this->registerUserEloquent();
    }

    /**
     * Register the service provider for publisher.
     *
     * @return void
     */
    protected function registerPublisher()
    {
        $this->app->singleton('antares.publisher', function ($app) {
            $memory = $app->make('antares.platform.memory');

            return (new PublisherManager($app))->attach($memory);
        });
    }

    /**
     * Register the service provider for component.
     *
     * @return void
     */
    protected function registerComponentEloquent()
    {
        $this->app->bind('antares.component', function () {
            return new Component();
        });
    }

    /**
     * Register the service provider for component.
     *
     * @return void
     */
    protected function registerActionComponentEloquent()
    {
        $this->app->bind('antares.component.action', function () {
            return new Action();
        });
    }

    /**
     * Register the service provider for roles.
     *
     * @return void
     */
    protected function registerRoleEloquent()
    {
        $this->app->bind('antares.role', function () {
            return new Role();
        });
    }

    /**
     * Register the service provider for component permission.
     *
     * @return void
     */
    public function registerComponentPermissionEloquent()
    {
        $this->app->bind('antares.component.permission', function () {
            return new Permission();
        });
    }

    /**
     * Register the service provider for user.
     *
     * @return void
     */
    protected function registerUserEloquent()
    {
        $this->app->bind('antares.user', function () {
            return new User();
        });
    }

    /**
     * Register the service provider for user roles.
     *
     * @return void
     */
    protected function registerUserRoleEloquent()
    {
        $this->app->bind('antares.user.role', function () {
            return new UserRole();
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return [
            'antares.publisher', 'antares.role', 'antares.user',
        ];
    }

}


text:
#ifndef QNETWORKACCESSMANAGER_P_H
#define QNETWORKACCESSMANAGER_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists for the convenience
// of the Network Access API.  This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//

#include "qnetworkaccessmanager.h"
#include "qnetworkaccesscache_p.h"
#include "qnetworkaccessbackend_p.h"
#include "private/qobject_p.h"
#include "QtNetwork/qnetworkproxy.h"
#include "QtNetwork/qnetworksession.h"
#include "qnetworkaccessauthenticationmanager_p.h"
#ifndef QT_NO_BEARERMANAGEMENT
#include "QtNetwork/qnetworkconfigmanager.h"
#endif

QT_BEGIN_NAMESPACE

class QAuthenticator;
class QAbstractNetworkCache;
class QNetworkAuthenticationCredential;
class QNetworkCookieJar;

class QNetworkAccessManagerPrivate: public QObjectPrivate
{
public:
    QNetworkAccessManagerPrivate()
        : networkCache(0), cookieJar(0),
          httpThread(0),
#ifndef QT_NO_NETWORKPROXY
          proxyFactory(0),
#endif
#ifndef QT_NO_BEARERMANAGEMENT
          lastSessionState(QNetworkSession::Invalid),
          networkConfiguration(networkConfigurationManager.defaultConfiguration()),
          customNetworkConfiguration(false),
          networkSessionRequired(networkConfigurationManager.capabilities()
                                 & QNetworkConfigurationManager::NetworkSessionRequired),
          networkAccessible(QNetworkAccessManager::Accessible),
          activeReplyCount(0),
          online(false),
          initializeSession(true),
#endif
          cookieJarCreated(false),
          authenticationManager(new QNetworkAccessAuthenticationManager)
    { }
    ~QNetworkAccessManagerPrivate();

    void _q_replyFinished();
    void _q_replyEncrypted();
    void _q_replySslErrors(const QList<QSslError> &errors);
    QNetworkReply *postProcess(QNetworkReply *reply);
    void createCookieJar() const;

    void authenticationRequired(QAuthenticator *authenticator,
                                QNetworkReply *reply,
                                bool synchronous,
                                QUrl &url,
                                QUrl *urlForLastAuthentication,
                                bool allowAuthenticationReuse = true);
    void cacheCredentials(const QUrl &url, const QAuthenticator *auth);
    QNetworkAuthenticationCredential *fetchCachedCredentials(const QUrl &url,
                                                             const QAuthenticator *auth = 0);

#ifndef QT_NO_NETWORKPROXY
    void proxyAuthenticationRequired(const QUrl &url,
                                const QNetworkProxy &proxy,
                                bool synchronous,
                                QAuthenticator *authenticator,
                                QNetworkProxy *lastProxyAuthentication);
    void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth);
    QNetworkAuthenticationCredential *fetchCachedProxyCredentials(const QNetworkProxy &proxy,
                                                             const QAuthenticator *auth = 0);
    QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query);
#endif

    QNetworkAccessBackend *findBackend(QNetworkAccessManager::Operation op, const QNetworkRequest &request);
    QStringList backendSupportedSchemes() const;

#ifndef QT_NO_BEARERMANAGEMENT
    void createSession(const QNetworkConfiguration &config);
    QSharedPointer<QNetworkSession> getNetworkSession() const;

    void _q_networkSessionClosed();
    void _q_networkSessionNewConfigurationActivated();
    void _q_networkSessionPreferredConfigurationChanged(const QNetworkConfiguration &config,
                                                        bool isSeamless);
    void _q_networkSessionStateChanged(QNetworkSession::State state);
    void _q_onlineStateChanged(bool isOnline);
#endif

    QNetworkRequest prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart);

    // this is the cache for storing downloaded files
    QAbstractNetworkCache *networkCache;

    QNetworkCookieJar *cookieJar;

    QThread *httpThread;

#ifndef QT_NO_NETWORKPROXY
    QNetworkProxy proxy;
    QNetworkProxyFactory *proxyFactory;
#endif

#ifndef QT_NO_BEARERMANAGEMENT
    QSharedPointer<QNetworkSession> networkSessionStrongRef;
    QWeakPointer<QNetworkSession> networkSessionWeakRef;
    QNetworkSession::State lastSessionState;
    QNetworkConfigurationManager networkConfigurationManager;
    QNetworkConfiguration networkConfiguration;
    // we need to track whether the user set a config or not,
    // because the default config might change
    bool customNetworkConfiguration;
    bool networkSessionRequired;
    QNetworkAccessManager::NetworkAccessibility networkAccessible;
    int activeReplyCount;
    bool online;
    bool initializeSession;
#endif

    bool cookieJarCreated;

    // The cache with authorization data:
    QSharedPointer<QNetworkAccessAuthenticationManager> authenticationManager;

    // this cache can be used by individual backends to cache e.g. their TCP connections to a server
    // and use the connections for multiple requests.
    QNetworkAccessCache objectCache;
    static inline QNetworkAccessCache *getObjectCache(QNetworkAccessBackend *backend)
    { return &backend->manager->objectCache; }
    Q_AUTOTEST_EXPORT static void clearCache(QNetworkAccessManager *manager);
#ifndef QT_NO_BEARERMANAGEMENT
    Q_AUTOTEST_EXPORT static const QWeakPointer<const QNetworkSession> getNetworkSession(const QNetworkAccessManager *manager);
#endif
    Q_DECLARE_PUBLIC(QNetworkAccessManager)
};

QT_END_NAMESPACE

#endif