text:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
%width=0.4\textwidth,
%height=0.125\textheight

\begin{axis}[%
width=7cm,
height=3cm,xlabel={Time step (15 mins)},ylabel={Power demand (kW)},
scale only axis, scaled ticks=false,tick label style={/pgf/number format/fixed},
xmin=0,
xmax=100,
ymin=0,
ymax=10000,
name=plot3
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
0 5272.07982464799\\
4.23333333333333 5272.07982464799\\
4.23333333333333 4205.39974045848\\
8.5 4205.39974045848\\
8.5 2716.61115238008\\
17.0333333333333 2716.61115238008\\
17.0333333333333 2290.82610535175\\
21.3 2290.82610535175\\
21.3 3367.89765317262\\
23.4333333333333 3367.89765317262\\
23.4333333333333 5553.82362711607\\
25.5666666666667 5553.82362711607\\
25.5666666666667 5559.89183952418\\
27.7 5559.89183952418\\
27.7 3647.1786653497\\
29.8333333333333 3647.1786653497\\
29.8333333333333 1975.82749724022\\
34.1 1975.82749724022\\
34.1 4812.47772724673\\
35.1666666666667 4812.47772724673\\
35.1666666666667 7489.97604283661\\
36.2333333333333 7489.97604283661\\
36.2333333333333 7883.37447859643\\
42.6333333333333 7883.37447859643\\
42.6333333333333 7253.90989230625\\
46.9 7253.90989230625\\
46.9 6116.22094219621\\
51.1666666666667 6116.22094219621\\
51.1666666666667 6011.38793639423\\
59.7 6011.38793639423\\
59.7 4850.10045735744\\
61.8333333333333 4850.10045735744\\
61.8333333333333 2200.58792876384\\
63.9666666666667 2200.58792876384\\
63.9666666666667 1994.4815050808\\
68.2333333333333 1994.4815050808\\
68.2333333333333 2455.45493141395\\
72.5 2455.45493141395\\
72.5 4739.70736029833\\
76.7666666666667 4739.70736029833\\
76.7666666666667 5423.52486435123\\
85.3 5423.52486435123\\
85.3 5923.8807416125\\
87.4333333333333 5923.8807416125\\
87.4333333333333 6646.91779675908\\
93.8333333333333 6646.91779675908\\
93.8333333333333 5673.62348982634\\
94.9 5673.62348982634\\
94.9 5582.385050475\\
95.0333333333333 5582.385050475\\
};
\addplot [
color=blue,
dotted,thick,
forget plot
]
table[row sep=crcr]{
0 6178.616809\\
1 6036.95455739286\\
2 5168.87151025\\
3 4756.91250371429\\
4 4421.47558742857\\
5 4188.63627092857\\
6 4240.75934892857\\
7 4247.05452446429\\
8 4159.51977110714\\
9 3531.12508267857\\
10 3156.93297825\\
11 2755.85100560714\\
12 2717.65225610714\\
13 2721.67530953571\\
14 2524.55476739286\\
15 2245.79564828571\\
16 2233.86208503571\\
17 2280.18588660714\\
18 2286.64569039286\\
19 2280.55235675\\
20 2323.92463928571\\
21 2248.09884882143\\
22 2709.41342978571\\
23 4210.61986696429\\
24 5457.82831321429\\
25 5844.63397832143\\
26 5793.07550921429\\
27 5512.19626189286\\
28 4836.31457960714\\
29 3279.82693685714\\
30 1861.90690042857\\
31 1848.92957382143\\
32 1956.16875903571\\
33 2103.90363503571\\
34 2069.19434207143\\
35 6457.11756357143\\
36 7986.26837642857\\
37 8013.53559989286\\
38 7873.46141660714\\
39 7883.13954107143\\
40 7835.83188478571\\
41 7815.99455125\\
42 7835.02216125\\
43 7950.00938910714\\
44 7722.22260871429\\
45 7299.0647275\\
46 6988.67178146429\\
47 5164.55323582143\\
48 6522.60577803571\\
49 6538.51512510714\\
50 6365.07040771429\\
51 5343.99506775\\
52 5357.65974157143\\
53 6166.56027942857\\
54 6601.01467839286\\
55 6487.56547214286\\
56 5597.08591760714\\
57 5488.08066053571\\
58 6383.26303071429\\
59 6331.38118735714\\
60 5665.13719903571\\
61 4883.25203046429\\
62 2789.47606485714\\
63 1902.640093\\
64 1937.95664053572\\
65 1963.15772364286\\
66 2002.01800503571\\
67 2024.89762910714\\
68 2027.39035978571\\
69 2004.31255092857\\
70 1951.84950557143\\
71 1969.23035507143\\
72 3950.04117353571\\
73 4431.55149739286\\
74 4887.91202792857\\
75 5063.20039175\\
76 4624.78582975\\
77 4767.78601360714\\
78 4720.37898\\
79 5163.77054846428\\
80 5321.29670460714\\
81 5476.50717532143\\
82 5233.03575189286\\
83 5735.78787021429\\
84 6249.30841982143\\
85 6131.791879\\
86 5741.720266\\
87 5915.28296375\\
88 7321.70787096429\\
89 7284.54382832143\\
90 7012.29849557143\\
91 6334.65914110714\\
92 6276.75585464286\\
93 6144.88728903572\\
94 5723.84820353572\\
95 5577.50701071428\\
};
\end{axis}

\begin{axis}[%
width=7cm,
height=3cm,xlabel={Time step (15 mins)},ylabel={Power demand (kW)},
scale only axis, scaled ticks=false,tick label style={/pgf/number format/fixed},
xmin=0,
xmax=100,
ymin=0,
ymax=10000,
name=plot1,
at=(plot3.above north west),
anchor=below south west
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
0 4082.97271541306\\
4.23333333333333 4082.97271541306\\
4.23333333333333 2559.52953093282\\
8.5 2559.52953093282\\
8.5 2554.18044019425\\
17.0333333333333 2554.18044019425\\
17.0333333333333 2974.59218409586\\
21.3 2974.59218409586\\
21.3 4127.45597123145\\
25.5666666666667 4127.45597123145\\
25.5666666666667 4653.83963347645\\
29.8333333333333 4653.83963347645\\
29.8333333333333 3385.12641680067\\
34.1 3385.12641680067\\
34.1 5233.41071387307\\
35.1666666666667 5233.41071387307\\
35.1666666666667 6953.38501290404\\
42.6333333333333 6953.38501290404\\
42.6333333333333 6454.80951281733\\
46.9 6454.80951281733\\
46.9 5583.11423790674\\
51.1666666666667 5583.11423790674\\
51.1666666666667 5098.04748422809\\
59.7 5098.04748422809\\
59.7 4155.18851413065\\
61.8333333333333 4155.18851413065\\
61.8333333333333 2290.58850509665\\
63.9666666666667 2290.58850509665\\
63.9666666666667 2421.85246117872\\
68.2333333333333 2421.85246117872\\
68.2333333333333 2907.86651556151\\
72.5 2907.86651556151\\
72.5 5749.65874537748\\
76.7666666666667 5749.65874537748\\
76.7666666666667 7212.12327258486\\
81.0333333333333 7212.12327258486\\
81.0333333333333 7131.66143979866\\
83.1666666666667 7131.66143979866\\
83.1666666666667 7640.45982694514\\
85.3 7640.45982694514\\
85.3 7508.6644050007\\
93.8333333333333 7508.6644050007\\
93.8333333333333 6811.8394734995\\
94.9 6811.8394734995\\
94.9 6537.56544535635\\
95.0333333333333 6537.56544535635\\
};
\addplot [
color=blue,
dotted,thick,
forget plot
]
table[row sep=crcr]{
0 4815.69360289286\\
1 4689.91513913095\\
2 4320.65658622619\\
3 3675.47012959524\\
4 2961.76849591667\\
5 2748.32770572619\\
6 2523.75206628572\\
7 2445.43351164286\\
8 2396.15848671429\\
9 2488.49587479762\\
10 2529.41889515476\\
11 2709.87445515476\\
12 2578.20540394048\\
13 2519.15895217857\\
14 2527.89307067857\\
15 2542.2684025119\\
16 2567.86912648809\\
17 2519.96209446429\\
18 2700.10666513095\\
19 2923.14857090476\\
20 3103.92477209524\\
21 3472.65611905952\\
22 3704.54347436905\\
23 3987.55652454762\\
24 4337.05656230952\\
25 4593.90139894048\\
26 4574.74913660714\\
27 4979.71812234524\\
28 5176.20060595238\\
29 4390.11385540476\\
30 3165.37874582143\\
31 3165.22795138095\\
32 3490.41192589286\\
33 3602.93590410714\\
34 3408.45227952381\\
35 6328.18665977381\\
36 7311.38718863095\\
37 7281.58358076191\\
38 7007.70956257143\\
39 6791.02589360714\\
40 6885.96149602381\\
41 6873.05392703571\\
42 6769.08153738095\\
43 6768.95399978572\\
44 6754.18339196429\\
45 6793.93339360714\\
46 6084.49514610714\\
47 5114.46153627381\\
48 5736.38513034524\\
49 5885.38384745238\\
50 5747.43680553571\\
51 5070.66820895238\\
52 4969.26647255952\\
53 5321.83829707143\\
54 5484.80788696428\\
55 5189.07576333333\\
56 4759.46607229762\\
57 4618.55470936905\\
58 5269.66103135714\\
59 5288.44546021429\\
60 4686.91404503571\\
61 4162.6373684881\\
62 2829.80959897619\\
63 1918.65212301191\\
64 2279.19839632143\\
65 2347.74657983333\\
66 2511.79568986905\\
67 2465.41332688095\\
68 2446.04125589286\\
69 2406.49770913095\\
70 2496.709865\\
71 2535.71867792857\\
72 4208.13053217857\\
73 5063.9998840119\\
74 5813.7252380119\\
75 6289.42602961905\\
76 5744.85926145238\\
77 6407.629546\\
78 6977.64327379762\\
79 7627.22150888095\\
80 7642.49776930953\\
81 7205.82928417857\\
82 7041.73251622619\\
83 7204.38834146428\\
84 7716.83797282143\\
85 7762.47262940476\\
86 7272.00493342857\\
87 6993.67693253571\\
88 7703.85103373809\\
89 8027.2034447619\\
90 8122.49837705953\\
91 7785.63099797619\\
92 7260.38510857143\\
93 7005.10969816666\\
94 6988.51183345238\\
95 6522.01556990476\\
};
\end{axis}

\begin{axis}[%
width=7cm,
height=3cm,xlabel={Time step (15 mins)},ylabel={Heating demand (kW)},
scale only axis, scaled ticks=false,tick label style={/pgf/number format/fixed},
xmin=0,
xmax=100,
ymin=0,
ymax=3000,
name=plot2,
at=(plot1.right of south east),
anchor=left of south west
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
0 781.015977928348\\
4.23333333333333 781.015977928348\\
4.23333333333333 782.168215084296\\
8.5 782.168215084296\\
8.5 844.944356842571\\
17.0333333333333 844.944356842571\\
17.0333333333333 1197.71875323289\\
21.3 1197.71875323289\\
21.3 1394.36630195092\\
25.5666666666667 1394.36630195092\\
25.5666666666667 1590.38168523684\\
29.8333333333333 1590.38168523684\\
29.8333333333333 1483.25615526114\\
34.1 1483.25615526114\\
34.1 1355.61272705221\\
35.1666666666667 1355.61272705221\\
35.1666666666667 1253.49013197625\\
42.6333333333333 1253.49013197625\\
42.6333333333333 1281.69677352368\\
46.9 1281.69677352368\\
46.9 1315.26929805207\\
51.1666666666667 1315.26929805207\\
51.1666666666667 1044.40266743832\\
59.7 1044.40266743832\\
59.7 962.441493281022\\
61.8333333333333 962.441493281022\\
61.8333333333333 1037.67012393526\\
63.9666666666667 1037.67012393526\\
63.9666666666667 1311.4854425872\\
68.2333333333333 1311.4854425872\\
68.2333333333333 1549.73981497438\\
72.5 1549.73981497438\\
72.5 1692.98592475895\\
76.7666666666667 1692.98592475895\\
76.7666666666667 1694.74702945275\\
81.0333333333333 1694.74702945275\\
81.0333333333333 1693.00918894722\\
83.1666666666667 1693.00918894722\\
83.1666666666667 1287.08676738912\\
85.3 1287.08676738912\\
85.3 1057.17533176626\\
93.8333333333333 1057.17533176626\\
93.8333333333333 934.184204672947\\
94.9 934.184204672947\\
94.9 934.4318600275\\
95.0333333333333 934.4318600275\\
};
\addplot [
color=blue,
dotted,thick,
forget plot
]
table[row sep=crcr]{
0 779.820179979762\\
1 780.8404266\\
2 781.087840613095\\
3 781.335254601191\\
4 781.582668614286\\
5 781.830082626191\\
6 782.077496614286\\
7 782.324910615476\\
8 782.572324615476\\
9 782.819738617857\\
10 783.067152629762\\
11 783.314566621429\\
12 783.561980625\\
13 783.809394638095\\
14 784.056808629762\\
15 784.304222641666\\
16 1125.10227117143\\
17 1125.34968521191\\
18 1125.59709919167\\
19 1125.8445132119\\
20 1296.36724447262\\
21 1296.60508318095\\
22 1296.84292184167\\
23 1297.080760575\\
24 1501.83104520952\\
25 1495.5358819869\\
26 1489.24071875357\\
27 1482.9455556619\\
28 1681.16283828572\\
29 1674.86767516667\\
30 1668.572512\\
31 1662.2773487619\\
32 1372.18999015595\\
33 1365.89482697024\\
34 1359.5996637\\
35 1353.30450057381\\
36 1347.00933735119\\
37 1344.29781950238\\
38 1341.58630160595\\
39 1338.87478381667\\
40 1131.65082001548\\
41 1128.93930213929\\
42 1126.22778428095\\
43 1123.51626647619\\
44 1325.31719444048\\
45 1322.60567656786\\
46 1319.89415875476\\
47 1317.18264082262\\
48 1314.47112297381\\
49 1315.36741637262\\
50 1316.26370985476\\
51 1317.16000325357\\
52 1113.54385081905\\
53 1114.44014419048\\
54 1115.33643767262\\
55 1116.232731075\\
56 953.519067782143\\
57 954.41536122619\\
58 955.311654644048\\
59 956.20794805119\\
60 957.104241492857\\
61 963.905415552381\\
62 970.706589589286\\
63 977.69143347619\\
64 1262.05240038571\\
65 1268.85357447857\\
66 1275.65474855952\\
67 1282.45592259286\\
68 1493.76954258333\\
69 1500.57071661905\\
70 1507.37189071429\\
71 1514.17306467857\\
72 1691.89899294048\\
73 1692.31175188095\\
74 1692.7245107381\\
75 1693.13726967857\\
76 1693.55002865476\\
77 1693.96278752381\\
78 1694.3755464881\\
79 1694.78830529762\\
80 1695.2010642619\\
81 1695.61382313095\\
82 1696.026582\\
83 1696.43934098809\\
84 1207.46506355476\\
85 1207.87782250833\\
86 1208.29058141309\\
87 1208.70334034405\\
88 1045.506142525\\
89 1045.91890144643\\
90 1046.33166030833\\
91 1046.74441922976\\
92 933.207341936905\\
93 933.620100844048\\
94 934.032859733334\\
95 934.445618658334\\
};
\end{axis}

\begin{axis}[%
width=7cm,
height=3cm,xlabel={Time step (15 mins)},ylabel={Heating demand (kW)},
scale only axis, scaled ticks=false,tick label style={/pgf/number format/fixed},
xmin=0,
xmax=100,
ymin=0000,
ymax=3000,
name=plot4,
at=(plot2.below south west),
anchor=above north west
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
0 2022.7864179654\\
4.23333333333333 2022.7864179654\\
4.23333333333333 2024.92106949687\\
8.5 2024.92106949687\\
8.5 2081.35484293376\\
17.0333333333333 2081.35484293376\\
17.0333333333333 2390.06104171317\\
21.3 2390.06104171317\\
21.3 2486.24320889308\\
23.4333333333333 2486.24320889308\\
23.4333333333333 2667.0071951125\\
25.5666666666667 2667.0071951125\\
25.5666666666667 2704.94966728348\\
27.7 2704.94966728348\\
27.7 2880.86891870848\\
29.8333333333333 2880.86891870848\\
29.8333333333333 2733.34370892269\\
34.1 2733.34370892269\\
34.1 2635.78579485923\\
35.1666666666667 2635.78579485923\\
35.1666666666667 2635.31585549375\\
36.2333333333333 2635.31585549375\\
36.2333333333333 2530.81691917842\\
42.6333333333333 2530.81691917842\\
42.6333333333333 2582.77255878218\\
46.9 2582.77255878218\\
46.9 2621.51564435231\\
51.1666666666667 2621.51564435231\\
51.1666666666667 2354.21260299851\\
59.7 2354.21260299851\\
59.7 2269.4655577689\\
61.8333333333333 2269.4655577689\\
61.8333333333333 2324.06288068125\\
63.9666666666667 2324.06288068125\\
63.9666666666667 2561.50412077266\\
68.2333333333333 2561.50412077266\\
68.2333333333333 2765.37478504044\\
72.5 2765.37478504044\\
72.5 2875.32417349907\\
76.7666666666667 2875.32417349907\\
76.7666666666667 2779.62637603746\\
85.3 2779.62637603746\\
85.3 2419.87747369702\\
87.4333333333333 2419.87747369702\\
87.4333333333333 2231.22476526094\\
93.8333333333333 2231.22476526094\\
93.8333333333333 2164.95714080714\\
94.9 2164.95714080714\\
94.9 2164.78334926429\\
95.0333333333333 2164.78334926429\\
};
\addplot [
color=blue,
dotted,thick,
forget plot
]
table[row sep=crcr]{
0 2021.73576914286\\
1 2022.23607810714\\
2 2022.73638710714\\
3 2023.23669596429\\
4 2023.73700503571\\
5 2024.23731396429\\
6 2024.73762275\\
7 2025.23793189286\\
8 2025.73824082143\\
9 2026.23854964286\\
10 2026.73885860714\\
11 2027.23916753571\\
12 2027.73947653571\\
13 2028.23978557143\\
14 2028.7400945\\
15 2029.24040346429\\
16 2325.98723025\\
17 2326.48753921429\\
18 2326.987848\\
19 2327.48815703571\\
20 2476.11172496429\\
21 2476.61203382143\\
22 2477.11234275\\
23 2477.61265175\\
24 2682.6254065\\
25 2682.20409389286\\
26 2681.78278085714\\
27 2681.36146828571\\
28 2885.45260110714\\
29 2885.03128842857\\
30 2884.60997535714\\
31 2884.18866282143\\
32 2636.89525189286\\
33 2636.47393896429\\
34 2636.05262635714\\
35 2635.63131346429\\
36 2635.21000064286\\
37 2633.967128\\
38 2632.72425507143\\
39 2631.48138232143\\
40 2425.72606371429\\
41 2424.48319089286\\
42 2423.24031807143\\
43 2421.9974455\\
44 2625.26701842857\\
45 2624.02414564286\\
46 2622.78127296429\\
47 2621.53840010714\\
48 2620.2955275\\
49 2621.72799096429\\
50 2623.1604545\\
51 2624.59291814286\\
52 2421.51293564286\\
53 2422.94539907143\\
54 2424.37786278571\\
55 2425.81032628571\\
56 2263.63283307143\\
57 2265.06529642857\\
58 2266.49776028571\\
59 2267.93022371429\\
60 2269.36268721429\\
61 2269.53121235714\\
62 2269.69973746429\\
63 2266.07006817857\\
64 2525.99964135714\\
65 2526.1681665\\
66 2526.33669171429\\
67 2526.50521675\\
68 2731.18618764286\\
69 2731.35471278571\\
70 2731.52323807143\\
71 2731.69176307143\\
72 2876.08692517857\\
73 2875.79727275\\
74 2875.50762003571\\
75 2875.21796757143\\
76 2874.92831503571\\
77 2874.63866239286\\
78 2874.34900996429\\
79 2874.05935732143\\
80 2873.76970496429\\
81 2873.48005214286\\
82 2873.19039975\\
83 2872.90074725\\
84 2427.72092021429\\
85 2427.43126775\\
86 2427.14161521429\\
87 2426.85196271429\\
88 2262.95235353571\\
89 2262.66270089286\\
90 2262.37304832143\\
91 2262.08339589286\\
92 2165.64265178571\\
93 2165.35299932143\\
94 2165.06334675\\
95 2164.77369417857\\
};
\end{axis}

\begin{axis}[%
width=7cm,
height=3cm,xlabel={Time step (15 mins)},ylabel={Heating demand (kW)},
scale only axis, scaled ticks=false,tick label style={/pgf/number format/fixed},
xmin=0,
xmax=100,
ymin=0,
ymax=3000,
name=plot6,
at=(plot4.below south west),
anchor=above north west
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
0 1592.77068439608\\
4.23333333333333 1592.77068439608\\
4.23333333333333 1594.56599573474\\
8.5 1594.56599573474\\
8.5 1647.85507119245\\
17.0333333333333 1647.85507119245\\
17.0333333333333 1940.92570398119\\
21.3 1940.92570398119\\
21.3 2032.61334667241\\
23.4333333333333 2032.61334667241\\
23.4333333333333 2211.20148005542\\
25.5666666666667 2211.20148005542\\
25.5666666666667 2241.79272950419\\
27.7 2241.79272950419\\
27.7 2410.09464435592\\
29.8333333333333 2410.09464435592\\
29.8333333333333 2258.58085333487\\
34.1 2258.58085333487\\
34.1 2156.26658471356\\
35.1666666666667 2156.26658471356\\
35.1666666666667 2152.04299758296\\
36.2333333333333 2152.04299758296\\
36.2333333333333 2042.21858353023\\
42.6333333333333 2042.21858353023\\
42.6333333333333 2087.65863404768\\
46.9 2087.65863404768\\
46.9 2122.68083983279\\
51.1666666666667 2122.68083983279\\
51.1666666666667 1855.50366797111\\
59.7 1855.50366797111\\
59.7 1773.29075438564\\
61.8333333333333 1773.29075438564\\
61.8333333333333 1837.34855275581\\
63.9666666666667 1837.34855275581\\
63.9666666666667 2084.74872211025\\
68.2333333333333 2084.74872211025\\
68.2333333333333 2300.62847422377\\
72.5 2300.62847422377\\
72.5 2415.80927126405\\
76.7666666666667 2415.80927126405\\
76.7666666666667 2325.51960609395\\
85.3 2325.51960609395\\
85.3 1833.59825818943\\
93.8333333333333 1833.59825818943\\
93.8333333333333 1724.67546492712\\
94.9 1724.67546492712\\
94.9 1724.94119944862\\
95.0333333333333 1724.94119944862\\
};
\addplot [
color=blue,
dotted,thick,
forget plot
]
table[row sep=crcr]{
0 1591.88705456051\\
1 1592.30783071974\\
2 1592.72860679618\\
3 1593.1493828344\\
4 1593.57015901911\\
5 1593.99093501911\\
6 1594.41171111465\\
7 1594.83248732484\\
8 1595.25326338853\\
9 1595.67403944586\\
10 1596.09481559236\\
11 1596.51559172611\\
12 1596.93636773885\\
13 1597.35714387261\\
14 1597.7779199172\\
15 1598.19869598726\\
16 1880.19781471337\\
17 1880.61859079618\\
18 1881.03936690446\\
19 1881.46014298726\\
20 2022.67009038853\\
21 2023.09086646497\\
22 2023.5116426242\\
23 2023.93241867516\\
24 2228.86564063694\\
25 2224.87578163057\\
26 2220.88592254777\\
27 2216.89606338854\\
28 2417.41865014013\\
29 2413.4231556879\\
30 2409.42766115924\\
31 2405.43216671338\\
32 2166.78805349044\\
33 2162.79255899363\\
34 2158.79706458599\\
35 2154.80157005096\\
36 2150.80607549682\\
37 2148.34152973885\\
38 2145.87698405733\\
39 2143.41243836306\\
40 1936.43544663694\\
41 1933.97090098726\\
42 1931.50635524204\\
43 1929.04180949045\\
44 2131.08970965605\\
45 2128.62516400637\\
46 2126.16061821656\\
47 2123.69607246497\\
48 2121.2315267707\\
49 2122.71175697452\\
50 2124.19198715924\\
51 2125.67221736306\\
52 1922.64000169427\\
53 1924.12023194905\\
54 1925.60046216561\\
55 1927.08069236306\\
56 1764.95096582166\\
57 1766.43119600637\\
58 1767.91142626752\\
59 1769.39165641401\\
60 1770.87188665605\\
61 1773.9826242293\\
62 1777.09336192994\\
63 1781.5588693758\\
64 2043.0655965414\\
65 2046.17633412739\\
66 2049.28707171338\\
67 2052.39780930573\\
68 2260.0209927707\\
69 2263.13173039491\\
70 2266.24246801911\\
71 2269.35320557962\\
72 2414.64299234395\\
73 2415.085883\\
74 2415.52877382803\\
75 2415.97166450956\\
76 2416.41455530573\\
77 2416.85744604459\\
78 2417.30033678981\\
79 2417.74322760509\\
80 2418.18611827388\\
81 2418.62900910828\\
82 2419.07189988535\\
83 2419.51479052866\\
84 1978.48015361783\\
85 1978.92304435032\\
86 1979.36593508917\\
87 1979.80882582803\\
88 1816.6417599172\\
89 1817.08465067516\\
90 1817.52754136943\\
91 1817.97043209554\\
92 1723.62729009554\\


text:
\documentclass[a4paper,12pt]{article}

\usepackage{fancyhdr}
\usepackage{amssymb}
%\usepackage{mathpazo}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{slashed}
\usepackage{cancel}
\usepackage[mathscr]{euscript}
\usepackage{MaxPackage} %Note: You need MaxPackage installed or in the same folder as your .tex file or something.

\newcommand{\colorcomment}[2]{\textcolor{#1}{#2}} %First of these leaves in comments. Second one kills them.
%\newcommand{\colorcomment}[2]{}

\pagestyle{fancy}
\lhead{Max Jeter}
\chead{Class}
\rhead{Assignment, Page \thepage}

%Number of Problems		:
%Clear					:
%Begun					:
%Not started			:
%Can complete via book	:
%Needs Polish			:

%Pomodoros logged		:

\begin{document}

{\bf Problem 1:}

\shunt

{\bf Problem 2:}

\shunt

{\bf Problem 3:}

\shunt

{\bf Problem 4:}

\shunt

{\bf Problem 5:}

\shunt

{\bf Problem 6:}

\shunt

{\bf Problem 7:}

\shunt

\end{document}

domain: tex


text:
\chapter{Misc}

\section{Building gcc}\label{sec:gccbuilding}
This section explains how to build gcc from source.
These instructions have been tested on MacOS\footnote{Lion specifically} (where they are most needed).

Create a directory and put the following files in it (change version numbers as required).
\begin{itemize}
 \item gmp-4.3.2.tar.bz2 (eg \url{ftp://gcc.gnu.org/pub/gcc/infrastructure})
 \item mpfr-2.4.2.tar.bz2 (eg \url{http://www.mpfr.org/})
 \item mpc-0.8.1.tar.gz (eg \url{mpc-0.8.1.tar.gz})
 \item gcc source (eg \url{http://gcc.gnu.org/gcc-4.7/}
\end{itemize}

Change into the directory you created and
\begin{shellCode}
tar -xjf gmp-4.3.2.tar.bz2
tar -xjf mpfr-2.4.2.tar.bz2
tar -xzf mpc-0.8.1.tar.gz
tar -xjf gcc-4.7.1.tar.bz2
mv gmp-4.3.2 gcc-4.7.1/gmp
mv mpc-0.8.1 gcc-4.7.1/mpc
mv mpfr-2.4.2 gcc-4.7.1/mpfr

cd gcc-4.7.1
\end{shellCode}

\noindent Note that in the next step we specify the architecture explicitly.
This is because (on our test platform at least) some of the parts default to different architectures.

\begin{shellCode}
./configure --build=amd64-apple-darwin11.4.0
make
\end{shellCode}

\noindent Now go have several coffees, watch a movie or cook a roast.

\noindent Once the build has completed:
\begin{shellCode}
sudo make install
\end{shellCode}

\noindent Once this is done you can remove the directory you created at the beginning of this section.


text:
\hypertarget{classrocksdb_1_1SliceFormatter}{}\section{rocksdb\+:\+:Slice\+Formatter Class Reference}
\label{classrocksdb_1_1SliceFormatter}\index{rocksdb\+::\+Slice\+Formatter@{rocksdb\+::\+Slice\+Formatter}}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
virtual std\+::string {\bfseries Format} (const \hyperlink{classrocksdb_1_1Slice}{Slice} \&s) const =0\hypertarget{classrocksdb_1_1SliceFormatter_a1c4bb312de914e08e99116c0c5e4c4da}{}\label{classrocksdb_1_1SliceFormatter_a1c4bb312de914e08e99116c0c5e4c4da}

\end{DoxyCompactItemize}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
Appserver/src/external/rocksdb/ldb\+\_\+tool.\+h\end{DoxyCompactItemize}


text:
\hypertarget{classnlohmann_1_1basic__json}{}\doxysection{nlohmann\+::basic\+\_\+json Class Reference}
\label{classnlohmann_1_1basic__json}\index{nlohmann::basic\_json@{nlohmann::basic\_json}}

a class to store J\+S\+ON values

{\ttfamily \#include $<$json.\+hpp$>$}

\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a4e43b685789a169bca7e69b3104c86d1}\label{classnlohmann_1_1basic__json_a4e43b685789a169bca7e69b3104c86d1}}
using {\bfseries value\+\_\+t} = \mbox{\hyperlink{namespacenlohmann_1_1detail_a1ed8fc6239da25abcaf681d30ace4985}{detail\+::value\+\_\+t}}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a352187a5ebf3cde865be1b833c18f208}\label{classnlohmann_1_1basic__json_a352187a5ebf3cde865be1b833c18f208}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a352187a5ebf3cde865be1b833c18f208}{json\+\_\+pointer}} = \+::\mbox{\hyperlink{classnlohmann_1_1json__pointer}{nlohmann\+::json\+\_\+pointer}}$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$
\begin{DoxyCompactList}\small\item\em J\+S\+ON Pointer, see \mbox{\hyperlink{classnlohmann_1_1json__pointer}{nlohmann\+::json\+\_\+pointer}}. \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_ac81dd868670cb7d0d895426aacf0e06a}\label{classnlohmann_1_1basic__json_ac81dd868670cb7d0d895426aacf0e06a}}
{\footnotesize template$<$typename T , typename S\+F\+I\+N\+AE $>$ }\\using {\bfseries json\+\_\+serializer} = J\+S\+O\+N\+Serializer$<$ T, S\+F\+I\+N\+AE $>$
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a05b1719e15d24c47f4fce69888967d1e}\label{classnlohmann_1_1basic__json_a05b1719e15d24c47f4fce69888967d1e}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a05b1719e15d24c47f4fce69888967d1e}{error\+\_\+handler\+\_\+t}} = \mbox{\hyperlink{namespacenlohmann_1_1detail_a5a76b60b26dc8c47256a996d18d967df}{detail\+::error\+\_\+handler\+\_\+t}}
\begin{DoxyCompactList}\small\item\em how to treat decoding errors \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a229d672056243afb8f97ccf1b9df6ff7}\label{classnlohmann_1_1basic__json_a229d672056243afb8f97ccf1b9df6ff7}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a229d672056243afb8f97ccf1b9df6ff7}{cbor\+\_\+tag\+\_\+handler\+\_\+t}} = \mbox{\hyperlink{namespacenlohmann_1_1detail_a58bb1ef1a9ad287a9cfaf1855784d9ac}{detail\+::cbor\+\_\+tag\+\_\+handler\+\_\+t}}
\begin{DoxyCompactList}\small\item\em how to treat C\+B\+OR tags \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_ae8b2251872b6a3a9b04147d2ffa5a839}\label{classnlohmann_1_1basic__json_ae8b2251872b6a3a9b04147d2ffa5a839}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_ae8b2251872b6a3a9b04147d2ffa5a839}{initializer\+\_\+list\+\_\+t}} = std\+::initializer\+\_\+list$<$ \mbox{\hyperlink{classnlohmann_1_1detail_1_1json__ref}{detail\+::json\+\_\+ref}}$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$ $>$
\begin{DoxyCompactList}\small\item\em helper type for initializer lists of \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} values \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a6cefa2384f912265e090f7a34c99703d}\label{classnlohmann_1_1basic__json_a6cefa2384f912265e090f7a34c99703d}}
using {\bfseries input\+\_\+format\+\_\+t} = \mbox{\hyperlink{namespacenlohmann_1_1detail_aa554fc6a11519e4f347deb25a9f0db40}{detail\+::input\+\_\+format\+\_\+t}}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_af229d341abc5e2525a8ca4dc247533e1}\label{classnlohmann_1_1basic__json_af229d341abc5e2525a8ca4dc247533e1}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_af229d341abc5e2525a8ca4dc247533e1}{json\+\_\+sax\+\_\+t}} = \mbox{\hyperlink{structnlohmann_1_1json__sax}{json\+\_\+sax}}$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$
\begin{DoxyCompactList}\small\item\em S\+AX interface type, see \mbox{\hyperlink{structnlohmann_1_1json__sax}{nlohmann\+::json\+\_\+sax}}. \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a5d8fbc60f29db1c02fa8ce0828fcdc1d}{parse\+\_\+event\+\_\+t}} = \mbox{\hyperlink{namespacenlohmann_1_1detail_a2fb6dae6578e06ae73ca0d7cc8512b1a}{detail\+::parse\+\_\+event\+\_\+t}}
\begin{DoxyCompactList}\small\item\em parser event types \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a87cd77e74fd386d93f26ad04bd01b6a5}{parser\+\_\+callback\+\_\+t}} = detail\+::parser\+\_\+callback\+\_\+t$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$
\begin{DoxyCompactList}\small\item\em per-\/element parser callback type \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
J\+S\+O\+N\+\_\+\+H\+E\+D\+L\+E\+Y\+\_\+\+R\+E\+T\+U\+R\+N\+S\+\_\+\+N\+O\+N\+\_\+\+N\+U\+LL const char $\ast$ \mbox{\hyperlink{classnlohmann_1_1basic__json_ab8bb3fb959c5bcffb9c9cc079c407c9a}{type\+\_\+name}} () const noexcept
\begin{DoxyCompactList}\small\item\em return the type as string \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_af07877930c21c861d75a34cb32993fd0}\label{classnlohmann_1_1basic__json_af07877930c21c861d75a34cb32993fd0}}
static \mbox{\hyperlink{classnlohmann_1_1basic__json_a69388a77648e83007af1295aaf350c0f}{allocator\+\_\+type}} \mbox{\hyperlink{classnlohmann_1_1basic__json_af07877930c21c861d75a34cb32993fd0}{get\+\_\+allocator}} ()
\begin{DoxyCompactList}\small\item\em returns the allocator associated with the container \end{DoxyCompactList}\item
static J\+S\+O\+N\+\_\+\+H\+E\+D\+L\+E\+Y\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} \mbox{\hyperlink{classnlohmann_1_1basic__json_a651af45dd9d619a3e7524a95388ddb33}{meta}} ()
\begin{DoxyCompactList}\small\item\em returns version information on the library \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_ac80ff6c53f4441a8b491c827216c9c37}\label{classnlohmann_1_1basic__json_ac80ff6c53f4441a8b491c827216c9c37}}
J\+S\+O\+N\+\_\+\+P\+R\+I\+V\+A\+T\+E\+\_\+\+U\+N\+L\+E\+S\+S\+\_\+\+T\+E\+S\+T\+ED {\bfseries \+\_\+\+\_\+pad3\+\_\+\+\_\+}\+: \mbox{\hyperlink{namespacenlohmann_1_1detail_a1ed8fc6239da25abcaf681d30ace4985}{value\+\_\+t}} m\+\_\+type = \mbox{\hyperlink{namespacenlohmann_1_1detail_a1ed8fc6239da25abcaf681d30ace4985a37a6259cc0c1dae299a7866489dff0bd}{value\+\_\+t\+::null}}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a19622cd7064559888959fe0ef3882bea}\label{classnlohmann_1_1basic__json_a19622cd7064559888959fe0ef3882bea}}
json\+\_\+value \mbox{\hyperlink{classnlohmann_1_1basic__json_a19622cd7064559888959fe0ef3882bea}{m\+\_\+value}} = \{\}
\begin{DoxyCompactList}\small\item\em the value of the current element \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Friends}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a6275ed57bae6866cdf5db5370a7ad47c}\label{classnlohmann_1_1basic__json_a6275ed57bae6866cdf5db5370a7ad47c}}
{\footnotesize template$<$detail\+::value\+\_\+t $>$ }\\struct {\bfseries detail\+::external\+\_\+constructor}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_ac8f3125911eb018ef4ab00d879487baf}\label{classnlohmann_1_1basic__json_ac8f3125911eb018ef4ab00d879487baf}}
{\footnotesize template$<$typename Basic\+Json\+Type , typename Input\+Type $>$ }\\class {\bfseries \+::nlohmann\+::detail\+::parser}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a842e5c7ca096025c18b11e715d3401f4}\label{classnlohmann_1_1basic__json_a842e5c7ca096025c18b11e715d3401f4}}
{\footnotesize template$<$typename Basic\+Json\+Type $>$ }\\class {\bfseries \+::nlohmann\+::detail\+::iter\+\_\+impl}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a69d491bbda88ade6d3c7a2b11309e8bf}\label{classnlohmann_1_1basic__json_a69d491bbda88ade6d3c7a2b11309e8bf}}
{\footnotesize template$<$typename Basic\+Json\+Type , typename Char\+Type $>$ }\\class {\bfseries \+::nlohmann\+::detail\+::binary\+\_\+writer}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_aa226ed5103dfd10e27e562d35a3a106b}\label{classnlohmann_1_1basic__json_aa226ed5103dfd10e27e562d35a3a106b}}
{\footnotesize template$<$typename Basic\+Json\+Type , typename Input\+Type , typename S\+AX $>$ }\\class {\bfseries \+::nlohmann\+::detail\+::binary\+\_\+reader}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a47aabb1eceae32e8a6e8e7f0ff34be60}\label{classnlohmann_1_1basic__json_a47aabb1eceae32e8a6e8e7f0ff34be60}}
{\footnotesize template$<$typename Basic\+Json\+Type $>$ }\\class {\bfseries \+::nlohmann\+::detail\+::json\+\_\+sax\+\_\+dom\+\_\+parser}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a95574da8d12905ea99dc348934c837da}\label{classnlohmann_1_1basic__json_a95574da8d12905ea99dc348934c837da}}
{\footnotesize template$<$typename Basic\+Json\+Type $>$ }\\class {\bfseries \+::nlohmann\+::detail\+::json\+\_\+sax\+\_\+dom\+\_\+callback\+\_\+parser}
\end{DoxyCompactItemize}
\doxysubsection*{exceptions}
\label{_amgrp19ad27801b95bd1f2c6c2bf83dbb7515}%
Classes to implement user-\/defined exceptions. \begin{DoxyCompactItemize}
\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_ac00185487a16455dfdd53884f678040d}{exception}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1exception}{detail\+::exception}}
\begin{DoxyCompactList}\small\item\em general exception of the \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} class \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a3b1a24eaf07f81ee9cbf01e29cf8fb59}{parse\+\_\+error}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1parse__error}{detail\+::parse\+\_\+error}}
\begin{DoxyCompactList}\small\item\em exception indicating a parse error \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a5e6b5db267db5a283e770296f9e410a0}{invalid\+\_\+iterator}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1invalid__iterator}{detail\+::invalid\+\_\+iterator}}
\begin{DoxyCompactList}\small\item\em exception indicating errors with iterators \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a79473de577bb3f28ef0aa6e9f1571b52}{type\+\_\+error}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1type__error}{detail\+::type\+\_\+error}}
\begin{DoxyCompactList}\small\item\em exception indicating executing a member function with a wrong type \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a2e8fc803a09152f3174470ea2375b383}{out\+\_\+of\+\_\+range}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1out__of__range}{detail\+::out\+\_\+of\+\_\+range}}
\begin{DoxyCompactList}\small\item\em exception indicating access out of the defined range \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a48d5c5750a7f3164653bd8d3e1e8c893}{other\+\_\+error}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1other__error}{detail\+::other\+\_\+error}}
\begin{DoxyCompactList}\small\item\em exception indicating other library errors \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{container types}
\label{_amgrp6618fa684bc6d5a05e2c88bfff1c0d66}%
The canonic container types to use \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} like any other S\+TL container. \begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a3913219f58349e9be2cb8cc6ddfb3abf}\label{classnlohmann_1_1basic__json_a3913219f58349e9be2cb8cc6ddfb3abf}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a3913219f58349e9be2cb8cc6ddfb3abf}{value\+\_\+type}} = \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}}
\begin{DoxyCompactList}\small\item\em the type of elements in a \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} container \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_af11372ea846fedea8b2098dba7323831}\label{classnlohmann_1_1basic__json_af11372ea846fedea8b2098dba7323831}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_af11372ea846fedea8b2098dba7323831}{reference}} = \mbox{\hyperlink{classnlohmann_1_1basic__json_a3913219f58349e9be2cb8cc6ddfb3abf}{value\+\_\+type}} \&
\begin{DoxyCompactList}\small\item\em the type of an element reference \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_ae83ab5539e404c901ab216aafc9dc6d9}\label{classnlohmann_1_1basic__json_ae83ab5539e404c901ab216aafc9dc6d9}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_ae83ab5539e404c901ab216aafc9dc6d9}{const\+\_\+reference}} = const \mbox{\hyperlink{classnlohmann_1_1basic__json_a3913219f58349e9be2cb8cc6ddfb3abf}{value\+\_\+type}} \&
\begin{DoxyCompactList}\small\item\em the type of an element const reference \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a9b7596a400a85e2dd7ab22f62df8a340}\label{classnlohmann_1_1basic__json_a9b7596a400a85e2dd7ab22f62df8a340}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a9b7596a400a85e2dd7ab22f62df8a340}{difference\+\_\+type}} = std\+::ptrdiff\+\_\+t
\begin{DoxyCompactList}\small\item\em a type to represent differences between iterators \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a9eaf1dcc25d6e7bd204f72877cef254b}\label{classnlohmann_1_1basic__json_a9eaf1dcc25d6e7bd204f72877cef254b}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a9eaf1dcc25d6e7bd204f72877cef254b}{size\+\_\+type}} = std\+::size\+\_\+t
\begin{DoxyCompactList}\small\item\em a type to represent container sizes \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a69388a77648e83007af1295aaf350c0f}\label{classnlohmann_1_1basic__json_a69388a77648e83007af1295aaf350c0f}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a69388a77648e83007af1295aaf350c0f}{allocator\+\_\+type}} = Allocator\+Type$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$
\begin{DoxyCompactList}\small\item\em the allocator type \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a4ac83a20750a2bfacbf9d30f3e51c3bb}\label{classnlohmann_1_1basic__json_a4ac83a20750a2bfacbf9d30f3e51c3bb}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a4ac83a20750a2bfacbf9d30f3e51c3bb}{pointer}} = typename std\+::allocator\+\_\+traits$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json_a69388a77648e83007af1295aaf350c0f}{allocator\+\_\+type}} $>$\+::\mbox{\hyperlink{classnlohmann_1_1basic__json_a4ac83a20750a2bfacbf9d30f3e51c3bb}{pointer}}
\begin{DoxyCompactList}\small\item\em the type of an element pointer \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a2c77adc1436dd4c62960d2679e4befee}\label{classnlohmann_1_1basic__json_a2c77adc1436dd4c62960d2679e4befee}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a2c77adc1436dd4c62960d2679e4befee}{const\+\_\+pointer}} = typename std\+::allocator\+\_\+traits$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json_a69388a77648e83007af1295aaf350c0f}{allocator\+\_\+type}} $>$\+::\mbox{\hyperlink{classnlohmann_1_1basic__json_a2c77adc1436dd4c62960d2679e4befee}{const\+\_\+pointer}}
\begin{DoxyCompactList}\small\item\em the type of an element const pointer \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_aa3ab6c99db6584c47624c29037f9f14d}\label{classnlohmann_1_1basic__json_aa3ab6c99db6584c47624c29037f9f14d}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_aa3ab6c99db6584c47624c29037f9f14d}{iterator}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1iter__impl}{iter\+\_\+impl}}$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$
\begin{DoxyCompactList}\small\item\em an iterator for a \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} container \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a7a09a580613f00c73015c19e5e7c44ba}\label{classnlohmann_1_1basic__json_a7a09a580613f00c73015c19e5e7c44ba}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a7a09a580613f00c73015c19e5e7c44ba}{const\+\_\+iterator}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1iter__impl}{iter\+\_\+impl}}$<$ const \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$
\begin{DoxyCompactList}\small\item\em a const iterator for a \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} container \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a0d2df32b8689b776dd3b0865f1362f40}\label{classnlohmann_1_1basic__json_a0d2df32b8689b776dd3b0865f1362f40}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a0d2df32b8689b776dd3b0865f1362f40}{reverse\+\_\+iterator}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1json__reverse__iterator}{json\+\_\+reverse\+\_\+iterator}}$<$ typename \mbox{\hyperlink{classnlohmann_1_1basic__json_aa3ab6c99db6584c47624c29037f9f14d}{basic\+\_\+json\+::iterator}} $>$
\begin{DoxyCompactList}\small\item\em a reverse iterator for a \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} container \end{DoxyCompactList}\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_a59564ce7bf7dad8be7d4d8184be05d91}\label{classnlohmann_1_1basic__json_a59564ce7bf7dad8be7d4d8184be05d91}}
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a59564ce7bf7dad8be7d4d8184be05d91}{const\+\_\+reverse\+\_\+iterator}} = \mbox{\hyperlink{classnlohmann_1_1detail_1_1json__reverse__iterator}{json\+\_\+reverse\+\_\+iterator}}$<$ typename \mbox{\hyperlink{classnlohmann_1_1basic__json_a7a09a580613f00c73015c19e5e7c44ba}{basic\+\_\+json\+::const\+\_\+iterator}} $>$
\begin{DoxyCompactList}\small\item\em a const reverse iterator for a \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} container \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{J\+S\+ON value data types}
\label{_amgrpbddfba6d49869d59bfd397e65b8cba87}%
The data types to store a J\+S\+ON value. These types are derived from the template arguments passed to class \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}}. \begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnlohmann_1_1basic__json_af17b737bac7ddaa05c1b6205b1e025c6}\label{classnlohmann_1_1basic__json_af17b737bac7ddaa05c1b6205b1e025c6}}
using {\bfseries object\+\_\+comparator\+\_\+t} = std\+::less$<$ String\+Type $>$
\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a949272bf6af5eb8eab9675505422f5b3}{object\+\_\+t}} = Object\+Type$<$ String\+Type, \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}}, object\+\_\+comparator\+\_\+t, Allocator\+Type$<$ std\+::pair$<$ const String\+Type, \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$ $>$$>$
\begin{DoxyCompactList}\small\item\em a type for an object \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a69524b1f8f42c0a81b86cee3fc54e034}{array\+\_\+t}} = Array\+Type$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}}, Allocator\+Type$<$ \mbox{\hyperlink{classnlohmann_1_1basic__json}{basic\+\_\+json}} $>$ $>$
\begin{DoxyCompactList}\small\item\em a type for an array \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a561057a2cc70397ad0ab890745d1d7c7}{string\+\_\+t}} = String\+Type
\begin{DoxyCompactList}\small\item\em a type for a string \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a8cc04e22d7ef18efd2d34bc04eb6a1b2}{boolean\+\_\+t}} = Boolean\+Type
\begin{DoxyCompactList}\small\item\em a type for a boolean \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_ab227d71ad47b6ed6a3acae52dedbb49d}{number\+\_\+integer\+\_\+t}} = Number\+Integer\+Type
\begin{DoxyCompactList}\small\item\em a type for a number (integer) \end{DoxyCompactList}\item
using \mbox{\hyperlink{classnlohmann_1_1basic__json_a440094de5ef4e119b2771b549b33da70}{number\+\_\+unsigned\+\_\+t}} = Number\+Unsigned\+Type


text:
% !TEX root = ../main.tex

\section{Model behaviour using labelled transistion system (LTS)}

We have multiple interfaces with

An automaton for a simple light:
\begin{itemize}
  \item Input:
  \begin{itemize}
    \item Switch on
    \item Switch off
  \end{itemize}
  \item Output:
  \begin{itemize}
    \item Light on
    \item Light off
  \end{itemize}
\end{itemize}

There are two states:
\begin{itemize}
  \item On
  \item Off
\end{itemize}

The inputs switch from one state to the other, label transition system,
\autoref{fig:deterministic_on}

\begin{figure}
  \centering
  \begin{subfigure}[b]{.45\textwidth}
    \centering
    \begin{tikzpicture}
      \tikzstyle{every state}=[draw]

      \node[state] (on) {On};
      \node[state, below = of on] (off) {Off};

      \path (on)    edge[bend left] node {\emph{switch\_on}}  (off)
            (off)   edge[bend left] node {\emph{switch\_off}} (on);

    \end{tikzpicture}

    \caption{Simple automata \label{fig:deterministic_on}}
  \end{subfigure}
  ~
  \begin{subfigure}[b]{.45\textwidth}
    \centering
    \begin{tikzpicture}
      \tikzstyle{every state}=[draw]

      \node[state] (on) {On};
      \node[state, below = of on] (off) {Off};

      \path (on)    edge[bend left]   node {\emph{switch\_on}}  (off)
      (off)   edge[bend left]   node {\emph{switch\_off}} (on)
      edge[loop below]  node {\emph{switch\_off}} (off);

    \end{tikzpicture}

    \caption{Non-deterministic automata \label{fig:non-deterministic_on}}
  \end{subfigure}
\end{figure}
Sometimes we have a non-deterministic behaviour \autoref{fig:non-deterministic_on}. We can go
to two different states coming from the same previous state and having the same input

\subsection{Definition of a labelled transition system}

Definition
\textbf{This is a test}

\subsection{Transition system with an infinite state space}

Example: the natural numbers

\begin{align*}
  S &= \{ 0, 1, 2, 3, ... \} \\
  Act &= \{ Up, Down \}  \\
  \rightarrow &= \{ <i, Up, i+1>, <i, Down, i-1> \}
\end{align*}

If we were to remove the transition from 2 and 3 we would have unreachable states


text:
\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}

\begin{document}

\centering \small $\bullet$ Meta-learning achieve generalization by `learning to learn' .

\end{document}


text:
% !TEX program = xelatex

\documentclass{resume}
\usepackage{graphicx}
% \usepackage{tabu}
\usepackage{booktabs}
\usepackage{multirow}
% \usepackage{progressbar}
\usepackage{hyperref}
\usepackage[export]{adjustbox}
% \usepackage{zh_CN-Adobefonts_external} % Simplified Chinese Support using external fonts (./fonts/zh_CN-Adobe/)
% \usepackage{zh_CN-Adobefonts_internal} % Simplified Chinese Support using system fonts

\begin{document}
\pagenumbering{gobble} % suppress displaying page number

\begin{tabular*}{\textwidth}{l c @{\extracolsep{\fill}} r}
  \begin{minipage}[b]{1.5in}
    % adapt widths of minipages to your needs
    % change Large font here
    \textit{
      {\Large \textbf{Gen LI}}                            \\
      48 Rue de la Bourgeon-                              \\
      nière, 44300 Nantes                                 \\
      +33 (0)7 49 99 05 67                                \\
      \href{https://github.com/rami3l}{github.com/rami3l} \\
      \small{gen.li@eleves.ec-nantes.fr}
      % rami3l@outlook.com                                \\
    }
  \end{minipage}
  &
  \renewcommand\arraystretch{1.3}
  \begin{tabular}[b]{c}
    {\LARGE \textbf{Élève Ingénieur - Centrale Nantes}}      \\
    {\Large 2\textsuperscript{ème} Année du Cycle Ingénieur} \\
    {\Large \textbf{Recherche de Stage Ingénieur}}           \\
    {\Large \textbf{(Avril 2022 - 20 semaines)}}
  \end{tabular}
  &
  \begin{minipage}[b]{0.95in}
    \includegraphics[width=0.95in,valign=b]{avatar}
  \end{minipage}
\end{tabular*}

\section{Formation}

\datedsubsection{\textbf{École Centrale de Nantes (ECN)} {\small Nantes, France}}{Sept. 2020 - Avr. 2022}
Formation générale \& spécialisation \textbf{informatique} \hfill \textit{Programme double diplôme de Centrale Pékin}

\datedsubsection{\textbf{Université de Beihang (BUAA) - École Centrale Pékin} {\small Pékin, Chine}}{Sept. 2017 - Juin 2020}
Étude des sciences \textbf{en français} {\footnotesize (mathématiques, physique, programmation, etc., \textbf{GPA : 3.6647})} \hfill \textit{2ème \& 3ème année} \\
Étude intensive de la langue française (générale \& \textbf{scientifique}) \hfill \textit{1ère année}

% \datedsubsection{\textbf{Lycée Nankai de Chongqing} {\small Chongqing, Chine}}{Sept. 2014 - Juin 2017}
% Gaokao (Bac équivalent) : Mention Très Bien \hfill \textit{654/750 points}

\section{Expérience professionnelle}

\datedsubsection{\textbf{Projet Personnel} - \href{https://github.com/rami3l/pacaptr}{\textit{Pacaptr} : Outil Multiplateforme de Gestion de Paquets}}{Depuis Mars 2020}
Emballage des gestionnaires de paquets utilisant la syntaxe de \textit{pacman} d'\textit{Arch Linux} \hfill \textit{Rust, Clap}
\begin{itemize}
  \item Analyse des besoins, réalisation du projet \& maintenance continue
  \item Utilisation de \textit{GitHub Actions} pour la détection des régressions \& la distribution des paquets
  \item Contribution à la bibliothèque en amont (\textit{Clap}, bibliothèque \textit{Rust} d'analyse d'arguments CLI)
\end{itemize}

\datedsubsection{\textbf{DianGarden} - {Rédaction de Support de Formation \& Développement}}{Juin 2021 - Juill. 2021}
\textbf{Stage opérateur}, amélioration de la formation informatique proposée par le startup \hfill \textit{Python, SQLite, PyQt5}
\begin{itemize}
  \item Réalisation de matériel pédagogique sur \textit{Git} \& sur les tests logiciels
  \item Amélioration générale de la qualité de l'application \textit{Python} de démonstration
\end{itemize}

\datedsubsection{\textbf{BUAA} - \href{https://github.com/BUAA-SE-Compiling/rurikawa}{\textit{Rurikawa} : Évaluation des Travaux Pratiques Informatiques}}{Juin 2020 - Avr. 2021}
\textbf{Projet en équipe}, système de style \textit{Online Judge} automatisant l'évaluation des TP \hfill \textit{Rust, Docker}
\begin{itemize}
  \item Conception \& réalisation du sous-système d'exécution de code
  \item Contribution à la bibliothèque en amont (\textit{Bollard}, binding de \textit{Docker Engine API} en \textit{Rust})
\end{itemize}

\datedsubsection{\textbf{Projet Personnel} - \href{https://github.com/rami3l/yascm}{\textit{Yascm} : Interpréteur Simple du Langage \textit{Scheme}}}{Févr. 2020 - Déc. 2020}
Solution à un des projets du livre \textit{Structure and Interpretation of Computer Programs} \hfill \textit{Haskell, Scala}
\begin{itemize}
  \item Étude de la programmation fonctionnelle \& de la théorie des langages
  \item Implémentation basée sur l'interpréteur métacirculaire du livre, en \textit{Haskell} \& en \textit{Scala}
\end{itemize}

\datedsubsection{\textbf{BUAA} - \href{https://github.com/rami3l/CircuitSim}{\textit{CircuitSim} : Simulateur de Circuits Électriques}}{Oct. 2019 - Nov. 2019}
Réalisation d’une version simplifiée de \textit{SPICE} \& modélisation orientée objet \hfill \textit{C\#, Math.NET}
\begin{itemize}
  \item Coopération \textit{Git} \& gestion des tâches en équipe
\end{itemize}

% Reference Test
%\datedsubsection{\textbf{Paper Title\cite{zaharia2012resilient}}}{May. 2015}
%An xxx optimized for xxx\cite{verma2015large}
%\begin{itemize}
%  \item main contribution
%\end{itemize}

\section{Compétences linguistiques et informatiques}

\begin{tabular}{r l r l}
  \textbf{Anglais}                 & Courant - CET 6                                      &
  \textbf{Systèmes d'exploitation} & macOS, Linux, Windows                                  \\
  \textbf{Français}                & Courant - DELF B2                                    &
  \textbf{Programmation}           & \textbf{Rust}, Go, Python, Java, Haskell, Scala, C\#   \\
  \textbf{Mandarin}                & Langue Maternelle                                    &
  \textbf{Autres}                  & Docker, PostgreSQL, Git, VSCode, \LaTeX
\end{tabular}

% \section{\faHeartO\ Honors and Awards}
% \datedline{\textit{\nth{1} Prize}, Award on xxx }{Jun. 2013}
% \datedline{Other awards}{2015}

\section{Centre d’intérêts et activités}

\begin{tabular*}{\textwidth}{r l @{\extracolsep{\fill}} r}
  \textbf{Engagement Citoyen} & Vélocampus - Réparation de Vélos \\
  % & Depuis Oct. 2020 \\
  % \textbf{Activité Sociale} & Étude des Systèmes de Métro - Chengdu \& Chongqing & Août 2018 \\
  \textbf{Loisirs \& Intérêts} & Photographie \& Design
\end{tabular*}

%% Reference
%\newpage
%\bibliographystyle{IEEETran}
%\bibliography{mycite}
\end{document}


text:
%
\ifexam
	\part[2]
	\else
	\question[2]
\fi
%
%Begin Question---------------------------------
\emph{Mathematics:} The interatomic potential the is often used to describe covalent bonding is the Morse potential:

\[E_\text{N} = E_0 \text{exp}[-2 \beta(r-r_0)]-2E_0 \text{exp}[-\beta(r-r0)]\]

Here, E_0 is the equilibrium interatomic potential, $r$ is the interatomic distance, $\beta$ is a constant. Prove the that the \emph{equilibrium} interatomic bond distance is indeed $r = r_0$.

%FileID-------------------------------------------------
\begin{FileID}
	\begin{center}
		\begin{tabular}{ll}
			\hline
			\hline
			\#FileTag:C-Ch2-Math-Q14-1.tex & 	\#SourceTag:Original\\ %change
			\#AuthorTag:JDEmery & \#UseTag:QuizExam\\ %change
			\hline
			\#AssignmentTag: & \#TermTag: \\ %add
			\hline
			\#TopicTag:InteratomicPotential & \#TopicTag:MorsePotential\\ %change
			\hline
			\#TypeTag:MathEvaluation & \\
			\hline
		\end{tabular}
	\end{center}
\end{FileID}

%Solution------------------------------------------
\begin{solution}

There are two ways to do this, both require taking a derivative. The first, and the simplest is: we know that $\frac{dE}{dr} = F$ and at equilibrium, F = 0. Therefore, if $r = r_0$:

\begin{align}
	E_\text{N} &= E_0 \text{exp}[-2 \beta(r_0-r_0)]-2E_0 \text{exp}[-\beta(r_0-r0)]\\
	E_\text{N} &= E_0 -2E_0 \\
	E_\text{N} &= -E_0\\
	\frac{dE_\text{N}}{dr} = F = 0\\ \quad \text{which confirms equilibrium.}
\end{align}

The second, longer route is to take the derivatives right away:

\begin{align}
	E_\text{N} &= E_0 \text{exp}[-2 \beta(r-r_0)]-2E_0 \text{exp}[-\beta(r-r0)]\\
	\frac{dE_\text{N}}{dr} = 0 &= -\cancel{2 \beta E_0} \text{exp}[-2 \beta(r-r_0)]+\cancel{2 E_0 \beta} \text{exp}[-\beta(r-r0)]\\
	0 &= \text{exp}[-\beta(r-r_0)]+1\\
	\text{ln}1 &= -\beta(r-r0)\\
	0 = r - r_0\\
	r = r_0 \quad \text{qed}.
\end{align}

\end{solution}

%Rubric---------------------------------------------------
\begin{rubric}

\begin{itemize}
	\item Full points only for NiO. Give partial credit for work (up to 50\% pts) if they show electronegativity calculations.
\end{itemize}

\end{rubric}

%Outcomes--------------------------------------------------
\begin{outcomes}
	\begin{center}
		\begin{tabular}{cccc}
			\hline\hline
			Class-Term Used & Term Instructor & Assessment & Percent Correct\\
			\hline
			 &  &  & \%\\    %change
			\hline
		\end{tabular}
	\end{center}
\end{outcomes}

%Comments-------------------------------------------------
\begin{comments}

This one can be a bit tricky based on the values --- it seems trivial, or at least pedantic.
 I've not used it in class, although I have employed a more complete variant in exams.
\end{comments}


text:
\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{a4paper, total={170mm,257mm},left=20mm, top=20mm, }
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=black]{hyperref}
\usepackage{bookmark}
\usepackage[autostyle, english = american]{csquotes}
\usepackage{appendix}
\usepackage{graphicx}
\begin{document}
\begin{titlepage}
\centering
\vfill
\vspace*{4\baselineskip}
{\bfseries\Large
Labtainers Instructor Guide\par
}
\vspace*{4\baselineskip}
{\bfseries
Fully provisioned cybersecurity labs\par
}
\vspace*{2\baselineskip}
\today
\vfill
\includegraphics[width=2in]{labtainer5-sm.png}
%\includegraphics[width=\linewidth, scale=0.50,natwidth=200, natheight=286]{labtainer5-sm.png}
\vfill
\end{titlepage}

\section {Introduction}
This manual is intended for use by instructors who assign and/or grade
labs using Labtainers.

Labtainers provide a consistent execution environment for performing
laboratory exercises, and can include execution of several different
computers interconnected via virtual networks.  Refer to our published
papers at \url{https://my.nps.edu/web/c3o/labtainers} for additional information
on the use of Labtainers.  And see the \underline{Lab Designer User Guide}"
at \url{https://github.com/oabuoun/Labtainers/raw/master/docs/labdesigner/labdesigner.pdf}
information on creating and maintaining Labtainer exercises.

The easiest way to get Labtainers is to use our pre-built VM available at the Labtainer
website \url{https://my.nps.edu/web/c3o/virtual-machine-images}.
Note that any Linux system can be used as long as it supports Docker,
and it can be used on \textit{Docker Desktop} installations on
Mac and Windows computers as an alternative to using the VM appliance.
If Labtainers is to be used on a system other than the pre-built VM,
refer to the \underline{Labtainer Student Guide} for information on
installing Labtainers.

Running Labtainers on servers, e.g., cloud deployments is discussed in
section \ref{servers}

\section{Assigning Labs}
Available labs are summerized and organized into broad categories at \url{https://nps.edu/web/c3o/labtainer-lab-summary1}.
Pior to assigning a lab, become familiar with it by reviewing the lab and its manual.

Student instructions for using Labtainers are in the \underline{Labtainer Student Guide}.
Students work from the {\tt labtainer-student} directory, i.e.,
\begin{verbatim}
    cd ~/labtainer/trunk/scripts/labtainer-student
\end{verbatim}
Available labs are listed via the {\tt labtainer} script:
\begin{verbatim}
    labtainer
\end{verbatim}
\noindent Start a lab by providing its name as an argument to the {\tt labtainer} command.
This will typically display a link to a lab manual, or will display a lab manual in one of
the resulting virtual terminals.  You can interact with the resulting computers just as a
student would.

\section{Assessing Lab Performance}
When the student stops a lab, i.e., using {\tt stoplab}, Labtainers creates a zip file of
student artifacts (including lab reports) and then displays the path to this zip file to
the student.  The easiest way for the student to forward this zip file to you is by starting
a browser on the Linux VM and either emailing you the zip file, or uploading the file
into an LMS, (e.g., Sakai).  Alternately, the student can define a shared folder in the VM
and copy the zip to the host computer.

Collect all of the lab zip files from each student into your Labtainer transfer directory, which
is typically at
\begin{verbatim}
    ~/labtainer_xfer/<labname>
\end{verbatim}
\noindent where labname is the name of the lab.  Do not unzip the files.  Alternately student
assignments can be bulk-collected from a learning management system (LMS) per Appendix \ref{lms collection}
and the resulting zip  would be copied into the
Labtainer transfer directory.  Again, do not unzip files and do not change the file names of zip files.
See subsection \ref{shared_labtainer_xfer} for how to manage the student zip files on your host computer.

Instructor assessment of labs takes place from the {\tt labtainer-instructor} directory, i.e.,
\begin{verbatim}
    cd ~/labtainer/trunk/scripts/labtainer-instructor
\end{verbatim}

\noindent Use the {\tt gradelab} command to assess results for a given lab:
\begin{verbatim}
    gradelab <labname>
\end{verbatim}
\noindent A table of lab results with one row per student and
a column for each goal will be displayed.  A description of the goals follows the table.
A web-based display of that data is available as described in subsection \ref{review-artifacts}.

Note that not all labs include automated assessment.  For those labs, you will see this
message:
\begin{verbatim}
  No automated assessment for this lab
\end{verbatim}
\noindent Even when no automated assessment is performed, you can still observe student performance
artifacts, e.g., the {\tt .bash\_history} file and files created by the student as described below in \ref{review-artifacts}.

Use the {\tt -r} option to perform a fresh grading, e.g., if you've removed files from the {\tt labtainer\_xfer} directory.
Sometimes zip files within the {\tt labtainer\_xfer} directory are corrupted.  If error messages indicate a bad zip file,
try removing it from the directory and then use the {\tt -r} option to perform a fresh grading.
Use the {\tt -u } option to update your gradelab to the latest image.

Student reports (if any) are  copied into
\begin{verbatim}
    ~/labtainer_xfer/<labname>/docs
\end{verbatim}
\noindent on the Linux host.  If LMS assignment collection is used, then student reports should
be looked for in
\begin{verbatim}
    ~/labtainer_xfer/<labname>/reports
\end{verbatim}
\noindent which also includes reports separately uploaded into the LMS.

\subsection{Review lab artifacts}
\label{review-artifacts}
An early release of a web-based tool for viewing details of student assessment
results and student artifacts is available by use of the {\tt -w} flag with the {\tt gradelab} command.  That causes
the grader container to listen on port 8008 of the Labtainer VM.  You can then open
a browser on that VM and go to {\tt localhost:8008}.  Alternately, use your host machine's browser
by setting port forwarding on your VM, (e.g., in VirtualBox, use Machine / Settings / Network / Advanced /
Port Forwarding to set host IP 127.0.0.1:8008 to map to guest IP 0.0.0.0:8008).

The table of goals displayed in the browser includes links to details of artifacts
created by the student when performing the lab.  For example, clicking on the student name displays a table
of all timestamped result artifacts.  That page includes a \textbf{History} heading with links to the
{\tt .bash\_history} files one each container.  And it includes a table with links to files in the student home directory
and links to result files, e.g., stdout from selected commands issued by the student.

Links within each goal table cell lead to pages whose content depends on the type of goals defined.  For example,
a goal whose value is defined by a boolean expression will lead to a table of all boolean values for each timestamp
for which results are present.

Definitions of different goal types and result types can be found in the \textit{Lab Designer Guide}.  Note that you need
not understand all of the displayed data in order to gain useful insight into student progress.  Some of the displayed information
requires an understanding of the Labtainers automated assessment configuration directives, and is made available in the displays
primarily in support of those developing automated assessment for labs.

\subsubsection{Artifacts on the grader container}
You can view all student results, including their original artifacts by using the {\tt -d} flag
with the {\tt gradelab} command.  This results in a virtual terminal connected to a grading
container that contains all student artifacts and results.  If you have not first run the
{\tt gradelab} command without the ``-d'' option, run {\tt instructor.py} from within the
virtual terminal to cause the zip files to be extracted.  A student's home directory can
then be found in
\begin{verbatim}
<student email>/<lab>.<container>.student
\end{verbatim}
\noindent There you will find the {\tt .bash\_history} file along with the student-created files.
Student artifacts collected by the framework are found in
\begin{verbatim}
<student email>/<lab>.<container>.student/.local/result
\end{verbatim}

\noindent The {\tt -d} option is also used when debugging automated assessment configuration
files.  You can create additional virtual terminals into the grading container by reissuing
the gradelab command with the {\tt -a} flag.  When you are finished, or wish to stop working, type:
\begin{verbatim}
    stoplab
\end{verbatim}

\section{Managing Labtainer Installations and Updates}
Any given Labtainers installation can be brought up to date to the latest version by using the
\begin{verbatim}
   update-labtainer.sh
\end{verbatim}
\noindent command from the {\tt labtainer-student} directory.  The current version of a Labtainer installation is seen by using:
\begin{verbatim}
   labtainer -v
\end{verbatim}
\noindent
The first time any given lab exercise is started, the latest version of that lab is automatically pulled from
the Docker Hub registry.
Note however that any given lab is not updated by the {\tt update-labtainer.sh} command once the lab has been started.
To update a specific lab to the latest version after it has been started the previous version of that lab must be deleted
using:
\begin{verbatim}
   removelab.py <labname>
\end{verbatim}
\noindent The next time the lab is started, the latest version will be retrieved from the Docker registry.

\noindent \\If you want to update the labtainer.grader docker image (and delete the previous image and grader containers) use:
\begin{verbatim}
   gradelab -u <labname>
\end{verbatim}

\subsection{Suggestions for student workflow}
A student's work on any given lab is preserved until and unless the student restarts the lab using the ``-r''
option on the {\tt labtainer <labname> -r} command.  When taking a break from work on a lab, the student can
either stop the lab using {\tt stoplab}, or simply pause the VM.  However, if the student wishes to perform other
Labtainer-related work on the VM, (e.g., revisit a previous lab), they should first use {\tt stoplab} for the current
lab.  When they restart the lab, none of their work will be lost.

\subsection{Deploying without the Internet}
Labtainers pulls Docker images from Docker Hub when a student first runs any given lab.  You can deploy
Labtainers within environments that have no Internet connection by first creating your own
VM template.  Start with the standard Labtainers VM, and run the script at
\begin{verbatim}
   $LABTAINER_HOME/setup_scripts/pull_lab.py
\end{verbatim}
\noindent to pull images for your desired labs onto the VM.  Then replicate that VM for each user, e.g., by
exporting it as an appliance.

Note that a few labs deliberately access the Internet, e.g., the public key lab.  You can either avoid use
of those labs, or alter them to direct students to alternate network addresses.

\subsection{Collecting student zip files on the host computer}
\label{shared_labtainer_xfer}
It is often more convenient for instructors to gather student zip files on the computer that hosts a Labtainers
VM rather than on the VM.  For example, email clients and/or LMS interfaces may run more easily on the host than
they do on the VM.  This can be achieved by defining a shared folder for use by the VM guest, as follows:
\begin{itemize}
\item Pick a directory on your host that you will share with the VM. Somewhere within that directory create a
{\tt labtainer\_xfer} subdirectory.
\item Make that directory accessible by anyone on your host machine.
\item Define a shared folder for your guest VM, e.g., on VirtualBox, use Machine / Settings / Shared folders, map it
to your selected directory.
\item On VirtualBox, ensure your user ID is within the vboxsf group, and reboot.
\begin{verbatim}
    sudo usermod -G vboxsf -a $USER
    sudo reboot
\end{verbatim}
\item On the virtual machine, identify the path to the {\tt labtainer\_xfer} directory in the shared folder.  For example,
if you shared a directory called {\tt mydir} on VirtualBox, that might be found at {\tt /media/sf\_mdir/labtainer\_xfer}.
\item From the \$HOME directory on the virtual machine, remove the {\tt labtainer\_xfer} directory and replace it with
a symbolic link to the shared {\tt labtainer\_xfer} directory, e.g.,
\begin{verbatim}
   cd
   ln -s /media/sf_mydir/labtainer_xfer
\end{verbatim}
\noindent depending on where you created the new {\tt labtainer\_xfer} directory within the shared folder.
\item Now place student zip files on the host within the {\tt labtainer\_xfer/<labname>} directory.  Note
the lab subdirectory will be created when you start the lab to run it yourself -- or you can create it manually.
\end{itemize}

\subsection{Deploying on servers}
\label{servers}
Labtainers can be deployed on servers and accessed by students using a web browser.  This assumes you have
access to suitable infrastructure and IT support.  Two general approaches are:
\begin{enumerate}
\item Virtual Desktop Infrastructure -- Use VDI products such as VMWare Horizon
to run Labtainer VMs. In these environments, each student is allocated a VM, and that VM's desktop is seen
by the student in the browser.  Students deliver their results to instructors by starting a browser
within the VM, e.g., to access an LMS or web-mail account.
\item \textit{Headless Labtainers} -- Labtainers are deployed as servers in a cloud and a \textit{NOVNC} desktop is
rendered using a web browser.  Access to the Labtainer server instance is via HTTP through an SSH tunnel.
Please see \url{https://raw.githubusercontent.com/oabuoun/Labtainers/master/headless-lite/README.md} for additional information,
including a sample cloud-config file.
\end{enumerate}

\section{Customizing Labtainers}
Creating new labs and modifying existing labs is described in the \textit{Labtainers Lab Designer User Guide}.
\url{https://github.com/oabuoun/Labtainers/raw/master/docs/labdesigner/labdesigner.pdf}

That guide also describes how to provide your students with custom versions of the lab manuals, and how to
publish new labs so that they can be incorporated into your student's Labtainers instances, and shared
with other educators.

\newpage
\appendix
\section{\\LMS Assignment Collection}
\label{lms collection}
\subsection{Sakai}
In the Sakai Assignments section, select the ``In / New'' entry for the appropriate assignment.
The resulting page should enumerate each student who has submitted an assignment.  In the upper right,
click the ``Download All'' link, and then click the ``Student submission attachment(s)'' option and
click the ``Download'' button.  Copy the resulting zip into the lab transfer directory
on the Linux host, i.e.,
\begin{verbatim}
    ~/labtainer_xfer/<labname>
\end{verbatim}
\noindent Do not unzip the file and do not change its file name.
You can then run the {\tt gradelab <labname>} command from the {\tt labtainer-instructor} directory.
In addition to the assessment summary, any student lab reports will be available in:
\begin{verbatim}
   ~/labtainer_xfer/<labname>/reports/<student name>
\end{verbatim}
\noindent Those reports will include any that the student separately uploaded into Sakai (it is
important to remind students to NOT change the name of lab report documents.)

\subsection{Moodle}
See the Moodle user guide at
\newline
\url{https://moodleuserguides.org/guides/bulk-download-assignment-submissions/}
for information on getting a bulk download, but DO NOT unzip the file.  Copy the resulting zip into the lab transfer directory
on the Linux host, i.e.,
\begin{verbatim}
    ~/labtainer_xfer/<labname>
\end{verbatim}
\noindent Do not unzip the file and do not change its file name.
You can then run the {\tt gradelab <labname>} command from the {\tt labtainer-instructor} directory.
In addition to the assessment summary, any student lab reports will be available in:
\begin{verbatim}
   ~/labtainer_xfer/<labname>/reports/<student name>
\end{verbatim}
\noindent Those reports will include any that the student separately uploaded into Moodle (it is
important to remind students to NOT change the name of lab report documents.)

\subsection{Other LMS}
Send me a sample of the bulk download file from other LMS systems and we'll roll it into a future Labtainers release. (mfthomps at nps.edu)
\end{document}


text:
\begin{itemize}
	\item 移动语义允许对对象的复制进行优化，它可以隐式使用(用于未命名的临时对象或局部返回值)，也可以显式使用(通过\textit{std::move()})。
	\item \textit{std::move()}表示不再需要这个值，它将对象标记为可移动的。标记为\textit{std::move()}的对象不会(部分地)销毁(析构函数仍然会调用)。
	\item 通过使用非\textit{const}右值引用(例如\textit{std::string\&\&})声明函数，可以定义一个接口，调用者在接口中从语义上声明不再需要传递的值。函数可以通过“窃取”这个信息来进行优化，或者对传递的参数做任何修改。通常，实现者还必须确保传递的参数在调用后处于有效状态。
	\item 移动的C++标准库的对象仍然是有效的对象，但其值为未定义。
	\item 拷贝语义用作移动语义的备选(如果拷贝语义支持的话)。如果没有采用右值引用的实现，则使用任何采用普通\textit{const}左值引用的实现(如：\textit{const std::string\&})。即使对象被显式地标记为\textit{std::move()}，也会使用备选方式。
	\item 对\textit{const}对象调用\textit{std::move()}通常没有效果。
	\item 如果按值(而不是按引用)返回，不要将返回值声明为\textit{const}。
\end{itemize}

\newpage


text:
\documentclass[tikz, convert={density=2000,size=1024,outname=image-512,outext=.png}, border=0pt]{standalone}

\usepackage{xcolor}
\usepackage{transparent}
\usepackage{tikz}

\newcommand{\ket}[1]{\ensuremath{\left\vert #1 \right\rangle}}
\newcommand{\bra}[1]{\ensuremath{\left\langle #1 \right\vert}}

\begin{document}
\begin{tikzpicture}
  \node (ket) at (0, 0) {$\vert{}\phantom{0}\rangle{}$};
  \node[opacity=.7] (zero) at (0, 0) {0};
  \node[opacity=.7] (one) at (0, 0) {1};
  \draw[opacity=1, outer sep=0pt, inner sep = 0pt] (-.2, -.2) rectangle (.2, .2);
\end{tikzpicture}
\end{document}

% Local Variables:
% TeX-command-extra-options: "-shell-escape"
% End:


text:
\documentclass[degree=bachelor, pifootnote, openright, oneside]{thuthesis}
% 选项
%   degree=[bachelor|master|doctor|postdoctor], % 必选，学位类型
%   secret,                % 可选（默认：关闭），是否有密级
%   tocarialchapter,       % 可选（默认：关闭），章目录中使用黑体（这项表示同时打开下面两项）
%   tocarialchapterentry,  % 可选（默认：关闭），单独控制章标题在目录中使用黑体
%   tocarialchapterpage,   % 可选（默认：关闭），单独控制章页码在目录中使用黑体
%   pifootnote,            % 可选（默认：关闭），页脚编号采用 pifont 字体符号，建议打开

% 所有其它可能用到的包都统一放到这里了，可以根据自己的实际添加或者删除。
\usepackage{thuthesis}

% 插入代码
\usepackage{listings}

% 定义所有的图片文件在 figures 子目录下
\graphicspath{{figures/}}

% 可以在这里修改配置文件中的定义。导言区可以使用中文。
% \def\myname{薛瑞尼}

\begin{document}

%%% 封面部分
\frontmatter
% \input{data/cover}
\input{custom/abstract}
\includepdf[pages=-]{custom/thesis-cover.pdf}
\makecover[custom/thesis-commit.pdf]
% 如果使用授权说明扫描页，将可选参数中指定为扫描得到的 PDF 文件名，例如：
% \makecover[scan-auth.pdf]

% 自定义封面
% 基于Cocos引擎的跨平台飞行射击游戏的设计与开发
% \includepdf[pages=-]{custom/thesis-cover.pdf}

% 自定义承诺书

%% 目录
\tableofcontents

%% 本科生要这几个索引，研究生不要。选择性留下。
% 插图索引
\listoffigures
% 表格索引
\listoftables
% 公式索引
% \listofequations

%% 符号对照表
\input{data/denotation}

%%% 正文部分
\mainmatter
\include{data/intro}
\include{data/chap01}
\include{data/chap02}
\include{data/chap03}
\include{data/chap04}
\include{data/chap05}

%%% 其它部分
\backmatter

%% 参考文献
% 注意：至少需要引用一篇参考文献，否则下面两行可能引起编译错误。
% 如果不需要参考文献，请将下面两行删除或注释掉。
% 数字式引用
\bibliographystyle{thuthesis-numeric}
% 作者-年份式引用
% \bibliographystyle{thuthesis-author-year}
\bibliography{ref/refs}

%% 致谢
\include{data/ack}

%% 附录
% \begin{appendix}
% \input{data/appendix01}
% \end{appendix}

\end{document}


text:
\input format.tex
\input defs.tex

%% begin presentation

\title{\large \bfseries Distributed Deep Q-Learning}

\author{Hao Yi Ong, Kevin Chavez, and Augustus Hong\\[3ex]
CME 323, Stanford University}

\date{June 3, 2015}

\begin{document}

\frame{
\thispagestyle{empty}
\titlepage
}

\section{Introduction}

\begin{frame}{Motivation}
  \begin{itemize}\itemsep=12pt

    \item long-standing challenge of reinforcement learning (RL)
    \vspace*{0.5em}
    \begin{itemize}
        \item control with high-dimensional sensory inputs (\eg, vision, speech)
        \item shift away from reliance on hand-crafted features
    \end{itemize}

    \item utilize breakthroughs in deep learning for RL \cite{M+:13,M+:15}
    \vspace*{0.5em}
    \begin{itemize}
        \item extract high-level features from raw sensory data
        \item learn better representations than handcrafted features with neural network architectures used in supervised and unsupervised learning
    \end{itemize}

    \item create fast learning algorithm
    \vspace*{0.5em}
    \begin{itemize}
        \item train efficiently with stochastic gradient descent (SGD)
        \item distribute training process to accelerate learning \cite{D+:12}
    \end{itemize}

  \end{itemize}
\end{frame}

\begin{frame}{Success with Atari games}
    \begin{figure}
        \centering
        \includegraphics[width=0.8\textwidth]{atari-ex1.png}
    \end{figure}
    \begin{figure}
        \centering
        \includegraphics[width=0.8\textwidth]{atari-ex2.png}
    \end{figure}
\end{frame}

\begin{frame}{Goals}
    distributed deep RL algorithm
    \vspace*{0.5em}
    \begin{itemize}\itemsep=12pt

        \item robust neural network agent
        \vspace*{0.5em}
        \begin{itemize}
            \item must succeed in challenging test problems
        \end{itemize}

        \item control policies with high-dimensional sensory input
        \vspace*{0.5em}
        \begin{itemize}
            \item obtain better internal representations than handcrafted features
        \end{itemize}

        \item fast training algorithm
        \vspace*{0.5em}
        \begin{itemize}
            \item efficiently produce, use, and process training data
        \end{itemize}

    \end{itemize}
\end{frame}

\section{Mathematical formulation}

\begin{frame}{Playing games}
    \begin{figure}
        \centering
        \includegraphics[width=0.8\textwidth]{background.pdf}
    \end{figure}
    \textbf{objective:} learned policy maximizes future rewards
    \[
        R_{t} = \sum_{t'=t}^{T} \gamma^{t'-t}r_{t'},
    \]
    \begin{itemize}
        \item discount factor $\gamma$
        \item reward change at time $t'$ $r_{t'}$
    \end{itemize}
\end{frame}

\begin{frame}{State-action value function}
    \begin{itemize}\itemsep=12pt

        \item basic idea behind RL is to estimate
        \[
            Q^{\star}\left(s, a\right) =
            \max_{\pi}\Expect\left[R_{t} \mid s_{t} = s, a_{t} = a, \pi \right],
        \]
        where $\pi$ maps states to actions (or distributions over actions)

        \item optimal value function obeys Bellman equation
        \[
            Q^{\star}\left(s,a\right) =
            \Expect_{s' \sim \mathcal{E}} \left[r + \gamma \max_{a'}Q^{\star}\left(s',a'\right)\mid s, a \right],
        \]
        where $\mathcal{E}$ is the MDP environment

    \end{itemize}
\end{frame}

\begin{frame}{Q-network}
    \begin{itemize}\itemsep=12pt

        \item trained by minimizing a sequence of loss functions
        \[
            L^{(i)}\left(\theta^{(i)}\right) =
            \Expect_{s,a \sim \rho\left(\cdot\right)}
            \left[\left(y^{(i)} - Q\left(s,a;\theta^{(i)}\right)\right)^{2}\right],
        \]
        with
        \vspace*{0.5em}
        \begin{itemize}
            \item iteration number $i$, $i$th network parameters $\theta^{(i)}$
            \item target $y^{(i)} = \Expect_{s'\sim\mathcal{E}}\left[ r + \gamma\max_{a'}Q\left(s',a';\theta^{(i-1)}\right) \mid s,a \right]$
            \item ``behavior distribution'' (exploration policy) $\rho\left(s,a\right)$
        \end{itemize}

        \item architecture varies according to application

    \end{itemize}
\end{frame}

\section{Serial algorithm}

\begin{frame}{Preprocessing}
    \begin{figure}
        \centering
        \includegraphics[width=0.9\textwidth]{process.pdf}
    \end{figure}
\end{frame}

\begin{frame}{Q-learning}
    \begin{itemize}\itemsep=12pt

        \item optimize Q-network loss function via
        \[
            Q\left(s,a\right) :=
            Q\left(s,a\right) +
            \alpha \left( r + \gamma\max_{a'}Q\left(s',a'\right) - Q\left(s,a\right) \right)
        \]

        \item trains optimal policy using ``behavior policy'' (off-policy)
        \vspace*{0.5em}
        \begin{itemize}
            \item learns policy $\pi^{\star}\left(s\right) = \argmax_{a}Q\left(s,a;\theta\right)$
            \item uses an $\epsilon$-greedy strategy (behavior policy) for state-space exploration
        \end{itemize}

    \end{itemize}
\end{frame}

\begin{frame}{Experience replay}
    a kind of short-term memory
    \vspace*{0.5em}
    \begin{itemize}\itemsep=12pt

        \item store agent's experiences at each time step
        \[
            e_{t} = \left(s_{t},a_{t},r_{t},s_{t+1}\right)
        \]

        \item experiences form a replay memory dataset
        \[
            \mathcal{D} = \left\{ e_{1}, \ldots, e_{N} \right\},
        \]
        where $N$ is the fixed memory capacity

        \item execute Q-learning updates with samples of experience
        \[
            e \sim \mathcal{D}
        \]

    \end{itemize}
\end{frame}

\begin{frame}{Serial deep Q-learning}
    \begin{tabbing}
        {\bf given} replay memory $\mathcal{D}$ with capacity $N$ \\*[\smallskipamount]
        {\bf initialize} Q-networks $Q$, $\hat{Q}$ with same random weights $\theta$ \\*[\smallskipamount]
        {\bf repeat} until timeout \\
            \qquad \= {\bf initialize} frame sequence $s_{1}=\left\{ x_{1} \right\}$ and preprocessed state $\phi_{1} = \phi\left(s_{1}\right)$ \\
            \> for \(t\) = 1, \(\ldots\) , \(T\) \\
            \qquad \qquad \= 1.\ select action $ a_{t} = \bigg\{
            \begin{tabular}{ll}
                $\max_{a}Q\left(\phi\left(s_{t}\right),a;\theta\right)$ & w.p. $1 - \epsilon$ \\
                \text{random action} & otherwise
            \end{tabular} $ \\
            \> 2.\ execute action $a_{t}$ and observe reward $r_{t}$ and frame $x_{t+1}$ \\
            \> 3.\ append $s_{t+1} = \left(s_{t}, a_{t}, x_{t+1}\right)$ and preprocess $\phi_{t+1} = \phi\left(s_{t+1}\right)$ \\
            \> 4.\ store experience $\left(\phi_{t},a_{t},r_{t},\phi_{t+1}\right)$ in $\mathcal{D}$ \\
            \> 5.\ uniformly sample minibatch $\left( \phi_{j},a_{j},r_{j},\phi_{j+1} \right) \sim \mathcal{D}$ \\
            \> 6.\ set $ y_{j} = \bigg\{
            \begin{tabular}{ll}
                $r_{j}$ & if $\phi_{j+1}$ terminal \\
                $r_{j} + \gamma\max_{a'}\hat{Q}\left(\phi_{j+1},a';\theta\right)$ & otherwise
            \end{tabular} $ \\
            \> 7.\ perform gradient descent step for $Q$ on minibatch \\
            \> 8.\ every C steps reset $\hat{Q} = Q$
    \end{tabbing}
\end{frame}

\section{Distributed algorithm}

\begin{frame}{Model parallelism}
    for each Q-network
    \vspace*{0.5em}
    \begin{itemize}\itemsep=12pt

        \item partition model across CPUs/GPUs
        \vspace*{0.5em}
        \begin{itemize}
            \item up to availability of CPU/GPU resources
            \item uses Caffe deep learning framework
        \end{itemize}

        \item \todo{Kevin/Hao Yi: How does caffe use CPU/GPU resources? How does complexity scale for implementation? Answers question of how our algorithm scale for model.}

    \end{itemize}
\end{frame}

\begin{frame}{Data parallelism}
    \textbf{downpour SGD:} generic asynchronous distributed SGD
    \begin{figure}
        \centering
        \includegraphics[width=0.8\textwidth]{data-par.pdf}
    \end{figure}
\end{frame}

\begin{frame}{Implementation}
    \begin{itemize}\itemsep=12pt

        \item data shards are generated locally on each model worker in real-time
        \vspace*{0.5em}
        \begin{itemize}
            \item data is stored independently for each worker
            \item since game emulation is simple, generating data is fast
            \item simple fault tolerance approach: regenerate data if worker dies
        \end{itemize}

        \item algorithm scales very well with data
        \vspace*{0.5em}
        \begin{itemize}
            \item since data lives locally on workers, no data is sent
        \end{itemize}

    \end{itemize}
\end{frame}

\begin{frame}{Implementation}
    \begin{itemize}\itemsep=12pt

        \item bottleneck is parameter update time on parameter server
        \vspace*{0.5em}
        \begin{itemize}
            \item \eg, if parameter server gradient update takes 2 ms, then we can only do up to 500 updates per second (using buffers, etc.)
        \end{itemize}

        \item trade-off between parallel updates and model staleness
        \vspace*{0.5em}
        \begin{itemize}
            \item because worker is likely using a stale model, the updates are ``noisy'' and not of the same quality as in serial implementation
        \end{itemize}

    \end{itemize}
\end{frame}

\begin{frame}{Implementation}
    communication pattern
    \vspace*{0.5em}
    \begin{itemize}\itemsep=12pt

        \item one-to-all and all-to-one, but asynchronous for every minibatch

        \item like multiple asynchronous all-reduces

    \end{itemize}
\end{frame}

\section{Numerical experiments}

\begin{frame}{Evaluation}
    \begin{figure}
        \centering
        \includegraphics[height=0.6\textheight]{snake.png}
    \end{figure}
\end{frame}

\begin{frame}{Snake}
    \begin{itemize}\itemsep=12pt

        \item parameters
        \vspace*{0.5em}
        \begin{itemize}
            \item snake length grows with number of apples eaten
            \item one apple at any time, regenerated once eaten
            \item $n \times n$ array, with walled-off world
            \item want to maximize score, equal to snake length
        \end{itemize}

        \item complexity
        \vspace*{0.5em}
        \begin{itemize}
            \item four possible states for each cell: $\left\{ \mbox{empty, head, body, apple} \right\}$
            \item state space cardinality is $O\left(n^{8}\right)$
            \item four possible actions: $\left\{ \mbox{north, south, east, west} \right\}$
        \end{itemize}

    \end{itemize}
\end{frame}

\begin{frame}{Results}

\end{frame}

\section{Conclusion}

\begin{frame}{Summary}

\end{frame}

\section*{}

\begin{frame}[allowframebreaks]{References}
    \bibliography{IEEEabrv,slides}
\end{frame}

\section*{Appendix}

\begin{frame}{Theoretical complications}
    deep learning algorithms require
    \vspace*{0.5em}
    \begin{itemize}\itemsep=12pt

        \item huge training datasets

        \item independence between samples

        \item fixed underlying data distribution

    \end{itemize}
\end{frame}

\begin{frame}{Deep Q-learning}
    avoids theoretical complications
    \vspace*{0.5em}
    \begin{itemize}\itemsep=12pt

        \item greater data efficiency
        \vspace*{0.5em}
        \begin{itemize}
            \item each experience potentially used in many weight udpates
        \end{itemize}

        \item reduce correlations between samples
        \vspace*{0.5em}
        \begin{itemize}
            \item randomizing samples breaks correlations from consecutive samples
        \end{itemize}

        \item experience replay averages behavior distribution over states
        \vspace*{0.5em}
        \begin{itemize}
            \item smooths out learning
            \item avoids oscillations or divergence in gradient descent
        \end{itemize}

    \end{itemize}
\end{frame}

\end{document}


text:
% what have been done
% what have been proved
% what are the further research topics to be covered

На языке Go была разработана структура данных сжатый суффиксный массив (CSA), имеющая
функционал традиционного suffix array, позволяющего решать задачи поиска по подстрокам.
Реализован алгоритм Elias-Fano, позволяющий представлять индекс в сжатом виде.
Построены сравнительные характеристики работы по построению и поиску подстроки
для CSA и suffix array для текстов различного содержания.
Изучена зависимость потребляемой памяти структурами данных от размеров исходного текста.
Произведено сравнение radix tree с этими структурами по времени построения и поиска подстроки,
а также по затраченной памяти.

С точки зрения потребляемой памяти CSA показал свою эффективность по сравнению с suffix array и radix tree,
но разработанный алгоритм построения индекса и поиска подстроки является менее быстрым,
чем аналогичные алгоритмы в традиционном suffix array. Рассмотрена применимость CSA на реальных
прикладных задачах, в том числе поиск подстроки в белковой последовательности
и pattern matching в ДНК-коде, используемые в биоинформатике.
Показана эффективность поиска подстроки при помощи radix tree,
подчеркнута сложность его использования для текстовых данных из-за больших
затрат памяти при построении дерева.

Дальнейшие исследования в этой области могут опираться на разработку сжатых представлений существующих
классических структур данных. Применение методов сжатия,
таких как рассмотренный в этой работе алгоритм Elias-Fano, может позволить производить сжатое представление
данных различного типа, предварительно преобразованных к нужному формату.
На основании экспериментов выявлены достоинства и недостатки исследуемых алгоритмов и структур данных
для работы над реальными прикладными задачами.
Сжатые структуры данных могут быть задействованы в работе алгоритмов,
использующих хранение индекса во внешней памяти. Эта тема является малоизученной, поэтому
сжатие индекса представляет особый интерес в области индексирования по подстрокам во внешней памяти.


text:
\subsection{Database Design}\label{InitialDesign}

In section \ref{currentState}, we outlined how the code from last year was left in an unfinished and undocumented state. Because of this, we estimated that starting over would give more value to the pipeline rather than spending time trying to understand and document it.

As mentioned in section \ref{ORM}, we opted to use EF Core to communicate with the database from the C\# application.

Despite the many advantages of this approach, it resulted in a database design that had major space issue.
In our rush to quickly implement the redesign, we unfortunately overlooked how to effectively store words from articles.

At this stage, we stored every single word in the database without regard for duplicates, which took up more space than necessary. Therefore, it was not of the third normal form, and not in BCNF either.
Ideally, we should instead have stored each word only once with an associated counter for how many times the given word appeared in an article.
We realized that this was not an optimal approach and decided to address these in future sprints.

The current database design is captured in the ER-diagram in figure \ref{newdatabaseER}.

\begin{figure}[htb!]
    \centering
    \includegraphics[scale=0.6]{Images/DbRedesign.png}
    \caption{ER diagram of the new database model.}
    \label{newdatabaseER}
\end{figure}

%\vspace{2cm}


text:
\documentclass[a4paper]{article}
\PassOptionsToPackage{quiet}{xeCJK}
\usepackage{ctex}
\usepackage{lmodern}
\usepackage{xeCJK}
\usepackage{lipsum}
\usepackage{setspace}
\usepackage{forest}
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage[margin=1in]{geometry}
\usepackage[hidelinks]{hyperref}
\usepackage[noend,ruled,noline]{algorithm2e}
\title{\heiti\zihao{2} 算法设计与分析}
\author{\songti CS2008班   U202015533  徐瑞达}
\date{2022.04.20}
\begin{document}
\maketitle
\tableofcontents
\newpage
\section{动态规划作业}
\subsection{计算题}
\subsubsection{15.2-1}
\paragraph
{
    Question:$\\$
        对矩阵规模序列$(5,10,3,12,5,50,6)$，求矩阵链最优括号化方案。
}
\paragraph
{
    Answer:$\\$
    $((5\times 10)(10\times 3))(((3\times 12)(12\times 5))((5\times 50)(50\times 6)))$.
}
\subsubsection{15.4-1}
\paragraph
{
    Question:$\\$
        求$\langle 1,0,0,1,0,1,0,1 \rangle$和$\langle 0,1,0,1,1,0,1,1,0 \rangle$的一个$LCS$。
}
\paragraph
{
    Answer:$\\$
    $\langle 1,0,0,1,1,0 \rangle$或者$\langle 1,0,1,0,1,0 \rangle$.
}
\subsubsection{15.5-2}
\paragraph
{
    Question:$\\$
    若7个关键字的概率如下表所示，求其最优二叉搜索树的结构和代价。
}
\subparagraph{}
\begin{table}[htb]
    \begin{center}
        \begin{tabular}{ccccccccc}
            $i$   & 0    & 1    & 2    & 3    & 4    & 5    & 6    & 7    \\
            \hline
            $p_i$ &      & 0.04 & 0.06 & 0.08 & 0.02 & 0.10 & 0.12 & 0.14 \\
            $q_i$ & 0.06 & 0.06 & 0.06 & 0.06 & 0.05 & 0.05 & 0.05 & 0.05
        \end{tabular}
    \end{center}
\end{table}
\paragraph
{
    Answer:$\\$
        代价为3.12。$\\$
    结构如下:$\\$
}
\begin{forest}
    [$k_5$[$k_2$[$k_1$[$d_0$][$d_1$]][$k_3$[$d_2$][$k_4$[$d_3$][$d_4$]]]][$k_7$[$k_6$[$d_5$][$d_6$]][$d_7$]]]
\end{forest}
\subsection{算法设计题}
\subsubsection{15.1-3}
\paragraph
{
    Question:$\\$
        我们对钢条切割问题进行一点修改，除了切割下的钢条段具有不同价格$p_i$外，
        每次切割还要付出固定的成本$c$。这样，切割方案的收益就等于钢条段的价格之和减去切割的成本。
    设计一个动态规划算法解决修改后的钢条切割问题。
}
\paragraph
{
    Answer:$\\$
        修改BOTTOM-UP-CUT-ROD算法如下:除了最后一次迭代(此时$i=j$，没有切割)，
        都需要在循环中的每次迭代中考虑成本$c$，令循环在$j-1$处即结束而非$j$，
        保证$c$从候选收入中减去，然后选择当前最佳收入$q$和$p[j]$中的较大值。
}
\subsubsection{15-9}
\paragraph
{
    Question:$\\$
        （字符串拆分）某种字符串处理语言允许程序员将一个字符串拆分为两段。由于此操作需
        要复制字符串，因此要花费个时间单位来将一个$n$个字符的字符串拆为两段。假定一个
        程序员希望将一个字符串拆分为多段，拆分的顺序会影响所花费的总时间。例如，假定这
        个程序员希望将一个$20$个字符的字符串在第$2$个、第$8$个以及第$10$个字符后进行拆分
        (字符由左至右，从$1$开始升序编号)。如果她按由左至右的顺序进行拆分，则第一次拆分
        花费$20$个时间单位，第二次拆分花费$18$个时间单位（在第$8$个字符处拆分$3~20$间的字符
        串），而第三次拆分花费$12$个时间单位，共花费$50$个时间单位。但如果她按由右至左的
        顺序进行拆分，第一次拆分花费$20$个时间单位，第二次拆分花费$10$个时间单位，而第三
        次拆分花费$8$个时间单位，共花费$38$个时间单位。还可以按其他顺序，比如，她可以首
        先在第$8$个字符处进行拆分(时间$20$)，接着在左边一段第$2$个字符处进行拆分(时间$8$)，
        最后在右边一段第$10$个字符处进行拆分(时间$12$)，总时间为$40$。$\\$
    设计算法，对给定的拆分位置，确定最小代价的拆分顺序。更形式化地，给定一个
    个字符的字符串$S$和一个保存$m$个拆分点的数组$L[1\dots m]$,计算拆分的最小代价，以及
    最优拆分序列。
}
\paragraph
{
Answer:$\\$
    可以根据将数组分割为连续的子数组将问题分为若干个子问题，并尝试使用最小的花费来完成每次可能的分割。
    因为需要进行m次拆分，而且最多有$m^2$中可能的拆分顺序，因此解的复杂度为$O(m^3)$，另外，因为每次添加数字的复杂度为$O(n)$，
    循环中的每次迭代会消耗时间$O(\lg n+\lg m)$，因此，最终的运行时间为$O(m^3\lg n)$。该算法会返回拆分的最小代价和最优拆分序列。$\\$
例如，对于拆分点数组$L=[2,5,10]$，$S=25$，调用方法为Algorithm(L,0,len(L),0,S)。
}
\subsubsection{15-11}
\paragraph
{
    Question:$\\$
        （库存规划）Rinky Dink公司是一家制造溜冰场冰面修整设备的公司。这种设备每个月
        的需求量都在变化，因此公司希望设计一种策略来规划生产，需求是给定的，即它虽然
        是波动的，但是可预测的。公司希望设计接下来$n$个月的生产计划。对第$i$个月，公司知
        道需求$d$,即该月能够销售出去的设备的数量。令$$D=\sum_{i=1}^{n}d_i$$，为后$n$个月的总需求。
        公司雇用的全职员工，可以提供一个月制造$m$台设备的劳动力。如果公司希望一个月内制造
        多于$m$台设备，可以雇用额外的兼职劳动力，雇用成本为每制造一台机器付出$c$美元。
        而且，如果在月末有设备尚未售出，公司还要付出库存成本。保存$j$台设备的成本可描
        述为一个函数$h(j)$，$j=1,2,\dots,D$，其中对所有$1\leq j\leq D$，$h(j)\geq 0$，对$1\leq j\leq D-1$，$h(j)\leq h(j+1)$。
        $\\$设计库存规划算法，在满足所有需求的前提下最小化成本。算法运行时间应为$n$和
        $D$的多项式函数。
}
\paragraph
{
    Answer:$\\$
        可以根据整数$i\in[n]$和$j\in[D]$划分子问题。$i$表示已经过去了多少个月，也即，只需考虑$(d_i,\dots,d_n)$，$j$
        表示我们最初储备了多少台设备，然后使用递推式得出从$1$到$[D]$中所有可能的制造设备数。因为子问题数量复杂度为$O(nD)$，
        而且当解决某个子问题时，我们只需从$D$种选择中选取花费最小的方案，因此最终的运行时间为$O(nD^2)$。
}
\subsection{证明题}
\subsubsection{15.2-5}
\paragraph
{
    Question:$\\$
        令$R(i,j)$表示在一次调用MATRIX-CHAIN-ORDER过程中，计算其他表项时访问表项$m[i,j]$的次数。
    证明：
    $$\sum_{i=1}^{n}\sum_{j=i}^{n}R(i,j)=\frac{n^3-n}{3}$$
}
\paragraph
{
    Answer:$\\$
}
\begin{align*}
    \sum_{l=2}^{n}\sum_{i=1}^{n-l+1}\sum_{k=i}^{i+l-2}2 & =\sum_{l=2}^{n}\sum_{i=1}^{n-l+1}2(l-1)   \\
                                                        & =\sum_{l=2}^{n}2(l-1)(n-l+1)              \\
                                                        & =\sum_{l=1}^{n-1}2l(n-l)                  \\
                                                        & =2n\sum_{l=1}^{n-1}l-2\sum_{l=1}^{n-1}l^2 \\
                                                        & =n^2(n-1)-2\cdot\frac{(n-1)n(2n-1)}{6}    \\
                                                        & =n^3-n^2-\frac{2n^3-3n^2+n}{3}            \\
                                                        & =\frac{n^3-n}{3}                          \\
\end{align*}
\subsubsection{15.3-6}
\paragraph
{
Question:$\\$
    假定你希望兑换外汇，你意识到与其直接兑换，不如进行多种外币的一系列兑换，最后
    兑换到你想要的那种外币，可能会获得更大收益。假定你可以交易$n$种不同的货币，编
    号为$1,2,\dots,n$,兑换从1号货币开始，最终兑换为$n$号货币。对每两种货币$i$和$j$,
    给定汇率$r_{ij}$,意味着你如果有$d$个单位的货币$i$,可以兑换$dr_{ij}$个单位的货币$j$。
    进行一系列的交易需要支付一定的佣金，金额取决于交易的次数。令$c_{k}$表示$k$次交易需要支付
    的佣金。证明：如果对所有$k=1,2,\dots,n,c_{k}=0$,那么寻找最优兑换序列的问题具
    有最优子结构性质。然后请证明：如果佣金$c_{k}$为任意值，那么问题不一定具有最优子结
    构性质。
    }
    \paragraph
    {
    Answer:$\\$
首先假设佣金为0，设$k$表示最佳交易序列$s$中出现的货币，取值为1~$n$号，$p_{k}$表示该序列中的第一部分(货币从1号到$k$号)，而$q_{k}$表示该序列中的其余部分。
那么$p_{k}$和$q_{k}$分别表示从1号到$k$号和从$k$号到$n$号的最佳交易序列。为了证明之，假设$p_{k}$不是最优的，而$p_{k}^{'}$是最优的。那么通过序列$p_{k}^{'}q_{k}$得到
的序列将比$s$更优，这与$s$是最优的相矛盾，$q_{k}$同理可证。$\\$
    现在假设佣金可以取任意值，假设有1号到6号的货币，且$r_{12}=r_{23}=r_{34}=r_{45}=2,r_{13}=r_{35}=6$,其余交易均为100，
    令$c_1=0,c_2=1$，且对于$k\geq 3$有$c_k=10$。$\\$
在这种情况下的最优解是$1\rightarrow 3,3\rightarrow 5$，此时花费为13。
而$1\rightarrow 3$的最优解为$1\rightarrow 2,2\rightarrow 3$，此时花费为5。$3\rightarrow 5$的最优解为$3\rightarrow 4,4\rightarrow 5$，此时花费为5。
组合这两个子情况最优解时需要花费更多代价，总花费为18，这不是最优解，因此不具有最优子结构性质。
}
\section{贪心作业}
\subsection{题目}
\subsubsection{16.1-4}
\paragraph
{
    Question:$\\$
        假定有一组活动，我们需要将它们安排到一些教室，任意活动都可以在任意教室进行。
        我们希望使用最少的教室完成所有活动。设计一个高效的贪心算法求每个活动应该在哪
        个教室进行。
        (这个问题称为$\textbf{区间图着色问题}$(interval-graph color problem)。我们可以构造一个区间
    图，顶点表示给定的活动，边连接不兼容的活动。要求用最少的颜色对顶点进行着色，
    使得所有相邻顶点颜色均不相同一这与使用最少的教室完成所有活动的问题是对应的。)
}
\paragraph
{
    Answer:$\\$
        用$F$表示可供使用且已经被使用过的一组教室，用$B$表示当前繁忙的一组教室。以开始时间对这些活动进行排序，当遇到一个新的活动时，从$F$中移除一个教室，并在该教室中安排该活动，将其加入B中。
    如果F为空，向F中添加一个从未被使用的教室，当一个活动结束时，将其从B中移除并放到F中，这就是最优方案。
}
\subsubsection{16.2-7}
\paragraph
{
Question:$\\$
    给定两个集合$A$和$B$,各包含$n$个正整数。你可以按需要任意重排每个集合。重排后，
    令$a_i$为集合$A$的第$i$个元素，$b_i$为集合B的第$i$个元素。于是你得到回报$$\prod_{i=1}^{n}a_{i}^{b_i}$$
    设计算法最大化你的回报。证明你的算法是正确的，并分析运行时间。
    }
    \paragraph
    {
    Answer:$\\$
        由于集合具有无序性，不影响回报，可假设$A$是升序排列。则可以证明当$B$也是升序排列时回报最大化。
        假设不是如此，也即，存在$i<j$使得$a_i<a_j$且$b_i>b_j$，然后只考虑$i$和$j$对回报的贡献，也即，$a_i^{b_i}a_j^{b_j}$，
        然后，如果交换$b_i$和$b_j$的次序，那么贡献为$a_i^{b_j}a_j^{b_i}$，可见后者比前者大，因为有$(\frac{a_j}{a_i})^{b_i-b_j}>1$,
        因此，可得在这种次序下得到的回报不是最大化的。
        }
        \subsubsection{16.3-3}
        \paragraph
        {
            Question:$\\$
                如下所示，8个字符对应的出现频率是斐波那契数列的前8个数，此频率集合的赫夫曼编码是怎样的？
                \textbf{$\\a:1\quad b:1\quad c:2\quad d:3\quad e:5\quad f:8\quad g:13\quad h:21\\$}
                你能否推广你的结论，求频率集为前$n$个斐波那契数的最优前缀码？
        }
        \paragraph{Answer:}
        \subparagraph{}
        \begin{table}[htb]
            \begin{center}
                \begin{tabular}{c|c}
                    $a$ & 1111111 \\
                    $b$ & 1111110 \\
                    $c$ & 111110  \\
                    $d$ & 11110   \\
                    $e$ & 1110    \\
                    $f$ & 110     \\
                    $g$ & 10      \\
                    $h$ & 0       \\
                \end{tabular}
            \end{center}
        \end{table}
        \paragraph{推广:$\\$}
        \paragraph{$T_2.left=c_2,T_2.right=c_1,T_2.freq=c_1.freq+c_2.freq=2$}
        \paragraph{$(\forall i;3\leq i\leq n)T_i.left=c_i,T_i.right=T_{i-1},T_i.freq=c_i.freq+T_{i-1}.freq$}
\subsubsection{16-1}
\paragraph
{
    Question:$\\$
        （找零问题）考虑用最少的硬币找$n$美分零钱的问题。假定每种硬币的面额都是整数。
    $a.$设计贪心算法求解找零问题，假定有25美分、10美分、5美分和1美分4种面额的硬
        币。证明你的算法能找到最优解。
    $b.$假定硬币面额是$c$的幂，即面额为$c^0,C^1,\dots,c^k,c$和$k$为整数，$c>1,k\geq 1$。
        证明：贪心算法总能得到最优解。
    $c.$设计一组硬币面额，使得贪心算法不能保证得到最优解。这组硬币面额中应该包含1美
        分，使得对每个零钱值都存在找零方案。
    $d.$设计一个$O(nk)$时间的找零算法，适用于任何$k$种不同面额的硬币，假定总是包含1美
    分硬币。
}
\paragraph
{
    Answer:$\\$
    $a.$总是给最大面额的硬币，重复该过程，直到剩余的零钱为0。$\\$
    $b.$假设存在最优解$(x_0,x_1,\dots,x_k)$，其中$x_i$表示面值为$c_i$的零钱的数量，
    则对于$i<k$应有$x_i<c$。假设存在$x_i$使得$x_i>c$，那么可以以$c$为递减量减小$x_i$，以1为递减量减小$x_{i+1}$，
    这个硬币的集合的总值相同，却只包含$c-1$个硬币，所以前者方案不是最优的，相互矛盾，因此得证。$\\$
    $c.$令货币面额为${1,3,4}$，要找6美分硬币，贪心算法得到的结果为${1,1,4}$，而最优解决方案应为${3,3}$。$\\$
    $d.$参考动态规划算法$MAKE-CHANGE(S,v)$，由于第一个for循环执行$n$次，内部for循环执行$k$次，之后的while循环执行最多n次，因此最终的时间为$O(nk)$。
}
\subsubsection{思考题}
\paragraph
{
    Question:$\\$
        求以下背包问题的最优解:$n=7,M=15,(p_1,\dots,p_7)=(10,5,15,7,6,18,3),(w_1,\dots,w_7)=(2,3,5,7,1,4,1)$
}
\paragraph
{
    Answer:$\\$
        排序得到$p_5/w_5>p_1>w_1>p_6/w_6>p_3/w_3>p_7/w_7>p_2/w_2>p_4/w_4$，
        因此得到结果为$X=(1,\frac{2}{3},1,0,1,1,1)$，$F(M)=\frac{166}{3}$。
}
\end{document}