text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ajayhao.simpleboot.dal.mapper.StockInfoMapper">
  <resultMap id="BaseResultMap" type="com.ajayhao.simpleboot.dal.dataobject.StockInfoDO">
    <id column="ID" jdbcType="BIGINT" property="id" />
    <result column="GID" jdbcType="VARCHAR" property="gid" />
    <result column="WORK_DATE" jdbcType="VARCHAR" property="workDate" />
    <result column="STOCK_NAME" jdbcType="VARCHAR" property="stockName" />
    <result column="INCRE_PER" jdbcType="DECIMAL" property="increPer" />
    <result column="INCREASE" jdbcType="DECIMAL" property="increase" />
    <result column="TODAY_START_PRI" jdbcType="DECIMAL" property="todayStartPri" />
    <result column="YESTOD_END_PRI" jdbcType="DECIMAL" property="yestodEndPri" />
    <result column="NOW_PRI" jdbcType="DECIMAL" property="nowPri" />
    <result column="TODAY_MAX" jdbcType="DECIMAL" property="todayMax" />
    <result column="TODAY_MIN" jdbcType="DECIMAL" property="todayMin" />
    <result column="TRA_NUMBER" jdbcType="DECIMAL" property="traNumber" />
    <result column="TRA_AMOUNT" jdbcType="DECIMAL" property="traAmount" />
    <result column="GMT_CREATED" jdbcType="TIMESTAMP" property="gmtCreated" />
    <result column="CREATOR" jdbcType="VARCHAR" property="creator" />
    <result column="GMT_MODIFIED" jdbcType="TIMESTAMP" property="gmtModified" />
    <result column="MODIFIER" jdbcType="VARCHAR" property="modifier" />
    <result column="IS_DELETED" jdbcType="CHAR" property="isDeleted" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    ID, GID, WORK_DATE, STOCK_NAME, INCRE_PER, INCREASE, TODAY_START_PRI, YESTOD_END_PRI,
    NOW_PRI, TODAY_MAX, TODAY_MIN, TRA_NUMBER, TRA_AMOUNT, GMT_CREATED, CREATOR, GMT_MODIFIED,
    MODIFIER, IS_DELETED
  </sql>
  <select id="selectByExample" parameterType="com.ajayhao.simpleboot.dal.dataobject.StockInfoDOExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from STOCK_INFO
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from STOCK_INFO
    where ID = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
    delete from STOCK_INFO
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.ajayhao.simpleboot.dal.dataobject.StockInfoDO">
  <selectKey keyProperty="id" resultType="java.lang.Long" order="BEFORE">
    select SEQSTOCKINFO.nextval from dual
  </selectKey>
    insert into STOCK_INFO (ID, GID, WORK_DATE,
      STOCK_NAME, INCRE_PER, INCREASE,
      TODAY_START_PRI, YESTOD_END_PRI, NOW_PRI,
      TODAY_MAX, TODAY_MIN, TRA_NUMBER,
      TRA_AMOUNT, GMT_CREATED, CREATOR,
      GMT_MODIFIED, MODIFIER, IS_DELETED
      )
    values (#{id,jdbcType=BIGINT}, #{gid,jdbcType=VARCHAR}, #{workDate,jdbcType=VARCHAR},
      #{stockName,jdbcType=VARCHAR}, #{increPer,jdbcType=DECIMAL}, #{increase,jdbcType=DECIMAL},
      #{todayStartPri,jdbcType=DECIMAL}, #{yestodEndPri,jdbcType=DECIMAL}, #{nowPri,jdbcType=DECIMAL},
      #{todayMax,jdbcType=DECIMAL}, #{todayMin,jdbcType=DECIMAL}, #{traNumber,jdbcType=DECIMAL},
      #{traAmount,jdbcType=DECIMAL}, #{gmtCreated,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR},
      #{gmtModified,jdbcType=TIMESTAMP}, #{modifier,jdbcType=VARCHAR}, #{isDeleted,jdbcType=CHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.ajayhao.simpleboot.dal.dataobject.StockInfoDO">
    insert into STOCK_INFO
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="gid != null">
        GID,
      </if>
      <if test="workDate != null">
        WORK_DATE,
      </if>
      <if test="stockName != null">
        STOCK_NAME,
      </if>
      <if test="increPer != null">
        INCRE_PER,
      </if>
      <if test="increase != null">
        INCREASE,
      </if>
      <if test="todayStartPri != null">
        TODAY_START_PRI,
      </if>
      <if test="yestodEndPri != null">
        YESTOD_END_PRI,
      </if>
      <if test="nowPri != null">
        NOW_PRI,
      </if>
      <if test="todayMax != null">
        TODAY_MAX,
      </if>
      <if test="todayMin != null">
        TODAY_MIN,
      </if>
      <if test="traNumber != null">
        TRA_NUMBER,
      </if>
      <if test="traAmount != null">
        TRA_AMOUNT,
      </if>
      <if test="gmtCreated != null">
        GMT_CREATED,
      </if>
      <if test="creator != null">
        CREATOR,
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED,
      </if>
      <if test="modifier != null">
        MODIFIER,
      </if>
      <if test="isDeleted != null">
        IS_DELETED,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="gid != null">
        #{gid,jdbcType=VARCHAR},
      </if>
      <if test="workDate != null">
        #{workDate,jdbcType=VARCHAR},
      </if>
      <if test="stockName != null">
        #{stockName,jdbcType=VARCHAR},
      </if>
      <if test="increPer != null">
        #{increPer,jdbcType=DECIMAL},
      </if>
      <if test="increase != null">
        #{increase,jdbcType=DECIMAL},
      </if>
      <if test="todayStartPri != null">
        #{todayStartPri,jdbcType=DECIMAL},
      </if>
      <if test="yestodEndPri != null">
        #{yestodEndPri,jdbcType=DECIMAL},
      </if>
      <if test="nowPri != null">
        #{nowPri,jdbcType=DECIMAL},
      </if>
      <if test="todayMax != null">
        #{todayMax,jdbcType=DECIMAL},
      </if>
      <if test="todayMin != null">
        #{todayMin,jdbcType=DECIMAL},
      </if>
      <if test="traNumber != null">
        #{traNumber,jdbcType=DECIMAL},
      </if>
      <if test="traAmount != null">
        #{traAmount,jdbcType=DECIMAL},
      </if>
      <if test="gmtCreated != null">
        #{gmtCreated,jdbcType=TIMESTAMP},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="modifier != null">
        #{modifier,jdbcType=VARCHAR},
      </if>
      <if test="isDeleted != null">
        #{isDeleted,jdbcType=CHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByExampleSelective" parameterType="map">
    update STOCK_INFO
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.gid != null">
        GID = #{record.gid,jdbcType=VARCHAR},
      </if>
      <if test="record.workDate != null">
        WORK_DATE = #{record.workDate,jdbcType=VARCHAR},
      </if>
      <if test="record.stockName != null">
        STOCK_NAME = #{record.stockName,jdbcType=VARCHAR},
      </if>
      <if test="record.increPer != null">
        INCRE_PER = #{record.increPer,jdbcType=DECIMAL},
      </if>
      <if test="record.increase != null">
        INCREASE = #{record.increase,jdbcType=DECIMAL},
      </if>
      <if test="record.todayStartPri != null">
        TODAY_START_PRI = #{record.todayStartPri,jdbcType=DECIMAL},
      </if>
      <if test="record.yestodEndPri != null">
        YESTOD_END_PRI = #{record.yestodEndPri,jdbcType=DECIMAL},
      </if>
      <if test="record.nowPri != null">
        NOW_PRI = #{record.nowPri,jdbcType=DECIMAL},
      </if>
      <if test="record.todayMax != null">
        TODAY_MAX = #{record.todayMax,jdbcType=DECIMAL},
      </if>
      <if test="record.todayMin != null">
        TODAY_MIN = #{record.todayMin,jdbcType=DECIMAL},
      </if>
      <if test="record.traNumber != null">
        TRA_NUMBER = #{record.traNumber,jdbcType=DECIMAL},
      </if>
      <if test="record.traAmount != null">
        TRA_AMOUNT = #{record.traAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.gmtCreated != null">
        GMT_CREATED = #{record.gmtCreated,jdbcType=TIMESTAMP},
      </if>
      <if test="record.creator != null">
        CREATOR = #{record.creator,jdbcType=VARCHAR},
      </if>
      <if test="record.gmtModified != null">
        GMT_MODIFIED = #{record.gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifier != null">
        MODIFIER = #{record.modifier,jdbcType=VARCHAR},
      </if>
      <if test="record.isDeleted != null">
        IS_DELETED = #{record.isDeleted,jdbcType=CHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update STOCK_INFO
    set ID = #{record.id,jdbcType=BIGINT},
      GID = #{record.gid,jdbcType=VARCHAR},
      WORK_DATE = #{record.workDate,jdbcType=VARCHAR},
      STOCK_NAME = #{record.stockName,jdbcType=VARCHAR},
      INCRE_PER = #{record.increPer,jdbcType=DECIMAL},
      INCREASE = #{record.increase,jdbcType=DECIMAL},
      TODAY_START_PRI = #{record.todayStartPri,jdbcType=DECIMAL},
      YESTOD_END_PRI = #{record.yestodEndPri,jdbcType=DECIMAL},
      NOW_PRI = #{record.nowPri,jdbcType=DECIMAL},
      TODAY_MAX = #{record.todayMax,jdbcType=DECIMAL},
      TODAY_MIN = #{record.todayMin,jdbcType=DECIMAL},
      TRA_NUMBER = #{record.traNumber,jdbcType=DECIMAL},
      TRA_AMOUNT = #{record.traAmount,jdbcType=DECIMAL},
      GMT_CREATED = #{record.gmtCreated,jdbcType=TIMESTAMP},
      CREATOR = #{record.creator,jdbcType=VARCHAR},
      GMT_MODIFIED = #{record.gmtModified,jdbcType=TIMESTAMP},
      MODIFIER = #{record.modifier,jdbcType=VARCHAR},
      IS_DELETED = #{record.isDeleted,jdbcType=CHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ajayhao.simpleboot.dal.dataobject.StockInfoDO">
    update STOCK_INFO
    <set>
      <if test="gid != null">
        GID = #{gid,jdbcType=VARCHAR},
      </if>
      <if test="workDate != null">
        WORK_DATE = #{workDate,jdbcType=VARCHAR},
      </if>
      <if test="stockName != null">
        STOCK_NAME = #{stockName,jdbcType=VARCHAR},
      </if>
      <if test="increPer != null">
        INCRE_PER = #{increPer,jdbcType=DECIMAL},
      </if>
      <if test="increase != null">
        INCREASE = #{increase,jdbcType=DECIMAL},
      </if>
      <if test="todayStartPri != null">
        TODAY_START_PRI = #{todayStartPri,jdbcType=DECIMAL},
      </if>
      <if test="yestodEndPri != null">
        YESTOD_END_PRI = #{yestodEndPri,jdbcType=DECIMAL},
      </if>
      <if test="nowPri != null">
        NOW_PRI = #{nowPri,jdbcType=DECIMAL},
      </if>
      <if test="todayMax != null">
        TODAY_MAX = #{todayMax,jdbcType=DECIMAL},
      </if>
      <if test="todayMin != null">
        TODAY_MIN = #{todayMin,jdbcType=DECIMAL},
      </if>
      <if test="traNumber != null">
        TRA_NUMBER = #{traNumber,jdbcType=DECIMAL},
      </if>
      <if test="traAmount != null">
        TRA_AMOUNT = #{traAmount,jdbcType=DECIMAL},
      </if>
      <if test="gmtCreated != null">
        GMT_CREATED = #{gmtCreated,jdbcType=TIMESTAMP},
      </if>
      <if test="creator != null">
        CREATOR = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="modifier != null">
        MODIFIER = #{modifier,jdbcType=VARCHAR},
      </if>
      <if test="isDeleted != null">
        IS_DELETED = #{isDeleted,jdbcType=CHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ajayhao.simpleboot.dal.dataobject.StockInfoDO">
    update STOCK_INFO
    set GID = #{gid,jdbcType=VARCHAR},
      WORK_DATE = #{workDate,jdbcType=VARCHAR},
      STOCK_NAME = #{stockName,jdbcType=VARCHAR},
      INCRE_PER = #{increPer,jdbcType=DECIMAL},
      INCREASE = #{increase,jdbcType=DECIMAL},
      TODAY_START_PRI = #{todayStartPri,jdbcType=DECIMAL},
      YESTOD_END_PRI = #{yestodEndPri,jdbcType=DECIMAL},
      NOW_PRI = #{nowPri,jdbcType=DECIMAL},
      TODAY_MAX = #{todayMax,jdbcType=DECIMAL},
      TODAY_MIN = #{todayMin,jdbcType=DECIMAL},
      TRA_NUMBER = #{traNumber,jdbcType=DECIMAL},
      TRA_AMOUNT = #{traAmount,jdbcType=DECIMAL},
      GMT_CREATED = #{gmtCreated,jdbcType=TIMESTAMP},
      CREATOR = #{creator,jdbcType=VARCHAR},
      GMT_MODIFIED = #{gmtModified,jdbcType=TIMESTAMP},
      MODIFIER = #{modifier,jdbcType=VARCHAR},
      IS_DELETED = #{isDeleted,jdbcType=CHAR}
    where ID = #{id,jdbcType=BIGINT}
  </update>
</mapper>


text: QNIBTerminal version of the ceph monitor

redpajama_set_name: RedPajamaGithub


text:
package baselit

import (
	"fmt"
	"path/filepath"

	"github.com/vito/booklit"
	"github.com/vito/booklit/ast"
)

func init() {
	booklit.RegisterPlugin("baselit", NewPlugin)
}

func NewPlugin(section *booklit.Section) booklit.Plugin {
	return Plugin{
		section: section,
	}
}

type Plugin struct {
	section *booklit.Section
}

func (plugin Plugin) UsePlugin(name string) error {
	pluginFactory, found := booklit.LookupPlugin(name)
	if !found {
		return fmt.Errorf("unknown plugin '%s'", name)
	}

	plugin.section.UsePlugin(pluginFactory)

	return nil
}

func (plugin Plugin) Styled(name string) {
	plugin.section.Style = name
}

func (plugin Plugin) Title(title booklit.Content, tags ...string) error {
	if plugin.section.Title != booklit.Empty {
		return booklit.TitleTwiceError{
			TitleLocation: booklit.ErrorLocation{
				FilePath:     plugin.section.FilePath(),
				NodeLocation: plugin.section.TitleLocation,
				Length:       len("\\title"),
			},
			ErrorLocation: booklit.ErrorLocation{
				FilePath:     plugin.section.FilePath(),
				NodeLocation: plugin.section.InvokeLocation,
				Length:       len("\\title"),
			},
		}
	}

	plugin.section.SetTitle(title, plugin.section.InvokeLocation, tags...)
	return nil
}

func (plugin Plugin) Aux(content booklit.Content) booklit.Content {
	return booklit.Aux{
		Content: content,
	}
}

func (plugin Plugin) Section(node ast.Node) error {
	section, err := plugin.section.Processor.EvaluateNode(plugin.section, node, plugin.section.PluginFactories)
	if err != nil {
		return err
	}

	section.Location = plugin.section.InvokeLocation

	plugin.section.Children = append(plugin.section.Children, section)

	return nil
}

func (plugin Plugin) IncludeSection(path string) error {
	sectionPath := filepath.Join(filepath.Dir(plugin.section.FilePath()), path)

	section, err := plugin.section.Processor.EvaluateFile(plugin.section, sectionPath, []booklit.PluginFactory{NewPlugin})
	if err != nil {
		return err
	}

	plugin.section.Children = append(plugin.section.Children, section)

	return nil
}

func (plugin Plugin) SinglePage() {
	plugin.section.PreventSplitSections = true
}

func (plugin Plugin) SplitSections() {
	plugin.section.ResetDepth = true

	if !plugin.section.SplitSectionsPrevented() {
		plugin.section.SplitSections = true
	}
}

func (plugin Plugin) OmitChildrenFromTableOfContents() {
	plugin.section.OmitChildrenFromTableOfContents = true
}

func (plugin Plugin) TableOfContents() booklit.Content {
	return booklit.TableOfContents{
		Section: plugin.section,
	}
}

func (plugin Plugin) Code(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleVerbatim,
	}
}

func (plugin Plugin) Italic(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleItalic,
	}
}

func (plugin Plugin) Bold(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleBold,
	}
}

func (plugin Plugin) Larger(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleLarger,
	}
}

func (plugin Plugin) Smaller(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleSmaller,
	}
}

func (plugin Plugin) Strike(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleStrike,
	}
}

func (plugin Plugin) Superscript(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleSuperscript,
	}
}

func (plugin Plugin) Subscript(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleSubscript,
	}
}

func (plugin Plugin) Inset(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleInset,
	}
}

func (plugin Plugin) Aside(content booklit.Content) booklit.Content {
	return booklit.Styled{
		Content: content,
		Style:   booklit.StyleAside,
	}
}

func (plugin Plugin) Link(content booklit.Content, target string) booklit.Content {
	return booklit.Link{
		Content: content,
		Target:  target,
	}
}

func (plugin Plugin) Reference(tag string, content ...booklit.Content) booklit.Content {
	ref := &booklit.Reference{
		Section: plugin.section,

		TagName: tag,

		Location: plugin.section.InvokeLocation,
	}

	if len(content) > 0 {
		ref.Content = content[0]
	}

	return ref
}

func (plugin Plugin) Target(tag string, titleAndContent ...booklit.Content) booklit.Content {
	ref := &booklit.Target{
		TagName:  tag,
		Location: plugin.section.InvokeLocation,
	}

	switch len(titleAndContent) {
	case 2:
		ref.Title = titleAndContent[0]
		ref.Content = titleAndContent[1]
	case 1:
		ref.Title = titleAndContent[0]
	default:
		ref.Title = booklit.String(tag)
	}

	return ref
}

func (plugin Plugin) List(items ...booklit.Content) booklit.Content {
	return booklit.List{
		Items: items,
	}
}

func (plugin Plugin) OrderedList(items ...booklit.Content) booklit.Content {
	return booklit.List{
		Items:   items,
		Ordered: true,
	}
}

func (plugin Plugin) Image(path string, description ...string) booklit.Content {
	img := booklit.Image{
		Path: path,
	}

	if len(description) > 0 {
		img.Description = description[0]
	}

	return img
}

func (plugin Plugin) SetPartial(name string, content booklit.Content) {
	plugin.section.SetPartial(name, content)
}

func (plugin Plugin) Table(rows ...booklit.Content) (booklit.Content, error) {
	table := booklit.Table{}

	for _, row := range rows {
		list, ok := row.(booklit.List)
		if !ok {
			return nil, fmt.Errorf("table row is not a list: %s", row)
		}

		table.Rows = append(table.Rows, list.Items)
	}

	return table, nil
}

func (plugin Plugin) TableRow(cols ...booklit.Content) booklit.Content {
	return plugin.List(cols...)
}

func (plugin Plugin) Definitions(items ...booklit.Content) (booklit.Content, error) {
	defs := booklit.Definitions{}
	for _, item := range items {
		list, ok := item.(booklit.List)
		if !ok {
			return nil, fmt.Errorf("definition item is not a list: %s", item)
		}

		if len(list.Items) != 2 {
			return nil, fmt.Errorf("definition item must have two entries: %s", item)
		}

		defs = append(defs, booklit.Definition{
			Subject:    list.Items[0],
			Definition: list.Items[1],
		})
	}

	return defs, nil
}

func (plugin Plugin) Definition(subject, definition booklit.Content) booklit.Content {
	return plugin.List(subject, definition)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (c) 2016 Google Inc.

  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.
  -->

<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="48dp"
    android:height="48dp"
    android:viewportHeight="24"
    android:viewportWidth="24">

    <group
        android:name="background_protection"
        android:translateY="1">
        <path
            android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,16.5v-9l6,4.5 -6,4.5z"
            android:fillColor="#42424242" />
    </group>

    <path
        android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,16.5v-9l6,4.5 -6,4.5z"
        android:fillColor="@android:color/white" />

</vector>


text:
Plugin.define "LK-IHC-Controller" do
author "Brendan Coles <bcoles@gmail.com>" # 2011-06-01
version "0.1"
description "Visualization of an IHC Control electrical installation."
website "http://www.prolor.dk/ihc.php"

# Google results as at 2011-06-01 #
# 5 for intitle:"LK IHC controller forside" +SceneView

# Dorks #
dorks [
'intitle:"LK IHC controller forside" "SceneView"'
]

# Matches #
matches [

# Title
{ :text=>'<title>LK IHC controller forside</title>' },

# images/bg_image_LK.jpg HTML
{ :text=>'<table width="640" height="480" border="0" cellspacing="0" cellpadding="0"  background="images/bg_image_LK.jpg">' },

# /images/bg_image_LK.jpg
{ :url=>"/images/bg_image_LK.jpg", :md5=>"c23378580cb58ee4c404106dda5757b3" },

]

end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AdminLTE 2 | Data Tables</title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

  <link rel="stylesheet" href="<?php echo base_url().'assets/AdminLTE/';?>bootstrap/css/bootstrap.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <link rel="stylesheet" href="<?php echo base_url().'assets/AdminLTE/';?>plugins/datatables/dataTables.bootstrap.css">

  <link rel="stylesheet" href="<?php echo base_url().'assets/AdminLTE/';?>dist/css/AdminLTE.min.css">

  <link rel="stylesheet" href="<?php echo base_url().'assets/AdminLTE/';?>dist/css/skins/_all-skins.min.css">

      ALT

      AdminLTE

        Toggle navigation

              4

You have 4 messages

                        Support Team
                         5 mins

Why not buy a new awesome theme?

                        AdminLTE Design Team
                         2 hours

Why not buy a new awesome theme?

                        Developers
                         Today

Why not buy a new awesome theme?

                        Sales Department
                         Yesterday

Why not buy a new awesome theme?

                        Reviewers
                         2 days

Why not buy a new awesome theme?

See All Messages

              10

You have 10 notifications

                       5 new members joined today

                       Very long description here that may not fit into the
                      page and may cause design problems

                       5 new members joined

                       25 sales made

                       You changed your username

View all

              9

You have 9 tasks

                        Design some buttons
                        20%

                          20% Complete

                        Create a nice theme
                        40%

                          40% Complete

                        Some task I need to do
                        60%

                          60% Complete

                        Make beautiful transitions
                        80%

                          80% Complete

                View all tasks

              Alexander Pierce

                  Alexander Pierce - Web Developer
                  Member since Nov. 2012

                    Followers

                    Sales

                    Friends

                  Profile

                  Sign out

Alexander Pierce

           Online

      <form action="#" method="get" class="sidebar-form">

          <input type="text" name="q" class="form-control" placeholder="Search...">

                <button type="submit" name="search" id="search-btn" class="btn btn-flat">
                </button>

      </form>

MAIN NAVIGATION

             Dashboard

 Dashboard v1

 Dashboard v2

            Layout Options

              4

 Top Navigation

 Boxed

 Fixed

 Collapsed Sidebar

             Widgets

              new

            Charts

 ChartJS

 Morris

 Flot

 Inline charts

            UI Elements

 General

 Icons

 Buttons

 Sliders

 Timeline

 Modals

             Forms

 General Elements

 Advanced Elements

 Editors

             Tables

 Simple tables

 Data tables

             Calendar

              3
              17

             Mailbox

              12
              16
              5

             Examples

 Invoice

 Profile

 Login

 Register

 Lockscreen

 404 Error

 500 Error

 Blank Page

 Pace Page

             Multilevel

 Level One

               Level One

 Level Two

                   Level Two

 Level Three

 Level Three

 Level One

 Documentation

LABELS

 Important

 Warning

 Information

        Data Tables
        advanced tables

 Home

Tables

Data tables

              <a href="<?php echo base_url().'user/create';?>"><button type="submit" class="btn btn-primary">Create User</button>

            <?php if($this->session->flashdata('success_message')) { ?>

<?php echo $this->session->flashdata('success_message');?>

            <?php } ?>
            <?php if($this->session->flashdata('delete_message')) { ?>

<?php echo $this->session->flashdata('delete_message');?>

            <?php } ?>
            <?php if($this->session->flashdata('update_message')) { ?>

<?php echo $this->session->flashdata('update_message');?>

            <?php } ?>

                  Name
                  Email
                  Age
                  Engine version
                  CSS grade

                <?php foreach($all_user as $key => $value) { ?>

                  <?php echo $value->username;?>
                  <?php echo $value->email;?>
                  <?php echo $value->age;?>
                  -
                  U

                <?php  } ?>

                  Rendering engine
                  Browser
                  Platform(s)
                  Engine version
                  CSS grade

      Version 2.3.6

    Copyright © 2014-2016 Almsaeed Studio. All rights
    reserved.

Recent Activity

Langdon's Birthday

Will be 23 on April 24th

Frodo Updated His Profile

New phone +1(800)555-1234

Nora Joined Mailing List

nora@example.com

Cron Job 254 Executed

Execution time 5 seconds

Tasks Progress

                Custom Template Design
                70%

                Update Resume
                95%

                Laravel Integration
                50%

                Back End Framework
                68%

Stats Tab Content

        <form method="post">

General Settings

              Report panel usage
              <input type="checkbox" class="pull-right" checked>

              Some information about this general settings option

              Allow mail redirect
              <input type="checkbox" class="pull-right" checked>

              Other sets of options are available

              Expose author name in posts
              <input type="checkbox" class="pull-right" checked>

              Allow the user to show his name in blog posts

Chat Settings

              Show me as online
              <input type="checkbox" class="pull-right" checked>

              Turn off notifications
              <input type="checkbox" class="pull-right">

              Delete chat history

        </form>


text:
namespace subresource_filter {

DevtoolsInteractionTracker::DevtoolsInteractionTracker(
    content::WebContents* web_contents)
    : content::WebContentsUserData<DevtoolsInteractionTracker>(*web_contents) {}

DevtoolsInteractionTracker::~DevtoolsInteractionTracker() = default;

void DevtoolsInteractionTracker::ToggleForceActivation(bool force_activation) {
  if (!activated_via_devtools_ && force_activation)
    ContentSubresourceFilterThrottleManager::LogAction(
        SubresourceFilterAction::kForcedActivationEnabled);
  activated_via_devtools_ = force_activation;
}

WEB_CONTENTS_USER_DATA_KEY_IMPL(DevtoolsInteractionTracker);

}  // namespace subresource_filter


text:
using System;
using FluentAssertions;
using Machine.Specifications;

namespace NeverNull.Tests {
    [Subject(typeof (Option), "FromTryPattern")]
    public class When_I_create_an_option_from_Int32_TryParse {
        static Option<int> _sut;

        Because of =
            () => _sut = Option.FromTryPattern<string, int>(Int32.TryParse, "26");

        It should_return_an_option_that_has_a_value =
            () => _sut.HasValue.Should().BeTrue();

        It should_return_an_option_that_is_not_empty =
            () => _sut.IsEmpty.Should().BeFalse();

        It should_return_that_contains_hello_as_the_value =
            () => _sut.Value.Should().Be(26);
    }
}


text:
import React, { PropTypes } from 'react';

const TextInput = ({ name, label, onChange, placeholder, value, error }) => {
  let wrapperClass = 'form-group';
  if (error && error.length > 0) {
    wrapperClass += " " + "haserror";
  }

  return (

      { label }

        <input
          type="text"
          name={ name }
          classsName="form-control"
          placeholder={ placeholder }
          value={ value }
          onChange={ onChange }
        />
        { error &&
{ error }
 }

  );
};

TextInput.propTypes = {
  name: PropTypes.string.isRequired,
  label: PropTypes.string.isRequired,
  onChange: PropTypes.func.isRequired,
  placeholder: PropTypes.string,
  value: PropTypes.string,
  error: PropTypes.string
};

export default TextInput;


text:
package com.splunk.examples.explorer;

import com.splunk.Entity;

class OutputSyslogNode extends EntityNode {
    OutputSyslogNode(Entity value) {
        super(value);
    }

    @Override protected PropertyList getMetadata() {
        PropertyList list = super.getMetadata();
        list.add(String.class, "getServer");
        list.add(String.class, "getType");
        return list;
    }
}


text:
package com.google.cloud.bigtable.hbase.adapters.filters;

import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;

import com.google.api.core.InternalApi;
import com.google.cloud.bigtable.data.v2.models.Filters.Filter;
import com.google.cloud.bigtable.hbase.adapters.read.ReaderExpressionHelper;
import com.google.protobuf.ByteString;
import java.io.IOException;
import org.apache.hadoop.hbase.filter.ColumnPrefixFilter;

/**
 * Adapter for a single ColumnPrefixFilter to a Cloud Bigtable RowFilter.
 *
 * <p>For internal use only - public for technical reasons.
 */
@InternalApi("For internal usage only")
public class ColumnPrefixFilterAdapter extends TypedFilterAdapterBase<ColumnPrefixFilter> {

  /** {@inheritDoc} */
  @Override
  public Filter adapt(FilterAdapterContext context, ColumnPrefixFilter filter) throws IOException {
    byte[] prefix = filter.getPrefix();

    // Quoting for RE2 can result in at most length * 2 characters written. Pre-allocate
    // that much space in the ByteString.Output to prevent reallocation later.
    ByteString.Output outputStream = ByteString.newOutput(prefix.length * 2);
    ReaderExpressionHelper.writeQuotedExpression(outputStream, prefix);
    outputStream.write(ReaderExpressionHelper.ALL_QUALIFIERS_BYTES);

    return FILTERS.qualifier().regex(outputStream.toByteString());
  }

  /** {@inheritDoc} */
  @Override
  public FilterSupportStatus isFilterSupported(
      FilterAdapterContext context, ColumnPrefixFilter filter) {
    return FilterSupportStatus.SUPPORTED;
  }
}


text:
CC=g++
FLAGS=-ggdb -Wall

all: asm85.cpp imagestore.cpp instructions.cpp symboltable.cpp scanner.cpp
	$(CC) $(FLAGS) imagestore.cpp -c
	$(CC) $(FLAGS) instructions.cpp -c
	$(CC) $(FLAGS) scanner.cpp -c
	$(CC) $(FLAGS) symboltable.cpp -c
	$(CC) $(FLAGS) asm85.cpp imagestore.o instructions.o scanner.o symboltable.o -o asm85

clean:
	rm -f asm85 *.o


text:
require File.dirname(__FILE__) + '/unit_test_helper'
require 'crack'
require 'restclient'

require File.dirname(__FILE__) + "/../init"

class TicketTest < Test::Unit::TestCase
  def test_query_ticket
      result = UuyoooTicket.get_with('queryTicket',{:goodsId=>"xxxxxx"})
      p result.inspect,'----queryTicket---'
  end

  #第三方接口有问题
  def test_query_film
     result = UuyoooTicket.get_with('queryFilm',{:goodsId=>"xxxxxx"})
     p result.inspect,'----queryFilm---'
  end

  def test_buy_film
    result = UuyoooTicket.get_with('buyFilm',{:goodsId=>"xxxxxx",:goodsNum=>"1",:tranSeq=>"xxxxxx",:time=>"20120531154000",:userPhone=>"xxxxxx"})
    p result.inspect,'----buyFilm---'
  end
end


text:
namespace BitFunnel
{
    class CompileNode;
    class IAllocator;
    class RowMatchNode;

    class RankZeroCompiler : NonCopyable
    {
    public:
        RankZeroCompiler(IAllocator& allocator);

        CompileNode const & Compile(RowMatchNode const & node);

    private:
        IAllocator& m_allocator;
    };
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Penha</logradouro><bairro>Rio Negro</bairro><cidade>Sabará</cidade><uf>MG</uf><cep>34700180</cep></feed>


text:
package com.svbio.cloudkeeper.model.bare.element;

import com.svbio.cloudkeeper.model.bare.BareLocatable;
import com.svbio.cloudkeeper.model.immutable.element.Version;

import javax.annotation.Nullable;
import java.net.URI;
import java.util.Date;
import java.util.List;

public interface BareBundle extends BareLocatable {
    /**
     * Human-readable name of the entity modeled by this interface.
     */
    String NAME = "bundle";

    /**
     * Returns the creation time/date of this repository.
     */
    @Nullable
    Date getCreationTime();

    /**
     * Returns the CloudKeeper version used to create this repository.
     */
    @Nullable
    Version getCloudKeeperVersion();

    /**
     * Returns the identifier of this repository.
     *
     * @return bundle identifier
     */
    @Nullable
    URI getBundleIdentifier();

    /**
     * Returns a list of all packages in this repository.
     *
     * @return list of all packages in this repository, guaranteed non-null
     */
    List<? extends BarePackage> getPackages();

    /**
     * Default implementations for standard methods.
     */
    final class Default {
        private Default() { }

        public static String toString(BareBundle instance) {
            return String.format(
                "%s '%s' (%d packages)", NAME, instance.getBundleIdentifier(), instance.getPackages().size()
            );
        }
    }
}


text:
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.android.sunshine.app.fragment.ForecastFragment">

    <ListView
        android:id="@+id/listview_forecast"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        style="@style/ForecastListStyle"
        android:divider="@null" />

</FrameLayout>


text:
package.path = './dmc_lua/?.lua;' .. package.path

--====================================================================--
--== Test: Lua Promise
--====================================================================--

-- Semantic Versioning Specification: http://semver.org/

local VERSION = "0.1.0"

--====================================================================--
--== Imports

local Promise = require 'lua_promise'

--====================================================================--
--== Testing Setup
--====================================================================--

describe( "Module Test: lua_promise.lua", function()

	describe( "Tests for Module", function()

		it( "has a version", function()
			assert.is.equal( type(Promise.__version), 'string' )
		end)

		it( "has a Promise class", function()
			local class = Promise.Promise
			assert.is.equal( type(class), 'table' )
			assert.is.equal( class.NAME, "Lua Promise" )
		end)

		it( "has a Deferred class", function()
			local class = Promise.Deferred
			assert.is.equal( type(class), 'table' )
			assert.is.equal( class.NAME, "Lua Deferred" )
		end)

	end)

	describe( "Tests for Promise", function()

		local obj

		before_each( function()
			obj = Promise.Promise:new()
		end)

		after_each( function()
			obj:destroy()
			obj = nil
		end)

		it( "can be resolved", function()
			local cb1_f, cb2_f
			local val, err = nil, nil

			cb1_f = function( value )
				val = value
			end
			cb2_f = function( e )
				err = e
			end

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:done( cb1_f )
			obj:fail( cb2_f )

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:resolve( "success" )

			assert.are.equal( val, 'success' )
			assert.are.equal( err, nil )

		end)

		it( "can be rejected", function()
			local cb1_f, cb2_f
			local val, err = nil, nil

			cb1_f = function( value )
				val = value
			end
			cb2_f = function( e )
				err = e
			end

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:done( cb1_f )
			obj:fail( cb2_f )

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:reject( "error" )

			assert.are.equal( val, nil )
			assert.are.equal( err, 'error' )
		end)

		it( "has multiple resolve callbacks", function()
			local cb1_f, cb2_f
			local val1, val2 = nil, nil

			cb1_f = function( value )
				val1 = value
			end
			cb2_f = function( e )
				val2 = e
			end

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:done( cb1_f )
			obj:done( cb2_f )

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:resolve( "success!" )

			assert.are.equal( val1, "success!" )
			assert.are.equal( val2, "success!" )
		end)

		it( "has multiple reject callbacks", function()
			local cb1_f, cb2_f
			local val1, val2 = nil, nil

			cb1_f = function( value )
				val1 = value
			end
			cb2_f = function( e )
				val2 = e
			end

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:fail( cb1_f )
			obj:fail( cb2_f )

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:reject( "error!" )

			assert.are.equal( val1, "error!" )
			assert.are.equal( val2, "error!" )
		end)

	end)

	describe( "Tests for Deferred", function()

		local obj

		before_each( function()
			obj = Promise.Deferred:new()
		end)

		after_each( function()
			obj:destroy()
			obj = nil
		end)

		it( "has a Promise", function()
			local promise = obj.promise
			assert.is.equal( type(promise), 'table' )
			assert.is.equal( promise.NAME, "Lua Promise" )
		end)

		it( "can be resolved", function()
			local cb1_f, cb2_f
			local val, err = nil, nil

			cb1_f = function( value )
				val = value
			end
			cb2_f = function( e )
				err = e
			end

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:addCallbacks( cb1_f, cb2_f )

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:callback( "success" )

			assert.are.equal( val, 'success' )
			assert.are.equal( err, nil )

		end)

		it( "can be rejected", function()
			local cb1_f, cb2_f
			local val, err = nil, nil

			cb1_f = function( value )
				val = value
			end
			cb2_f = function( e )
				err = e
			end

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:addCallbacks( cb1_f, cb2_f )

			assert.are.equal( val, nil )
			assert.are.equal( err, nil )

			obj:errback( "error" )

			assert.are.equal( val, nil )
			assert.are.equal( err, 'error' )
		end)

		it( "has multiple resolve callbacks", function()
			local cb1_f, cb2_f
			local val1, val2 = nil, nil

			cb1_f = function( value )
				val1 = value
			end
			cb2_f = function( e )
				val2 = e
			end

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:addCallbacks( cb1_f )
			obj:addCallbacks( cb2_f )

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:callback( "success!" )

			assert.are.equal( val1, "success!" )
			assert.are.equal( val2, "success!" )
		end)

		it( "has multiple reject callbacks", function()
			local cb1_f, cb2_f
			local val1, val2 = nil, nil

			cb1_f = function( value )
				val1 = value
			end
			cb2_f = function( e )
				val2 = e
			end

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:addCallbacks( nil, cb1_f )
			obj:addCallbacks( nil, cb2_f )

			assert.are.equal( val1, nil )
			assert.are.equal( val2, nil )

			obj:errback( "error!" )

			assert.are.equal( val1, "error!" )
			assert.are.equal( val2, "error!" )
		end)

	end)

end)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <title>Mac 遇到问题集锦 — 码志</title>
    <link rel="stylesheet" href="/assets/vendor/primer-css/css/primer.css">
    <link rel="stylesheet" href="/assets/vendor/primer-markdown/dist/user-content.min.css">
    <link rel="stylesheet" href="/assets/vendor/octicons/octicons/octicons.css">
    <link rel="stylesheet" href="/assets/css/components/collection.css">
    <link rel="stylesheet" href="/assets/css/components/repo-card.css">
    <link rel="stylesheet" href="/assets/css/sections/repo-list.css">
    <link rel="stylesheet" href="/assets/css/sections/mini-repo-list.css">
    <link rel="stylesheet" href="/assets/css/components/boxed-group.css">
    <link rel="stylesheet" href="/assets/css/globals/common.css">
    <link rel="stylesheet" href="/assets/vendor/share.js/dist/css/share.min.css">
    <link rel="stylesheet" href="/assets/css/globals/responsive.css">
    <link rel="stylesheet" href="/assets/css/posts/index.css">

    <link rel="alternate" type="application/atom+xml" title="码志" href="/feed.xml">
    <link rel="shortcut icon" href="/favicon.ico">

    <meta property="og:title" content="Mac 遇到问题集锦">

    <meta name="keywords" content="Mac">
    <meta name="og:keywords" content="Mac">

    <meta name="description" content="  在桌面和 Finder 底部出现的神秘白条是怎么回事,如何消除?">
    <meta name="og:description" content="  在桌面和 Finder 底部出现的神秘白条是怎么回事,如何消除?">

    <meta property="og:url" content="https://mazhuang.org/2015/10/25/mac/">
    <meta property="og:site_name" content="码志">
    <meta property="og:type" content="article">
    <meta property="og:locale" content="zh_CN" />

    <meta property="article:published_time" content="2015-10-25">

 码志

            <button class="collapsed mobile-visible" type="button" onclick="toggleMenu();">

            </button>

                首页

                分类

                维基

                链接

                关于

Mac 遇到问题集锦

             2015/10/25

            Mac

在桌面和 Finder 底部出现的神秘白条是怎么回事,如何消除?

它可以拖动,可以拉伸改变形状,并不知道它属于哪个程序,一旦出现在 Finder 底部和桌面都会存在。

经过尝试,发现它出现的步骤是这样的:

在 Finder 中点击一下空白区域,然后使用中文输入法打字。

在文字还没有上屏时出切换到英文输入状态。

用鼠标点击空白区域。

目前试验了「搜狗五笔」和 Mac 自带的「五笔型」均是如此,看来应该是系统的 Bug。

消除方法:点击白条后 Esc。

          Please enable JavaScript to view the comments powered by Disqus.

Search

    <input type="text" id="search_box" placeholder="Search">
    <button class="btn btn-default" id="site_search_do"></button>

<link rel="stylesheet" type="text/css" href="/assets/css/modules/sidebar-search.css">

Post Directory

                    © 2015
                    Zhuang Ma
                    TOP

                    TOP

                    首页

                    分类

                    维基

                    链接

                    关于

    <link rel="stylesheet" href="/assets/css/globals/prism.css">


text:
using System.Linq;

namespace FacetedWorlds.MyCon.Model
{
    public partial class SessionEvaluationRating
    {
        public int Answer
        {
            get { return CurrentAnswers.Select(a => a.Value).FirstOrDefault(); }
            set { Community.AddFact(new SessionEvaluationRatingAnswer(this, CurrentAnswers, value)); }
        }
    }
}


text:
var db = require('../db');
var ObjectID = require('mongodb').ObjectID;
var bcrypt = require('bcrypt-nodejs');
var tokenStorage = require('../utils/remember-me-token');
var GoogleAuthenticator = require('passport-2fa-totp').GoogeAuthenticator;
var TwoFAStartegy = require('passport-2fa-totp').Strategy;
var RememberMeStrategy = require('passport-remember-me').Strategy;

module.exports = function (passport) {
    var INVALID_LOGIN = 'Invalid username or password';

    passport.serializeUser(function (user, done) {
        return done(null, user._id);
    });

    passport.deserializeUser(function (id, done) {
        var users = db.get().collection('users');
        users.findOne(new ObjectID(id), function (err, user) {
            if (err) {
                return done(err);
            } else if (user === null) {
                return done(null, false);
            } else {
                return done(null, user);
            }
        });
    });

    passport.use('login', new TwoFAStartegy({
        usernameField: 'username',
        passwordField: 'password',
        codeField: 'code'
    }, function (username, password, done) {
        // 1st step verification: username and password

        process.nextTick(function () {
            var users = db.get().collection('users');
            users.findOne({ username: username }, function (err, user) {
                if (err) {
                    return done(err);
                }

                if (user === null) {
                    return done(null, false, { message: INVALID_LOGIN });
                }

                bcrypt.compare(password, user.password, function (err, result) {
                    if (err) {
                        return done(err);
                    }

                    if (result === true) {
                        return done(null, user);
                    } else {
                        return done(null, false, { message: INVALID_LOGIN });
                    }
                });
            });
        });
    }, function (user, done) {
        // 2nd step verification: TOTP code from Google Authenticator

        if (!user.secret) {
            done(new Error("Google Authenticator is not setup yet."));
        } else {
            // Google Authenticator uses 30 seconds key period
            // https://github.com/google/google-authenticator/wiki/Key-Uri-Format

            var secret = GoogleAuthenticator.decodeSecret(user.secret);
            done(null, secret, 30);
        }
    }));

    passport.use('register', new TwoFAStartegy({
        usernameField: 'username',
        passwordField: 'password',
        passReqToCallback: true,
        skipTotpVerification: true
    }, function (req, username, password, done) {
        // 1st step verification: validate input and create new user

        if (!/^[A-Za-z0-9_]+$/g.test(req.body.username)) {
            return done(null, false, { message: 'Invalid username' });
        }

        if (req.body.password.length === 0) {
            return done(null, false, { message: 'Password is required' });
        }

        if (req.body.password !== req.body.confirmPassword) {
            return done(null, false, { message: 'Passwords do not match' });
        }

        var users = db.get().collection('users');
        users.findOne({ username: username}, function (err, user) {
            if (err) {
                return done(err);
            }

            if (user !== null) {
                return done(null, false, { message: 'Invalid username' });
            }

            bcrypt.hash(password, null, null, function (err, hash) {
                if (err) {
                    return done(err);
                }

                var user = {
                    username: username,
                    password: hash
                };

                users.insert(user, function (err) {
                    if (err) {
                        return done(err);
                    }

                    return done(null, user);
                });
            });
        });
    }));

    passport.use(new RememberMeStrategy(function (token, done) {
        process.nextTick(function() {
            tokenStorage.consume(token, function (err, user) {
                if (err) {
                    return done(err);
                } else if (user === false) {
                    return done(null, false);
                } else {
                    return done(null, user);
                }
            });
        });
    },
    function (user, done) {
        process.nextTick(function() {
            tokenStorage.create(user, done);
        });
    }));
};


text:
using System.Web.Mvc;

namespace FunnelWeb.Web.Application.Markup
{
    /// <summary>
    /// Renders content (trusted or untrusted) by resolving a formatter that matches the given content format (e.g., HTML vs. Markdown).
    /// </summary>
    public interface IContentRenderer
    {
        string RenderTrusted(string content, string format, HtmlHelper html);
        string RenderUntrusted(string content, string format, HtmlHelper html);
    }
}


text:
using Microsoft.Build.Construction;
using Microsoft.DotNet.ProjectJsonMigration;
using Microsoft.DotNet.Internal.ProjectModel;
using Microsoft.DotNet.Tools.Test.Utilities;
using NuGet.Frameworks;
using System;
using System.IO;
using System.Linq;
using Xunit;
using FluentAssertions;
using Microsoft.DotNet.ProjectJsonMigration.Rules;
using Microsoft.DotNet.Internal.ProjectModel.Files;
using System.Collections.Generic;

namespace Microsoft.DotNet.ProjectJsonMigration.Tests
{
    public class GivenThatIWantToMigrateBuildOptions : TestBase
    {
        [Fact]
        public void SpecifiedDefaultPropertiesAreRemovedWhenTheyExistInTheCsprojTemplate()
        {
            // Setup project with default properties
            var defaultPropertiesExpectedToBeRemoved = new string[]
            {
                "OutputType",
                "TargetExt"
            };

            var defaultValue = "defaultValue";

            var templateProj = ProjectRootElement.Create();
            var defaultPropertyGroup = templateProj.AddPropertyGroup();

            foreach (var defaultPropertyName in defaultPropertiesExpectedToBeRemoved)
            {
                defaultPropertyGroup.AddProperty(defaultPropertyName, defaultValue);
            }

            // Setup projectcontext
            var testProjectDirectory = TestAssetsManager.CreateTestInstance("TestAppWithRuntimeOptions").Path;
            var projectContext = ProjectContext.Create(testProjectDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10);

            var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(testProjectDirectory, testProjectDirectory, templateProj);
            var testInputs = new MigrationRuleInputs(new[] {projectContext}, templateProj, templateProj.AddItemGroup(),
                templateProj.AddPropertyGroup());
            new MigrateBuildOptionsRule().Apply(testSettings, testInputs);

            defaultPropertyGroup.Properties.Count.Should().Be(0);
        }

        [Fact]
        public void MigratingEmptyBuildOptionsGeneratesAnEmptyCSProj()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": { }
                }");

            mockProj.Items.Count().Should().Be(0);
        }

        [Fact]
        public void MigratingWebProjectWithoutCustomSourcesOrResourcesDoesNotEmitCompileAndEmbeddedResource()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""emitEntryPoint"": true
                    },
                    ""dependencies"": {
                        ""Microsoft.AspNetCore.Mvc"" : {
                            ""version"": ""1.0.0""
                        }
                    },
                    ""frameworks"": {
                        ""netcoreapp1.0"": {}
                    }
                }");

            mockProj.Items.Count().Should().Be(0);
        }

        [Fact]
        public void MigratingConsoleProjectWithoutCustomSourcesOrResourcesDoesNotEmitCompileAndEmbeddedResource()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""emitEntryPoint"": true
                    },
                    ""frameworks"": {
                        ""netcoreapp1.0"": {}
                    }
                }");

            mockProj.Items.Count().Should().Be(0);
        }

        public void MigratingOutputNamePopulatesAssemblyName()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""outputName"": ""some name""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "AssemblyName").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "AssemblyName").Value.Should().Be("some name");
        }

        [Fact]
        public void MigratingOutputNamePopulatesPackageIdWithTheProjectContainingFolderName()
        {
            var testDirectoryPath = Temp.CreateDirectory().Path;
            var testDirectoryName = new DirectoryInfo(testDirectoryPath).Name;
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""outputName"": ""some name""
                    }
                }",
                testDirectoryPath);

            mockProj.Properties.Count(p => p.Name == "PackageId").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "PackageId").Value.Should().Be(testDirectoryName);
        }

        [Fact]
        public void MigratingEmitEntryPointTruePopulatesOutputTypeField()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""emitEntryPoint"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Exe");
        }

        [Fact]
        public void MigratingEmitEntryPointFalsePopulatesOutputTypeFields()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""emitEntryPoint"": ""false""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Library");
        }

        [Fact]
        public void MigratingDefinePopulatesDefineConstants()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""define"": [ ""DEBUG"", ""TRACE"" ]
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "DefineConstants").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "DefineConstants")
                .Value.Should().Be("$(DefineConstants);DEBUG;TRACE");
        }

        [Fact]
        public void MigratingNowarnPopulatesNoWarn()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""nowarn"": [ ""CS0168"", ""CS0219"" ]
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "NoWarn").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "NoWarn").Value.Should().Be("$(NoWarn);CS0168;CS0219");
        }

        [Fact]
        public void MigratingWarningsAsErrorsPopulatesWarningsAsErrors()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""warningsAsErrors"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "WarningsAsErrors").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "WarningsAsErrors").Value.Should().Be("true");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""warningsAsErrors"": ""false""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "WarningsAsErrors").Should().Be(0);
        }

        [Fact]
        public void MigratingAllowUnsafePopulatesAllowUnsafeBlocks()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""allowUnsafe"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "AllowUnsafeBlocks").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "AllowUnsafeBlocks").Value.Should().Be("true");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""allowUnsafe"": ""false""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "AllowUnsafeBlocks").Should().Be(0);
        }

        [Fact]
        public void MigratingOptimizePopulatesOptimize()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""optimize"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "Optimize").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "Optimize").Value.Should().Be("true");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""optimize"": ""false""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "Optimize").Should().Be(0);
        }

        [Fact]
        public void MigratingPlatformPopulatesPlatformTarget()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""platform"": ""x64""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "PlatformTarget").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "PlatformTarget").Value.Should().Be("x64");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""platform"": ""x86""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "PlatformTarget").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "PlatformTarget").Value.Should().Be("x86");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""platform"": ""foo""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "PlatformTarget").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "PlatformTarget").Value.Should().Be("foo");
        }

        [Fact]
        public void MigratingLanguageVersionPopulatesLangVersion()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""languageVersion"": ""5""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "LangVersion").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "LangVersion").Value.Should().Be("5");
        }

        [Fact]
        public void MigratingLanguageVersionRemovesCsharpInLangVersion()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""languageVersion"": ""csharp5""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "LangVersion").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "LangVersion").Value.Should().Be("5");
        }

        [Fact]
        public void MigratingKeyFilePopulatesAssemblyOriginatorKeyFileAndSignAssembly()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""keyFile"": ""../keyfile.snk""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "AssemblyOriginatorKeyFile").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "AssemblyOriginatorKeyFile").Value.Should().Be("../keyfile.snk");

            mockProj.Properties.Count(p => p.Name == "SignAssembly").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "SignAssembly").Value.Should().Be("true");

            mockProj.Properties.Count(p => p.Name == "PublicSign").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "PublicSign").Value.Should().Be("true");
            mockProj.Properties.First(p => p.Name == "PublicSign").Condition.Should().Be(" '$(OS)' != 'Windows_NT' ");
        }

        [Fact]
        public void MigratingDelaySignPopulatesDelaySign()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""delaySign"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "DelaySign").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "DelaySign").Value.Should().Be("true");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""delaySign"": ""false""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "DelaySign").Should().Be(0);
        }

        [Fact]
        public void MigratingPublicSignPopulatesPublicSign()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""publicSign"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "PublicSign").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "PublicSign").Value.Should().Be("true");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""publicSign"": ""false""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "PublicSign").Should().Be(0);
        }

        [Fact]
        public void MigratingDebugTypePopulatesDebugType()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""debugType"": ""full""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "DebugType").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "DebugType").Value.Should().Be("full");

            mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""debugType"": ""foo""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "DebugType").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "DebugType").Value.Should().Be("foo");
        }

        [Fact]
        public void MigratingXmlDocPopulatesGenerateDocumentationFile()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""buildOptions"": {
                        ""xmlDoc"": ""true""
                    }
                }");

            mockProj.Properties.Count(p => p.Name == "GenerateDocumentationFile").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "GenerateDocumentationFile").Value.Should().Be("true");
        }

        [Theory]
        [InlineData("compile", "Compile")]
        [InlineData("embed", "EmbeddedResource")]
        [InlineData("copyToOutput", "Content")]
        private void MigratingGroupIncludeExcludePopulatesAppropriateProjectItemElement(
            string group,
            string itemName)
        {
            var testDirectory = Temp.CreateDirectory().Path;
            WriteExtraFiles(testDirectory);

            var pj = @"
                {
                    ""buildOptions"": {
                        ""<group>"": {
                            ""include"": [""root"", ""src"", ""rootfile.cs""],
                            ""exclude"": [""src"", ""rootfile.cs""],
                            ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""],
                            ""excludeFiles"": [""src/file2.cs""]
                        }
                    }
                }".Replace("<group>", group);

            var mockProj = RunBuildOptionsRuleOnPj(pj,
                testDirectory: testDirectory);

            mockProj.Items.Count(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)).Should().Be(2);

            var defaultIncludePatterns = GetDefaultIncludePatterns(group);
            var defaultExcludePatterns = GetDefaultExcludePatterns(group);

            foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)))
            {
                VerifyContentMetadata(item);

                if (item.Include.Contains(@"src\file1.cs"))
                {
                    item.Include.Should().Be(@"src\file1.cs;src\file2.cs");
                    item.Exclude.Should().Be(@"src\file2.cs");
                }
                else
                {
                    if (defaultIncludePatterns.Any())
                    {
                        item.Include.Should()
                            .Be(@"root\**\*;src\**\*;rootfile.cs;" + string.Join(";", defaultIncludePatterns).Replace("/", "\\"));
                    }
                    else
                    {
                        item.Include.Should()
                            .Be(@"root\**\*;src\**\*;rootfile.cs");
                    }

                    if (defaultExcludePatterns.Any())
                    {
                        item.Exclude.Should()
                            .Be(@"src\**\*;rootfile.cs;" + string.Join(";", defaultExcludePatterns).Replace("/", "\\") +
                                @";src\file2.cs");
                    }
                    else
                    {
                        item.Exclude.Should()
                            .Be(@"src\**\*;rootfile.cs;src\file2.cs");
                    }
                }
            }
        }

        [Theory]
        [InlineData("compile", "Compile")]
        [InlineData("embed", "EmbeddedResource")]
        [InlineData("copyToOutput", "Content")]
        private void MigratingGroupIncludeOnlyPopulatesAppropriateProjectItemElement(
            string group,
            string itemName)
        {
            var testDirectory = Temp.CreateDirectory().Path;
            WriteExtraFiles(testDirectory);

            var pj = @"
                {
                    ""buildOptions"": {
                        ""<group>"": [""root"", ""src"", ""rootfile.cs""]
                    }
                }".Replace("<group>", group);

            var mockProj = RunBuildOptionsRuleOnPj(pj,
                testDirectory: testDirectory);

            Console.WriteLine(mockProj.RawXml);

            mockProj.Items.Count(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)).Should().Be(1);

            var defaultIncludePatterns = GetDefaultIncludePatterns(group);
            var defaultExcludePatterns = GetDefaultExcludePatterns(group);

            foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)))
            {
                VerifyContentMetadata(item);

                if (defaultIncludePatterns.Any())
                {
                    item.Include.Should()
                        .Be(@"root\**\*;src\**\*;rootfile.cs;" + string.Join(";", defaultIncludePatterns).Replace("/", "\\"));
                }
                else
                {
                    item.Include.Should()
                        .Be(@"root\**\*;src\**\*;rootfile.cs");
                }

                if (defaultExcludePatterns.Any())
                {
                    item.Exclude.Should()
                        .Be(string.Join(";", defaultExcludePatterns).Replace("/", "\\"));
                }
                else
                {
                    item.Exclude.Should()
                        .Be(string.Empty);
                }
            }
        }

        [Fact]
        public void MigratingTestProjectAddsGenerateRuntimeConfigurationFiles()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                    ""testRunner"": ""xunit""
                }");

            mockProj.Properties.Count(p => p.Name == "GenerateRuntimeConfigurationFiles").Should().Be(1);
            mockProj.Properties.First(p => p.Name == "GenerateRuntimeConfigurationFiles").Value.Should().Be("true");
        }

        [Fact]
        public void MigratingANonTestProjectDoesNotAddGenerateRuntimeConfigurationFiles()
        {
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                }");

            mockProj.Properties.Count(p => p.Name == "GenerateRuntimeConfigurationFiles").Should().Be(0);
        }

        [Fact]
        public void MigratingAnAppWithAppConfigAddsItAsNoneToTheCsProj()
        {
            var tempDirectory = Temp.CreateDirectory().Path;
            File.Create(Path.Combine(tempDirectory, "App.config")).Dispose();
            var mockProj = RunBuildOptionsRuleOnPj(@"
                {
                }",
                tempDirectory);

            mockProj.Items.Count(i => i.ItemType == "None").Should().Be(1);
            mockProj.Items.First(i => i.ItemType == "None").Include.Should().Be("App.config");
        }

        private static IEnumerable<string> GetDefaultExcludePatterns(string group)
        {
            var defaultExcludePatterns = new List<string>(group == "copyToOutput" ?
                                    Enumerable.Empty<string>() :
                                    ProjectFilesCollection.DefaultBuiltInExcludePatterns);

            if (group == "embed")
            {
                defaultExcludePatterns.Add("@(EmbeddedResource)");
            }

            return defaultExcludePatterns;
        }

        private static IEnumerable<string> GetDefaultIncludePatterns(string group)
        {
            return Enumerable.Empty<string>();
        }

        private static void VerifyContentMetadata(ProjectItemElement item)
        {
            if (item.ItemType == "Content")
            {
                item.Metadata.Count(m => m.Name == "CopyToOutputDirectory").Should().Be(1);
            }
        }

        private void WriteExtraFiles(string directory)
        {
            Directory.CreateDirectory(Path.Combine(directory, "root"));
            Directory.CreateDirectory(Path.Combine(directory, "src"));
            File.WriteAllText(Path.Combine(directory, "root", "file1.txt"), "content");
            File.WriteAllText(Path.Combine(directory, "root", "file2.txt"), "content");
            File.WriteAllText(Path.Combine(directory, "root", "file3.txt"), "content");
            File.WriteAllText(Path.Combine(directory, "src", "file1.cs"), "content");
            File.WriteAllText(Path.Combine(directory, "src", "file2.cs"), "content");
            File.WriteAllText(Path.Combine(directory, "src", "file3.cs"), "content");
            File.WriteAllText(Path.Combine(directory, "rootfile.cs"), "content");
        }

        private ProjectRootElement RunBuildOptionsRuleOnPj(string s, string testDirectory = null)
        {
            testDirectory = testDirectory ?? Temp.CreateDirectory().Path;
            return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[]
            {
                new MigrateBuildOptionsRule()
            }, s, testDirectory);
        }
    }
}


text:
**Breaking changes**

- When updating storage virtual networks, NetworkRuleSet is used instead of NetworkAcl.

**Notes**

- When updating storage virtual networks, virtualNetworkResourceId is limited to be resource ID of a subnet.
- Added Skus.list() operation, which could list all the available skus for the subscription.


text:
@interface CoreDataDataManagerTests()
{
    CoreDataDataManager *sharedDataManager;
}

@end

@implementation CoreDataDataManagerTests

- (void)setUp
{
    [super setUp];
    sharedDataManager = [CoreDataDataManager sharedInstance];
}

- (void)testDataManagerInit
{
    STAssertNotNil(sharedDataManager.document, @"There should be a Document Object");
    STAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:[sharedDataManager.document.fileURL path]], @"DatabaseFile exists on Disk");
}

- (void)testSemester
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"test"];
    STAssertEqualObjects(testSemester.name, @"test", @"TestSemester hat falschen titel");
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager saveDatabase];
    STAssertFalse([testSemester isInserted], @"TestSemester ist nach dem löschen noch im MOC");
}

- (void)testCreateStudiengang
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"test"];
    NSInteger preTestCreateStudiengangsCount = [[sharedDataManager getAllStudiengaenge] count];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    STAssertEqualObjects(testStudiengang.name, @"testName", @"TestStudiengang hat den Falschen Titel");
    NSInteger postCreateStudiengangsCount = [[sharedDataManager getAllStudiengaenge] count];

    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager saveDatabase];
    STAssertFalse([testStudiengang isInserted], @"TestStudiengang ist nach dem löschen noch im MOC");
    NSInteger postTestDeletionStudiengangCount = [[sharedDataManager getAllStudiengaenge] count];

    STAssertTrue(preTestCreateStudiengangsCount < postCreateStudiengangsCount, @"Nach dem Anlegen eines neuen Studiengangs gibt es nicht mehr Studiengaenge in der DB");
    STAssertTrue(postCreateStudiengangsCount > postTestDeletionStudiengangCount, @"Nach dem Löschen eines Studiengangs gibt es nicht weniger Studiengänge in der DB");
}

- (void)testCreateEintrag
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"WiSe 2014/15"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    Eintrag *testEintrag = [sharedDataManager createEintragWithTitle:@"testTitle" art:@"testArt" isBestanden:YES isBenotet:YES cp:[NSNumber numberWithInt:6] note:[NSNumber numberWithInt:2] inSemester:testSemester inStudiengang:testStudiengang];
    STAssertEqualObjects(testEintrag.semester, testSemester, @"Semester des Eintrags nicht gesetzt");
    STAssertEqualObjects(testEintrag.studiengang, testStudiengang, @"Studiengang des Eintrags falsch gesetzt");
    STAssertEqualObjects(testEintrag.titel, @"testTitle", @"testEintrag hat nicht den korrekten Titel");
    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager deleteEintrag:testEintrag];
    [sharedDataManager saveDatabase];
    STAssertFalse([testEintrag isInserted], @"TestEintrag ist nach dem löschen noch im MOC");

}

- (void)testCreateKriterium
{
    Kriterium *testKriterium = [sharedDataManager createKriteriumWithName:@"testName" isErledigt:YES date:[NSDate distantFuture] forEintrag:nil];
    STAssertEqualObjects(testKriterium.name, @"testName", @"TestKriterium nicht korrekt erstellt");
    STAssertTrue([testKriterium.erledigt boolValue], @"TestKriterium nicht korrekt erstellt");
    [sharedDataManager deleteKriterium:testKriterium];
    [sharedDataManager saveDatabase];
    STAssertFalse([testKriterium isInserted], @"TestKriterium ist nach dem löschen noch im MOC");
}

- (void)testGetCurrentSemester
{
    Semester *testSemester = [sharedDataManager getCurrentSemester];
    STAssertNotNil(testSemester, @"Kein Semester returned");
}

- (void)testKriteriumSort
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"test"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    Eintrag *testEintrag = [sharedDataManager createEintragWithTitle:@"testTitle" art:@"testArt" isBestanden:YES isBenotet:NO cp:[NSNumber numberWithInt:0] note:[NSNumber numberWithInt:0] inSemester:testSemester inStudiengang:testStudiengang];
    Kriterium *distandTestKriterium = [sharedDataManager createKriteriumWithName:@"distantKriterium" isErledigt:NO date:[NSDate distantFuture] forEintrag:testEintrag];
    Kriterium *urgentTestKriterium = [sharedDataManager createKriteriumWithName:@"urgentTestKriterium" isErledigt:NO date:[NSDate dateWithTimeIntervalSinceNow:7200] forEintrag:testEintrag];
    Kriterium *noDateKriterium = [sharedDataManager createKriteriumWithName:@"noDateKriterium" isErledigt:NO date:nil forEintrag:testEintrag];

    NSArray *sortedKriterien = [sharedDataManager getSortedKriterienForEintrag:testEintrag];
    STAssertEqualObjects(urgentTestKriterium, [sortedKriterien objectAtIndex:0], @"Das dringendere Kriterium ist nicht oben in der Liste");

    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager deleteEintrag:testEintrag];
    [sharedDataManager deleteKriterium:urgentTestKriterium];
    [sharedDataManager deleteKriterium:distandTestKriterium];
    [sharedDataManager deleteKriterium:noDateKriterium];
}

- (void)testCreateTwoSemesterWithTheSameName
{
    Semester *firstSemester = [sharedDataManager createSemesterWithName:@"Test"];
    [sharedDataManager saveDatabase];
    Semester *secondSemester = [sharedDataManager createSemesterWithName:@"Test"];
    [sharedDataManager saveDatabase];
    STAssertTrue([firstSemester isEqual:secondSemester], @"Es wurden 2 verschieden Objekte mit dem selben namen erstellt");
    [sharedDataManager deleteSemester:firstSemester];
    [sharedDataManager deleteSemester:secondSemester];
    [sharedDataManager saveDatabase];
}

- (void)testFindStudiengangWithNameAndAbschluss
{
    NSString *testName = @"testName";
    NSString *testAbschluss = @"testAbschluss";
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"test"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:testName abschluss:testAbschluss cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    [sharedDataManager saveDatabase];
    STAssertTrue([[sharedDataManager getStudiengangForName:testName abschluss:testAbschluss] isEqual:testStudiengang], @"Es wurde nicht das selbe Semester zurückgegeben");

    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager saveDatabase];
}

- (void)testGetAllEntriesForOverview
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"SoSe 1921"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    Eintrag *testEintrag = [sharedDataManager createEintragWithTitle:@"testTitle" art:@"testArt" isBestanden:YES isBenotet:NO cp:[NSNumber numberWithInt:0] note:[NSNumber numberWithInt:0] inSemester:testSemester inStudiengang:testStudiengang];

    NSArray *overviewArray = [sharedDataManager getAllEntriesForOverview];
    BOOL success = NO;

    //NSLog(@"Es gibt %d Semester", [overviewArray count]);
    for (NSArray *semesterArray in overviewArray) {
        //NSLog(@"Dieses Semester enthält Kurse aus %d studiengaengen", [semesterArray count]);
        for (NSArray *studiengangArray in semesterArray) {
            //Eintrag *infoEintrag = [studiengangArray lastObject];
            //NSLog(@"In diesem Studiengang(%@) und Semester(%@) gibt es %d Kurse", infoEintrag.studiengang.name,infoEintrag.semester.name ,[studiengangArray count]);
            for (Eintrag *anEintrag in studiengangArray) {
                //NSLog(@"%@", anEintrag.titel);
                if ([anEintrag isEqual:testEintrag]) {
                    success = YES;
                }
            }
        }
    }

    STAssertTrue(success, @"testEintrag nicht im Overview Array vorhanden");

    [sharedDataManager deleteEintrag:testEintrag];
    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager saveDatabase];
}

- (void)testGetAllOpenEntriesForOverview
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"SoSe 1921"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    Eintrag *testEintragOpen = [sharedDataManager createEintragWithTitle:@"testTitle" art:@"testArt" isBestanden:NO isBenotet:NO cp:[NSNumber numberWithInt:0] note:[NSNumber numberWithInt:0] inSemester:testSemester inStudiengang:testStudiengang];
    Eintrag *testEintragPast = [sharedDataManager createEintragWithTitle:@"testTitlePast" art:@"testArt" isBestanden:YES isBenotet:NO cp:[NSNumber numberWithInt:0] note:[NSNumber numberWithInt:0] inSemester:testSemester inStudiengang:testStudiengang];

    NSArray *overviewArray = [sharedDataManager getAllOpenEntriesForOverview];
    BOOL success = NO;

    //NSLog(@"Es gibt %d Semester", [overviewArray count]);
    for (NSArray *semesterArray in overviewArray) {
        //NSLog(@"Dieses Semester enthält Kurse aus %d studiengaengen", [semesterArray count]);
        for (NSArray *studiengangArray in semesterArray) {
            //Eintrag *infoEintrag = [studiengangArray lastObject];
            //NSLog(@"In diesem Studiengang(%@) und Semester(%@) gibt es %d Kurse", infoEintrag.studiengang.name,infoEintrag.semester.name ,[studiengangArray count]);
            for (Eintrag *anEintrag in studiengangArray) {
                //NSLog(@"%@", anEintrag.titel);
                if ([anEintrag isEqual:testEintragOpen]) {
                    success = YES;
                }
                if ([anEintrag isEqual:testEintragPast]) {
                    STFail(@"Der bestanden kurs sollte hier nicht enthalten sein!");
                }
            }
        }
    }
    STAssertTrue(success, @"testEintrag nicht im Overview Array vorhanden");
    [sharedDataManager deleteEintrag:testEintragOpen];
    [sharedDataManager deleteEintrag:testEintragPast];
    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager saveDatabase];
}

- (void)testGetAllPastEntriesForOverview
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"SoSe 1921"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
    Eintrag *testEintragOpen = [sharedDataManager createEintragWithTitle:@"testTitle" art:@"testArt" isBestanden:NO isBenotet:NO cp:[NSNumber numberWithInt:0] note:[NSNumber numberWithInt:0] inSemester:testSemester inStudiengang:testStudiengang];
    Eintrag *testEintragPast = [sharedDataManager createEintragWithTitle:@"testTitlePast" art:@"testArt" isBestanden:YES isBenotet:NO cp:[NSNumber numberWithInt:0] note:[NSNumber numberWithInt:0] inSemester:testSemester inStudiengang:testStudiengang];

    NSArray *overviewArray = [sharedDataManager getAllPastEntriesForOverview];
    BOOL success = NO;

    //NSLog(@"Es gibt %d Semester", [overviewArray count]);
    for (NSArray *semesterArray in overviewArray) {
        //NSLog(@"Dieses Semester enthält Kurse aus %d studiengaengen", [semesterArray count]);
        for (NSArray *studiengangArray in semesterArray) {
            //Eintrag *infoEintrag = [studiengangArray lastObject];
            //NSLog(@"In diesem Studiengang(%@) und Semester(%@) gibt es %d Kurse", infoEintrag.studiengang.name,infoEintrag.semester.name ,[studiengangArray count]);
            for (Eintrag *anEintrag in studiengangArray) {
                //NSLog(@"%@", anEintrag.titel);
                if ([anEintrag isEqual:testEintragPast]) {
                    success = YES;
                }
                if ([anEintrag isEqual:testEintragOpen]) {
                    STFail(@"Der offene kurs sollte hier nicht enthalten sein!");
                }
            }
        }
    }
    STAssertTrue(success, @"testEintrag nicht im Overview Array vorhanden");
    [sharedDataManager deleteEintrag:testEintragOpen];
    [sharedDataManager deleteEintrag:testEintragPast];
    [sharedDataManager deleteStudiengang:testStudiengang];
    [sharedDataManager deleteSemester:testSemester];
    [sharedDataManager saveDatabase];
}

- (void)testCurrentTerm
{
    Term *aTerm = [sharedDataManager currentTerm];
    STAssertNotNil(aTerm, @"There should always be a Term Objekt");
}

- (void)testDateWithString
{
    NSDate *aDate = [sharedDataManager dateWithString:@"20.07.1989"];
    STAssertNotNil(aDate, @"The Method should accept the Format of the Test Input and return a DateObject");
}

- (void)testAdd_RemoveDateBlocksToSchedule
{
    Lecture *aLecture = [Lecture createLectureWithTitle:@"test" vak:@"test" cp:Nil type:nil activeInSchedule:NO inCourse:nil inManagedContext:sharedDataManager.document.managedObjectContext];
    DateBlock *testDateBlock = [DateBlock createDateBlockWithRoom:@"test" startTime:@"test" stopTime:@"test" startDate:nil stopDate:nil repeatModifier:nil lecture:aLecture inManagedContext:sharedDataManager.document.managedObjectContext];
    Date *testDate = [Date createDateWithDateBlock:testDateBlock date:nil startTime:nil stopTime:nil active:NO forLecture:aLecture inManagedContext:sharedDataManager.document.managedObjectContext];
    STAssertFalse([testDate.active boolValue], @"TestDate should be inactive");
    STAssertFalse([aLecture.activeInSchedule boolValue], @"aLecture should not be in Schedule");
    [sharedDataManager addDateBlocksToSchedule:[NSArray arrayWithObject:testDateBlock]];
    STAssertTrue([testDate.active boolValue], @"TestDate should now be active");
    STAssertTrue([aLecture.activeInSchedule boolValue], @"aLecture should be in Schedule");
    [sharedDataManager removeDateBlocksFromSchedule:[NSArray arrayWithObject:testDateBlock]];
    STAssertFalse([testDate.active boolValue], @"TestDate should be inactive");
    STAssertFalse([aLecture.activeInSchedule boolValue], @"aLecture should not be in Schedule");
    [sharedDataManager.document.managedObjectContext deleteObject:testDate];
    [sharedDataManager.document.managedObjectContext deleteObject:testDateBlock];
    [sharedDataManager.document.managedObjectContext deleteObject:aLecture];
}

- (void)testGetAllActiveLectures
{
    int oldLectureCount = [[sharedDataManager getAllActiveLectures] count];
    Lecture *aLecture = [Lecture createLectureWithTitle:@"test" vak:@"test" cp:Nil type:nil activeInSchedule:YES inCourse:nil inManagedContext:sharedDataManager.document.managedObjectContext];
    int newLectureCount = [[sharedDataManager getAllActiveLectures] count];
    [sharedDataManager.document.managedObjectContext deleteObject:aLecture];
    STAssertTrue(oldLectureCount == newLectureCount - 1, @"There should be exactly one more active Lecture returned from the Database");
}

- (void)testLectureEintragConnection
{
    Semester *testSemester = [sharedDataManager createSemesterWithName:@"SoSe 1921"];
    Studiengang *testStudiengang = [sharedDataManager createStudiengangWithName:@"testName" abschluss:@"testAbschlluss" cp:[NSNumber numberWithInt:180] erstesFachsemester:testSemester];
     Lecture *aLecture = [Lecture createLectureWithTitle:@"test12" vak:@"test12" cp:Nil type:nil activeInSchedule:NO inCourse:nil inManagedContext:sharedDataManager.document.managedObjectContext];
    Eintrag *anEintrag = [sharedDataManager copyLecture:aLecture intoStudiengang:testStudiengang inSemester:testSemester];
    STAssertTrue([aLecture.title isEqualToString:anEintrag.titel], @"copied Object should have same title");
    STAssertNotNil(aLecture.eintrag, @"Copied Eintrag should be connected to source Lecture Object");

    [sharedDataManager.document.managedObjectContext deleteObject:aLecture];
    [sharedDataManager.document.managedObjectContext deleteObject:testSemester];
    [sharedDataManager.document.managedObjectContext deleteObject:testStudiengang];
    [sharedDataManager.document.managedObjectContext deleteObject:anEintrag];
}

- (void)testAddLecturer
{
    Lecturer *oldLecturer = [Lecturer createLecturerWithTitle:@"test" inManagedContext:sharedDataManager.document.managedObjectContext];
    Lecture *aLecture = [Lecture createLectureWithTitle:@"test" vak:@"test" cp:nil type:nil activeInSchedule:NO inCourse:nil inManagedContext:sharedDataManager.document.managedObjectContext];
    [oldLecturer addLectures:[NSSet setWithObject:aLecture]];
    STAssertTrue([aLecture.lecturers containsObject:oldLecturer], @"Old Lecturer should be added to Lecture");

    [sharedDataManager addLecturerToLecture:aLecture fromArray:[NSArray arrayWithObject:@"test2"]];
    STAssertFalse([aLecture.lecturers containsObject:oldLecturer], @"Old Lecturer should be removen");
    Lecturer *newLecturer = [aLecture.lecturers lastObject];
    STAssertEquals(@"test2", newLecturer.title,@"test");

    [sharedDataManager.document.managedObjectContext deleteObject:aLecture];
    [sharedDataManager.document.managedObjectContext deleteObject:oldLecturer];
    [sharedDataManager.document.managedObjectContext deleteObject:newLecturer];
}

@end


text:
using System.Collections.Generic;
using Newtonsoft.Json;

namespace MigrationTools._EngineV1.Configuration
{
    public interface IProcessorConfig
    {
        /// <summary>
        /// Active the processor if it true.
        /// </summary>
        [JsonProperty(Order = -200)]
        bool Enabled { get; set; }

        [JsonIgnore]
        string Processor { get; }

        /// <summary>
        /// Indicates, if this processor can be added to the list of current processors or not.
        /// Some processors are not compatible with each other.
        /// </summary>
        /// <param name="otherProcessors">List of already configured processors.</param>
        bool IsProcessorCompatible(IReadOnlyList<IProcessorConfig> otherProcessors);
    }
}