 ", sentence)
    sentence = sentence.strip()
    src_sentence.append(sentence)

# Target Data
trg_sentence = []

def unicode_to_ascii(s):
    return ''.join(c for c in unicodedata.normalize('NFD', s)
            if unicodedata.category(c) != 'Mn')

for sentence in dataset_df_8096['TRG']:
    # 위에서 구현한 함수를 내부적으로 호출
    sentence = unicode_to_ascii(sentence.lower())

    # 단어와 구두점 사이에 공백을 만듭니다.
    # Ex) "he is a boy." => "he is a boy ."
    sentence = re.sub(r"([?.!,¿])", r" \1", sentence)

    # (a-z, A-Z, ".", "?", "!", ",") 이들을 제외하고는 전부 공백으로 변환합니다.
    sentence = re.sub(r"[^a-zA-Z!.?]+", r" ", sentence)

    sentence = re.sub(r"\s+", " ", sentence)

    trg_sentence.append(sentence)

print(src_sentence[:5])
print(trg_sentence[:5])

'''
D9. Define dataframe
'''
SRC_df = pd.DataFrame(src_sentence)
TRG_df = pd.DataFrame(trg_sentence)

SRC_df.rename(columns={0: "SRC"}, errors="raise", inplace=True)
TRG_df.rename(columns={0: "TRG"}, errors="raise", inplace=True)
total_df = pd.concat([SRC_df, TRG_df], axis=1)

print('Translation Pair :',len(total_df)) # 리뷰 개수 출력

'''
D10. Define tokenizer
'''

with open('corpus_src.txt', 'w', encoding='utf8') as f:
    f.write('\n'.join(total_df['SRC']))

with open('corpus_trg.txt', 'w', encoding='utf8') as f:
    f.write('\n'.join(total_df['TRG']))

# This is the folder to save the data. Modify it to suit your environment.
data_dir = "/content"

corpus = "corpus_src.txt"
prefix = "nmt_src_vocab"
vocab_size = 20000
spm.SentencePieceTrainer.train(
    f"--input={corpus} --model_prefix={prefix} --vocab_size={vocab_size + 7}" +
    " --model_type=bpe" +
    " --max_sentence_length=999999" +               # max sentence length
    " --pad_id=0 --pad_piece=[PAD]" +               # pad (0)
    " --unk_id=1 --unk_piece=[UNK]" +               # unknown (1)
    " --bos_id=2 --bos_piece=[BOS]" +               # begin of sequence (2)
    " --eos_id=3 --eos_piece=[EOS]" +               # end of sequence (3)
    " --user_defined_symbols=[SEP],[CLS],[MASK]")   # other additional tokens

corpus = "corpus_trg.txt"
prefix = "nmt_trg_vocab"

vocab_size = 20000
spm.SentencePieceTrainer.train(
    f"--input={corpus} --model_prefix={prefix} --vocab_size={vocab_size + 7}" +
    " --model_type=bpe" +
    " --max_sentence_length=999999" +               # max sentence length
    " --pad_id=0 --pad_piece=[PAD]" +               # pad (0)
    " --unk_id=1 --unk_piece=[UNK]" +               # unknown (1)
    " --bos_id=2 --bos_piece=[BOS]" +               # begin of sequence (2)
    " --eos_id=3 --eos_piece=[EOS]" +               # end of sequence (3)
    " --user_defined_symbols=[SEP],[CLS],[MASK]")   # other additional tokens

for f in os.listdir("."):
    print(f)

vocab_src_file = f"{data_dir}/nmt_src_vocab.model"
vocab_src = spm.SentencePieceProcessor()
vocab_src.load(vocab_src_file)

vocab_trg_file = f"{data_dir}/nmt_trg_vocab.model"
vocab_trg = spm.SentencePieceProcessor()
vocab_trg.load(vocab_trg_file)

n_enc_vocab = len(vocab_src)
n_dec_vocab = len(vocab_trg)

print('Word set size of Encoder :',n_enc_vocab)
print('Word set size of Decoder :',n_dec_vocab)

'''
Token List
'''
# Recommend : For small number of vocabulary, please test each IDs.
# src_vocab_list
src_vocab_list = [[vocab_src.id_to_piece(id), id] for id in range(vocab_src.get_piece_size())]

# trg_vocab_list
trg_vocab_list = [[vocab_trg.id_to_piece(id), id] for id in range(vocab_trg.get_piece_size())]

'''
D11. Tokenizer test
'''
# Source Tokenizer
lines = [  SRC_df.iloc[1,0],  SRC_df.iloc[2,0],  SRC_df.iloc[3,0]]
for line in lines:
    print("Input        :", line)
    txt_2_ids = vocab_src.encode_as_ids(line)
    print("EncodeIds    :", txt_2_ids)
    print("DecodeIds    :", vocab_src.DecodeIds(txt_2_ids))

    txt_2_tkn = vocab_src.encode_as_pieces(line)
    print("EncodePieces :", txt_2_tkn)
    print("DecodePieces :", vocab_src.DecodePieces(txt_2_tkn))

    ids2 = vocab_src.piece_to_id(txt_2_tkn)
    print("Piece_2_IDs  :", ids2)
    print("Id_2_Pieces  :", vocab_src.id_to_piece(ids2))
    print("\n")

print("\n")

# Target Tokenizer
lines = [  TRG_df.iloc[1,0],  TRG_df.iloc[2,0],  TRG_df.iloc[3,0]]
for line in lines:
    print("Input        :", line)
    txt_2_ids = vocab_trg.encode_as_ids(line)
    print("EncodeIds    :", txt_2_ids)
    print("DecodeIds    :", vocab_trg.DecodeIds(txt_2_ids))

    txt_2_tkn = vocab_trg.encode_as_pieces(line)
    print("EncodePieces :", txt_2_tkn)
    print("DecodePieces :", vocab_trg.DecodePieces(t


,
     _ag0_=caml_string_of_jsbytes("Set.t_of_sexp: list needed"),
     _ag2_=[0,caml_string_of_jsbytes("src/set.ml"),1016,8],
     _agZ_=
      caml_string_of_jsbytes("Set.find_exn failed to find a matching element"),
     _agX_=[0,0,0],
     _agW_=[0,0,0,0],
     _agT_=
      [0,
       caml_string_of_jsbytes("src/set.ml.Tree0.Set_max_elt_exn_of_empty_set")],
     _agU_=[0,caml_string_of_jsbytes("src/set.ml"),308,15],
     _agQ_=
      [0,
       caml_string_of_jsbytes("src/set.ml.Tree0.Set_min_elt_exn_of_empty_set")],
     _agR_=[0,caml_string_of_jsbytes("src/set.ml"),298,15],
     _agH_=[0,caml_string_of_jsbytes("src/set.ml"),201,17],
     _agI_=[0,caml_string_of_jsbytes("src/set.ml"),202,18],
     _agJ_=[0,caml_string_of_jsbytes("src/set.ml"),208,21],
     _agK_=[0,caml_string_of_jsbytes("src/set.ml"),210,12],
     _agL_=[0,caml_string_of_jsbytes("src/set.ml"),216,17],
     _agM_=[0,caml_string_of_jsbytes("src/set.ml"),223,21],
     _agN_=[0,caml_string_of_jsbytes("src/set.ml"),225,12],
     _agE_=caml_string_of_jsbytes("of_sorted_array: duplicated elements"),
     _agG_=caml_string_of_jsbytes("of_sorted_array: elements are not ordered"),
     _agF_=caml_string_of_jsbytes("of_sorted_array: duplicated elements"),
     _agO_=caml_string_of_jsbytes("Base__Set.Tree0.Same"),
     _agP_=
      caml_string_of_jsbytes("Base__Set.Tree0.Set_min_elt_exn_of_empty_set"),
     _agS_=
      caml_string_of_jsbytes("Base__Set.Tree0.Set_max_elt_exn_of_empty_set"),
     _agY_=[0,caml_string_of_jsbytes("Set.choose_exn: empty set")],
     _ahf_=caml_string_of_jsbytes("max"),
     _ahg_=caml_string_of_jsbytes("min"),
     _ahh_=caml_string_of_jsbytes("clamp requires [min <= max]"),
     _ahe_=[0,caml_string_of_jsbytes("src/nativeint.ml"),180,2],
     _ahc_=caml_string_of_jsbytes(""),
     _ahd_=caml_string_of_jsbytes("[Nativeint.ceil_log2] got invalid input"),
     _aha_=caml_string_of_jsbytes(""),
     _ahb_=caml_string_of_jsbytes("[Nativeint.floor_log2] got invalid input"),
     _ag$_=
      [0,
       [11,caml_string_of_jsbytes("argument must be strictly positive"),0],
       caml_string_of_jsbytes("argument must be strictly positive")],
     _ag__=
      [0,
       [11,
        caml_string_of_jsbytes("Nativeint.of_float: argument ("),
        [8,
         [0,0,0],
         0,
         0,
         [11,caml_string_of_jsbytes(") is out of range or NaN"),0]]],
       caml_string_of_jsbytes
        ("Nativeint.of_float: argument (%f) is out of range or NaN")],
     _


cha-surface1-hsl: 234.286 13.208% 31.176%;--ctp-mocha-surface0: #313244;--ctp-mocha-surface0-rgb: 49 50 68;--ctp-mocha-surface0-hsl: 236.842 16.239% 22.941%;--ctp-mocha-base: #1e1e2e;--ctp-mocha-base-rgb: 30 30 46;--ctp-mocha-base-hsl: 240 21.053% 14.902%;--ctp-mocha-mantle: #181825;--ctp-mocha-mantle-rgb: 24 24 37;--ctp-mocha-mantle-hsl: 240 21.311% 11.961%;--ctp-mocha-crust: #11111b;--ctp-mocha-crust-rgb: 17 17 27;--ctp-mocha-crust-hsl: 240 22.727% 8.627%}:root{--nord0: #2e3440;--nord0-rgb: 46, 52, 64;--nord0-hsl: 210, 20%, 20%;--nord1: #3b4252;--nord1-rgb: 59, 66, 82;--nord1-hsl: 210, 12%, 26%;--nord2: #434c5e;--nord2-rgb: 67, 76, 94;--nord2-hsl: 210, 14%, 34%;--nord3: #4c566a;--nord3-rgb: 76, 86, 106;--nord3-hsl: 210, 13%, 40%;--nord4: #d8dee9;--nord4-rgb: 216, 222, 233;--nord4-hsl: 210, 36%, 91%;--nord5: #e5e9f0;--nord5-rgb: 229, 233, 240;--nord5-hsl: 210, 25%, 94%;--nord6: #eceff4;--nord6-rgb: 236, 239, 244;--nord6-hsl: 210, 21%, 96%;--nord7: #8fbcbb;--nord7-rgb: 143, 188, 187;--nord7-hsl: 180, 30%, 62%;--nord8: #88c0d0;--nord8-rgb: 136, 192, 208;--nord8-hsl: 192, 40%, 66%;--nord9: #81a1c1;--nord9-rgb: 129, 161, 193;--nord9-hsl: 210, 28%, 58%;--nord10: #5e81ac;--nord10-rgb: 94, 129, 172;--nord10-hsl: 210, 35%, 53%;--nord11: #bf616a;--nord11-rgb: 191, 97, 106;--nord11-hsl: 358, 60%, 53%;--nord12: #d08770;--nord12-rgb: 208, 135, 112;--nord12-hsl: 25, 50%, 66%;--nord13: #ebcb8b;--nord13-rgb: 235, 203, 139;--nord13-hsl: 45, 81%, 70%;--nord14: #a3be8c;--nord14-rgb: 163, 190, 140;--nord14-hsl: 104, 30%, 65%;--nord15: #b48ead;--nord15-rgb: 180, 142, 173;--nord15-hsl: 322, 28%, 64%}:root{--md-red-50: #FFEBEE;--md-red-50-rgb: 255, 235, 238;--md-red-50-hsl: 0, 100%, 97%;--md-red-100: #FFCDD2;--md-red-100-rgb: 255, 205, 210;--md-red-100-hsl: 0, 100%, 90%;--md-red-200: #EF9A9A;--md-red-200-rgb: 239, 154, 154;--md-red-200-hsl: 0, 80%, 75%;--md-red-300: #E57373;--md-red-300-rgb: 229, 115, 115;--md-red-300-hsl: 0, 70%, 65%;


from django.contrib import admin
from django.urls import path
from . import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.homepage, name='homepage'),  # Add homepage route
]


�接时，有向图非常复杂。根据有向图直接参数化的做法非常低效

     ![rnn_dag](../imgs/10/rnn_dag.png)

   - 相反：`RNN `引入了状态变量。它有助于我们获取非常高效的参数化：序列中的每个时间步使用相同的结构，并且共享相同的参数
     - 引入状态变量 $\mathbf{\vec h}^{(t)}$ 节点，可以用作过去和未来之间的变量，从而解耦它们。遥远的过去的变量 $\mathbf{\vec y}^{(i)}$ 通过影响 $\mathbf{\vec h}$ 来影响变量 $\mathbf{\vec y}^{(t)}$

       ![rnn_dag2](../imgs/10/rnn_dag2.png)

4. 当模型包含单个向量 $\mathbf{\vec x}$ 作为输入时，有三种方式：

   - 在每个时刻作为一个额外的输入。如图注任务：单个图像作为模型输入，生成描述图像的单词序列

     此时引入了新的权重矩阵 $\mathbf R$ 。 乘积 $\mathbf{\vec x}^{T}\mathbf R$ 在每个时间步作为隐单元的一个额外输入

     > 输出序列的每个元素 $y^{(t)}$ 同时用作输入（对于当前时间步），和训练期间的目标（对于前一个时间步）。因为它需要根据当前的序列和图像，预测下一个时刻的单词

     ![rnn_x](../imgs/10/rnn_x.png)

   - 作为初始状态 $\mathbf{\vec h}^{(0)}$

   - 结合上述两种方式

5. `RNN`也可以接收向量序列 $\mathbf{\vec x^{(t)}}$ 作为输入。此时`RNN`对应条件分布为 $P( \mathbf{\vec y}^{(1)},\cdots,\mathbf{\vec y}^{(\tau)}\mid \mathbf{\vec x}^{(1)},\cdots,\mathbf{\vec x}^{(\tau)})$

   - 第一类循环神经网络假设条件独立，此时：
     $$
     P( \mathbf{\vec y}^{(1)},\cdots,\mathbf{\vec y}^{(\tau)}\mid \mathbf{\vec x}^{(1)},\cdots,\mathbf{\vec x}^{(\tau)})=\prod_tP( \mathbf{\vec y}^{(t)}\mid \mathbf{\vec x}^{(1)},\cdots,\mathbf{\vec x}^{(t)})
     $$

   - 为了去掉条件独立的假设，我们可以在时刻 $t$ 的输出到时刻 $t+1$ 的隐单元添加连接。此时该模型代表了关于 $\mathbf{\vec y}$  序列的任意概率分布

     - 但是这样的序列有个限制：要求输入序列和输出序列的长度必须相同

       ![rnn_more](../imgs/10/rnn_more.pn


ere x=c and x=−c are interesting. They each give y=k.

So we want an upward facing U through these symmetrical points that just reaches
down to −2. The graph must look like this:

![](http://gdaymath.com/wp-content/uploads/2013/03/Q4_5_pic3.png)

By symmetry, the “action” must be happening at x=0.

Put in x=0, y=−2 to see we must have:

−2=(−c)(c+k
−2−c2+k
giving k=c2−2.  □

---

PRACTICE 94:

a) Find a value for k so that y=5x2−10x+k just touches the x-axis.

b) Find a value for m so that y=−2x2−18x+m has largest value 100.

c) Find a value for a so that y=(x−a)(x−3a) has smallest value −10.

---

PRACTICE 95: Consider y=2(x−1)(x+1)+(x−3)(x+4)+x(x−2).

a) If one were to expand this equation, would one obtain a quadratic expression y=ax2+bx+c  for some numbers a, b and c? YES/NO.

b) Explain why we can quickly see that a=2+1+1=4.

c) Put x=0 into y=2(x−1)(x+1)+(x−3)(x+4)+x(x−2). Explain why we now know c=−14.

So we have 2(x−1)(x+1)+(x−3)(x+4)+x(x−2)=4x2+bx−14. We don’t know what b is yet.

d) What might be an easy way to find the value b? What is its value?

e) Sketch the graph of y=2(x−1)(x+1)+(x−3)(x+4)+x(x−2).

---

PRACTICE 96: A rectangle has one side of length x+3 inches and the other of
length 7−x inches. Which value of x gives a rectangle of maximal area?

---

PRACTICE 100: A THEORY QUESTION

Consider the quadratic ](y=ax^{2}+bx+c\). Rewrite this as `y = x(ax+b)+c`.

a) What are the two interesting x-values for this quadratic?

b) Explain why the vertex of its graph occurs at `x=−b/(2a)`.

COMMENT: Many curricula have students memorise this result. For example, given
`y=3x2+4x+8`, say, they like students to be able to say that its vertex lies at
`x=−b2a=−42*3=−23`. If speed is important to you, then great! If not, there is
nothing wrong with writing y=x(3x+4)+8 and saying that the vertex is halfway
between x=0 and x=−43.

---

PRACTICE 101: Here’s to the power of interesting x-values! Consider this challenge.

Sketch a graph of y=(x+10)3(x+6)2(x+2)(x−3)4(x−5)(x−12)37.

We have not done this before so we are going to have to use our common sense.

Are there any interesting x-values?

Where does the graph cross the x-axis?

When x is a huge positive number does the graph want to be huge and positive?

What does the graph want to be if x is a huge negative number like −1000000?

Between the places where the graph crosses the x-axis, can you tell if the graph
wants to be positive or negative?

If you can answer these questions then you have enough information to make a
pretty good sketch of the thing!

---

QUESTION:
i) What is the x-coordinate of the vertex of y=−4x2+10x+7?
ii) What input x gives the smallest output for y=


> matchDscp;

    /**
     * @return The DSCP value of the traffic matched by the QoS rule. Value range: **0** to **63**. If not, the value is - 1.
     *
     */
    public Output<Integer> matchDscp() {
        return this.matchDscp;
    }
    /**
     * QoS rule priority. Value range: **1** to **9000**. The larger the number, the higher the priority. The priority of a QoS rule cannot be repeated in the same QoS policy.
     *
     */
    @Export(name="priority", refs={Integer.class}, tree="[0]")
    private Output<Integer> priority;

    /**
     * @return QoS rule priority. Value range: **1** to **9000**. The larger the number, the higher the priority. The priority of a QoS rule cannot be repeated in the same QoS policy.
     *
     */
    public Output<Integer> priority() {
        return this.priority;
    }
    /**
     * QoS rule protocol type, value:
     * - **ALL**
     * - **ICMP(IPv4)**
     * - **ICMPv6(IPv6)* *
     * - **TCP**
     * - **UDP**
     * - **GRE**
     * - **SSH**
     * - **Telnet**
     * - **HTTP**
     * - **HTTPS**
     * - **MS SQL**
     * - **Oracle**
     * - **MySql**
     * - **RDP**
     * - **PostgreSQL**
     * - **Redis**.
     *
     */
    @Export(name="protocol", refs={String.class}, tree="[0]")
    private Output<String> protocol;

    /**
     * @return QoS rule protocol type, value:
     * - **ALL**
     * - **ICMP(IPv4)**
     * - **ICMPv6(IPv6)* *
     * - **TCP**
     * - **UDP**
     * - **GRE**
     * - **SSH**
     * - **Telnet**
     * - **HTTP**
     * - **HTTPS**
     * - **MS SQL**
     * - **Oracle**
     * - **MySql**
     * - **RDP**
     * - **PostgreSQL**
     * - **Redis**.
     *
     */
    public Output<String> protocol() {
        return this.protocol;
    }
    /**
     * The QoS policy ID.
     *
     */
    @Export(name="qosId", refs={String.class}, tree="[0]")
    private Output<String> qosId;

    /**
     * @return The QoS policy ID.
     *
     */
    public Output<String> qosId() {
        return this.qosId;
    }
    /**
     * The QoS queue ID.
     *
     */
    @Export(name="queueId", refs={String.class}, tree="[0]")
    private Output<String> queueId;

    /**
     * @return The QoS queue ID.
     *
     */
    public Output<String> queueId() {
        return this.queueId;
    }
    /**
     * Modify The DSCP value in the flow. Value range: **0** to **63**. If the value is not modified, the value is - 1.
     *
     */
    @Export(name="remarkingDscp", refs={Integer.class}, tree="[0]")
    private Output<Integer> remarkingDscp;

    /**
     * @return Modify The DSCP value in the flow. Value range: **0** to **63**. If the value is not modified, the value is - 1.
     *
     */
    public Output<Integer> remarkingDscp() {
        return this.remarkingDscp;
    }
    /**
     * The description of the QoS rule.  The length is 0 to 256 characters and cannot start with 'http:// 'or 'https.
     *
     */
    @Export(name="ruleDescription", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> ruleDescription;


						githubURL = fmt.Sprintf("https://%s/issues", st.RepoSpec.URI)
					case st.RepoSpec.URI != "github.com/shurcooL/issuesapp" && st.RepoSpec.URI != "github.com/shurcooL/notificationsapp" &&
						st.IssueID != 0:
						githubURL = fmt.Sprintf("https://%s/issues/%d", st.RepoSpec.URI, st.IssueID)
					default:
						githubURL = "https://" + st.RepoSpec.URI
					}
					heading.AppendChild(&html.Node{
						Type: html.ElementNode, Data: atom.A.String(),
						Attr: []html.Attribute{
							{Key: atom.Href.String(), Val: githubURL},
							{Key: atom.Class.String(), Val: "gray"},
							{Key: atom.Style.String(), Val: "margin-left: 10px;"},
						},
						FirstChild: octicon.SetSize(octicon.MarkGitHub(), 24),
					})
					tabnav := homecomponent.TabNav{
						Tabs: []homecomponent.Tab{
							{
								Content: contentCounter{
									Content: iconText{Icon: octicon.IssueOpened, Text: "Issues"},
									Count:   int(openIssues),
								},
								URL: "/issues/" + st.RepoSpec.URI, OnClick: "Open(event, this)",
								Selected: true,
							},
							{
								Content: contentCounter{
									Content: iconText{Icon: octicon.GitPullRequest, Text: "Changes"},
									Count:   int(openChanges),
								},
								URL: "/changes/" + st.RepoSpec.URI, OnClick: "Open(event, this)",
							},
						},
					}
					return []htmlg.Component{header, htmlg.NodeComponent(*heading), tabnav}, nil
				}
			},
		},
	)
	changesApp := changesapp.New(
		changeService,
		userService,
		redirect,
		changesapp.Options{
			Notification: notifService,
			BodyTop: func(ctx context.Context, st changesapp.State) ([]htmlg.Component, error) {
				var nc uint64
				if st.CurrentUser.ID != 0 {
					var err error
					nc, err = notifService.CountNotifications(ctx)
					if err != nil {
						log.Println("notifService.CountNotifications:", err)
					}
				}

				header := homecomponent.Header{
					CurrentUser:       st.CurrentUser,
					NotificationCount: nc,
					ReturnURL:         st.ReqURL.String(),
				}

				switch {
				default:
					return []htmlg.Component{header}, nil

				case strings.HasPrefix(st.RepoSpec, "dmitri.shuralyov.com/"):
					// TODO: Maybe try to avoid fetching openChanges twice...
					t0 := time.Now()
					d, err := codeService.GetDirectory(ctx, st.RepoSpec)
					if err != nil {
						return nil, err
					}
					openIssues, err := issueService.Count(ctx, issues.RepoSpec{URI: st.RepoSpec}, issues.IssueListOptions{State: issues.StateFilter(statepkg.IssueOpen)})
					if err != nil {
						return nil, err
					}
					openChanges, err := changeService.Count(ctx, st.RepoSpec, change.ListOptions{Filter: change.FilterOpen})
					if err != nil {
						return nil, err
					}
					fmt.Println("counting packages & open issues & changes took:", time.Since(t0).Milliseconds(), "ms", "for:", st.RepoSpec)

					heading := htmlg.NodeComponent{
						Type: html.ElementNode, Data: atom.H2.String(),
						FirstChild: htmlg.Text(st.RepoSpec + "/..."),
					}
					repoPath := strings.TrimPrefix(st.RepoSpec, "dmitri.shuralyov.com")
					tabnav := homecomponent.RepositoryTabNav(homecomponent.ChangesTab, repo


K: vpcmpgtq -2048(%rdx), %xmm30, %k3
// CHECK:  encoding: [0x62,0xf2,0x8d,0x00,0x37,0x5a,0x80]
          vpcmpgtq -2048(%rdx), %xmm30, %k3

// CHECK: vpcmpgtq -2064(%rdx), %xmm30, %k3
// CHECK:  encoding: [0x62,0xf2,0x8d,0x00,0x37,0x9a,0xf0,0xf7,0xff,0xff]
          vpcmpgtq -2064(%rdx), %xmm30, %k3

// CHECK: vpcmpgtq 1016(%rdx){1to2}, %xmm30, %k3
// CHECK:  encoding: [0x62,0xf2,0x8d,0x10,0x37,0x5a,0x7f]
          vpcmpgtq 1016(%rdx){1to2}, %xmm30, %k3

// CHECK: vpcmpgtq 1024(%rdx){1to2}, %xmm30, %k3
// CHECK:  encoding: [0x62,0xf2,0x8d,0x10,0x37,0x9a,0x00,0x04,0x00,0x00]
          vpcmpgtq 1024(%rdx){1to2}, %xmm30, %k3

// CHECK: vpcmpgtq -1024(%rdx){1to2}, %xmm30, %k3
// CHECK:  encoding: [0x62,0xf2,0x8d,0x10,0x37,0x5a,0x80]
          vpcmpgtq -1024(%rdx){1to2}, %xmm30, %k3

// CHECK: vpcmpgtq -1032(%rdx){1to2}, %xmm30, %k3
// CHECK:  encoding: [0x62,0xf2,0x8d,0x10,0x37,0x9a,0xf8,0xfb,0xff,0xff]
          vpcmpgtq -1032(%rdx){1to2}, %xmm30, %k3

// CHECK: vpcmpgtq %ymm20, %ymm22, %k2
// CHECK:  encoding: [0x62,0xb2,0xcd,0x20,0x37,0xd4]
          vpcmpgtq %ymm20, %ymm22, %k2

// CHECK: vpcmpgtq %ymm20, %ymm22, %k2 {%k1}
// CHECK:  encoding: [0x62,0xb2,0xcd,0x21,0x37,0xd4]
          vpcmpgtq %ymm20, %ymm22, %k2 {%k1}

// CHECK: vpcmpgtq (%rcx), %ymm22, %k2
// CHECK:  encoding: [0x62,0xf2,0xcd,0x20,0x37,0x11]
          vpcmpgtq (%rcx), %ymm22, %k2

// CHECK: vpcmpgtq 291(%rax,%r14,8), %ymm22, %k2
// CHECK:  encoding: [0x62,0xb2,0xcd,0x20,0x37,0x94,0xf0,0x23,0x01,0x00,0x00]
          vpcmpgtq 291(%rax,%r14,8), %ymm22, %k2

// CHECK: vpcmpgtq (%rcx){1to4}, %ymm22, %k2
// CHECK:  encoding: [0x62,0xf2,0xcd,0x30,0x37,0x11]
          vpcmpgtq (%rcx){1to4}, %ymm22, %k2

// CHECK: vpcmpgtq 4064(%rdx), %ymm22, %k2
// CHECK:  encoding: [0x


ash = allocate()   characters.shash = shash -- nil if no conversion

    for k, v in next, characters.data do
     -- if k < 0x11000 then
            local l = v.lccode
            if l then
                -- we have an uppercase
                if type(l) == "number" then
                    lhash[utfchar(k)] = utfchar(l)
                elseif #l == 2 then
                    lhash[utfchar(k)] = utfchar(l[1]) .. utfchar(l[2])
             -- else
             --     inspect(v)
                end
            else
                local u = v.uccode
                if u then
                    -- we have an lowercase
                    if type(u) == "number" then
                        uhash[utfchar(k)] = utfchar(u)
                    elseif #u == 2 then
                        uhash[utfchar(k)] = utfchar(u[1]) .. utfchar(u[2])
                 -- else
                 --     inspect(v)
                    end
                end
            end
            local s = v.shcode
            if s then
                if type(s) == "number" then
                    shash[utfchar(k)] = utfchar(s)
                elseif #s == 2 then
                    shash[utfchar(k)] = utfchar(s[1]) .. utfchar(s[2])
             -- else
             --     inspect(v)
                end
            end
     -- end
    end

    if storage then
        storage.register("characters/lhash", lhash, "characters.lhash")
        storage.register("characters/uhash", uhash, "characters.uhash")
        storage.register("characters/shash", shash, "characters.shash")
    end

end

local lhash = characters.lhash mark(lhash)
local uhash = characters.uhash mark(uhash)
local shash = characters.shash mark(shash)

local utf8lowercharacter = utfchartabletopattern(lhash) / lhash
local utf8uppercharacter = utfchartabletopattern(uhash) / uhash
local utf8shapecharacter = utfchartabletopattern(shash) / shash

local utf8lower = Cs((utf8lowercharacter + utf8character)^0)
local utf8upper = Cs((utf8uppercharacter + utf8character)^0)
local utf8shape = Cs((utf8shapecharacter + utf8character)^0)

lpegpatterns.utf8lowercharacter = utf8lowercharacter -- one character
lpegpatterns.utf8uppercharacter = utf8uppercharacter -- one character
lpegpatterns.utf8shapecharacter = utf8shapecharacter -- one character

lpegpatterns.utf8lower = utf8lower -- string
lpegpatterns.utf8upper = utf8upper -- string
lpegpatterns.utf8shape = utf8shape -- string

function characters.lower (str) return str and lpegmatch(utf8lower,str) or "" end
function characters.upper (str) return str and lpegmatch(utf8upper,str) or "" end
function characters.shaped(str) return str and lpegmatch(utf8shape,str) or "" end

lpeg.setutfcasers(characters.lower,characters.upper)

-- local str = [[
--     ÀÁÂÃÄÅàáâãäå àáâãäåàáâãäå ÀÁÂÃÄÅÀÁÂÃÄÅ AAAAAAaaaaaa
--     ÆÇæç         æçæç         ÆÇÆÇ         AECaec
--     ÈÉÊËèéêë     èéêëèéêë     ÈÉÊËÈÉÊË     EEEEeeee
--     ÌÍÎÏÞìíîïþ   ìíîïþìíîïþ   ÌÍÎÏÞÌÍÎÏÞ   IIIIÞiiiiþ
--     Ðð           ðð           ÐÐ           Ðð
--     Ññ           ññ           ÑÑ           Nn
--     ÒÓÔÕÖòóôõ


.gs-imageResult a.gs-title:hover b {
color: #0000CC;
}
.gs-webResult.gs-result a.gs-title:active,
.gs-webResult.gs-result a.gs-title:active b,
.gs-imageResult a.gs-title:active,
.gs-imageResult a.gs-title:active b {
color: #0000CC;
}
.gsc-cursor-page {
color: #0000CC;
}
a.gsc-trailing-more-results:link {
color: #0000CC;
}
.gs-webResult .gs-snippet,
.gs-imageResult .gs-snippet,
.gs-fileFormatType {
color: #000000;
}
.gs-webResult div.gs-visibleUrl,
.gs-imageResult div.gs-visibleUrl {
color: #008000;
}
.gs-webResult div.gs-visibleUrl-short {
color: #008000;
}
.gs-webResult div.gs-visibleUrl-short {
display: none;
}
.gs-webResult div.gs-visibleUrl-long {
display: block;
}
.gs-promotion div.gs-visibleUrl-short {
display: none;
}
.gs-promotion div.gs-visibleUrl-long {
display: block;
}
.gsc-cursor-box {
border-color: #FFFFFF;
}
.gsc-results .gsc-cursor-box .gsc-cursor-page {
border-color: #E9E9E9;
background-color: #FFFFFF;
color: #0000CC;
}
.gsc-results .gsc-cursor-box .gsc-cursor-current-page {
border-color: #FF9900;
background-color: #FFFFFF;
color: #0000CC;
}
.gsc-webResult.gsc-result.gsc-promotion {
border-color: #336699;
background-color: #FFFFFF;
}
.gsc-completion-title {
color: #0000CC;
}
.gsc-completion-snippet {
color: #000000;
}
.gs-promotion a.gs-title:link,
.gs-promotion a.gs-title:link *,
.gs-promotion .gs-snippet a:link {
color: #0000CC;
}
.gs-promotion a.gs-title:visited,
.gs-promotion a.gs-title:visited *,
.gs-promotion .gs-snippet a:visited {
color: #0000CC;
}
.gs-promotion a.gs-title:hover,
.gs-promotion a.gs-title:hover *,
.gs-promotion .gs-snippet a:hover {
color: #0000CC;
}
.gs-promotion a.gs-title:active,
.gs-promotion a.gs-title:active *,
.gs-promotion .gs-snippet a:active {
color: #0000CC;
}
.gs-promotion .gs-snippet,
.gs-promotion .gs-title .gs-promotion-title-right,
.gs-promotion .gs-title .gs-promotion-title-right * {
color: #000000;
}
.gs-promotion .gs-visibleUrl,
.gs-promotion .gs-visibleUrl-short {
color: #008000;
}</style>
<style type="text/css">.gscb_a{display:inline-block;font:27px/13px arial,sans-serif}.gsst_a .gscb_a{color:#a1b9ed;cursor:pointer}.gsst_a:hover .gscb_a,.gsst_a:focus .gscb_a{color:#36c}.gsst_a{display:inline-block}.gsst_a{cursor:pointer;padding:0 4px}.gsst_a:hover{text-decoration:none!im


.4-44.4 6.9-29.2 20.3-60.7 20.3-81.8 0-53-75.5-45.7-75.5 25 0 21.7 7.3 36.5 7.3 36.5-31.4 132.8-36.1 134.5-29.6 192.6l2.2.8H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h352c26.5 0 48 21.5 48 48z"],
      "playstation": [576, 512, [], "f3df", "M570.9 372.3c-11.3 14.2-38.8 24.3-38.8 24.3L327 470.2v-54.3l150.9-53.8c17.1-6.1 19.8-14.8 5.8-19.4-13.9-4.6-39.1-3.3-56.2 2.9L327 381.1v-56.4c23.2-7.8 47.1-13.6 75.7-16.8 40.9-4.5 90.9.6 130.2 15.5 44.2 14 49.2 34.7 38 48.9zm-224.4-92.5v-139c0-16.3-3-31.3-18.3-35.6-11.7-3.8-19 7.1-19 23.4v347.9l-93.8-29.8V32c39.9 7.4 98 24.9 129.2 35.4C424.1 94.7 451 128.7 451 205.2c0 74.5-46 102.8-104.5 74.6zM43.2 410.2c-45.4-12.8-53-39.5-32.3-54.8 19.1-14.2 51.7-24.9 51.7-24.9l134.5-47.8v54.5l-96.8 34.6c-17.1 6.1-19.7 14.8-5.8 19.4 13.9 4.6 39.1 3.3 56.2-2.9l46.4-16.9v48.8c-51.6 9.3-101.4 7.3-153.9-10z"],
      "product-hunt": [512, 512, [], "f288", "M326.3 218.8c0 20.5-16.7 37.2-37.2 37.2h-70.3v-74.4h70.3c20.5 0 37.2 16.7 37.2 37.2zM504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-128.1-37.2c0-47.9-38.9-86.8-86.8-86.8H169.2v248h49.6v-74.4h70.3c47.9 0 86.8-38.9 86.8-86.8z"],
      "pushed": [432, 512, [], "f3e1", "M407 111.9l-98.5-9 14-33.4c10.4-23.5-10.8-40.4-28.7-37L22.5 76.9c-15.1 2.7-26 18.3-21.4 36.6l105.1 348.3c6.5 21.3 36.7 24.2 47.7 7l35.3-80.8 235.2-231.3c16.4-16.8 4.3-42.9-17.4-44.8zM297.6 53.6c5.1-.7 7.5 2.5 5.2 7.4L286 100.9 108.6 84.6l189-31zM22.7 107.9c-3.1-5.1 1-10 6.1-9.1l248.7 22.7-96.9 230.7L22.7 107.9zM136 456.4c-2.6 4-7.9 3.1-9.4-1.2L43.5 179.7l127.7 197.6c-7 15-35.2 79.1-35.2 7


];
  EXPECT_NE(read_bmc_reset_cause(device_token_, reset_cause), FPGA_OK);
}

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(board_a10gx_invalid_c_p);
INSTANTIATE_TEST_SUITE_P(
    board_a10gx_invalid_c, board_a10gx_invalid_c_p,
    ::testing::ValuesIn(test_platform::mock_platforms({"skx-p"})));
// Copyright(c) 2018-2022, Intel Corporation
//
// Redistribution  and  use  in source  and  binary  forms,  with  or  without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of  source code  must retain the  above copyright notice,
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
// * Neither the name  of Intel Corporation  nor the names of its contributors
//   may be used to  endorse or promote  products derived  from this  software
//   without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT NOT LIMITED TO,  THE
// IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT  SHALL THE COPYRIGHT OWNER  OR CONTRIBUTORS BE
// LIABLE  FOR  ANY  DIRECT,  INDIRECT,  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR
// CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT LIMITED  TO,  PROCUREMENT  OF
// SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE,  DATA, OR PROFITS;  OR BUSINESS
// INTERRUPTION)  HOWEVER CAUSED  AND ON ANY THEORY  OF LIABILITY,  WHETHER IN
// CONTRACT,  STRICT LIABILITY,  OR TORT  (INCLUDING NEGLIGENCE  OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif // HAVE_CONFIG_H

extern "C" {
#include "metrics/vector.h"
#include "opae_int.h"
#include "types_int.h"
}

#include "gtest/gtest.h"

/**
 * @test       opaec
 * @brief      Tests: fpga_vector_init
 * @details    TODO: test needs a valid comment.
 */
TEST(metric_vector, test_metric_vector_01) {
  fpga_metric_vector vector;

  // NULL Input parameters
  EXPECT_NE(FPGA_OK, fpga_vector_init(NULL));

  // NULL Input parameters
  EXPECT_NE(FPGA_OK, fpga_vector_free(NULL));

  // NULL Input parameters
  EXPECT_NE(FPGA_OK, fpga_vector_total(NULL, NULL));

  // NULL Input parameters
  EXPECT_NE(FPGA_OK, fpga_vector_resize(NULL, 20));

  // Init vector
  EXPECT_EQ(FPGA_OK, fpga_vector_init(&vector));

  // NULL Input parameters
  EXPECT_NE(FPGA_OK, fpga_vector_push(&vector, NULL));

  // NULL Input parameters
  EXPECT_NE(FPGA_OK, fpga_vector_push(NULL, NULL));

  // Delete with NULL
  EXPECT_NE(FPGA_OK, fpga_vector_delete(NULL, 0));

  EXPECT_EQ(FPGA_OK, fpga_vector_free(&vector));
}

/**
 * @test       opaec
 * @brief      Tests: fpga_vector_init
 * @details    TODO: test needs a valid comment.
 */
TEST(metric_vector, test_metric_vector_02) {
  fpga_metric_vector metric_vector;
  struct _fpga_


ceguíes de seda de Mariscal",
[16440] = "Guantes de seda de Mariscal",
[16441] = "Nimbo de Mariscal de campo",
[16442] = "Leotardos de seda de Mariscal",
[16443] = "Vestimentas de seda de Mariscal de campo",
[16444] = "Bufas de seda de Mariscal de campo",
[16446] = "Guardapiés de cuero de Mariscal",
[16448] = "Guanteletes de pellejo de dragón de Mariscal",
[16449] = "Bufas de pellejo de dragón de Mariscal de campo",
[16450] = "Musleras de pellejo de dragón de Mariscal",
[16451] = "Casco de pellejo de dragón de Mariscal de campo",
[16452] = "Coraza de pellejo de dragón de Mariscal de campo",
[16453] = "Pechera de cuero de Mariscal de campo",
[16454] = "Lúas de cuero de Mariscal",
[16455] = "Máscara de cuero de Mariscal de campo",
[16456] = "Leotardos de cuero de Mariscal",
[16457] = "Cubrehombros de cuero de Mariscal de campo",
[16459] = "Botas de pellejo de dragón de Mariscal",
[16462] = "Botas de anillas de Mariscal",
[16463] = "Mandiletes de anillas de Mariscal",
[16465] = "Yelmo de anillas de Mariscal de campo",
[16466] = "Coraza de anillas de Mariscal de campo",
[16467] = "Musleras de anillas de Mariscal",
[16468] = "Bufas de anillas de Mariscal de campo",
[16471] = "Guantes de láminas de Mariscal",
[16472] = "Botas de láminas de Mariscal",
[16473] = "Peto de láminas de Mariscal de campo",
[16474] = "Visera de láminas de Mariscal de campo",
[16475] = "Quijotes de láminas de Mariscal",
[16476] = "Espaldares de láminas de Mariscal de campo",
[16477] = "Armadura de placas de Mariscal de campo",
[16478] = "Yelmo de placas de Mariscal de campo",
[16479] = "Musleras de placas de Mariscal",
[16480] = "Guardahombros de placas de Mariscal de campo",
[16483] = "Botas de placas de Mariscal",
[16484] = "Guantes de placas de Mariscal",
[16485] = "Borceguíes de seda de Guardia de sangre",
[16486] = "Puños de seda de Gran capataz",
[16487] = "Guantes de seda de Guardia de sangre",
[16489] = "Caperuza de seda de Campeón",
[16490] = "Pantalones de seda de Legionario",
[16491] = "Togas de seda de Legionario",
[16492] = "Hombreras de seda de Campeón",
[16494] = "Botas de pellejo de dragón de Guardia de sangre",
[16496] = "Guanteletes de pellejo de dragón de Guardia de sangre",
[16497] = "Guardabrazos de cuero de Gran capataz",
[16498] = "Botines de cuero de Guardia de sangre",
[16499] = "Abrazadera de cuero de Guardia de sangre",
[16501] = "Bufas de pellejo de dragón de Campeón",
[16502] = "Calzas de pellejo de dragón de Legionario",
[16503] = "Yelmo


,
   "day": null
 },
 {
   "id": 83,
   "crag": 9,
   "order": 17,
   "name": "Furnace ",
   "description": "The left hand route with a shallow open book in the upper section. Finish up a short crack. ",
   "grade": "12",
   "stars": 3,
   "type": "Sport",
   "number_draws": "11",
   "fa_date": "2017",
   "fa_text": "Jette Bollerup Clive Curson",
   "notes": "",
   "month": "",
   "day": null
 },
 {
   "id": 84,
   "crag": 9,
   "order": 18,
   "name": "Wildfire ",
   "description": "Tagged. The middle route with the crux just before the anchors and to the bolt above the roof. ",
   "grade": "17",
   "stars": 4,
   "type": "Sport",
   "number_draws": "12",
   "fa_date": "2017",
   "fa_text": "C Curson J Bollerup ",
   "notes": "Also called hellfire. 16 if you go 1m L instead of the bolt above the roof",
   "month": "",
   "day": null
 },
 {
   "id": 85,
   "crag": 9,
   "order": 19,
   "name": "Inferno ",
   "description": "The arête on the R, 1m R of Wildfire. Step R to crux after the last bolt. ",
   "grade": "14",
   "stars": 4,
   "type": "Sport",
   "number_draws": "12",
   "fa_date": "2017",
   "fa_text": "Jette Bollerup C Curson",
   "notes": "",
   "month": "",
   "day": null
 },
 {
   "id": 856,
   "crag": 9,
   "order": 20,
   "name": "Slabby ",
   "description": "Start in the short corner 4m R of Wildfire. Climb the slab R of the arête, finishing up the same move as Inferno. ",
   "grade": "15",
   "stars": null,
   "type": "Sport",
   "number_draws": "11",
   "fa_date": "2017",
   "fa_text": "Clive Curson",
   "notes": "",
   "month": "August",
   "day": null
 },
 {
   "id": 857,
   "crag": 9,
   "order": 21,
   "name": "Angular ",
   "description": "15? Start off the track up to Als Bells, about 10m up R from Wildfire, 12m left of Hot Spot. Climb up & left to gain the arête with some difficulty. Up this past the overlap to the anchors.",
   "grade": "16",
   "stars": null,
   "type": "Sport",
   "number_draws": "9",
   "fa_date": "2017",
   "fa_text": "Clive Curson",
   "notes": "",
   "month": "August",
   "day": null
 },
 {
   "id": 858,
   "crag": 9,
   "order": 22,
   "name": "Burnout ",
   "description": "Start 5m R of Angular, off a small block deep in the chimney. Diagonally L out of the cleft and up to the anchors. The direct start (2 separate bolts) submits to some grunty technique at about 15",
   "grade": "12",
   "stars": null,
   "type": "Sport",
   "number_draws": "8",
   "fa_date": "2017",
   "fa_text": "Clive Curson",
   "notes": "",
   "month": "August",
   "day": null
 },
 {
   "id": 859,
   "crag": 9,
   "order": 23,
   "name": "Perp ",
   "description": "Start at a fig about 3m R of Burnout. Diagonally


","addWord":"Adicionar palavra","allCaps":"Ignorar palavras maiúsculas","dic_create":"Criar","dic_delete":"Excluir","dic_field_name":"Nome do Dicionário","dic_info":"Inicialmente, o dicionário do usuário fica armazenado em um Cookie. Porém, Cookies tem tamanho limitado, portanto quand o dicionário do usuário atingir o tamanho limite poderá ser armazenado no nosso servidor. Para armazenar seu dicionário pessoal no nosso servidor deverá especificar um nome para ele. Se já tiver um dicionário armazenado por favor especifique o seu nome e clique em Restaurar.","dic_rename":"Renomear","dic_restore":"Restaurar","dictionariesTab":"Dicionários","disable":"Desabilitar correção ortográfica durante a digitação","emptyDic":"O nome do dicionário não deveria estar vazio.","enable":"Habilitar correção ortográfica durante a digitação","ignore":"Ignorar","ignoreAll":"Ignorar todas","ignoreDomainNames":"Ignorar nomes de domínio","langs":"Idiomas","languagesTab":"Idiomas","mixedCase":"Ignorar palavras com maiúsculas e minúsculas misturadas","mixedWithDigits":"Ignorar palavras com números","moreSuggestions":"Mais sugestões","opera_title":"Não suportado no Opera","options":"Opções","optionsTab":"Opções","title":"Correção ortográfica durante a digitação","toggle":"Ativar/desativar correção ortográfica durante a digitação","noSuggestions":"No suggestion"},"stylescombo":{"label":"Estilo","panelTitle":"Estilos de Formatação","panelTitle1":"Estilos de bloco","panelTitle2":"Estilos de texto corrido","panelTitle3":"Estilos de objeto"},"table":{"border":"Borda","caption":"Legenda","cell":{"menu":"Célula","insertBefore":"Inserir célula a esquerda","insertAfter":"Inserir célula a direita","deleteCell":"Remover Células","merge":"Mesclar Células","mergeRight":"Mesclar com célula a direita","mergeDown":"Mesclar com célula abaixo","splitHorizontal":"Dividir célula horizontalmente","splitVertical":"Dividir célula verticalmente","title":"Propriedades da célula","cellType":"Tipo de célula","rowSpan":"Linhas cobertas","colSpan":"Colunas cobertas","wordWrap":"Quebra de palavra","hAlign":"Alinhamento horizontal","vAlign":"Alinhamento vertical","alignBaseline":"Patamar de alinhamento","bgColor":"Cor de fundo","borderColor":"Cor das bordas","data":"Dados","header":"Cabeçalho","yes":"Sim","no":"Não","invalidWidth":"A largura da célula tem que ser um número.","invalidHeight":"A altura da célula tem que ser um número.","invalidRowSpan":"Linhas cobertas tem que ser um número inteiro.","invalidColSpan":"Colunas cobertas tem que ser um número inteiro.","chooseColor":"Escolher"},"cellPad":"Margem interna","cellSpace":"Espaçamento","column":{"menu":"Coluna","insertBefore":"Inserir coluna a esquerda","insertAfter":"Inserir coluna a direita","deleteColumn":"Remover Colunas"},"columns":"Colunas","deleteTable":"Apagar Tabela","headers":"Cabeçalho","headersBoth":"Ambos","he


/*
 * Copyright (c) 2016 IBM Corporation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#include "ppc_asm.h"
#include "../include/asm/opal-api.h"

	.text

	.globl opal_kentry
opal_kentry:
	/* r3 is the fdt ptr */
	mtctr r4
	li	r4, 0
	li	r5, 0
	li	r6, 0
	li	r7, 0
	ld	r11,opal@got(r2)
	ld	r8,0(r11)
	ld	r9,8(r11)
	bctr

#define OPAL_CALL(name, token)				\
	.globl name;					\
name:							\
	li	r0, token;				\
	b	opal_call;

opal_call:
	mflr	r11
	std	r11,16(r1)
	mfcr	r12
	stw	r12,8(r


?aW.g:(r.gdpr||"0");var aT=D(O);r.us_privacy=aT&&aT.c?aT.c:r.us_privacy||"";var aS=z(O,"GPP");r.gpp=aS&&aS.gpp?aS.gpp:(r.gpp||"");r.gpp_sid=(aS&&aS.gpp_sid)?aS.gpp_sid:(r.gpp_sid||"");var aV=N();if(aV==false){ax(aH,"YES",90,"/",aA)}if(aV==false&&t(aH)==="YES"){aB(aH,"/",aA);m(aU)}else{ap()}};U.PugMasterCallback=function(aT,aS,aU){setTimeout(function(){aB(Y,"/",ab)},2000);if(aT||(!r.SPug&&Math.floor(Math.random()*100)<=10)){x(O)}if(aS){setTimeout(function(){av()},30000)}if(aU){ax(ag,(new Date()).getTime()+(60*60*6*1000),1,"/",ab)}ap()};U.loadAsyncIframePixel=function(aS){aC(aS)};U.loadAsyncImagePixel=function(aS){w(aS)};U.loadAsyncScriptPixel=function(aS){p(aS)};var u=function(aS){switch(aS){case"GDPRTCF2":l=true;break;case"USP":ac=true;break;case"GPP":P=true;break;default:break}if(l&&ac&&P){j()}};var aq=function(){var aS=aN(r.p||0);if(aS==0){aS=aN(t("pp"))||0}an(aS,u);aR(aS,u);ay(aS,u)};aq();if("onvisibilitychange" in ah.document){I(ah.document,"visibilitychange",function(){if(ah.document.visibilityState==="hidden"){B()}})}if("onpagehide" in ah){I(ah,"pagehide",B)}else{I(ah,"beforeunload",B)}})();</script><img src="./D14C8FD7-0FF4-425A-AD6E-9BCD78046A14" height="0" width="0" border="0px" hspace="0" vspace="0" style="height: 0px; width: 0px; disp


/********************************************************************************
** Form generated from reading UI file 'PluginManagerForm.ui'
**
** Created by: Qt User Interface Compiler version 5.14.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef UI_PLUGINMANAGERFORM_H
#define UI_PLUGINMANAGERFORM_H

#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QListView>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QWidget>

QT_BEGIN_NAMESPACE

class Ui_MainWindow
{
public:
    QWidget *centralwidget;
    QListView *pluginList;
    QMenuBar *menubar;
    QStatusBar *statusbar;

    void setupUi(QMainWindow *MainWindow)
    {
        if (MainWindow->objectName().isEmpty())
            MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
        MainWindow->resize(670, 276);
        centralwidget = new QWidget(MainWindow);
        centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
        pluginList = new QListView(centralwidget);
        pluginList->setObjectName(QString::fromUtf8("pluginList"));
        pluginList->setGeometry(QRect(0, 0, 671, 231));
        MainWindow->setCentralWidget(centralwidget);
        menubar = new QMenuBar(MainWindow);
        menubar->setObjectName(QString::fromUtf8("menubar"));
        menubar->setGeometry(QRect(0, 0, 670, 21));
        MainWindow->setMenuBar(menubar);
        statusbar = new QStatusBar(MainWindow);
        statusbar->setObjectName(QString::fromUtf8("statusbar"));
        MainWindow->setStatusBar(statusbar);

        retranslateUi(MainWindow);

        QMetaObject::connectSlotsByName(MainWindow);
    } // setupUi

    void retranslateUi(QMainWindow *MainWindow)
    {
        MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr));
    } // retranslateUi

};

namespace Ui {
    class MainWindow: public Ui_MainWindow {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_PLUGINMANAGERFORM_H


 }
                _ => {
                    return Ok(SteelVal::VectorV(Gc::new(Vector::new())));
                }
            }

            for (i, val) in args.enumerate() {
                pairs.push(Gc::new(ConsCell::new(
                    val.clone(),
                    Some(Gc::clone(&pairs[i])),
                )));
            }

            pairs.pop().map(SteelVal::Pair).ok_or_else(|| {
                SteelErr::new(
                    ErrorKind::Generic,
                    "list-pair broke inside built_in_list_func".to_string(),
                )
            })
        }
    }

    pub fn built_in_list_func_flat(args: &[SteelVal]) -> Result<SteelVal> {
        let mut args = args.into_iter().rev();
        let mut pairs = Vec::new();

        match args.next() {
            Some(car) => {
                pairs.push(Gc::new(ConsCell::new(car.clone(), None)));
            }
            _ => {
                return Ok(SteelVal::VectorV(Gc::new(Vector::new())));
            }
        }

        for (i, val) in args.enumerate() {
            pairs.push(Gc::new(ConsCell::new(
                val.clone(),
                Some(Gc::clone(&pairs[i])),
            )));
        }

        pairs.pop().map(SteelVal::Pair).ok_or_else(|| {
            SteelErr::new(
                ErrorKind::Generic,
                "list-pair broke inside built_in_list_func_flat".to_string(),
            )
        })
    }

    pub fn list_length() -> SteelVal {
        SteelVal::FuncV(|args: &[SteelVal]| -> Result<SteelVal> {
            if args.len() == 1 {
                match &args[0] {
                    SteelVal::VectorV(v) => Ok(SteelVal::IntV(v.len() as isize)),
                    SteelVal::Pair(_) => {
                        let mut count: isize = 0;
                        for _ in SteelVal::iter(args[0].clone()) {
                            count += 1;
                        }
                        Ok(SteelVal::IntV(count))
                    }
                    _ => stop!(TypeMismatch => "length expects a list"),
                }
            } else {
                stop!(ArityMismatch => "length takes one argument");
            }
        })
    }

    pub fn built_in_list_func_flat_non_gc(args: Vec<SteelVal>) -> Result<SteelVal> {
        let mut args = args.into_iter().rev();
        let mut pairs = Vec::new();

        match args.next() {
            Some(car) => {
                pairs.push(Gc::new(ConsCell::new(car, None)));
            }
            _ => {
                return Ok(SteelVal::VectorV(Gc::new(Vector::new())));
            }
        }

        for (i, val) in args.enumerate() {
            pairs.push(Gc::new(ConsCell::new(val, Some(Gc::clone(&pairs[i])))));
        }

        pairs.pop().map(SteelVal::Pair).ok_or_else(|| {
            SteelErr::new(
                ErrorKind::Generic,
                "list-pair broke inside built_in_list_func_flat_non_gc".to_string(),
            )
        })
    }
}

#[cfg(test)]
mod list_operation_tests {

    use super::*;
    use crate::rerrs::ErrorKind;
    use crate::throw;
    use im_rc::vector;

    fn apply_function(func: SteelVal, args: Vec<SteelVal>) -> Result<SteelVal> {
        func.


{
        captions: Mutable::new(play_settings.captions),
        muted: Mutable::new(play_settings.muted),
        autoplay: Mutable::new(play_settings.autoplay),
        _loop: Mutable::new(matches!(play_settings.done_action, Some(DoneAction::Loop))),
        base: Default::default(),
        on_ended: on_ended.map(|f| Rc::new(f) as _),
    }
}
<gh_stars>0
extern crate ndarray;

use ndarray::prelude::*;

use std::collections::HashMap;
use std::collections::HashSet;
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::num::ParseIntError;
use std::str::FromStr;

fn main() -> Result<(), <Point as FromStr>::Err> {
    let args: Vec<String> = env::args().collect();

    let filename = &args[1];

    let maxdist = args[2].parse::<i64>().unwrap();

    let contents = get_contents(filename);

    let points = get_points(&contents)?;

    println!("{}", largest_area(&points));
    println!("{}", close_area(&points, maxdist));

    Ok(())
}

fn close_area(points: &[Point], maxdist: i64) -> u64 {
    let size = get_max(points) + 1;

    let mut arena = Array::<i64, Ix2>::zeros((size, size));

    for i in 0..size {
        for j in 0..size {
            let mut dists: Vec<i64> = vec![0; points.len()];
            for (c, p) in points.iter().enumerate() {
                dists[c] = (p.x - i as i64).abs() + (p.y - j as i64).abs();
            }
            if dists.iter().sum::<i64>() >= maxdist {
                continue;
            }
            arena[[j, i]] = 1;
        }
    }
    arena.sum() as u64
}

fn largest_area(points: &[Point]) -> u64 {
    let size = get_max(points) + 1;

    let mut arena = Array::<i64, Ix2>::zeros((size, size));

    for i in 0..size {
        for j in 0..size {
            let mut dists = vec![0; points.len()];
            for (c, p) in points.iter().enumerate() {
                dists[c] = (p.x - i as i64).abs() + (p.y - j as i64).abs();
            }
            let mindist = dists.iter().min().unwrap();
            let mut noccs = 0;
            for dist in dists.iter() {
                if *dist == *mindist {
                    noccs += 1;
                }
            }
            if noccs > 1 {
                arena[[j, i]] = -1;
            } else {
                arena[[j, i]] = dists.iter().position(|&val| val == *mindist).unwrap() as i64;
            }
        }
    }

    let mut ignore: HashSet<usize> = HashSet::new();

    for i in 0..size {
        ignore.insert(arena[[0, i]] as usize);
        ignore.insert(arena[[size - 1, i]] as usize);
        ignore.insert(arena[[i, 0]] as usize);
        ignore.insert(arena[[i, size - 1]] as usize);
    }

    let mut arena_counts: HashMap<usize, u64> = HashMap::new();

    for c in (0..points.len()).filter(|x| !ignore.contains(x)) {
        for v in arena.iter() {
            if *v as usize == c {
                *arena_counts.entry(c).or_insert(0) += 1
            }
        }
    }

    *arena_counts.values().max().unwrap()
}

fn get_contents(filename: &str) -> String {
    let mut f = File::open(filename).expect("file not found");

    let mut contents = String::new();
    f


    #[pdf(key="MediaBox")]
    pub media_box:  Option<Rect>,

    #[pdf(key="CropBox")]
    pub crop_box:   Option<Rect>,
}
impl PageTree {
    pub fn page(&self, resolve: &impl Resolve, page_nr: u32) -> Result<PageRc> {
        let mut pos = 0;
        for &kid in &self.kids {
            let rc = resolve.get(kid)?;
            match *rc {
                PagesNode::Tree(ref tree) => {
                    if (pos .. pos + tree.count).contains(&page_nr) {
                        return tree.page(resolve, page_nr - pos);
                    }
                    pos += tree.count;
                }
                PagesNode::Leaf(ref page) => {
                    if pos == page_nr {
                        return Ok(page.clone());
                    }
                    pos += 1;
                }
            }
        }
        Err(PdfError::PageOutOfBounds {page_nr, max: pos})
    }
    /*
    pub fn pages<'a>(&'a self, resolve: &'a impl Resolve) -> impl Iterator<Item=Result<PageRc>> + 'a {
        self.kids.iter().flat_map(move |&r| {
            match resolve.get(r) {
                Ok(node) => Either::Left(node.pages(resolve)),
                Err(e) => Either::Right(once(Err(e)))
            }
        })
    }
    */
}
#[derive(Object, Debug)]
pub struct Page {
    #[pdf(key="Parent")]
    pub parent: Ref<PagesNode>,

    #[pdf(key="Resources")]
    pub resources: Option<Rc<Resources>>,

    #[pdf(key="MediaBox")]
    pub media_box:  Option<Rect>,

    #[pdf(key="CropBox")]
    pub crop_box:   Option<Rect>,

    #[pdf(key="TrimBox")]
    pub trim_box:   Option<Rect>,

    #[pdf(key="Contents")]
    pub contents:   Option<Content>
}
fn inherit<T, F, B: Backend>(mut parent: Ref<PagesNode>, file: &File<B>, f: F) -> Result<Option<T>>
    where F: Fn(&PageTree) -> Option<T>
{
    while let PagesNode::Tree(ref page_tree) = *file.get(parent)? {
        debug!("parent: {:?}", page_tree);
        match (page_tree.parent, f(&page_tree)) {
            (_, Some(t)) => return Ok(Some(t)),
            (Some(ref p), None) => parent = *p,
            (None, None) => return Ok(None)
        }
    }
    bail!("bad parent")
}

impl Page {
    pub fn new(parent: Ref<PagesNode>) -> Page {
        Page {
            parent,
            media_box:  None,
            crop_box:   None,
            trim_box:   None,
            resources:  None,
            contents:   None
        }
    }
    pub fn media_box<B: Backend>(&self, file: &File<B>) -> Result<Rect> {
        match self.media_box {
            Some(b) => Ok(b),
            None => inherit(self.parent, file, |pt| pt.media_box)?
                .ok_or_else(|| PdfError::MissingEntry { typ: "Page", field: "MediaBox".into() })
        }
    }
    pub fn crop_box<B: Backend>(&self, file: &File<B>) -> Result<Rect> {
        match self.crop_box {
            Some(b) => Ok(b),
            None => match inherit(self.parent, file, |pt| pt.crop_box


点。

class XiaoJieJie42 implements Girl{
    name="刘英"
    age=18
    bust=90
    say(){
        return '欢迎光临 ，红浪漫洗浴！！'
    }
}
// class lala implements Girl
// class lala implements Girl

// 接口也可以用于继承的，比如你新写一个Teacher接口，继承于Girl接口。

interface Teacher extends Girl{
    teach() :string
}
// let lala: Teacher = {

// }   //报错

// 比如这时候老板说了，只看Teacher级别的简历，那我们需要修改getResume()方法。

const getResume5=( girl:Teacher)=>{
    console.log(girl.name+'年龄是：'+girl.age)
    console.log(girl.name+'胸围是：'+girl.bust)
    girl.waistline && console.log(girl.name+'腰围是：'+girl.waistline)
    girl.sex && console.log(girl.name+'性别是：'+girl.sex)
}
// 修改后，你就会发现下面我们调用getResume()方法的地方报错了,因为这时候传的值必须有Teach方法，

// getResume(girl)
// 修改girle对象，增加teach（）方法，这时候就不会报错了。

const girl5={
    name:'大脚',
    age:18,
    bust:94,
    waistline:21,
    sex:'女',
    say(){
        return '欢迎光临 ，红浪漫洗浴！！'
    },
    teach(){
        return '我是一个老师'
    }
}
const getResume6=( girl:Teacher)=>{
    console.log(girl.name+'年龄是：'+girl.age)
    console.log(girl.name+'胸围是：'+girl.bust)
    girl.waistline && console.log(girl.name+'腰围是：'+girl.waistline)
    girl.sex && console.log(girl.name+'性别是：'+girl.sex)
}
// getResume6(girl5)

/* 学会了接口，你还需要明白一件事，就是接口只是对我们开发的约束，在生产环境中并没有体现。
也可以说接口只是在TypeScript里帮我们作语法校验的工具，编译成正式的js代码，就不会有任何用处了。 */

import * as sampleController from './sample.controller';
import withAuthMiddleware from '../../routers/withAuthMiddleware';
import { Router } from 'express';
import withErrorHandlerRoute from '../../routers/withErrorHandlerRoute';

const router = Router();
const protectedRouter = withAuthMiddleware(router);
const errorHandledRouter = withErrorHandlerRoute(protectedRouter);

/**
 * @swagger
 *
 * /samples:
 *   get:
 *     tags: ['Sample']
 *     summary: Get All Sample
 *     security:
 *       - jwt: []
 *     produces:
 *       - application/json
 *     responses:
 *       200:
 *         description: login
 */
errorHandledRouter.get('/', sampleController.getAll);

/**
 * @swagger
 *
 * /samples:
 *   post:
 *     tags: ['Sample']
 *     summary: Create Sample
 *     description: Create Sample
 *     security:
 *       - jwt: []
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: sampleId
 *         in: formData
 *         required: true
 *         type: string
 *       - name: distributor
 *         in: formData
 *         required: true
 *         type: string
 *       - name: customer
 *         in: formData
 *         required: true
 *         type: string
 *       - name: lubricantLife
 *         in: formData
 *         required: true
 *         type: string
 *       - name: equipmentLife
 *         in: formData
 *         required: true
 *         type: string
 *       - name: drawnDate
 *         in: formData
 *         req


 address. Valid values:`Private` or `Public`. `Private`: communication within the private network. `Public`: communication over the public network
        /// </summary>
        public readonly string NetworkType;
        /// <summary>
        /// The status of the IPv6 address. Valid values:`Pending` or `Available`.
        /// </summary>
        public readonly string Status;
        /// <summary>
        /// The ID of the VPC to which the IPv6 address belongs.
        /// </summary>
        public readonly string VpcId;
        /// <summary>
        /// The ID of the vSwitch to which the IPv6 address belongs.
        /// </summary>
        public readonly string VswitchId;

        [OutputConstructor]
        private GetIpv6AddressesAddressResult(
            string associatedInstanceId,

            string associatedInstanceType,

            string createTime,

            string id,

            string ipv6Address,

            string ipv6AddressId,

            string ipv6AddressName,

            string ipv6GatewayId,

            string networkType,

            string status,

            string vpcId,

            string vswitchId)
        {
            AssociatedInstanceId = associatedInstanceId;
            AssociatedInstanceType = associatedInstanceType;
            CreateTime = createTime;
            Id = id;
            Ipv6Address = ipv6Address;
            Ipv6AddressId = ipv6AddressId;
            Ipv6AddressName = ipv6AddressName;
            Ipv6GatewayId = ipv6GatewayId;
            NetworkType = networkType;
            Status = status;
            VpcId = vpcId;
            VswitchId = vswitchId;
        }
    }
}


{
      Operation op = s->op->ReplaceInputs(s->op, repl);
      if (!op.same_as(s->op)) {
        for (int j = 0; j < op->num_outputs(); ++j) {
          repl[s->op.output(j)] = op.output(j);
        }
        s->op = op;
      }
    }
  }
}

void LegalizeInvalidAttach(ScheduleNode* sch) {
  // Legalize the compute_at location if the target iterator of compute_at is split or fused.
  // Case 1: If the target of compute_at is split,
  //         we will move the compute_at location to the inner iterator.
  // Case 2: If the target of compute_at is fused,
  //         we will move the compute_at location to the newly fused iterator.
  // Note that case 2 can only happen if the target of compute_at
  // is the innermost operand of fuse operation.

  // Map an old invalid attach point to its new valid attach point
  std::unordered_map<IterVar, IterVar> replace_map;

  for (Stage stage : sch->stages) {
    std::unordered_set<const Object*> visited;
    for (Stage s = stage; s.defined();) {
      // The following logic is simiar to the `CreateAttachPath` in `src/te/schedule/graph.h`,
      // because we follow the validation check in that function to legalize the attach.
      ICHECK(!visited.count(s.get())) << "Find loop in compute_at attach group";
      visited.insert(s.get());
      Stage spec = s.GetAttachSpec();
      if (spec->attach_type != kScope) {
        break;
      }
      bool start_attach = false;
      IterVar attach_ivar = spec->attach_ivar;
      s = spec->attach_stage;
      ICHECK(attach_ivar.defined());
      ICHECK(s.defined());

      for (size_t i = s->leaf_iter_vars.size(); i != 0; --i) {
        IterVar iv = s->leaf_iter_vars[i - 1];
        if (!start_attach && iv.same_as(attach_ivar)) {
          start_attach = true;
          break;
        }
      }

      if (!start_attach) {
        IterVar new_attach_ivar = attach_ivar;
        bool updated = true;
        // recursively update the relations
        while (updated) {
          updated = false;
          for (const auto& rel : s->relations) {
            if (const FuseNode* r = rel.as<FuseNode>()) {
              if (new_attach_ivar.same_as(r->inner)) {
                new_attach_ivar = r->fused;
                updated = true;
              }
            } else if (const SplitNode* r = rel.as<SplitNode>()) {
              if (new_attach_ivar.same_as(r->parent)) {
                new_attach_ivar = r->inner;
                updated = true;
              }
            }
          }
          replace_map[attach_ivar] = new_attach_ivar;
        }
      }
    }
  }

  // remap the parent relation
  for (Stage s : sch->stages) {
    if (s->attach_type != kScope) continue;
    if (replace_map.count(s->attach_ivar)) {
      s->attach_ivar = replace_map.at(s->attach_ivar);
    }
  }
  for (Stage s : sch->groups) {
    if (s->attach_type != kScope) continue;
    if (replace_map.count(s->attach_ivar)) {
      s->attach_ivar = replace_map.at(s->attach_ivar);
    }
  }
}

Schedule Schedule::normalize() {
  Schedule sn = copy();
  InjectInline(sn.operator->(), false);
  RebaseNonZeroMinLoop(sn.operator->());
  LegalizeInvalidAttach(sn.


,2.88 0.58,3.93 a 9.57,9.57 0 0 0 18.82,-2.83 v 0 a 1.8524376,1.8524376 0 0 1 3.7,-0.19 z" id="path12" /><path class="cls-2" d="m 117.85,158.46 -3.6,32 a 11.43,11.43 0 0 1 -22.77,-1.9" id="path13" /><path class="cls-3" d="m 119.11,158.6 -0.71,8.41 -0.77,8.39 -0.83,8.39 -0.41,4.2 a 38.06,38.06 0 0 1 -0.54,4.42 13.27,13.27 0 0 1 -23.22,5.24 13.42,13.42 0 0 1 -2.93,-9.15 1.86,1.86 0 0 1 2,-1.73 1.84,1.84 0 0 1 1.73,1.93 9.6,9.6 0 0 0 2.22,6.52 9.49,9.49 0 0 0 5.94,3.38 9.68,9.68 0 0 0 6.69,-1.47 9.43,9.43 0 0 0 4,-5.61 c 0.26,-1 0.39,-2.55 0.57,-3.93 l 0.53,-4.18 1.06,-8.36 1.11,-8.36 1.18,-8.36 a 1.24,1.24 0 0 1 2.46,0.28 z" id="path14" /><path class="cls-2" d="m 94.46,157.41 -0.93,32.1 a 11.42,11.42 0 0 1 -22.84,0 l -0.93,-32.1" id="path15" /><path class="cls-3" d="m 95.69,157.47 q 0,12.44 -0.19,24.87 l -0.1,6.22 a 17.8,17.8 0 0 1 -0.3,3.42 13.31,13.31 0 0 1 -13,10.59 12.81,12.81 0 0 1 -3.59,-0.5 12.62,12.62 0 0 1 -3.32,-1.46 13.38,13.38 0 0 1 -4.85,-5.2 13.15,13.15 0 0 1 -1.22,-3.4 17,17 0 0 1 -0.3,-3.42 l -0.1,-6.22 Q 68.49,169.93 68.53,157.5 A 1.24,1.24 0 0 1 71,157.43 c 0.49,8.28 0.92,16.56 1.24,24.84 l 0.26,6.21 a 15.61,15.61 0 0 0 0.27,2.75 9.55,9.55 0 0 0 9.35,7.48 9.49,9.49 0 0 0 8.44,-5.05 9,9 0 0 0 0.9,-2.42 15.73,15.73 0 0 0 0.27,-2.76 l 0.26,-6.21 c 0.32,-8.28 0.75,-16.56 1.23,-24.84 a 1.24,1.24 0 0 1 2.47,0.07 z" id="path16" /><metadata id="metadata16"><rdf:RDF><cc:Work rdf:about=""><dc:title>Plan de travail 1</dc:title></cc:Work></rdf:RDF></metadata></svg>

<svg id="Calque_1" data-name="Calque 1" viewBox="0 0 164.22001 202.57924" version="1.1" sodipodi:docname="ScyllaDb.svg" width="164.22" height="202.57924" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sour


#ifndef __LSYNC_H
#define __LSYNC_H
/*
 * Copyright (C) 2007, 2008, 2009, Strawberry Development Group.
 *
 * This file is part of the CapROS Operating System runtime library.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
/* This material is based upon work supported by the US Defense Advanced
Research Projects Agency under Contract No. W31P4Q-07-C-0070.
Approved for public release, distribution unlimited. */

/* lsync.h -- Header for drivers using Linux kernel emulation.
*/

#include <domain/cmte.h>

/* Key registers: */
#define KR_LINUX_EMUL KR_CMTE(0) // Node of keys for Linux driver environment
#define KR_DEVPRIVS   KR_CMTE(1)
#define KR_APP2(i)    KR_CMTE(2+(i)) // first available key reg for driver

/* Slots in the node in KR_LINUX_EMUL: */
#define LE_CLOCKS 0
#define LE_IOMEM 1
/* LE_IOMEM has a key to an extended node containing, beginning with slot 0:
- A number key containing the number of pages
  and the starting phys addr (uint64_t)
- The keys to the physical pages
This pattern repeats for as many physical ranges are available to
the process (usually one). */
//// Combine clocks, iomem, etc. into one extended node to save space?
// (at the cost of time)

/* Slots in the supernode KR_KEYSTORE: */
#define LKSN_APP                 LKSN_CMTE // available for driver

/* Constituents of driver constructors: */
#define KC_LINUX_EMUL KC_CMTE(0)
#define KC_DEVPRIVS   KC_CMTE(1)
#define KC_APP2(n)    KC_CMTE(2+(n))

#ifndef __ASSEMBLER__
#include <stdint.h>
extern uint32_t delayCalibrationConstant;
#endif

#endif // __LSYNC_H


 Style Stage:
* @link https://stylestage.dev/styles/queer-modes/
*/

@charset "UTF-8";
/* @docs
label: Core Remedies
version: 0.1.0-beta.2

note: |
  These remedies are recommended
  as a starter for any project.

category: file
*/
/* @docs
label: Box Sizing

note: |
  Use border-box by default, globally.

category: global
*/
*, ::before, ::after {
  box-sizing: border-box;
}

/* @docs
label: Line Sizing

note: |
  Consistent line-spacing,
  even when inline elements have different line-heights.

links:
  - https://drafts.csswg.org/css-inline-3/#line-sizing-property

category: global
*/
html {
  line-sizing: normal;
}

/* @docs
label: Body Margins

note: |
  Remove the tiny space around the edge of the page.

category: global
*/
body {
  margin: 0;
}

/* @docs
label: Heading Sizes

note: |
  Switch to rem units for headings

category: typography
*/
h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.17rem;
}

h4 {
  font-size: 1rem;
}

h5 {
  font-size: 0.83rem;
}

h6 {
  font-size: 0.67rem;
}

/* @docs
label: H1 Margins

note: |
  Keep h1 margins consistent, even when nested.

category: typography
*/
h1 {
  margin: 0.67em 0;
}

/* @docs
label: Pre Wrapping

note: |
  Overflow by default is bad...

category: typography
*/
pre {
  white-space: pre-wrap;
}

/* @docs
label: Horizontal Rule

note: |
  1. Solid, thin horizontal rules
  2. Remove Firefox `color: gray`
  3. Remove default `1px` height, and common `overflow: hidden`

category: typography
*/
hr {
  border-style: solid;
  border-width: 1px 0 0;
  color: inherit;
  height: 0;
  overflow: visible;
}

/* @docs
label: Responsive Embeds

note: |
  1. Block display is usually what we want
  2. Remove strange space-below when inline
  3. Responsive by default

category: embedded elements
*/
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
  max-width: 100%;
}

/* @docs
label: Aspect Ratios

note: |
  Maintain intrinsic aspect ratios when `max-width` is applied.
  `iframe`, `embed`, and `object` are also embedded,
  but have no intrinsic ratio,
  so their `height` needs to be set explicitly.

category: embedded elements
*/
img, svg, video, canvas {
  height: auto;
}

/* @docs
label: Audio Width

note: |
  There is no good reason elements default to 300px,
  and audio files are unlikely to come with a width attribute.

category: embedded elements
*/
audio {
  width: 100%;
}

/* @docs
label: Image Borders

note: |
  Remove the border on images inside links in IE 10 and earlier.

category: legacy browsers
*/
img {
  border-style: none;
}

/* @docs
label: SVG Overflow

note: |
  Hide the overflow in IE 10 and earlier.

category: legacy browsers
*/


/*
// <copyright>
// dotNetRDF is free and open source software licensed under the MIT License
// -------------------------------------------------------------------------
//
// Copyright (c) 2009-2025 dotNetRDF Project (http://dotnetrdf.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
*/

using VDS.RDF.Configuration;
using VDS.RDF.Nodes;
using VDS.RDF.Parsing;

namespace VDS.RDF.Query.Operators;

/// <summary>
/// Abstract base class for SPARQL Operators which also makes their configuration serializa


w RequestTracer(env =>
            {
                return TaskHelpers.Completed();
            });

            StringWriter writer = new StringWriter();
            TextWriterTraceListener textListener = new TextWriterTraceListener(writer, "TestTracer");
            TraceSource traceSource = new TraceSource("TestSource", SourceLevels.All);
            traceSource.Listeners.Add(textListener);

            Request request = Request.Create();
            request.Environment["host.TraceSource"] = traceSource;
            middleware.Invoke(request.Environment).Wait();
            Assert.That(writer.GetStringBuilder().ToString(), Is.Not.EqualTo(string.Empty));
        }
    }
}


rom<(&'g PackageId, FeatureLabel<'g>)> for FeatureId<'g> {
    fn from((package_id, label): (&'g PackageId, FeatureLabel<'g>)) -> Self {
        FeatureId { package_id, label }
    }
}

/// The `Display` impl prints out:
///
/// * `{package-id}/[base]` for base features.
/// * `{package-id}/feature-name` for named features.
/// * `{package-id}/dep:dep-name` for optional dependencies.
///
/// ## Examples
///
/// ```
/// use guppy::PackageId;
/// use guppy::graph::feature::FeatureId;
///
/// let package_id = PackageId::new("region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)");
///
/// assert_eq!(
///     format!("{}", FeatureId::base(&package_id)),
///     "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/[base]"
/// );
///
/// assert_eq!(
///     format!("{}", FeatureId::named(&package_id, "foo")),
///     "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/foo"
/// );
///
/// assert_eq!(
///     format!("{}", FeatureId::optional_dependency(&package_id, "bar")),
///     "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/dep:bar"
/// );
/// ```
impl<'g> fmt::Display for FeatureId<'g> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}/{}", self.package_id, self.label)
    }
}

/// A unique identifier for a feature within a specific package. Forms part of a [`FeatureId`].
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum FeatureLabel<'g> {
    /// The "base" feature. Every package has one such feature.
    Base,

    /// This is a named feature in the `[features]` section, or an implicit feature that corresponds to
    /// an optional dependency.
    ///
    /// For versions of Cargo prior to 1.60, optional dependencies always create implicit features
    /// by the same name. For versions 1.60 and greater, optional dependencies may create implicit
    /// features if the dependency doesn't exist with the name "dep" in it.
    Named(&'g str),

    /// This is an optional dependency.
    OptionalDependency(&'g str),
}

impl<'g> FeatureLabel<'g> {
    /// Returns the kind of feature this is.
    ///
    /// The kind of a feature is simply the enum variant without any associated data.
    #[inline]
    pub fn kind(self) -> FeatureKind {
        match self {
            Self::Base => FeatureKind::Base,
            Self::Named(_) => FeatureKind::Named,
            Self::OptionalDependency(_) => FeatureKind::OptionalDependency,
        }
    }
}

/// The `Display` impl for `FeatureLabel` prints out:
///
/// * `[base]` for base labels.
/// * `feature-name` for optional dependencies.
/// * `dep:dep-name` for named features.
///
/// ## Examples
///
/// ```
/// use guppy::graph::feature::FeatureLabel;
///
/// assert_eq!(format!("{}", FeatureLabel::Base), "[base]");
/// assert_eq!(format!("{}", FeatureLabel::Named("foo")), "foo");
/// assert_eq!(format!("{}", FeatureLabel::OptionalDependency("bar")), "dep:bar");
/// ```

impl<'g> fmt::Display for FeatureLabel<'g> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::Base => write!(f, "[base]"),
            Self::Named(feature_name) => write!(f, "{}", feature_


                "/tmp/install-dir",
                "--dev",
                "lua-cjson",
                vim.NIL, -- version
            }
        end)
    )

    it("should parse outdated luarocks", function()
        assert.same(
            {
                {
                    name = "lua-cjson",
                    installed = "2.1.0-1",
                    available = "2.1.0.6-1",
                    repo = "https://luarocks.org",
                },
                {
                    name = "lua-resty-influx-mufanh",
                    installed = "0.2.1-0",
                    available = "0.2.1-1",
                    repo = "https://luarocks.org",
                },
            },
            luarocks.parse_outdated_rocks [[lua-cjson	2.1.0-1	2.1.0.6-1	https://luarocks.org
lua-resty-influx-mufanh	0.2.1-0	0.2.1-1	https://luarocks.org]]
        )
    end)

    it("should parse listed luarocks", function()
        assert.same(
            {
                {
                    package = "lua-cjson",
                    version = "2.1.0-1",
                    arch = "installed",
                    nrepo = "/my/luarock/loc",
                },
                {
                    package = "lua-resty-http",
                    version = "0.17.0.beta.1-0",
                    arch = "installed",
                    nrepo = "/my/luarock/loc",
                },
                {
                    package = "lua-resty-influx-mufanh",
                    version = "0.2.1-0",
                    arch = "installed",
                    nrepo = "/my/luarock/loc",
                },
            },
            luarocks.parse_installed_rocks [[lua-cjson	2.1.0-1	installed	/my/luarock/loc
lua-resty-http	0.17.0.beta.1-0	installed	/my/luarock/loc
lua-resty-influx-mufanh	0.2.1-0	installed	/my/luarock/loc]]
        )
    end)
end)


nst filtered = filterData();
  const new_data = wrangleData(filtered);

  // update visualization
  vis(new_data);
}

// init interaction, e.g., listen to click events
d3.select(...).on('click', () => {
  // update state
  updateApp();
})

d3.json(...).then((data) => {
  // load data, e.g., via d3.json and update app afterwards
  state.data = data;
  updateApp();
});

```

Besides this functional approach an object oriented way is an valid alternative.

---

**INTERACTIVE**

MCV Initial Setup: [mcv01_initial.html](examples/mcv01_initial.html) [![Open in CodePen][codepen]](https://codepen.io/sgratzl/pen/bQzNBO)

---

## Layouts

D3 provides a bunch of standard layouts. A layout does not actually render the visualization but prepares your data, such that you can render, e.g., a pie chart. Most of the time the work with helper tools for SVG from D3. e.g., the `d3.pie()` works best with `d3.arc()`.

### Pie Layout

A pie-layout is a simple layout algorithm. It takes the data and a way to sort/compute the value per slice. It wraps the data and enhance it with additional attributes for the pie slice, such as start end end angle. _Hint_ the angles and arcs are computed relatively to the pie's center. The computed attributes with another utility function `d3.arc()` which converts the given values to a SVG path.

![D3 Pie Layout](./i/pie.png)

---

SEE: [pie.html](examples/pie.html) [![Open in CodePen][codepen]](https://codepen.io/sgratzl/pen/BaaBBdZ)

---

### Force Layout

A force layout is a graph layout algorithm, which uses a simulation for positioning nodes. The goal is to minimize the force applied on the system introduced by gravity, node repulsive force, and edge attraction forces. In this case it is not a one layout step, but a continuous one, where on each `tick` a new set of positions are available.

![D3 Force Layout](./i/force.png)

---

SEE: [miserables.html](examples/miserables.html) [![Open in CodePen][codepen]](https://codepen.io/sgratzl/pen/poozzrK)

---

### D3 Geo

D3 Geo is the D3 package for creating maps and other geo location based visualization. Similar to the other layouts D3 only helps to create the data structure and transformations but one has to render the map itself using SVG path elements. D3 provides numerous different geo projection methods, commonly used are `d3.geoAlbersUsa` and `d3.geoMercator`. A `d3.geoPath` uses a geo projection to transform geographical shape data in [GeoJSON](http://geojson.org/) or its derivative [TopoJSON](https://github.com/topojson/topojson) to SVG Path descriptions.

For example using `d3.geoAlbersUsa` and the [US Atlas](https://github.com/topojson/us-atlas) shape data one can create a simple Choropleth chart in which each US state is encoded using a continuous colored value.

![D3 Choropleth](./i/choropleth.png)

---

SEE: [choropleth.html](examples/choropleth.html) [![Open in CodePen][codepen]](https://codepen.io/sgratzl/pen/LYGbObX)

---

**INTERACTIVE**

Pie chart layout: [mcv02_piechart.html](examples/mcv02_piechart.html) [![Open in CodePen][codepen]](https://codepen.io/sgratzl/pen/abbooyg)

---

## Interaction And Filtering

So far the visualizations


using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;

using DigitalPlatform;

namespace DigitalPlatform.Range
{
#if REMOVED
    /// <summary>
    /// RangeItem是RangeList集合的成员，表示一个连续的范围
    /// </summary>
    public class RangeItem : IComparable
    {
        public long lStart = 0;	// 如果为-1，表示从尾端长度为lLength的一段，因为总长度未知，所以lStart未知，但是-1表明了这种状态
        public long lLength = 0;	// 如果为-1，表示从lStart开始一直到末尾。
        #region IComparable Members

        // 如果this小于obj，返回<0的值
        public int CompareTo(object obj)
        {
            RangeItem item = (RangeItem)obj;
            /*
			if (this.lStart == item.lStart)
				return (int)(this.lLength - item.lLength);
			return (int)(this.lStart - item.lStart);
             * */

            // 2012/8/26 修改
            if (this.lStart == item.lStart)
            {
                long lDelta = this.lLength - item.lLength;
                if (lDelta == 0)
                    return 0;
                if (lDelta < 0)
                    return -1;
                return 1;
            }
            {
                long lDelta = this.lStart - item.lStart;
                if (lDelta == 0)
                    return 0;
                if (lDelta < 0)
                    return -1;
                return 1;
            }
        }

        #endregion

        public RangeItem()
        {
        }

        public RangeItem(RangeItem item)
        {
            lStart = item.lStart;
            lLength = item.lLength;
        }

        // 拼接为表示范围的字符串
        public string GetContentRangeString()
        {
            Debug.Assert(this.lStart >= 0, "");
            Debug.Assert(this.lStart + this.lLength - 1 >= 0, "");

            if (lLength == 1)
                return Convert.ToString(lStart);

            return Convert.ToString(lStart) + "-" + Convert.ToString(lStart + lLength - 1);
        }
    }

    /// <summary>
    /// 表示范围的类
    /// </summary>
    public class RangeList : List<RangeItem>
    {
        public string delimeters = ",";	// 分隔符。可以列出多个
        public string contentRange = "";	// 保存范围字符串

        // 构造函数
        public RangeList(string strContentRange)
        {
            BuildItems(strContentRange);
        }

        public RangeList()
        {

        }

        public RangeList(string strContentRange,
            string delemParam)
        {
            delimeters = delemParam;

            BuildItems(strContentRange);
        }

        // 创建内容事项
        public void BuildItems(string strContentRange)
        {
            long lStart = 0;
            long lLength = 0;
            string[] split = null;

            char[] delimChars = delimeters.ToCharArray();

            split = strContentRange.Split(delimChars);

            for (int i = 0; i < split.Length; i++)
            {
                if (split[i] == "")
                    continue;
                // 根据-拆分
                int nRet = split[i].IndexOf("-");
                if (nRet == -1)
                {
                    lStart = 0; //  Convert.ToInt64(split[i]);

                    if (Int64.TryParse(split[i], out lStart) == false)
                        throw new Exception("用字符串 '" + strContentRange + "' 构造RangeList时出错：数字 '" + split[i].ToString() + "' 格式不正确");

                    lLength = 1;
                }
                else
                {
                    string left = split[i].Substring(0, nRet);
                    string right = split[i].Subs


specified permission."""
        if not self.is_active:
            return False

        perm_value = perm.value if isinstance(perm, BasePermissionEnum) else perm
        return perm_value in self.get_permissions()

class AppTokenManager(models.Manager["AppToken"]):
    def create(self, app, name="", auth_token=None, **extra_fields):
        """Create an app token with the given name."""
        if not auth_token:
            auth_token = generate_token()
        app_token = self.model(app=app, name=name, **extra_fields)
        app_token.set_auth_token(auth_token)
        app_token.save()
        return app_token, auth_token

    def create_with_token(self, *args, **kwargs) -> tuple["AppToken", str]:
        # As `create` is waiting to be fixed, I'm using this proper method from future
        # to get both AppToken and auth_token.
        return self.create(*args, **kwargs)

class AppToken(models.Model):
    app = models.ForeignKey(App, on_delete=models.CASCADE, related_name="tokens")
    name = models.CharField(blank=True, default="", max_length=128)
    auth_token = models.CharField(unique=True, max_length=128)
    token_last_4 = models.CharField(max_length=4)

    objects = AppTokenManager()

    def set_auth_token(self, raw_token=None):
        self.auth_token = make_password(raw_token)
        self.token_last_4 = raw_token[-4:]

class AppExtension(models.Model):
    app = models.ForeignKey(App, on_delete=models.CASCADE, related_name="extensions")
    label = models.CharField(max_length=256)
    url = models.URLField()
    mount = models.CharField(choices=AppExtensionMount.CHOICES, max_length=256)
    target = models.CharField(
        choices=AppExtensionTarget.CHOICES,
        max_length=128,
        default=AppExtensionTarget.POPUP,
    )
    permissions = models.ManyToManyField(
        Permission,
        blank=True,
        help_text="Specific permissions for this app extension.",
    )

class AppInstallation(Job):
    uuid = models.UUIDField(unique=True, default=uuid4)
    app_name = models.CharField(max_length=60)
    manifest_url = models.URLField()
    permissions = models.ManyToManyField(
        Permission,
        blank=True,
        help_text="Specific permissions which will be assigned to app.",
        related_name="app_installation_set",
        related_query_name="app_installation",
    )
    brand_logo_default = models.ImageField(
        upload_to="app-installation-brand-data", blank=True, null=True
    )

    def set_message(self, message: str, truncate=True):
        if truncate:
            message_field = cast(models.Field, self._meta.get_field("message"))
            max_length = message_field.max_length
            if max_length is None:
                raise ValueError("Cannot truncate message without max_length")
            message = Truncator(message).chars(max_length)
        self.message = message


 findAll(): Promise<LectureDto[]> {
    const lectures = await this.lecturesRepository.find({
      relations: ['event'],
    });
    return lectures.map((lecture) => {
      return new LectureDto(lecture);
    });
  }

  async findOne(id: number): Promise<LectureDto> {
    const lecture = await this.lecturesRepository.findOne(id, {
      relations: ['event'],
    });
    if (!lecture) {
      throw new HttpException('No lecture found', HttpStatus.NOT_FOUND);
    }

    return new LectureDto(lecture);
  }

  async create(createLectureDto: CreateLectureDto): Promise<LectureDto> {
    const lecture = new Lecture();

    lecture.name = createLectureDto.name;
    lecture.start = createLectureDto.start;
    lecture.end = createLectureDto.end;

    try {
      return new LectureDto(await getRepository(Lecture).save(lecture));
    } catch (err) {
      throw new HttpException(err, HttpStatus.INTERNAL_SERVER_ERROR);
    }
  }

  private async getLecture(id: number): Promise<Lecture> {
    const lecture = await this.lecturesRepository.findOne(id, {
      relations: ['event'],
    });
    if (!lecture) {
      throw new HttpException('No lecture found', HttpStatus.NOT_FOUND);
    }

    return lecture;
  }

  async update(
    id: number,
    updateLectureDto: UpdateLectureDto,
  ): Promise<LectureDto> {
    const lecture = await this.getLecture(id);

    lecture.name = updateLectureDto.name || lecture.name;
    lecture.start = updateLectureDto.start || lecture.start;
    lecture.end = updateLectureDto.end || lecture.end;

    try {
      return new LectureDto(await getRepository(Lecture).save(lecture));
    } catch (err) {
      throw new HttpException(err, HttpStatus.INTERNAL_SERVER_ERROR);
    }
  }

  async delete(id: number): Promise<LectureDto> {
    const lecture = await this.getLecture(id);
    return new LectureDto(await getRepository(Lecture).remove(lecture));
  }

  async offset(index = 0): Promise<LectureOffset> {
    const lectures = await this.lecturesRepository.findAndCount({
      relations: ['event'],
      take: 100,
      skip: index * 100,
      order: {
        id: 'ASC',
      },
    });

    const LecturesDto = lectures[0].map((lecture) => {
      return new LecturesDto(lecture);
    });

    return { rows: LecturesDto, count: lectures[1] };
  }
}
import { Document } from '@contentful/rich-text-types'
import { graphql, useStaticQuery } from 'gatsby'

interface EducationQuery {
  contentfulPersonalSiteMainPage: {
    education: Array<{
      id: string
      source: string
      title: string
      description: {
        raw: string
      }
    }>
  }
}

export const useEducation = () => {
  const {
    contentfulPersonalSiteMainPage: { education },
  } = useStaticQuery<EducationQuery>(graphql`
    query {
      contentfulPersonalSiteMainPage(key: { eq: "denisveleaev" }) {
        education {
          id
          source
          title
          description {
            raw
          }
        }
      }
    }
  `)

  return education.map(item => ({
    ...item,
    description:
      item.description !== null
        ? (JSON.parse(item.description.raw) as Document)
        : null,
  }))
}
import { Gender, HealthCheckRating, OccupationalHealthSick } from '../../types'


 1;
    }
    for(int i=2;i<=m;i++){
        for(int j=2;j<=n;j++){
            f[i][j] = f[i-1][j] + f[i][j-1];
        }
    }
    cout << f[m][n] << endl;
    return 0;
}

```

### 题目四

*有$n$块石头分别在X轴的$1,2...,n$位置。现有一只青蛙在石头$1$上,想跳到石头$n$上。如果青蛙在第$i$块石头上，它最多可以向右跳$a_i$的距离。问青蛙能否跳到石头$n$上。*

**状态**：
  设$f[i]$表示青蛙能否跳到石头$i$上。若青蛙能跳到石头$n$上，则考虑最后一步的操作，青蛙是从石头$i$上跳至石头$n$上的。这必须满足两个条件:

  > 1. 青蛙能跳到石头i上 ---> $f[i] = true$
  > 2. $i + a[i] >= n$ ---> 青蛙在石头$i$上是可达石头$n$的。

**转移**：$f[j] = ∪(f[i] 且 i+a_i >= j),i<=j$

#### 代码

```C++
#include<bits/stdc++.h>

using namespace std;

int n;
int a[105];
int f[105];

int main()
{
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> a[i];
    }
    f[1] = 1;
    for(int j=1;j<=n;j++){
        for(int i=1;i<=j;i++){
            // 第i块石头可达并且从第i块石头可以跳的最远距离大于石头j
            if(f[i] && i + a[i] >= j){
                f[j] = 1;
                break;
            }
        }
    }
    if(f[n]){
        cout << "True" << endl;
    }else{
        cout << "False" << endl;
    }
    return 0;
}

```

### 题目五

*给定$a[1],...,a[n]$,找到最长的连续子序列$i,i+1,...,j$，使得$a[i]*a[i+1]*...*a[j]$最大。*

**1. 分析**：

 - 对于最优策略，一定有最后一个元素$a_j$
 - 情况一：最优策略就是$a_j$
 - 情况二: 最优策略是以$a_j-1$元素结尾的最优策略乘以$a_j$

 **2. 确定状态**：
 考虑到以$a[j]$结尾的连续子序列可能为负数也可能为正数。针对不同情况，需要考虑最优策略是选最大还是最小。因此，需要有两个数组$f[i]$和$g[i]$表示最大最小状态。


       } else if lookahead.peek( kw::u32 ) {
            input.parse::< kw::u32 >()?;
            BasicType::U32
        } else if lookahead.peek( kw::u64 ) {
            input.parse::< kw::u64 >()?;
            BasicType::U64
        } else if lookahead.peek( kw::u64_varint ) {
            input.parse::< kw::u64_varint >()?;
            BasicType::VarInt64
        } else {
            return Err( lookahead.error() );
        };

        Ok( ty )
    }
}

enum VariantAttribute {
    Tag {
        key_token: kw::tag,
        tag: u64
    }
}

enum StructAttribute {
}

enum EnumAttribute {
    TagType {
        key_token: kw::tag_type,
        ty: BasicType
    },
    PeekTag {
        key_token: kw::peek_tag
    }
}

enum VariantOrStructAttribute {
    Variant( VariantAttribute ),
    Struct( StructAttribute )
}

fn parse_variant_attribute(
    input: &syn::parse::ParseStream,
    lookahead: &syn::parse::Lookahead1
) -> syn::parse::Result< Option< VariantAttribute > >
{
    let attribute = if lookahead.peek( kw::tag ) {
        let key_token = input.parse::< kw::tag >()?;
        let _: Token![=] = input.parse()?;
        let raw_tag: syn::LitInt = input.parse()?;
        let tag = raw_tag.base10_parse::< u64 >().map_err( |err| {
            syn::Error::new( raw_tag.span(), err )
        })?;

        VariantAttribute::Tag {
            key_token,
            tag
        }
    } else {
        return Ok( None )
    };

    Ok( Some( attribute ) )
}

fn parse_struct_attribute(
    _input: &syn::parse::ParseStream,
    _lookahead: &syn::parse::Lookahead1
) -> syn::parse::Result< Option< StructAttribute > >
{
    Ok( None )
}

fn parse_enum_attribute(
    input: &syn::parse::ParseStream,
    lookahead: &syn::parse::Lookahead1
) -> syn::parse::Result< Option< EnumAttribute > >
{
    let attribute = if lookahead.peek( kw::tag_type ) {
        let key_token = input.parse::< kw::tag_type >()?;
        let _: Token![=] = input.parse()?;
        let ty: BasicType = input.parse()?;

        EnumAttribute::TagType {
            key_token,
            ty
        }
    } else if lookahead.peek( kw::peek_tag ) {
        let key_token = input.parse::< kw::peek_tag >()?;
        EnumAttribute::PeekTag {
            key_token
        }
    } else {
        return Ok( None )
    };

    Ok( Some( attribute ) )
}

impl syn::parse::Parse for StructAttribute {
    fn parse( input: syn::parse::ParseStream ) -> syn::parse::Result< Self > {
        let lookahead = input.lookahead1();
        parse_struct_attribute( &input, &lookahead )?.ok_or_else( || lookahead.error() )
    }
}

impl syn::parse::Parse for EnumAttribute {
    fn parse( input: syn::parse::ParseStream ) -> syn::parse::Result< Self > {
        let lookahead = input.lookahead1();
        parse_enum_attribute( &input, &lookahead )?.ok_or_else( || lookahead.error() )
    }
}

impl syn::parse::Parse for VariantOrStructAttribute {
    fn parse( input: syn::parse::ParseStream ) -> syn::parse::Result< Self > {
        let lookahead = input.lookahead1();
        if let Some( attr ) = parse_variant_attribute(


ds && !hasHandlers {
		t.Errorf("Node %s has wildcards without handlers", n.path)
	}
}

func TestTree(t *testing.T) {
	test = t
	tree := &node{path: "/"}

	addPath(t, tree, "/")
	addPath(t, tree, "/i")
	addPath(t, tree, "/i/:aaa")
	addPath(t, tree, "/images")
	addPath(t, tree, "/images/abc.jpg")
	addPath(t, tree, "/images/:imgname")
	addPath(t, tree, "/images/*path")
	addPath(t, tree, "/ima")
	addPath(t, tree, "/ima/:par")
	addPath(t, tree, "/images1")
	addPath(t, tree, "/images2")
	addPath(t, tree, "/apples")
	addPath(t, tree, "/app/les")
	addPath(t, tree, "/apples1")
	addPath(t, tree, "/appeasement")
	addPath(t, tree, "/appealing")
	addPath(t, tree, "/date/:year/:month")
	addPath(t, tree, "/date/:year/month")
	addPath(t, tree, "/date/:year/:month/abc")
	addPath(t, tree, "/date/:year/:month/:post")
	addPath(t, tree, "/date/:year/:month/*post")
	addPath(t, tree, "/:page")
	addPath(t, tree, "/:page/:index")
	addPath(t, tree, "/post/:post/page/:page")
	addPath(t, tree, "/plaster")
	addPath(t, tree, "/users/:pk/:related")
	addPath(t, tree, "/users/:id/updatePassword")
	addPath(t, tree, "/:something/abc")
	addPath(t, tree, "/:something/def")

	testPath(t, tree, "/users/abc/updatePassword", "/users/:id/updatePassword",
		map[string]string{"id": "abc"})
	testPath(t, tree, "/users/all/something", "/users/:pk/:related",
		map[string]string{"pk": "all", "related": "something"})

	testPath(t, tree, "/aaa/abc", "/:something/abc",
		map[string]string{"something": "aaa"})
	testPath(t, tree, "/aaa/def", "/:something/def",
		map[string]string{"something": "aaa"})

	testPath(t, tree, "/paper", "/:page",
		map[string]string{"page": "paper"})

	testPath(t, tree, "/", "/", nil)
	testPath(t, tree, "/i", "/i", nil)
	testPath(t, tree, "/images", "/images", nil)
	testPath(t, tree, "/images/abc.jpg", "/images/abc.jpg", nil)
	testPath(t, tree, "/images/something", "/images/:imgname",
		map[string]string{"imgname": "something"})
	testPath(t, tree, "/images/long/path", "/images/*path",
		map[string]string{"path": "long/path"})
	testPath(t, tree, "/images/even/longer/path", "/images/*path",
		map[string]string{"path": "even/longer/path"})
	testPath(t, tree, "/ima", "/ima", nil)
	testPath(t, tree, "/apples", "/apples", nil)
	testPath(t, tree, "/app/les", "/app/les", nil)
	testPath(t, tree, "/abc", "/:page",
		map[string]string{"page": "abc"})
	testPath(t, tree, "/abc/100", "/:page/:index",
		map[string]string{"page": "abc", "index": "100"})
	testPath(t, tree, "/post/a/page/2", "/post/:post/page/:page",
		map[string]string{"post": "a", "page": "2"})
	testPath(t, tree, "/date/2014


 Write out the data to a file.
  FILE *fp = fopen(filename, "w");
  assert(fp);
  uint64_t prev = 0;
  for (int i = 0; i < count; i++) {
    fprintf(fp, "%llu\n", (long long) (times[i] - prev));
    prev = times[i];
  }
  rc = fclose(fp);
  assert(rc == 0);

  // Clean up.
  rc = munmap(mapped, mapping_size);
  assert(rc == 0);
}

void wrap_data_as_js_file(const char *input_filename,
                          const char *output_filename,
                          const char *var_name) {
  FILE *in = fopen(input_filename, "r");
  assert(in);
  FILE *out = fopen(output_filename, "w");
  assert(out);
  fprintf(out, "%s = \"", var_name);
  for (;;) {
    int ch = fgetc(in);
    if (ch == EOF)
      break;
    if (ch == '\n')
      fprintf(out, "\\n");
    else
      fputc(ch, out);
  }
  fprintf(out, "\";\n");
  fclose(in);
  fclose(out);
}

double square(double x) {
  return x * x;
}

struct TimePoint {
  uint32_t time; // Time from start of sampling, in nanoseconds.
  uint32_t taken; // Time taken to access memory, in nanoseconds.
};

void analyse_data(std::string base_filename) {
  uint32_t points_max = 200000;
  TimePoint points[points_max];
  uint32_t points_idx = 0;

  // Read in the data file.
  FILE *in = fopen(base_filename.c_str(), "r");
  assert(in);
  uint64_t total_time = 0;
  while (!feof(in)) {
    assert(points_idx < points_max);
    long long time_taken;
    int rc = fscanf(in, "%lld\n", &time_taken);
    assert(rc == 1);
    points[points_idx].time = total_time;
    points[points_idx].taken = time_taken;
    ++points_idx;
    total_time += time_taken;
  }
  fclose(in);

  // Output the data as a CSV file that is easily graphable using a
  // spreadsheet.
  FILE *out = fopen((base_filename + ".full_graph.csv").c_str(), "w");
  assert(out);
  for (uint32_t i = 0; i < points_idx; ++i) {
    fprintf(out, "%lli,%lli\n",
            (long long) points[i].time,
            (long long) points[i].taken);
  }
  fclose(out);

  // This is like full_graph.csv, but only covers a subset of the time
  // range.  This is even more easily graphable in a spreadsheet.
  out = fopen((base_filename + ".graph.csv").c_str(), "w");
  assert(out);
  unsigned start_ns = kRefreshInterval * 20;
  unsigned end_ns = kRefreshInterval * 40;
  for (uint32_t i = 0; i < points_idx; ++i) {
    if (points[i].time < start_ns)
      continue;
    if (points[i].time >= end_ns)
      break;
    fprintf(out, "%lli,%lli\n",
            (long long) points[i].time - start_ns,
            (long long) points[i].taken);
  }
  fclose(out);

  wrap_data_as_js_file((base_filename + ".graph.csv").c_str(),
                       (base_filename + ".graph.csv.js").c_str(),
                       "graph_data");

  // When a memory access was delayed due to a memory refresh, we
  // expect it to take longer than this time.
  // TODO: Calculate this from the data rather than hard-coding it.
  uint32_t cu