文章样式

标题一

标题二

标题三

小车正穿行在洛基山脉蜿蜒曲折的盘山公路上,克里朵托夫里维静静地看着窗外,发现车子每当行驶到无路的关头,路边都会出现一块交通指示牌:“前方转弯”或写着“注意急转弯”。而转过每一道弯道之后前方照例又是一片柳暗花明、豁然开朗。山路弯弯、峰回路转,“前方转弯”几个大字一次次冲击着他的眼球,也渐渐敲醒了他的心扉。原来不是路已到了尽头,而是该转弯了……路在脚下,更在心中,心随路转,心路常宽。学会转弯也是人生的智慧,因为挫折往往是转折,危机同时是转机。

代码样式

Create a new post

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
deploy:
- type: git
repo: # 像这样设置多个 git 仓库,`名称: 地址,分支`,逗号后面没有空格。
github: git@github.com:XXXXXX/XXXXXX.git,branch
coding: git@git.coding.net:XXXXXXX/XXXXXXX,coding-pages
message: Site updated by Hexo at {{ now('YYYY-MM-DD HH:mm:ss') }}.
- type: rsync
host: YOUR VPS IP # 你的服务器的 IP 地址
user: YOUR USERNAME # 你刚刚复制密钥的那个用户
root: YOUR DESTINATION # 你想把文件上传到哪里,比如我的是 `~/stackharbor.alynx.xyz/`
port: 22 # 这是 ssh 默认的端口,如果你修改了,这里也要改
args: --progress # 额外的 rsync 参数,我这里添加了一个进度条参数,你也可以不设置
delete: true # 是否删除旧的文件
verbose: true # 是否同步时显示详细状态
ignore_errors: false # 忽略错误

Bash

1
2
3
4
$ hexo server
$ hexo generate
$ hexo deploy
$ hexo server

More info: Server

Generate static files

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
* Created by y0n on 2017/4/18.
* 1.编写一个代表地址的Address类,地址信息由国家,身份,城市,街道,邮编组成
* 并可以返回完整的地址信息
*/
public class JavaDay002_1 {
String Country;
String Identifiy;
String City;
String Street;
String Stamp;
public void setCountry(String country) {
Country = country;
}
public void setIdentifiy(String identifiy) {
Identifiy = identifiy;
}
public void setCity(String city) {
City = city;
}
public void setStreet(String street) {
Street = street;
}
public void setStamp(String stamp) {
Stamp = stamp;
}
public String getCountry() {
return Country;
}
public String getIdentifiy() {
return Identifiy;
}
public String getCity() {
return City;
}
public String getStreet() {
return Street;
}
public String getStamp() {
return Stamp;
}
public static void main(String []args)
{
JavaDay002_1 address = new JavaDay002_1();
address.setCountry("Chain");
address.setIdentifiy("Student");
address.setCity("Beijing");
address.setStreet("XinFuRoad");
address.setStamp("402310");

System.out.println("地址:" +
address.getCountry() + "_" +
address.getIdentifiy() + "_" +
address.getCity() + "_" +
address.getStreet() + "_" +
address.getStamp());
}
}

/**
* Created by y0n on 2017/4/18.
* 2.设计一个Dog类,有名字,颜色,年龄等属性,定义构造方法来初始化类的这些属性,
* 定义方法输出Dog信息,编写应用程序使用Dog类
*/
public class JavaDay002_2 {

String strName;
String strColor;
String strAge;
public JavaDay002_2(String strName, String strColor, String strAge) {
this.strName = strName;
this.strColor = strColor;
this.strAge = strAge;
}

void ShowDog()
{
System.out.println("此狗叫" + strName + "," + strColor + "色," + strAge + "岁");
}

public static void main(String []args)
{
JavaDay002_2 Dog = new JavaDay002_2("旺财", "白", "2");
Dog.ShowDog();
}
}

/**
* Created by y0n on 2017/4/18.
* 3.定义一个数组,它可以存储一个矩形,三角形,圆形
* 一个双精度数或一个整数
*/
public class JavaDay002_3 {
int Rectangle(int length, int wight)
{
return length * wight;
}
int Trangle(int aSide, int bSide, int cSide)
{
int s = (aSide + bSide + cSide) / 2;
double area = (double) (s * (s - aSide) * (s - bSide) * (s - cSide));
return (int) Math.pow(area, 0.5);
}
int Round(int redis)
{
return (int) (redis * redis * 3.14);
}
int IntNumber(int nNum)
{
return nNum;
}
public static void main(String []args)
{
JavaDay002_3 array = new JavaDay002_3();

System.out.println("矩形:" + array.Rectangle(3, 4)
+ " 三角形:" + array.Trangle(3, 4, 5)
+ " 圆:" + array.Round(2)
+ " 整数:" + array.IntNumber(5));
}
}

/**
* Created by y0n on 2017/4/18.
* 4.定义一个抽象类Shape,用类标示二维图形,
* Shape具有抽象方法area和perimeter,分别用来计算形状的面积和周长,
* 定义一些二维形状类(矩形,三角形,圆)
* 这些类都是Shape类的子类
*/
public abstract class JavaDay002_4 {
abstract int area();
abstract int perimeter();
}

class Rect extends JavaDay002_4
{
int length;
int wight;
public int getLength() {
return length;
}

public void setLength(int length) {
this.length = length;
}

public int getWight() {
return wight;
}

public void setWight(int wight) {
this.wight = wight;
}

@Override
int area() {

return length * wight;
}

@Override
int perimeter() {
return (length + wight) * 2;
}
}


More info: Generating

Deploy to remote sites

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
$con = mysql_connect("localhost", "hello", "321");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db("test_db",$con);

$sql = "SELECT * from Person";
$result = mysql_query($sql,$con);

while ($property = mysql_fetch_field($result))
{
echo "Field name: " . $property->name . "<br />";
echo "Table name: " . $property->table . "<br />";
echo "Default value: " . $property->def . "<br />";
echo "Max length: " . $property->max_length . "<br />";
echo "Not NULL: " . $property->not_null . "<br />";
echo "Primary Key: " . $property->primary_key . "<br />";
echo "Unique Key: " . $property->unique_key . "<br />";
echo "Mutliple Key: " . $property->multiple_key . "<br />";
echo "Numeric Field: " . $property->numeric . "<br />";
echo "BLOB: " . $property->blob . "<br />";
echo "Field Type: " . $property->type . "<br />";
echo "Unsigned: " . $property->unsigned . "<br />";
echo "Zero-filled: " . $property->zerofill . "<br /><br />";
}

mysql_close($con);
?>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import threading
import time

class myThread (threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print "Starting " + self.name
# 获得锁,成功获得锁定后返回True
# 可选的timeout参数不填时将一直阻塞直到获得锁定
# 否则超时后将返回False
threadLock.acquire()
print_time(self.name, self.counter, 3)
# 释放锁
threadLock.release()

def print_time(threadName, delay, counter):
while counter:
time.sleep(delay)
print "%s: %s" % (threadName, time.ctime(time.time()))
counter -= 1

threadLock = threading.Lock()
threads = []

# 创建新线程
thread1 = myThread(1, "Thread-1", 1)
thread2 = myThread(2, "Thread-2", 2)

# 开启新线程
thread1.start()
thread2.start()

# 添加线程到线程列表
threads.append(thread1)
threads.append(thread2)

# 等待所有线程完成
for t in threads:
t.join()
print "Exiting Main Thread"

html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225




<!DOCTYPE html>
<html lang="zh-cn">
<head>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-878633-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-878633-1');
</script>

<meta charset="gbk" />
<meta name="robots" content="all" />
<meta name="author" content="w3school.com.cn" />
<link rel="stylesheet" type="text/css" href="/c5_20171220.css" />
<link rel=icon type="image/png" sizes="16x16" href="/ui2017/logo-16.png">
<link rel=icon type="image/png" sizes="32x32" href="/ui2017/logo-32.png">
<link rel=icon type="image/png" sizes="48x48" href="/ui2017/logo-48.png">
<link rel=icon type="image/png" sizes="96x96" href="/ui2017/logo-96.png">
<link rel="apple-touch-icon-precomposed" sizes="96x96" href="/ui2017/logo-96.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/ui2017/logo-144.png">


<title>HTML 测验</title>

</head>

<body class="html">

<div id="wrapper">

<div id="header">
<a href="/index.html" title="w3school 在线教程" style="float:left;">w3school 在线教程</a>
<div id="ad_head">
<script type="text/javascript"><!--
google_ad_client = "pub-3381531532877742";
/* 728x90, 创建于 08-12-1 */
google_ad_slot = "7423315034";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>

<div id="navfirst">
<ul id="menu">
<li id="h"><a href="/h.asp" title="HTML 系列教程">HTML 系列教程</a></li>
<li id="b"><a href="/b.asp" title="浏览器脚本教程">浏览器脚本</a></li>
<li id="s"><a href="/s.asp" title="服务器脚本教程">服务器脚本</a></li>
<li id="d"><a href="/d.asp" title="ASP.NET 教程">ASP.NET 教程</a></li>
<li id="x"><a href="/x.asp" title="XML 系列教程">XML 系列教程</a></li>
<li id="ws"><a href="/ws.asp" title="Web Services 系列教程">Web Services 系列教程</a></li>
<li id="w"><a href="/w.asp" title="建站手册">建站手册</a></li>
</ul>
</div>

<div id="navsecond">

<div id="course"><h2>HTML 基础教程</h2>
<ul>
<li><a href="/html/index.asp" title="HTML 教程">HTML 教程</a></li>
<li><a href="/html/html_jianjie.asp" title="HTML 简介">HTML 简介</a></li>
<li><a href="/html/html_editors.asp" title="HTML 编辑器">HTML 编辑器</a></li>
<li><a href="/html/html_basic.asp" title="HTML 基础 - 四个实例">HTML 基础</a></li>
<li><a href="/html/html_elements.asp" title="HTML 元素">HTML 元素</a></li>
<li><a href="/html/html_attributes.asp" title="HTML 属性">HTML 属性</a></li>
<li><a href="/html/html_headings.asp" title="HTML 标题">HTML 标题</a></li>
<li><a href="/html/html_paragraphs.asp" title="HTML 段落">HTML 段落</a></li>
<li><a href="/html/html_styles.asp" title="HTML 样式 - CSS">HTML 样式</a></li>
<li><a href="/html/html_formatting.asp" title="HTML 文本格式化">HTML 格式化</a></li>

</ul>
<h2>HTML XHTML</h2>
<ul>
<li><a href="/html/html_xhtml.asp" title="XHTML 简介">XHTML 简介</a></li>
<li><a href="/html/html_xhtml_elements.asp" title="XHTML - 元素">XHTML 元素</a></li>
<li><a href="/html/html_xhtml_attributes.asp" title="XHTML - 属性">XHTML 属性</a></li>
</ul>

<ul>
<li><a href="/html/html5_canvas.asp" title="HTML5 Canvas">HTML5 画布</a></li>
<li><a href="/html/html5_svg.asp" title="HTML5 内联 SVG">HTML5 SVG</a></li>
<li><a href="/html/html5_canvas_vs_svg.asp" title="HTML5 Canvas vs. SVG">HTML5 画布 vs SVG</a></li>
</ul>
<h2>HTML 媒体</h2>
<ul>
<li><a href="/html/html_media.asp" title="HTML 多媒体">HTML 媒体</a></li>
<li><a href="/html/html_object.asp" title="HTML Object 元素">HTML 对象</a></li>
<li><a href="/html/html_audio.asp" title="HTML 音频">HTML 音频</a></li>
<li><a href="/html/html_video.asp" title="HTML 视频">HTML 视频</a></li>
</ul>
<h2>HTML API</h2>
<ul>
<li><a href="/html/html5_geolocation.asp" title="HTML5 地理定位">HTML5 地理定位</a></li>
<li><a href="/html/html5_draganddrop.asp" title="HTML5 拖放">HTML5 拖放</a></li>
<li><a href="/html/html5_webstorage.asp" title="HTML5 Web 存储">HTML5 Web 存储</a></li>
<li><a href="/html/html5_app_cache.asp" title="HTML 5 应用程序缓存">HTML5 应用缓存</a></li>
<li><a href="/html/html5_webworkers.asp" title="HTML5 Web Workers">HTML5 Web Workers</a></li>
<li><a href="/html/html5_serversentevents.asp" title="HTML5 服务器发送事件">HTML5 SSE</a></li>
</ul>
<h2>实例/测验/总结</h2>
<ul>
<li><a href="/example/html_examples.asp" title="HTML 实例">HTML 实例</a></li>
<li class="currentLink"><a href="/html/html_quiz.asp" title="HTML 测验">HTML 测验</a></li>
<li><a href="/html/html_summary.asp" title="HTML 总结">HTML 总结</a></li>
</ul>
<h2>HTML 参考手册</h2>
<ul>
<li><a href="/tags/index.asp" title="HTML 4.01 / XHTML 1.0 参考手册">HTML 标签列表</a></li>
<li><a href="/tags/html_ref_standardattributes.asp" title="HTML 标准属性">HTML 属性</a></li>
<li><a href="/tags/html_ref_eventattributes.asp" title="HTML 事件属性">HTML 事件</a></li>
<li><a href="/tags/html_ref_dtd.asp" title="HTML 元素与合法的 Doctype">HTML 合法 DTD</a></li>
<li><a href="/tags/html_ref_colornames.asp" title="HTML 颜色名">HTML 颜色名</a></li>
<li><a href="/tags/html_ref_charactersets.asp" title="HTML 字符集">HTML 字符集</a></li>
<li><a href="/tags/html_ref_ascii.asp" title="HTML ASCII 参考手册">HTML ASCII</a></li>
<li><a href="/tags/html_ref_entities.html" title="HTML ISO-8859-1 参考手册">HTML ISO-8859-1</a></li>
<li><a href="/tags/html_ref_symbols.html" title="HTML 4.01 符号实体">HTML 符号</a></li>
<li><a href="/tags/html_ref_urlencode.html" title="HTML URL 编码">HTML URL 编码</a></li>
<li><a href="/tags/html_ref_language_codes.asp" title="HTML 语言代码参考手册">HTML 语言代码</a></li>
<li><a href="/tags/html_ref_httpmessages.asp" title="HTML 状态消息">HTML 消息</a></li>
</ul>
<h2>HTML5</h2>
<ul>
<li><a href="/html/index.asp" title="HTML5 教程">HTML5 教程</a></li>
<li><a href="/tags/index.asp" title="HTML5 参考手册">HTML5 参考手册</a></li>
</ul>
</div><div id="selected">
<h2>建站手册</h2>
<ul>
<li><a href="/site/index.asp" title="网站构建">网站构建</a></li>
<li><a href="/w3c/index.asp" title="万维网联盟 (W3C)">万维网联盟 (W3C)</a></li>
<li><a href="/browsers/index.asp" title="浏览器信息">浏览器信息</a></li>
<li><a href="/quality/index.asp" title="网站品质">网站品质</a></li>
<li><a href="/semweb/index.asp" title="语义网">语义网</a></li>
<li><a href="/careers/index.asp" title="职业规划">职业规划</a></li>
<li><a href="/hosting/index.asp" title="网站主机">网站主机</a></li>
</ul>

<h2><a href="/about/index.asp" title="关于 W3School" id="link_about">关于 W3School</a></h2>
<h2><a href="/about/about_helping.asp" title="帮助 W3School" id="link_help">帮助 W3School</a></h2>

</div>

</div>

<div id="maincontent">




<div id="intro">
<p><strong>您可以通过 W3SCHOOL 的测验程序来测试您的 HTML 技能。</strong></p>
</div>


<div>
<h2>关于本测验</h2>

<p>本测验包含 20 道题,每道题的最长答题时间是 20 分钟(这是由于每个 session 的默认有效时间是20钟)。</p>

<p>本测验是非官方的测试,它仅仅提供了一个了解您对 HTML 的掌握程度的工具。</p>
</div>


<div>
<h2>测验会被记分</h2>

<p>每道题的分值是 1 分。在您完成全部的 20 道题之后,系统会为您的测验打分,并提供您做错的题目的正确答案。其中,绿色为正确答案,而红色为错误答案。</p>

<p><a href="/quiz/quiz.asp?quiz=html">现在就开始测验</a>!祝您好运。</p>
</div>


<div id="bpn">
<ul class="prenext">
<li class="pre"><a href="/example/html_examples.asp" title="HTML 实例">HTML 实例</a></li>
<li class="next"><a href="/html/html_summary.asp" title="HTML 总结">HTML 总结</a></li>
</ul>
</div>


<div style="background-color:#fcfdf8; padding:0;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- W3School 正文底部广告位 -->
<ins class="adsbygoogle"
style="display:inline-block;width:800px;height:250px"
data-ad-client="ca-pub-3381531532877742"
data-ad-slot="9384069314"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>

</div>
<!-- maincontent end -->

<div id="sidebar">

<div id="tools">
<h5 id="tools_reference"><a href="/tags/index.asp">HTML 参考手册</a></h5>
<h5 id="tools_example"><a href="/example/html_examples.asp">HTML 实例</a></h5>
<h5 id="tools_quiz"><a href="/html/html_quiz.asp">HTML 测验</a></h5>
</div>




</div>
<!-- wrapper end -->

</body>

</html>

链接

More info: Deployment

坚持原创技术分享,您的支持是我前进的动力!