text:
package vg.civcraft.mc.citadel.playerstate;

import org.bukkit.ChatColor;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import vg.civcraft.mc.citadel.Citadel;
import vg.civcraft.mc.citadel.CitadelUtility;
import vg.civcraft.mc.citadel.ReinforcementLogic;
import vg.civcraft.mc.citadel.reinforcementtypes.ReinforcementType;
import vg.civcraft.mc.namelayer.group.Group;

public class FortificationState extends AbstractPlayerState {

	private final ReinforcementType type;
	private final Group group;

	public FortificationState(Player player, ReinforcementType type, Group group) {
		super(player);
		this.type = type;
		this.group = group;
	}

	public Group getGroup() {
		return group;
	}

	@Override
	public String getName() {
		return "Fortifying mode with " + ChatColor.AQUA + type.getName() + ChatColor.YELLOW + " on "
				+ ChatColor.LIGHT_PURPLE + group.getName();
	}

	public ReinforcementType getType() {
		return type;
	}

	@Override
	public void handleBlockPlace(BlockPlaceEvent event) {
		Player player = event.getPlayer();
		Block block = event.getBlock();
		// Prevent double reinforcement (slabs)
		if (ReinforcementLogic.getReinforcementAt(block.getLocation()) != null) {
			return;
		}
		if (CitadelUtility.attemptReinforcementCreation(block, type, group, player)) { // true == fail
			Citadel.getInstance().getStateManager().setState(player, null);
			event.setCancelled(true);
			//return;
		}
	}

	@Override
	public void handleInteractBlock(PlayerInteractEvent event) { }

	@Override
	public boolean equals(Object other) {
		if (!(other instanceof FortificationState)) {
			return false;
		}
		FortificationState fort = (FortificationState) other;
		return fort.type == this.type && fort.group.getName().equals(this.getGroup().getName());
	}

	@Override
	public String getOverlayText() {
		return String.format("%sCTF %s%s %s%s", ChatColor.GOLD, ChatColor.LIGHT_PURPLE, group.getName(), ChatColor.AQUA,
				type.getName());
	}
}


text:
"use strict";

var React = require('react');
var $ = require('jQuery');

var RowComponent = require('./row');
var Dispatcher = require('./dispatcher');
var Helpers = require('./helpers');

var SpreadsheetComponent = React.createClass({displayName: "SpreadsheetComponent",
    spreadsheetId: null,

    /**
     * React 'getInitialState' method
     */
    getInitialState: function() {
        var initialData = this.props.initialData || {};

        if (!initialData.rows) {
            initialData.rows = [];

            for (var i = 0; i < this.props.config.rows; i = i + 1) {
                initialData.rows[i] = [];
                for (var ci = 0; ci < this.props.config.columns; ci = ci + 1) {
                    initialData.rows[i][ci] = '';
                }
            }
        }

        return {
            data: initialData,
            selected: null,
            lastBlurred: null,
            selectedElement: null,
            editing: false
        };
    },

    /**
     * React 'componentDidMount' method
     */
    componentDidMount: function () {
        this.bindKeyboard();

        $('body').on('focus', 'input', function (e) {
            $(this)
                .one('mouseup', function () {
                    $(this).select();
                    return false;
                })
                .select();
        });
    },

    /**
     * React Render method
     * @return {[JSX]} [JSX to render]
     */
    render: function() {
        var data = this.state.data,
            config = this.props.config,
            _cellClasses = this.props.cellClasses,
            rows = [], key, i, cellClasses;

        this.spreadsheetId = this.spreadsheetId || Helpers.makeSpreadsheetId();

        // Sanity checks
        if (!data.rows && !config.rows) {
            return console.error('Table Component: Number of colums not defined in both data and config!');
        }

        // Create Rows
        for (i = 0; i < data.rows.length; i = i + 1) {
            key = 'row_' + i;
            cellClasses = (_cellClasses && _cellClasses.rows && _cellClasses.rows[i]) ? _cellClasses.rows[i] : null;

            rows.push(React.createElement(RowComponent, {cells: data.rows[i],
                                    cellClasses: cellClasses,
                                    uid: i,
                                    key: key,
                                    config: config,
                                    selected: this.state.selected,
                                    editing: this.state.editing,
                                    handleSelectCell: this.handleSelectCell,
                                    handleDoubleClickOnCell: this.handleDoubleClickOnCell,
                                    handleCellBlur: this.handleCellBlur,
                                    onCellValueChange: this.handleCellValueChange,
                                    spreadsheetId: this.spreadsheetId,
                                    className: "cellComponent"}));
        }

        return (
            React.createElement("table", {tabIndex: "0", "data-spreasheet-id": this.spreadsheetId},
                React.createElement("tbody", null,
                    rows
                )
            )
        );
    },

    /**
     * Binds the various keyboard events dispatched to table functions
     */
    bindKeyboard: function () {
        Dispatcher.setupKeyboardShortcuts($(React.findDOMNode(this))[0], this.spreadsheetId);

        Dispatcher.subscribe('up_keyup', function(data)  {
            this.navigateTable('up', data);
        }.bind(this), this.spreadsheetId);
        Dispatcher.subscribe('down_keyup', function(data)  {
            this.navigateTable('down', data);
        }.bind(this), this.spreadsheetId);
        Dispatcher.subscribe('left_keyup', function(data)  {
            this.navigateTable('left', data);
        }.bind(this), this.spreadsheetId);
        Dispatcher.subscribe('right_keyup', function(data)  {
            this.navigateTable('right', data);
        }.bind(this), this.spreadsheetId);
        Dispatcher.subscribe('tab_keyup', function(data)  {
            this.navigateTable('right', data, null, true);
        }.bind(this), this.spreadsheetId);

        // Prevent brower's from jumping to URL bar
        Dispatcher.subscribe('tab_keydown', function(data)  {
            if ($(document.activeElement) && $(document.activeElement)[0].tagName === 'INPUT') {
                if (data.preventDefault) {
                    data.preventDefault();
                } else {
                    // Oh, old IE, you 💩
                    data.returnValue = false;
                }
            }
        }, this.spreadsheetId);

        Dispatcher.subscribe('remove_keydown', function(data)  {
            if (!$(data.target).is('input, textarea')) {
                if (data.preventDefault) {
                    data.preventDefault();
                } else {
                    // Oh, old IE, you 💩
                    data.returnValue = false;
                }
            }
        }, this.spreadsheetId);

        Dispatcher.subscribe('enter_keyup', function()  {
            if (this.state.selectedElement) {
                this.setState({editing: !this.state.editing});
            }
            $(React.findDOMNode(this)).first().focus();
        }.bind(this), this.spreadsheetId);

        // Go into edit mode when the user starts typing on a field
        Dispatcher.subscribe('letter_keydown', function()  {
            if (!this.state.editing && this.state.selectedElement) {
                Dispatcher.publish('editStarted', this.state.selectedElement, this.spreadsheetId);
                this.setState({editing: true});
            }
        }.bind(this), this.spreadsheetId);

        // Delete on backspace and delete
        Dispatcher.subscribe('remove_keyup', function()  {
            if (this.state.selected && !Helpers.equalCells(this.state.selected, this.state.lastBlurred)) {
                this.handleCellValueChange(this.state.selected, '');
            }
        }.bind(this), this.spreadsheetId);
    },

    /**
     * Navigates the table and moves selection
     * @param  {string} direction                               [Direction ('up' || 'down' || 'left' || 'right')]
     * @param  {Array: [number: row, number: cell]} originCell  [Origin Cell]
     * @param  {boolean} inEdit                                 [Currently editing]
     */
    navigateTable: function (direction, data, originCell, inEdit) {
        // Only traverse the table if the user isn't editing a cell,
        // unless override is given
        if (!inEdit && this.state.editing) {
            return false;
        }

        // Use the curently active cell if one isn't passed
        if (!originCell) {
            originCell = this.state.selectedElement;
        }

        // Prevent default
        if (data.preventDefault) {
            data.preventDefault();
        } else {
            // Oh, old IE, you 💩
            data.returnValue = false;
        }

        var $origin = $(originCell),
            cellIndex = $origin.index(),
            target;

        if (direction === 'up') {
            target = $origin.closest('tr').prev().children().eq(cellIndex).find('span');
        } else if (direction === 'down') {
            target = $origin.closest('tr').next().children().eq(cellIndex).find('span');
        } else if (direction === 'left') {
            target = $origin.closest('td').prev().find('span');
        } else if (direction === 'right') {
            target = $origin.closest('td').next().find('span');
        }

        if (target.length > 0) {
            target.click();
        } else {
            this.extendTable(direction, originCell);
        }
    },

    /**
     * Extends the table with an additional row/column, if permitted by config
     * @param  {string} direction [Direction ('up' || 'down' || 'left' || 'right')]
     */
    extendTable: function (direction) {
        var config = this.props.config,
            data = this.state.data,
            newRow, i;

        if (direction === 'down' && config.canAddRow) {
            newRow = [];

            for (i = 0; i < this.state.data.rows[0].length; i = i + 1) {
                newRow[i] = '';
            }

            data.rows.push(newRow);
            Dispatcher.publish('rowCreated', data.rows.length, this.spreadsheetId);
            return this.setState({data: data});
        }

        if (direction === 'right' && config.canAddColumn) {
            for (i = 0; i < data.rows.length; i = i + 1) {
                data.rows[i].push('');
            }

            Dispatcher.publish('columnCreated', data.rows[0].length, this.spreadsheetId);
            return this.setState({data: data});
        }

    },

    /**
     * Callback for 'selectCell', updating the selected Cell
     * @param  {Array: [number: row, number: cell]} cell [Selected Cell]
     * @param  {object} cellElement [Selected Cell Element]
     */
    handleSelectCell: function (cell, cellElement) {
        Dispatcher.publish('cellSelected', cell, this.spreadsheetId);
        $(React.findDOMNode(this)).first().focus();

        this.setState({
            selected: cell,
            selectedElement: cellElement
        });
    },

    /**
     * Callback for 'cellValueChange', updating the cell data
     * @param  {Array: [number: row, number: cell]} cell [Selected Cell]
     * @param  {object} newValue                         [Value to set]
     */
    handleCellValueChange: function (cell, newValue) {
        var data = this.state.data,
            row = cell[0],
            column = cell[1],
            oldValue = data.rows[row][column];

        Dispatcher.publish('cellValueChanged', [cell, newValue, oldValue], this.spreadsheetId);

        data.rows[row][column] = newValue;
        this.setState({
            data: data
        });

        Dispatcher.publish('dataChanged', data, this.spreadsheetId);
    },

    /**
     * Callback for 'doubleClickonCell', enabling 'edit' mode
     */
    handleDoubleClickOnCell: function () {
        this.setState({
            editing: true
        });
    },

    /**
     * Callback for 'cellBlur'
     */
    handleCellBlur: function (cell) {
        if (this.state.editing) {
            Dispatcher.publish('editStopped', this.state.selectedElement);
        }

        this.setState({
            editing: false,
            lastBlurred: cell
        });
    }
});

module.exports = SpreadsheetComponent;

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NINJA: NINJA/BinaryHeap_IntKey_TwoInts.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

NINJA
    2.x

Functions

BinaryHeap_IntKey_TwoInts.cpp File Reference

#include "BinaryHeap_IntKey_TwoInts.hpp"

Functions

bool 	compare3Ints (ints3 x, ints3 y)

int 	compareMyType2 (const void *a, const void *b)

Function Documentation

◆ compare3Ints()

          bool compare3Ints
          (
          ints3
          x,

          ints3
          y

          )

◆ compareMyType2()

          int compareMyType2
          (
          const void *
          a,

          const void *
          b

          )

NINJA

BinaryHeap_IntKey_TwoInts.cpp

Generated by

     1.8.18


text:
/* global _, rulesByCollection:true, addFuncForAll:true, ensureCreated:true, ensureDefaultAllow:true */

rulesByCollection = {};

var created = {
  allow: {
    insert: {},
    update: {},
    remove: {},
    download: {} // for use with CollectionFS packages
  },
  deny: {
    insert: {},
    update: {},
    remove: {},
    download: {} // for use with CollectionFS packages
  }
};

/**
 * Adds the given function as an allow or deny function for all specified collections and types.
 * @param {Array(Mongo.Collection)} collections Array of Mongo.Collection instances
 * @param {String}                  allowOrDeny "allow" or "deny"
 * @param {Array(String)}           types       Array of types ("insert", "update", "remove")
 * @param {Array(String)|null}      fetch       `fetch` property to use
 * @param {Function}                func        The function
 */
addFuncForAll = function addFuncForAll(collections, allowOrDeny, types, fetch, func) {
  // We always disable transformation, but we transform for specific
  // rules upon running our deny function if requested.
  var rules = {transform: null};
  if (_.isArray(fetch)) {
    rules.fetch = fetch;
  }
  _.each(types, function (t) {
    rules[t] = func;
  });
  _.each(collections, function (c) {
    c[allowOrDeny](rules);
  });
};

/**
 * Creates the allow or deny function for the given collections if not already created. This ensures that this package only ever creates up to one allow and one deny per collection.
 * @param   {String}                  allowOrDeny "allow" or "deny"
 * @param   {Array(Mongo.Collection)} collections An array of collections
 * @param   {Array(String)}           types       An array of types ("insert", "update", "remove")
 * @param   {Array(String)|null}      fetch       `fetch` property to use
 * @param   {Function}                func        The function
 */
ensureCreated = function ensureCreated(allowOrDeny, collections, types, fetch, func) {
  _.each(types, function (t) {
    collections = _.reject(collections, function (c) {
      return _.has(created[allowOrDeny][t], c._name);
    });
    addFuncForAll(collections, allowOrDeny, [t], null, func);
    // mark that we've defined function for collection-type combo
    _.each(collections, function (c) {
      created[allowOrDeny][t][c._name] = true;
    });
  });
};

/**
 * Sets up default allow functions for the collections and types.
 * @param   {Array(Mongo.Collection)} collections Array of Mongo.Collection instances
 * @param   {Array(String)}           types       Array of types ("insert", "update", "remove")
 */
ensureDefaultAllow = function ensureDefaultAllow(collections, types) {
  ensureCreated("allow", collections, types, [], function () {
    return true;
  });
};


text:
package com.thoughtworks.go.server.database.pg;

import com.thoughtworks.go.server.database.migration.AbstractMigratorIntegrationTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.testcontainers.containers.JdbcDatabaseContainer;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

@Testcontainers
@EnabledOnOs({OS.LINUX, OS.MAC})
class DatabaseMigratorPostgreSQLTest extends AbstractMigratorIntegrationTest {
    @Container
    private final JdbcDatabaseContainer postgresqlContainer = new PostgreSQLContainer("postgres:12");

    @Test
    void shouldMigrate() throws Exception {
        migrate(postgresqlContainer,
                "SELECT\n" +
                        "    table_schema || '.' || table_name\n" +
                        "FROM\n" +
                        "    information_schema.tables\n" +
                        "WHERE\n" +
                        "    table_type = 'BASE TABLE'\n" +
                        "AND\n" +
                        "    table_schema NOT IN ('pg_catalog', 'information_schema');", postgresqlContainer.getUsername(), postgresqlContainer.getPassword());
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.ObjectModel;
using System.IO;
using System.Drawing;
using System.Windows.Controls.Primitives;
using ContentManager;
using System.Windows.Input;
using System.Net;
using System.Web;
using System.Collections.Specialized;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;

namespace CloudUSB
{
    public partial class MainWindow : MetroWindow
    {

        Boolean cutFlag = false;
        Boolean copyFlag = false;

        string cFilePath = "";

        string fileName = "";

        string fileExistCheck(string destFile)
        {
            if (!System.IO.Path.GetExtension(destFile).Equals(""))
            {
                string[] splitStr = destFile.Split('.');
                int splitStrLeng = splitStr.Length;
                string targetPath = destFile;
                string copyStr = "";

                for (int i = 0; i < splitStr.Length - 2; i++)
                {
                    copyStr += splitStr[i];
                    copyStr += '.';
                }
                copyStr += splitStr[splitStrLeng - 2];
                copyStr += " - 복사본";
                string fileNamePlus = copyStr;
                copyStr += '.';
                copyStr += splitStr[splitStrLeng - 1]; //확장자 붙이기

                //"파일명 - 복사본"이 존재하지 않으면
                if (!(File.Exists(copyStr)))
                {
                    return copyStr; //" - 복사본" 붙이기
                }
                else
                {
                    int count = 1;
                    string returnPath = "";
                    do
                    {
                        returnPath = fileNamePlus + "(" + count + ").";
                        returnPath += splitStr[splitStrLeng - 1];
                        count++;

                    } while (File.Exists(returnPath));

                    return returnPath;
                }
            }
            else
            {
                string targetPath = destFile;
                string copyStr = destFile + " - 복사본";
                //"파일명 - 복사본"이 존재하지 않으면
                if (!(File.Exists(copyStr)))
                {
                    return copyStr; //" - 복사본" 붙이기
                }
                else
                {
                    int count = 1;
                    string returnPath = "";
                    do
                    {
                        returnPath = copyStr + "(" + count + ")";
                        count++;

                    } while (File.Exists(returnPath));

                    return returnPath;
                }
            }

        }
        string folderExistCheck(string destFolder)
        {
            string targetPath = destFolder;
            string copyStr = targetPath + " - 복사본";

            //"폴더명 - 복사본"이 존재하지 않으면
            if (!(Directory.Exists(copyStr)))
            {
                return copyStr; //" - 복사본" 붙이기
            }
            else
            {
                int count = 1;
                string returnPath = "";
                do
                {
                    returnPath = copyStr + "(" + count + ")";
                    count++;

                } while(Directory.Exists(returnPath));

                return returnPath;
            }
        }
        //복사 모듈
        void CopyModule(string _tagetFile, string _originFullPath, string _nowPathRoot)
        {
            string targetFile = _tagetFile;
            string originFullPath = _originFullPath;
            string nowPathRoot = _nowPathRoot;

            try
            {
                if (Directory.Exists(originFullPath) || File.Exists(originFullPath))
                {
                    //선택 대상이 폴더라면
                    if ((File.GetAttributes(originFullPath) & FileAttributes.Directory) == FileAttributes.Directory)
                    {

                        //폴더 만들기
                        if (!(Directory.Exists(targetFile)))
                        {
                            Directory.CreateDirectory(targetFile);
                            nowPathRoot = targetFile;
                        }
                        else
                        {
                            targetFile = folderExistCheck(targetFile);
                            Directory.CreateDirectory(targetFile);
                            nowPathRoot = targetFile;
                        }

                        //폴더 안의 파일 만들기

                        string[] files = Directory.GetFileSystemEntries(originFullPath);

                        foreach (string s in files)
                        {
                            string subTargetFile = "";
                            string subOrigincFullPath = "";
                            string subNowPathRoot = "";
                            //폴더
                            if ((File.GetAttributes(s) & FileAttributes.Directory) == FileAttributes.Directory)
                            {
                                //재귀
                                subTargetFile = nowPathRoot + "\\" + System.IO.Path.GetFileName(s);
                                subOrigincFullPath = s;
                                subNowPathRoot = nowPathRoot;

                                CopyModule(subTargetFile, subOrigincFullPath, subNowPathRoot);
                            }
                            //파일
                            else
                            {
                                subTargetFile = nowPathRoot + "\\" + System.IO.Path.GetFileName(s);
                                subOrigincFullPath = s;
                                subNowPathRoot = nowPathRoot;

                                CopyModule(subTargetFile, subOrigincFullPath, subNowPathRoot);
                            }
                        }
                    }
                    //선택 대상이 파일이라면
                    else
                    {
                        //목적지에 파일이 존재하지 않으면 파일 이름 그대로 복사
                        if (!File.Exists(targetFile))
                        {
                            System.IO.File.Copy(originFullPath, targetFile);
                        }
                        //파일 존재하면, 복사본 붙이기
                        else
                        {
                            string temp = "";
                            temp += fileExistCheck(targetFile);
                            System.IO.File.Copy(originFullPath, temp);
                        }
                    }
                }

            }
            catch (Exception eee)
            {
                MessageBox.Show(eee.Message);
            }
            return;
        }
        bool targetCheck(string origin, string target)
        {
            if (!(target.Equals(origin)) && target.Contains(origin))
                return true;
            return false;
        }
        //붙여넣기
        private async void ContextMenu_Paste(object sender, RoutedEventArgs e)
        {
            string desFileName = "";
            if (isClipboardData == true)
            {
                desFileName = nowPath + "\\" + clipboardFileName;
            }
            else
            {
                desFileName = nowPath + "\\" + fileName;
            }

            if (copyFlag == true || (isClipboardData == true && copyClipboard == true))
            {
                //타겟대상이 원본대상의 하위일때
                if (targetCheck(cFilePath, desFileName))
                {
                    await this.ShowMessageAsync("중단된 작업", "대상 폴더가 원본 폴더의 하위 폴더입니다");
                }
                else
                {
                    //(string _tagetFile, string _originFullPath, string _nowPathRoot)
                    CopyModule(desFileName, cFilePath, nowPath);
                    Refresh(nowPath);
                }

                copyFlag = false;
                copyClipboard = false;

                clipboardFileName = "";
                clipboardFullPath = "";
            }
            else if (cutFlag == true || (isClipboardData == true && cutClipboard == true))
            {
                try
                {
                    //폴더라면
                    if ((File.GetAttributes(cFilePath) & FileAttributes.Directory) == FileAttributes.Directory)
                    {
                        //타겟대상이 원본대상의 하위일때
                        if (targetCheck(cFilePath, desFileName))
                        {
                            await this.ShowMessageAsync("중단된 작업", "대상 폴더가 원본 폴더의 하위 폴더입니다");
                        }
                        else
                        {
                            if (Directory.Exists(desFileName))
                            {
                                MessageDialogResult result =
                                    await this.ShowMessageAsync
                                    ("파일이 이미 존재합니다", "덮어쓰시겠습니까?",
                                    MessageDialogStyle.AffirmativeAndNegative);

                                if (result.Equals(MessageDialogResult.Affirmative))
                                {
                                    System.IO.Directory.Delete(desFileName, true);
                                    System.IO.Directory.Move(cFilePath, desFileName);
                                }
                            }
                            else
                            {
                                System.IO.Directory.Move(cFilePath, desFileName);
                            }
                        }
                    }
                    //파일이라면
                    else
                    {
                        if (File.Exists(desFileName))
                        {
                            MessageDialogResult result = await this.ShowMessageAsync("파일이 이미 존재합니다", "덮어쓰시겠습니까?", MessageDialogStyle.AffirmativeAndNegative);

                            if (result.Equals(MessageDialogResult.Affirmative))
                            {
                                System.IO.File.Delete(desFileName);
                                System.IO.File.Move(cFilePath, desFileName);
                            }
                        }
                        else
                        {
                            System.IO.File.Move(cFilePath, desFileName);
                        }
                    }
                }
                catch (Exception eee)
                {
                    MessageBox.Show(eee.Message);
                    //Console.WriteLine(eee.Message);
                }
                finally
                {
                    Refresh(nowPath);
                }
                cutFlag = false;
                cutClipboard = false;
                Clipboard.Clear(); //
                isClipboardData = false;//
            }
            cFilePath = "";
            //isClipboardData = false;
            //Clipboard.Clear();
        }

        //잘라내기
        private void ContextMenu_Cut(object sender, RoutedEventArgs e)
        {
            int selectedItemCnt = AllFileList.SelectedItems.Count;
            //타겟 파일을 클릭 했을 경우만
            if (selectedItemCnt > 0)
            {
                try // FileNotFoundException
                {
                    cFilePath = ((FileData)AllFileList.SelectedItems[0]).FullPathStr;
                    fileName = ((FileData)AllFileList.SelectedItems[0]).FileName;
                    cutFlag = true;

                    StringCollection FileCollection = new StringCollection();
                    FileCollection.Add(((FileData)AllFileList.SelectedItems[0]).FullPathStr);

                    //클립보드에 데이터 셋팅
                    Clipboard.SetFileDropList(FileCollection);
                    cutClipboard = true;
                }
                catch (FileNotFoundException eee)
                {
                    System.Windows.MessageBox.Show(eee.Message);
                }
            }

        }

        //복사하기
        private void ContextMenu_Copy(object sender, RoutedEventArgs e)
        {

            int selectedItemCnt = AllFileList.SelectedItems.Count;
            //타겟 파일을 클릭 했을 경우만
            if (selectedItemCnt > 0)
            {
                try // FileNotFoundException
                {
                   // MenuItem mi = sender as MenuItem;
                    cFilePath = ((FileData)AllFileList.SelectedItems[0]).FullPathStr;
                    copyFlag = true;
                    fileName = ((FileData)AllFileList.SelectedItems[0]).FileName;
                    //mi.Visibility = System.Windows.Visibility.Collapsed;

                    StringCollection FileCollection = new StringCollection();
                    FileCollection.Add(((FileData)AllFileList.SelectedItems[0]).FullPathStr);

                    //클립보드에 데이터 셋팅
                    Clipboard.SetFileDropList(FileCollection);
                    copyClipboard = true;
                }
                catch (FileNotFoundException eee)
                {
                    System.Windows.MessageBox.Show(eee.Message);
                }

            }
        }

        //이름 수정
        private async void ContextMenu_Rename(object sender, RoutedEventArgs e)
        {

            int selectedItemCnt = AllFileList.SelectedItems.Count;
            if (selectedItemCnt > 0)
            {
                try
                {
                    var result = await this.ShowInputAsync("이름 수정", "파일 이름을 입력해주세요", new MetroDialogSettings() {
                        ColorScheme = MetroDialogColorScheme.Accented
                    });

                    if (result != null)
                    {
                        if(result.Equals(""))
                            MessageBox.Show("파일 이름을 입력해야 합니다");
                        else
                        {
                            string fileDataPath = ((FileData)AllFileList.SelectedItems[0]).FullPathStr;
                            string newPathToFile = "";
                            if (!((File.GetAttributes(fileDataPath) & FileAttributes.Directory) == FileAttributes.Directory))
                            {
                                string[] splitStr = fileDataPath.Split('.');
                                string extension = splitStr[splitStr.Length - 1];
                                newPathToFile = System.IO.Path.Combine(nowPath, result + "." + extension);
                                File.Move(fileDataPath, newPathToFile);
                            }
                            else
                            {
                                newPathToFile = System.IO.Path.Combine(nowPath, result);
                                Directory.Move(fileDataPath, newPathToFile);
                            }
                            Refresh(nowPath);
                        }
                    }
                }
                catch (Exception eee)
                {
                    System.Windows.MessageBox.Show(eee.Message);
                }

            }
           // this.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;//블루
            //this.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Inverted; //블랙

        }
        private void ContextMenu_TagSetting(object sender, RoutedEventArgs e)
        {
            MenuItem cm = (MenuItem)sender as MenuItem;
            cm.Items.Clear();

            string[] Keys = this.e.Meta.getKeys();

            foreach (string k in Keys)
            {
                MenuItem newItem = new MenuItem();
                newItem.Header = k;
                newItem.Click += SubContextMenuClick;
                cm.Items.Add(newItem);
            }
        }

        private void SubContextMenuClick(object sender, RoutedEventArgs e)
        {
            MenuItem cm = (MenuItem)sender as MenuItem;

            foreach(EntryElement eee in this.e.CurrentRoot.Children){
                if(eee.File.FileName.Equals(((FileData)AllFileList.SelectedItems[0]).FileName))
                {
                    this.e.addMetadata(eee.File, cm.Header.ToString());
                    break;
                }
            }
        }
        //삭제하기
        private async void ContextMenu_Delete(object sender, RoutedEventArgs e)
        {
            int selectedItemCnt = AllFileList.SelectedItems.Count;
            //타겟 파일을 클릭 했을 경우만
            if (selectedItemCnt > 0)
            {
                try // FileNotFoundException
                {
                    for (int i = 0; i < selectedItemCnt; i++)
                    {
                        string path = ((FileData)AllFileList.SelectedItems[0]).FullPathStr;

                        MessageDialogResult result = await this.ShowMessageAsync("삭제", "이 파일을 휴지통에 버리시겠습니까?",
                            MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings {
                                ColorScheme = MetroDialogColorScheme.Inverted
                            });

                        if(result.Equals(MessageDialogResult.Affirmative))
                        {
                            //폴더라면
                            if ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory)
                            {
                                // Delete a directory and all subdirectories with Directory static method
                                if (System.IO.Directory.Exists(path))
                                {
                                    try
                                    {
                                        System.IO.Directory.Delete(path, true);
                                        myFilesList.Remove(((FileData)AllFileList.SelectedItems[0]));
                                    }

                                    catch (System.IO.IOException exception)
                                    {
                                        Console.WriteLine(exception.Message);
                                    }
                                }
                            }
                            else//파일이라면
                            {
                                if (System.IO.File.Exists(path))
                                {
                                    // Use a try block to catch IOExceptions, to
                                    // handle the case of the file already being
                                    // opened by another process.
                                    try
                                    {
                                        System.IO.File.Delete(path);
                                        myFilesList.Remove(((FileData)AllFileList.SelectedItems[0]));
                                    }
                                    catch (System.IO.IOException exception)
                                    {
                                        Console.WriteLine(exception.Message);
                                        return;
                                    }
                                }

                            }
                        }
                    }
                }
                catch (FileNotFoundException eee)
                {
                    System.Windows.MessageBox.Show(eee.Message);
                }

            }
        }
        //File Delete key press 파일 삭제
        private async void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            int selectedItemCnt = AllFileList.SelectedItems.Count;
            //타겟 파일을 클릭 했을 경우만
            if (selectedItemCnt > 0)
            {
                try // FileNotFoundException
                {
                    //Delete Key
                    if (e.Key == Key.Delete)
                    {
                        for (int i = 0; i < selectedItemCnt; i++)
                        {
                            string path = ((FileData)AllFileList.SelectedItems[0]).FullPathStr;

                            MessageDialogResult result = await this.ShowMessageAsync("삭제", "이 파일을 휴지통에 버리시겠습니까?",
                          MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings
                          {
                              ColorScheme = MetroDialogColorScheme.Inverted
                          });
                             if (result.Equals(MessageDialogResult.Affirmative))
                             {
                                 //폴더라면
                                 if ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory)
                                 {
                                     // Delete a directory and all subdirectories with Directory static method
                                     if (System.IO.Directory.Exists(path))
                                     {
                                         try
                                         {
                                             System.IO.Directory.Delete(path, true);

                                             myFilesList.Remove(((FileData)AllFileList.SelectedItems[0]));
                                         }

                                         catch (System.IO.IOException exception)
                                         {
                                             Console.WriteLine(exception.Message);
                                         }
                                     }
                                 }
                                 else//파일이라면
                                 {
                                     if (System.IO.File.Exists(path))
                                     {
                                         // Use a try block to catch IOExceptions, to
                                         // handle the case of the file already being
                                         // opened by another process.
                                         try
                                         {
                                             System.IO.File.Delete(path);
                                             myFilesList.Remove(((FileData)AllFileList.SelectedItems[0]));
                                         }
                                         catch (System.IO.IOException exception)
                                         {
                                             Console.WriteLine(exception.Message);
                                             return;
                                         }
                                     }

                                 }
                             }

                        }
                    }

                }
                catch (FileNotFoundException eee)
                {
                    System.Windows.MessageBox.Show(eee.Message);
                }

            }
        }

    }
}


text:
The plugin is supported on Ubuntu 14.04 and 16.04.

Docker 1.11 and newer is supported.

Python 2.7 is supported.

Supported Pure Storage FlashArray FA-4xx series and //m series arrays:

- Purity version support (4.0.0 and beyond)

Supported Pure Storage Python SDK:

- version 1.6.1 or newer

## Features

FlashArray capabilities(via Docker Volume opts):

- Size

Support for iSCSI CHAP configuration

Support for Docker Compose and Docker Swarm

## Setup

#### Install and upgrade needed packages

Run the following commands to install and update needed packages for
the plugin:

```
sudo apt-get install git build-essential libssl-dev libffi-dev python-dev python-pip open-iscsi
sudo pip install -U setuptools
sudo pip install --upgrade pip
sudo pip install purestorage
```

#### Install Docker

Follow the steps listed here to install Docker:

https://docs.docker.com/engine/installation/linux/ubuntulinux/

If errors occur during the hello-word step a proxy needs to be added
to Docker.

If using Ubuntu 16.04 refer to the proxy section in the docker engine documentation at:

https://docs.docker.com/engine/admin/systemd/#http-proxy

If using Ubuntu 14.04 modify the **/etc/docker/default** file by adding
the following:

```
export http_proxy="http://<proxy>:<port>/"
```

Next, restart the Docker service:

```
sudo service docker restart
```

#### Install etcd

First create an export for your local IP:

```
export HostIP="<your host IP>"
```

Then run the following command to create an etcd container in Docker:

```
sudo docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 \
-p 2380:2380 -p 2379:2379 \
--name etcd quay.io/coreos/etcd \
-name etcd0 \
-advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://${HostIP}:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://${HostIP}:2380 \
-initial-cluster-state new
```

For more information on etcd:

https://github.com/coreos/etcd/releases/

#### Install puredockerplugin

Clone the puredockerplugin using the following:

```
git clone https://github.com/PureStorage-OpenConnect/puredockerplugin.git
```

Once cloned use pip to install the plugin:

```
cd puredockerplugin
sudo python setup.py install
```

Use the following to remove the plugin:

```
sudo pip uninstall puredockerplugin
```

#### Configure the plugin

Sample configration files for a Pure Storage FlashArray are located in
the **config/pure.conf.sample** file.

Copy the sample configs into **config/pure.conf** and modify the
template with desired settings:

```
<starting from plugin folder>
cd config
cp <sample_file> pure.conf
<edit pure.conf>
```

## Starting the plugin

Start the Pure Storage Native Docker Volume Plugin by running the following commands:

```
<starting from plugin folder>
cd puredockerplugin
sudo twistd --python pure_plugin_service.py
```

Currently you must use the following command to stop the service:

```
kill -9 <pure plugin PID>
```

## Usage
The following are the currently supported actions that can be taken using the Pure Storage Docker plugin.

#### Creating a Pure Storage volume

```
sudo docker volume create -d pure --name <vol_name>
```

There is an optional parameters that can be used during volume creation:

- size -- specifies the desired size in GB of the volume.

The following is an example call creating a full provisioned, 50 GB volume:

```
sudo docker volume create -d pure --name <vol_name> -o size=50
```

#### Deleting a volume

```
sudo docker volume rm <vol_name>
```

#### List volumes

```
sudo docker volume ls
```

#### Inspect a volume

```
sudo docker volume inspect <vol_name>
```

#### Mounting a volume

Use the following command to mount a volume and start a bash prompt:

```
sudo docker run -it -v <vol_name>:/<mount_point>/ --volume-driver pure <image_name> bash
```

Note: If the volume does not exist it will be created.

The image used for mounting can be any image located on https://hub.docker.com/ or
the local filesystem. See https://docs.docker.com/v1.8/userguide/dockerimages/
for more details.

#### Unmounting a volume

Exiting the bash prompt will cause the volume to unmount:

```
exit
```

The volume is still associated with a container at this point.

Run the following command to get the container ID associated with the volume:

```
sudo docker ps -a
```

Then stop the container:

```
sudo docker stop <container_id>
```

Next, delete the container:

```
sudo docker rm <container_id>
```

Finally, remove the volume:

```
sudo docker volume rm <vol_name>
```

#### Running plugin unit tests

Run the following commands to run the plugin unit tests:

```
cd test
sudo trial test_pure_plugin.py
```

Use the following command to check for PEP8 violations in the plugin:

```
tox
```

##Licensing

**Pure Storage will not provide legal guidance on which open source license should be used in projects. We do expect that all projects and contributions will have a valid open source license, or align to the appropriate license for the project/contribution**

Copyright [2016] [Pure Storage Inc.]

Some small portions of this driver were forked from the Apache 2.0 licensed repository at https://github.com/hpe-storage/python-hpedockerplugin, and the appropriate copyrights apply to that portion.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
package org.jvending.provisioning.match;

import java.util.Collection;

import javax.provisioning.BundleDescriptor;
import javax.provisioning.MatchPolicy;

/**
 * Matches a bundle descriptor from the BundleDescriptorRepository by bundle id.
 *
 * @author Shane Isbell
 * @version 1.0
 */

public final class BundleIdMatch implements MatchPolicy {
    //collection of strings denoting ids
    private Collection<String> id;

    public BundleIdMatch(Collection<String> id) {
        this.id = id;
    }

    public float doMatch(BundleDescriptor bd) {
        if (bd == null) return 0f;
        if (id == null) return 1.0f;
        return id.contains(bd.getBundleID()) ? 1.0f : 0f;
    }

}


text:
Lorem ipsum mixin designed for easy creatiion of random dummy-content. It can create single word with requested length or requested quantity of words, sentences and paragpraph.
Fore beautiful result mixin create text with some visual feathures - capitalize first letter, place point or questio at the end of sentence and put some comma inside text. Number of words in sentence and sentences in paragraph are random between defined min and max value, but result is normally-distributed.

## How to use:
Add mixin in your Jade template:
```jade
include lipsum
```
Then create content what you need:
```jade
+lipsum(items, type)
```
**items** must be number.
**type** must be on of following strings: *"characters"*, *"words"*, *"sentences"*, *"paragpraphs"*. Paragrpaphs generated inside **p** tag, all other clear from any HTML

## Usage examples
```jade
+lipsum(7, "characters")
//- Doadipi
+lipsum(7, "characters")
//- Mollite
+lipsum(2, "words")
//- Ullamco laboris
+lipsum(5, "words")
//- Sunt dolor ipsum eu ullamco
+lipsum(2, "sentences")
//- Labore proident ullamco. Ex, magna in sunt deserunt fugiat, sit, deserunt commodo dolore esse dolore tempor in?
+lipsum(2, "sentences")
//- Anim do ut minim reprehenderit, culpa, dolore. Qui, consequat amet minim, velit occaecat, laboris nisi laborum irure.
+lipsum(2, "paragpraphs")
//-
	p
		Ullamco eiusmod et, occaecat aliquip tempor sunt. Ea pariatur et sed ullamco tempor tempor aliqua incididunt?
	p
		Anim laborum, nulla aliqua culpa, deserunt, eiusmod? Labore pariatur nulla, ipsum elit reprehenderit sunt lorem minim laborum culpa, ut enim.
```

## Codepen demo

See the Pen Jade Lorem Ipsum mixin by Konstantin Zakablukovsky (@KZee) on CodePen.


text:
import { EmployeeInsights } from "../../";

export = EmployeeInsights;


text:
require "gif-info/fixed-block"
require "frozen-objects"

##
# Primary GifInfo module.
#

class GifInfo

    ##
    # General blocks module.
    #

    module Blocks

        ##
        # Used to specify transparency settings and control animations.
        #

        class GraphicsControlExtension < FixedBlock

            ##
            # Byte structure.
            #

            STRUCTURE = Frozen << Proc::new do
                skip {3}
                byte (:packed) do
                    number (:reserved) {3}
                    number (:disposal_method) {3}
                    boolean :user_input
                    boolean :transparent_color
                end
                uint16 :delay_time
                uint8 :transparent_color_index
                skip {1}
            end
        end
    end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.6" />
<title>git-apply(1)</title>

git-apply(1) Manual Page

NAME

git-apply -
   Apply a patch to files and/or to the index

SYNOPSIS

git apply [--stat] [--numstat] [--summary] [--check] [--index] [--3way]
          [--apply] [--no-add] [--build-fake-ancestor=<file>] [-R | --reverse]
          [--allow-binary-replacement | --binary] [--reject] [-z]
          [-p<n>] [-C<n>] [--inaccurate-eof] [--recount] [--cached]
          [--ignore-space-change | --ignore-whitespace ]
          [--whitespace=(nowarn|warn|fix|error|error-all)]
          [--exclude=<path>] [--include=<path>] [--directory=<root>]
          [--verbose] [<patch>…]

DESCRIPTION

Reads the supplied diff output (i.e. "a patch") and applies it to files.
With the <tt>--index</tt> option the patch is also applied to the index, and
with the <tt>--cached</tt> option the patch is only applied to the index.
Without these options, the command applies the patch only to files,
and does not require them to be in a Git repository.

This command applies the patch but does not create a commit.  Use
git-am(1) to create commits from patches generated by
git-format-patch(1) and/or received by email.

OPTIONS

<patch>…

        The files to read the patch from.  - can be used to read
        from the standard input.

--stat

        Instead of applying the patch, output diffstat for the
        input.  Turns off "apply".

--numstat

        Similar to <tt>--stat</tt>, but shows the number of added and
        deleted lines in decimal notation and the pathname without
        abbreviation, to make it more machine friendly.  For
        binary files, outputs two <tt>-</tt> instead of saying
        <tt>0 0</tt>.  Turns off "apply".

--summary

        Instead of applying the patch, output a condensed
        summary of information obtained from git diff extended
        headers, such as creations, renames and mode changes.
        Turns off "apply".

--check

        Instead of applying the patch, see if the patch is
        applicable to the current working tree and/or the index
        file and detects errors.  Turns off "apply".

--index

        When <tt>--check</tt> is in effect, or when applying the patch
        (which is the default when none of the options that
        disables it is in effect), make sure the patch is
        applicable to what the current index file records.  If
        the file to be patched in the working tree is not
        up-to-date, it is flagged as an error.  This flag also
        causes the index file to be updated.

--cached

        Apply a patch without touching the working tree. Instead take the
        cached data, apply the patch, and store the result in the index
        without using the working tree. This implies <tt>--index</tt>.

-3

--3way

        When the patch does not apply cleanly, fall back on 3-way merge if
        the patch records the identity of blobs it is supposed to apply to,
        and we have those blobs available locally, possibly leaving the
        conflict markers in the files in the working tree for the user to
        resolve.  This option implies the <tt>--index</tt> option, and is incompatible
        with the <tt>--reject</tt> and the <tt>--cached</tt> options.

--build-fake-ancestor=<file>

        Newer git diff output has embedded index information
        for each blob to help identify the original version that
        the patch applies to.  When this flag is given, and if
        the original versions of the blobs are available locally,
        builds a temporary index containing those blobs.

When a pure mode change is encountered (which has no index information),
the information is read from the current index instead.

-R

--reverse

        Apply the patch in reverse.

--reject

        For atomicity, git apply by default fails the whole patch and
        does not touch the working tree when some of the hunks
        do not apply.  This option makes it apply
        the parts of the patch that are applicable, and leave the
        rejected hunks in corresponding *.rej files.

-z

        When <tt>--numstat</tt> has been given, do not munge pathnames,
        but use a NUL-terminated machine-readable format.

Without this option, each pathname output will have TAB, LF, double quotes,
and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
respectively, and the pathname will be enclosed in double quotes if
any of those replacements occurred.

-p<n>

        Remove <n> leading slashes from traditional diff paths. The
        default is 1.

-C<n>

        Ensure at least <n> lines of surrounding context match before
        and after each change.  When fewer lines of surrounding
        context exist they all must match.  By default no context is
        ever ignored.

--unidiff-zero

        By default, git apply expects that the patch being
        applied is a unified diff with at least one line of context.
        This provides good safety measures, but breaks down when
        applying a diff generated with <tt>--unified=0</tt>. To bypass these
        checks use <tt>--unidiff-zero</tt>.

Note, for the reasons stated above usage of context-free patches is
discouraged.

--apply

        If you use any of the options marked "Turns off
        apply" above, git apply reads and outputs the
        requested information without actually applying the
        patch.  Give this flag after those flags to also apply
        the patch.

--no-add

        When applying a patch, ignore additions made by the
        patch.  This can be used to extract the common part between
        two files by first running diff on them and applying
        the result with this option, which would apply the
        deletion part but not the addition part.

--allow-binary-replacement

--binary

        Historically we did not allow binary patch applied
        without an explicit permission from the user, and this
        flag was the way to do so.  Currently we always allow binary
        patch application, so this is a no-op.

--exclude=<path-pattern>

        Don’t apply changes to files matching the given path pattern. This can
        be useful when importing patchsets, where you want to exclude certain
        files or directories.

--include=<path-pattern>

        Apply changes to files matching the given path pattern. This can
        be useful when importing patchsets, where you want to include certain
        files or directories.

When <tt>--exclude</tt> and <tt>--include</tt> patterns are used, they are examined in the
order they appear on the command line, and the first match determines if a
patch to each path is used.  A patch to a path that does not match any
include/exclude pattern is used by default if there is no include pattern
on the command line, and ignored if there is any include pattern.

--ignore-space-change

--ignore-whitespace

        When applying a patch, ignore changes in whitespace in context
        lines if necessary.
        Context lines will preserve their whitespace, and they will not
        undergo whitespace fixing regardless of the value of the
        <tt>--whitespace</tt> option. New lines will still be fixed, though.

--whitespace=<action>

        When applying a patch, detect a new or modified line that has
        whitespace errors.  What are considered whitespace errors is
        controlled by <tt>core.whitespace</tt> configuration.  By default,
        trailing whitespaces (including lines that solely consist of
        whitespaces) and a space character that is immediately followed
        by a tab character inside the initial indent of the line are
        considered whitespace errors.

By default, the command outputs warning messages but applies the patch.
When <tt>git-apply</tt> is used for statistics and not applying a
patch, it defaults to <tt>nowarn</tt>.

You can use different <tt><action></tt> values to control this
behavior:

<tt>nowarn</tt> turns off the trailing whitespace warning.

<tt>warn</tt> outputs warnings for a few such errors, but applies the
  patch as-is (default).

<tt>fix</tt> outputs warnings for a few such errors, and applies the
  patch after fixing them (<tt>strip</tt> is a synonym --- the tool
  used to consider only trailing whitespace characters as errors, and the
  fix involved stripping them, but modern Gits do more).

<tt>error</tt> outputs warnings for a few such errors, and refuses
  to apply the patch.

<tt>error-all</tt> is similar to <tt>error</tt> but shows all errors.

--inaccurate-eof

        Under certain circumstances, some versions of diff do not correctly
        detect a missing new-line at the end of the file. As a result, patches
        created by such diff programs do not record incomplete lines
        correctly. This option adds support for applying such patches by
        working around this bug.

-v

--verbose

        Report progress to stderr. By default, only a message about the
        current patch being applied will be printed. This option will cause
        additional information to be reported.

--recount

        Do not trust the line counts in the hunk headers, but infer them
        by inspecting the patch (e.g. after editing the patch without
        adjusting the hunk headers appropriately).

--directory=<root>

        Prepend <root> to all filenames.  If a "-p" argument was also passed,
        it is applied before prepending the new root.

For example, a patch that talks about updating <tt>a/git-gui.sh</tt> to <tt>b/git-gui.sh</tt>
can be applied to the file in the working tree <tt>modules/git-gui/git-gui.sh</tt> by
running <tt>git apply --directory=modules/git-gui</tt>.

Configuration

apply.ignorewhitespace

        Set to change if you want changes in whitespace to be ignored by default.
        Set to one of: no, none, never, false if you want changes in
        whitespace to be significant.

apply.whitespace

        When no <tt>--whitespace</tt> flag is given from the command
        line, this configuration item is used as the default.

Submodules

If the patch contains any changes to submodules then git apply
treats these changes as follows.

If <tt>--index</tt> is specified (explicitly or implicitly), then the submodule
commits must match the index exactly for the patch to apply.  If any
of the submodules are checked-out, then these check-outs are completely
ignored, i.e., they are not required to be up-to-date or clean and they
are not updated.

If <tt>--index</tt> is not specified, then the submodule commits in the patch
are ignored and only the absence or presence of the corresponding
subdirectory is checked and (if possible) updated.

SEE ALSO

git-am(1).

GIT

Part of the git(1) suite

Last updated 2013-08-20 08:40:27 PDT


text:
{% extends "base.html" %}
{% load static %}

{% block title %}Set Up - {{ block.super }}{% endblock %}

{% block analytics %}
analytics.page("Setup");
{% endblock %}

{% block bodyclass %}

{% endblock %}

{% block content %}

Hello Web App Set Up Instructions

Table of Contents

Install Python

                            Install pip

Install Virtualenv

Set up Django

                            Start your Virtualenv

                            Install Django

                            Start git

                            Start your project

                            Create an app

                            Add your app to your settings

                            Set up your database

                            Start your local server

Hey friends! Let's get your computers set up so you can run the Hello Web App tutorial. This page might look long but it should be fairly simple. Just a lot of steps. One of the hardest parts about web app development is installation (the other is deployment) so once we're through this challenging beginning bit, everything will get a lot easier.

(Why don't I include these instructions in the book? Here, I can
update whenever I need since the programming ecosystem changes a lot.  This
way, the books won't go out of date as quickly!)

Optional: Get Comfortable with Command Line

Are you new to development? I wrote a fun, short zine to introduce using the command line for beginners. We'll be using the command line a lot throughout the book so, if you're new to using the command line, I recommend checking out the zine first (comes in printable, online, and other versions): https://hellowebbooks.com/learn-command-line

1. Install Python

Unfortunately, unlike making web pages with HTML, we need to install Python before our computers can run the files that we're building.

Head over to these links to install Python 3 onto your computer:

Mac OSX

Windows

Linux

Windows users, I highly encourage you to use the Linux Subsystem for Windows to give yourself the ability to use UNIX commands used in the books (like touch) in your command line.

Do you have pip installed?

pip is the Python package installer — you'll use it heavily with Hello Web
App and pretty much any Python project. If you followed the Python install
instructions, you should have pip installed already.

To check whether it's installed, open up your command line and run this (don't
include the $, it's an indicator that this command is being run in your
command line utility):

$ pip list

It should be pretty obvious if it didn't work. If it didn't work, check out
this page.

2. Install Virtualenv

When we start developing our Django apps, we want to make sure our projects are
enclosed in "bubbles" known as virtual environments.

For example, as of this writing, Django's current version is 2.0. When new
versions of Django are released, they may not be backwards compatible with
previous versions of Django.

Without a virtual environment, we'd have Django 1.9.2 installed globally on
our computer, and every Django project you build would use that version. If you
wanted to upgrade your version of Django, you'd have to go through every one of
your projects to make sure they don't break.

With a virtual environment, every project can have a separate version of
Django and other plugins that you install. You can install Django 1.9 on one
project, and down the line, start another project with Django 2.0. Every
project can work off of whatever version of whatever you install, keeping them
separate from each other. This is very important when you're programming.

We should already have pip, so we'll use it to install virtualenv (again,
don't paste in the $ ):

$ pip install virtualenv

3. Set up Django and start your project

First thing we need to do is create a folder for your project. I personally use
a "projects" folder in my top level user folder on my computer, which contains
all my programming projects. If you'd like to do this as well, follow these
commands in your terminal to create the projects folder, and a folder within for
this individual project:

$ mkdir projects
$ cd projects
projects $ mkdir myhellowebapp
projects $ cd myhellowebapp

If you need a command line review, mkdir creates folders, and cd changes
directories into that folder. If you ever get lost, your terminal should show
which directory you're in, and running ls (on Mac or Linux, dir on Windows),
will list out the contents of the folder you're in. Use cd .. to back up out
of a folder.

Start your virtual environment

Now that you're within your empty project folder, create your virtual
environment.

projects/myhellowebapp $ virtualenv venv

And then activate the environment:

projects/myhellowebapp $ source venv/bin/activate

You should see something like this in your command line before the folder
structure — the (venv) indicates you're in the virtual environment:

(venv)tracymakes@Orion ~/projects/myhellowebapp $

(Orion is my computer's name and tracymakes is my username — your exact setup
will be different.)

Now you're in your bubble, so we can start installing project-specific utilities.
If you ever need to deactivate your environment, run deactivate.

Install Django

Finally, it's Django time! We'll use pip to install Django, so run this in your
command line, making sure you're in your project folder and the virtual
environment is activated:

$ pip install Django==3.2

We're telling pip to install a specific version of Django, in case Django
releases a new version that this tutorial doesn't cover.

Start git

We also want to start our version control system. Now that we're in our project
folder, run this command to start git:

$ git init

Running this command in your project folder will make the entire folder and its
contents part of a new Git repository. For more about git and why we should use
it (spoiler: version control is very important and it's needed for deployment
to Heroku), see the Git tips page
here.

Optional but good to do: Git will track everything in your directory, but we really only want it to track files we're actually changing. We can tell Git to ignore certain files by creating a .gitignore file in our myhellowebapp directory (touch .gitignore), then open up the file with a code editor and pasting everything here in.

Then you can commit the file...

$ git add .
$ git commit -a -m "Added git ignore file"

...and now Git won't track those files.

Start your Django project

We installed Django, now we can use Django to build all the starting files we
need for our web app. In your command line (again, in your project folder with
your environment activated):

$ django-admin startproject hellowebapp .

(The . at the end is important, don't forget it!)

This is going to start a Django project in your currect directory.

django-admin: The script we'll be running.

startproject: The specific utility we're using.

hellowebapp: The name we're giving the project.

.: The location where we're starting the project, with . denoting the
current directory.

startproject will create these files and folders:

myhellowebapp/
    manage.py
    hellowebapp/
        __init__.py
        asgi.py
        settings.py
        urls.py
        wsgi.py

The myhellowebapp folder is your top level directory.

manage.py: We won't edit this file, but will use this file in the command line
to interact with your project. You'll see it in action soon.

The inner hellowebapp folder holds your project.

__init__.py: Ignorable — tells Python that this is a Python "package".

asgi.py: Relates to deployment; we don't be using it.

settings.py: Aptly named — contains your settings.

urls.py: URL declarations for the project. Important and we'll go over this
soon.

wsgi.py: Not needed at this point until you deploy your project.

Create your Django app

A project can run many apps (all doing something distinct), but we're just going
to focus on having one for now, which is all you'll need for a very long
time.

In your top level folder (the one with manage.py in it), run this command:

$ django-admin startapp collection

Like before, django-admin is the script, startapp is the command, and
collection is the name we're giving the app, which you can change if you wish.

startapp will create an additional folder and a few files:

myhellowebapp/
    manage.py
    collection/
        migrations/
        __init__.py
        admin.py
        apps.py
        models.py
        tests.py
        views.py
    hellowebapp/
        __init__.py
        settings.py
        urls.py
        wsgi.py

Note the additional "collection" folder in your project.

migrations: A directory created to contain your database migrations (we'll cover this soon).

__init__.py: Ignorable — again, Python just needs this empty file.

admin.py: Contains admin codebits.

apps.py: A file created by Django that we won't be using.

models.py: Where you'll define your database eventually.

tests.py: We'll eventually write tests to test your code for errors here.

views.py: Where the logic goes that powers your website.

If that's a bit complicated, don't worry about it yet because we'll review it
all later when we specifically start working with all those files.

Add your new app to your settings file

We need to tell the project that we've added an app to it — it doesn't find it
            automatically.  Open up your settings.py file (which is under the
            hellowebapp directory, see the directory tree above) and find the
            INSTALLED_APPS section. Add the name of your app to the beginning of the list
            (don't forget the trailing comma):

INSTALLED_APPS = (
    'collection', # this is the app we added
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
)

If you've used Django before, you might be wondering why I put collection at the top of the list. It's a bit of trickery to make sure our templates are used rather than the default Django admin templates when we set up our login pages. Shouldn't affect anything else.

Set up your database

Django has some fancypants utilities built in to keep your database manageable. This is where
all your dynamic information is stored, including any content that your users add when
they interact with your future app.

First, we need to make some quick edits to our models.py file, which
was created in our collection directory. Copy this code and paste it in:

models.py

from django.db import models
from django.contrib.auth.models import AbstractUser

class User(AbstractUser):
    pass

The top line should already be in the file; the rest we added. So, what are we doing?
Django has a way to store User information by default (usernames, passwords, etc.) But,
if you wanted to add extra information to this default set of info in the future, you
might run into issues down the line if we just went with the default. By putting in the
above right at the start of your project, I'm giving you maximum flexibility for your
future project.

Last thing we need to do is add one more bit to our settings.py — add this line
to the bottom:

settings.py

AUTH_USER_MODEL = 'collection.User'

With this, we're telling Django to use the code we added in models.py by default
(AUTH_USER_MODEL setting, pointing to "User" in our "collection" app).

Complete the set up of your database by creating what we call a "migration." We'll
explain databases and migrations more in depth in Chapter 6; long story short, we're
creating a history file for our database, and Django's makemigrations tool
does this automatically for us.

Run this command in your terminal (in your top level folder; the one with manage.py in it):

$ python manage.py makemigrations

Django will create that history file, and then we need to apply that history file by running
the migrate command. Type this in your terminal:

$ python manage.py migrate

Don't worry about understanding this just yet — we'll go over
databases and migrations a bit more in the "Adding Dynamic Data" chapter of
Hello Web App.

Start your local server

Want to see if everything worked? In your terminal, head over to your top level
myhellowebapp folder (make sure you're in the same directory as manage.py)
and run this command:

$ python manage.py runserver

...and you'll see the local Django development server starting, which'll serve
your project to your computer.

$ python manage.py runserver
Validating models...

0 errors found
March 26, 2014 - 15:50:53
Django version 2.0.8, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Now just head to your favorite web browser and visit
http://localhost:8000, where you'll see a "Welcome to
Django" page. Congrats on starting Django!

At this point you can continue working on the book. Best of luck and remember to use the discussion forum if you need any help!

Learn how to create your first web app and get on the path of a fun side project, a lifestyle business, or your first startup. Order Hello Web App today.

{% include 'includes/newsletter.html' %}

{% endblock content %}

{% block scripts %}
{{ block.super }}
{% include 'includes/newsletter-analytics.html' %}
<link rel="stylesheet" href="{% static '/css/tomorrow-night-blue.css' %}">

{% endblock scripts %}


text:
package org.ddd4j.test;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.List;

import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.manipulation.Sorter;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.JUnit4;
import org.junit.runners.ParentRunner;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.RunnerBuilder;

public class Dependent extends ParentRunner<Runner> {

	@Retention(RUNTIME)
	@Target(TYPE)
	public @interface DependsOn {

		Class<? extends Runner> runWith() default JUnit4.class;

		Class<?>[] value() default {};
	}

	private final RunnerBuildingContext context;

	public Dependent(Class<?> testClass, RunnerBuilder builder) throws InitializationError {
		super(testClass);
		context = RunnerBuildingContext.of(builder);
		context.analyze(getTestClass().getJavaClass(), getTestClass().getAnnotation(DependsOn.class));
	}

	@Override
	protected void collectInitializationErrors(List<Throwable> errors) {
		super.collectInitializationErrors(errors);
		if (getTestClass().getAnnotation(DependsOn.class) == null) {
			errors.add(new Exception(
					"Test classes run with " + Dependent.class.getName() + " has to be annotated with " + DependsOn.class.getName()));
		}
	}

	@Override
	protected Description describeChild(Runner child) {
		return child.getDescription();
	}

	@Override
	protected List<Runner> getChildren() {
		return context.getChildren();
	}

	@Override
	protected void runChild(Runner child, RunNotifier notifier) {
		child.run(notifier);
	}

	@Override
	public void sort(Sorter sorter) {
		// ignore
	}
}


text:
#include "gm/gm.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkFont.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypeface.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"
#include "include/gpu/GrContext.h"
#include "include/private/GrTypesPriv.h"
#include "src/core/SkMatrixProvider.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrPaint.h"
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/SkGr.h"
#include "tools/ToolUtils.h"

#include <utility>

static constexpr SkScalar kTileWidth = 40;
static constexpr SkScalar kTileHeight = 30;

static constexpr int kRowCount = 4;
static constexpr int kColCount = 3;

static void draw_text(SkCanvas* canvas, const char* text) {
    SkFont font(ToolUtils::create_portable_typeface(), 12);
    canvas->drawString(text, 0, 0, font, SkPaint());
}

static void draw_gradient_tiles(SkCanvas* canvas, bool alignGradients) {
    // Always draw the same gradient
    static constexpr SkPoint pts[] = { {0.f, 0.f}, {0.25f * kTileWidth, 0.25f * kTileHeight} };
    static constexpr SkColor colors[] = { SK_ColorBLUE, SK_ColorWHITE };

    GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();

    GrContext* context = canvas->getGrContext();

    auto gradient = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkTileMode::kMirror);
    SkPaint paint;
    paint.setShader(gradient);

    for (int i = 0; i < kRowCount; ++i) {
        for (int j = 0; j < kColCount; ++j) {
            SkRect tile = SkRect::MakeWH(kTileWidth, kTileHeight);
            if (alignGradients) {
                tile.offset(j * kTileWidth, i * kTileHeight);
            } else {
                canvas->save();
                canvas->translate(j * kTileWidth, i * kTileHeight);
            }

            unsigned aa = SkCanvas::kNone_QuadAAFlags;
            if (i == 0) {
                aa |= SkCanvas::kTop_QuadAAFlag;
            }
            if (i == kRowCount - 1) {
                aa |= SkCanvas::kBottom_QuadAAFlag;
            }
            if (j == 0) {
                aa |= SkCanvas::kLeft_QuadAAFlag;
            }
            if (j == kColCount - 1) {
                aa |= SkCanvas::kRight_QuadAAFlag;
            }

            if (rtc) {
                // Use non-public API to leverage general GrPaint capabilities
                SkMatrix view = canvas->getTotalMatrix();
                SkSimpleMatrixProvider matrixProvider(view);
                GrPaint grPaint;
                SkPaintToGrPaint(context, rtc->colorInfo(), paint, matrixProvider, &grPaint);
                rtc->fillRectWithEdgeAA(GrNoClip(), std::move(grPaint), GrAA::kYes,
                                        static_cast<GrQuadAAFlags>(aa), view, tile);
            } else {
                // Fallback to solid color on raster backend since the public API only has color
                SkColor color = alignGradients ? SK_ColorBLUE
                                               : (i * kColCount + j) % 2 == 0 ? SK_ColorBLUE
                                                                              : SK_ColorWHITE;
                canvas->experimental_DrawEdgeAAQuad(
                        tile, nullptr, static_cast<SkCanvas::QuadAAFlags>(aa), color,
                        SkBlendMode::kSrcOver);
            }

            if (!alignGradients) {
                // Pop off the matrix translation when drawing unaligned
                canvas->restore();
            }
        }
    }
}

static void draw_color_tiles(SkCanvas* canvas, bool multicolor) {
    for (int i = 0; i < kRowCount; ++i) {
        for (int j = 0; j < kColCount; ++j) {
            SkRect tile = SkRect::MakeXYWH(j * kTileWidth, i * kTileHeight, kTileWidth, kTileHeight);

            SkColor4f color;
            if (multicolor) {
                color = {(i + 1.f) / kRowCount, (j + 1.f) / kColCount, .4f, 1.f};
            } else {
                color = {.2f, .8f, .3f, 1.f};
            }

            unsigned aa = SkCanvas::kNone_QuadAAFlags;
            if (i == 0) {
                aa |= SkCanvas::kTop_QuadAAFlag;
            }
            if (i == kRowCount - 1) {
                aa |= SkCanvas::kBottom_QuadAAFlag;
            }
            if (j == 0) {
                aa |= SkCanvas::kLeft_QuadAAFlag;
            }
            if (j == kColCount - 1) {
                aa |= SkCanvas::kRight_QuadAAFlag;
            }

            canvas->experimental_DrawEdgeAAQuad(
                    tile, nullptr, static_cast<SkCanvas::QuadAAFlags>(aa), color.toSkColor(),
                    SkBlendMode::kSrcOver);
        }
    }
}

static void draw_tile_boundaries(SkCanvas* canvas, const SkMatrix& local) {
    // Draw grid of red lines at interior tile boundaries.
    static constexpr SkScalar kLineOutset = 10.f;
    SkPaint paint;
    paint.setAntiAlias(true);
    paint.setColor(SK_ColorRED);
    paint.setStyle(SkPaint::kStroke_Style);
    paint.setStrokeWidth(0.f);
    for (int x = 1; x < kColCount; ++x) {
        SkPoint pts[] = {{x * kTileWidth, 0}, {x * kTileWidth, kRowCount * kTileHeight}};
        local.mapPoints(pts, 2);
        SkVector v = pts[1] - pts[0];
        v.setLength(v.length() + kLineOutset);
        canvas->drawLine(pts[1] - v, pts[0] + v, paint);
    }
    for (int y = 1; y < kRowCount; ++y) {
        SkPoint pts[] = {{0, y * kTileHeight}, {kTileWidth * kColCount, y * kTileHeight}};
        local.mapPoints(pts, 2);
        SkVector v = pts[1] - pts[0];
        v.setLength(v.length() + kLineOutset);
        canvas->drawLine(pts[1] - v, pts[0] + v, paint);
    }
}

// Tile renderers (column variation)
typedef void (*TileRenderer)(SkCanvas*);
static TileRenderer kTileSets[] = {
    [](SkCanvas* canvas) { draw_gradient_tiles(canvas, /* aligned */ false); },
    [](SkCanvas* canvas) { draw_gradient_tiles(canvas, /* aligned */ true); },
    [](SkCanvas* canvas) { draw_color_tiles(canvas, /* multicolor */ false); },
    [](SkCanvas* canvas) { draw_color_tiles(canvas, /* multicolor */true); },
};
static const char* kTileSetNames[] = { "Local", "Aligned", "Green", "Multicolor" };
static_assert(SK_ARRAY_COUNT(kTileSets) == SK_ARRAY_COUNT(kTileSetNames), "Count mismatch");

namespace skiagm {

class DrawQuadSetGM : public GM {
private:
    SkString onShortName() override { return SkString("draw_quad_set"); }
    SkISize onISize() override { return SkISize::Make(800, 800); }

    void onDraw(SkCanvas* canvas) override {
        SkMatrix rowMatrices[5];
        // Identity
        rowMatrices[0].setIdentity();
        // Translate/scale
        rowMatrices[1].setTranslate(5.5f, 20.25f);
        rowMatrices[1].postScale(.9f, .7f);
        // Rotation
        rowMatrices[2].setRotate(20.0f);
        rowMatrices[2].preTranslate(15.f, -20.f);
        // Skew
        rowMatrices[3].setSkew(.5f, .25f);
        rowMatrices[3].preTranslate(-30.f, 0.f);
        // Perspective
        SkPoint src[4];
        SkRect::MakeWH(kColCount * kTileWidth, kRowCount * kTileHeight).toQuad(src);
        SkPoint dst[4] = {{0, 0},
                          {kColCount * kTileWidth + 10.f, 15.f},
                          {kColCount * kTileWidth - 28.f, kRowCount * kTileHeight + 40.f},
                          {25.f, kRowCount * kTileHeight - 15.f}};
        SkAssertResult(rowMatrices[4].setPolyToPoly(src, dst, 4));
        rowMatrices[4].preTranslate(0.f, +10.f);
        static const char* matrixNames[] = { "Identity", "T+S", "Rotate", "Skew", "Perspective" };
        static_assert(SK_ARRAY_COUNT(matrixNames) == SK_ARRAY_COUNT(rowMatrices), "Count mismatch");

        // Print a column header
        canvas->save();
        canvas->translate(110.f, 20.f);
        for (size_t j = 0; j < SK_ARRAY_COUNT(kTileSetNames); ++j) {
            draw_text(canvas, kTileSetNames[j]);
            canvas->translate(kColCount * kTileWidth + 30.f, 0.f);
        }
        canvas->restore();
        canvas->translate(0.f, 40.f);

        // Render all tile variations
        for (size_t i = 0; i < SK_ARRAY_COUNT(rowMatrices); ++i) {
            canvas->save();
            canvas->translate(10.f, 0.5f * kRowCount * kTileHeight);
            draw_text(canvas, matrixNames[i]);

            canvas->translate(100.f, -0.5f * kRowCount * kTileHeight);
            for (size_t j = 0; j < SK_ARRAY_COUNT(kTileSets); ++j) {
                canvas->save();
                draw_tile_boundaries(canvas, rowMatrices[i]);

                canvas->concat(rowMatrices[i]);
                kTileSets[j](canvas);
                // Undo the local transformation
                canvas->restore();
                // And advance to the next column
                canvas->translate(kColCount * kTileWidth + 30.f, 0.f);
            }
            // Reset back to the left edge
            canvas->restore();
            // And advance to the next row
            canvas->translate(0.f, kRowCount * kTileHeight + 20.f);
        }
    }
};

DEF_GM(return new DrawQuadSetGM();)

} // namespace skiagm


text:
<!DOCTYPE html>
<title>Default passive event listeners on window, document, document element, body</title>
<link rel="help" href="https://dom.spec.whatwg.org/#default-passive-value">


text:
module Core.Passes(
    passes,
    printPass,
    ppIO
    ) where
import Core
import Core.Helper
import Flags
import Pretty
import Core.Renamer
import Core.Simplify
import Core.ReduceLinear
import Core.Atomize
import Core.Inliner

passes :: [Function] -> CompilerM [Function]
passes fs =
    printPass DumpCore fs >>=

    fixLits      >>=
    rename       >>= printPass DumpRename >>=
    runSimplify  >>= printPass DumpSimp   >>=
    put          >>=
    inline       >>= printPass DumpInline >>=
    rename       >>= printPass DumpRename >>=
    runSimplify  >>= printPass DumpSimp   >>=
    atomize      >>= printPass DumpAtom   >>=
    reduceLinear >>= printPass DumpLin

printPass :: Flag -> [Function] -> CompilerM [Function]
printPass fl fs = do
    ifSet fl $ do
        inIO $ putStrLn $ banner (show fl)
        inIO $ mapM_ (putStrLn . pp False)  fs
    return fs

ppIO :: Pretty p => p -> IO ()
ppIO p =
    let s = pp False p
    in putStrLn s
bind :: CompilerM [Function] -> ([Function] -> CompilerM a) -> CompilerM a
bind fs func =
    {-fs >>= (mapM putFunction) >>= return fs >>= func-}
    fs >>= func

put :: [Function] -> CompilerM [Function]
put fs = do
    mapM_ putFunction fs
    return fs


text:
Focal::Application.routes.draw do
  ActiveAdmin.routes(self)

  devise_for :admin_users, ActiveAdmin::Devise.config

  resources :burndowns, only: [:show] do
    resources :iterations, only: [:show] do
      get :print, on: :member
    end

  	member {
  		get :metrics
  	}
  end
end


text:
package org.usc.wechat.mp.sdk.vo.menu;

import java.util.ArrayList;
import java.util.List;

import org.usc.wechat.mp.sdk.vo.AbstractToStringBuilder;

import com.alibaba.fastjson.annotation.JSONField;

/**
 *
 * @author Shunli
 */
public class Menu extends AbstractToStringBuilder {
    @JSONField(name = "button")
    private List<MenuInfo> menuInfos = new ArrayList<MenuInfo>();

    public Menu() {
    }

    public Menu(List<MenuInfo> menuInfos) {
        this.menuInfos = menuInfos;
    }

    public List<MenuInfo> getMenuInfos() {
        return menuInfos;
    }

    public void setMenuInfos(List<MenuInfo> menuInfos) {
        this.menuInfos = menuInfos;
    }

}


text:
namespace ui {
class AXNode;
}

namespace pdf {

class PdfAccessibilityTree;

// Abstracts an AXNode, representing a PDF node, for dispatching
// accessibility actions.
class PdfAXActionTarget : public ui::AXActionTarget {
 public:
  static const PdfAXActionTarget* FromAXActionTarget(
      const ui::AXActionTarget* ax_action_target);

  PdfAXActionTarget(const ui::AXNode& plugin_node, PdfAccessibilityTree* tree);
  ~PdfAXActionTarget() override;

  const ui::AXNode& AXNode() const { return target_plugin_node_; }

 protected:
  // AXActionTarget overrides.
  Type GetType() const override;
  bool PerformAction(const ui::AXActionData& action_data) const override;
  gfx::Rect GetRelativeBounds() const override;
  gfx::Point GetScrollOffset() const override;
  gfx::Point MinimumScrollOffset() const override;
  gfx::Point MaximumScrollOffset() const override;
  void SetScrollOffset(const gfx::Point& point) const override;
  bool SetSelected(bool selected) const override;
  bool SetSelection(const ui::AXActionTarget* anchor_object,
                    int anchor_offset,
                    const ui::AXActionTarget* focus_object,
                    int focus_offset) const override;
  bool ScrollToMakeVisible() const override;
  bool ScrollToMakeVisibleWithSubFocus(
      const gfx::Rect& rect,
      ax::mojom::ScrollAlignment horizontal_scroll_alignment,
      ax::mojom::ScrollAlignment vertical_scroll_alignment,
      ax::mojom::ScrollBehavior scroll_behavior) const override;

 private:
  bool Click() const;
  bool ShowContextMenu() const;
  bool ScrollToGlobalPoint(const gfx::Point& point) const;

  const ui::AXNode& target_plugin_node_;
  PdfAccessibilityTree* pdf_accessibility_tree_source_;
};

}  // namespace pdf

#endif  // COMPONENTS_PDF_RENDERER_PDF_AX_ACTION_TARGET_H_


text:
C++ library for Pythagorean Hodograph Quintic curves

### Overview
Pythogarean Hodograph curves provide a clean and elegant representation for
machine traversable curves without the control point clutter that plagues cubic splines.
Quintic PH curves provide C2 continuity ideal for smooth machine acceleration.

This library is targeted for use in FirePick Delta machines, but may find use
elsewhere.

### What is a PH5Curve?
A Pythogarean Hodograph curve is a polynomial approximation to 2D curve. As such,
it is similar to a Bezier or NURBS curve. What makes a PH curve special is that
the curve passes through its control points. The on-curve control point greatly
reduces the human labor of specifying a PH curve (In reality, a PH curve does in
fact have off-curve control points, but these are secondary and entirely derived
from the on-curve control points.)

PH curves, in particular, quintic PH curves (PH5Curve) are well suited to generating
smooth curves for CNC robots. Although higher order PH curves (7,9, etc.) are also
acceptable, the PH5Curve exhibits C2 continuity for the least computational burden.
C2 continuity is important because C2 continuity asserts that the acceleration profile for a
point traversing the curve is continuous. If acceleration is discontinuous,
machinery jerks.

### Computation and Memory
Generating PH curves from a set of control points is computationally and memory
intensive. However, traversing a PH curve is less demanding. And, finally,
traversing a piece-wise linear approximation to a a sampled PH curve is
even less demanding.

This library is designed to run on processors as small as the ArduinoMega2560,
which only has 8KB of free RAM. On sucha a small processor, the support for
PH curves is necessarily limited--perhaps even to 3 control points.
Given more processing power and memory (e.g., BeagleBone Black) this library
can traverse more complex PH curves having more control points.

Generally speaking, you want to generate PH curves on a fast, desktop/laptop,
but you can traverse them on more modest hardware.

### Installation: ArduinoMega2560
1. Download and install the [library](https://github.com/firepick1/ph5/releases):

	`https://github.com/firepick1/ph5/releases`

1. Unzip and copy the **ph5** folder under the **libraries** folder of your
Arduino workspace folder

	*your-personal-Arduino-workspace-folder*`/libraries/ph5`

1. Restart your Arduino IDE

1. To use the library, include the following line in your sketch:

	`#include <ph5.h>`