- 博客(0)
- 资源 (13)
- 收藏
- 关注
东北大学软件系统操作系统
东北大学软件系统操作系统资源
Computer system can be divided into four components
Hardware – provides basic computing resources
CPU, memory, I/O devices
Operating system
Controls and coordinates use of hardware among various applications and users
Application programs – define the ways in which the system resources are used to solve the computing problems of the users
Word processors, compilers, web browsers, database systems, video games
Users
People, machines, other computers
2013-11-05
Experiment 2 Europe by Rail(4 hours)
o main.cpp - This file contains the main routine.
o City.h - This defines class City.
o Service.h - This defines class Service.
o RailSystem.h - This declares a class to represent the rail system.
o RailSystem.cpp - This is a partial implementation of class RailSystem.
o services.txt - This file contains data that defines the rail system services.
2013-06-06
网页制作程序作业
网页文学空间程序作业
<html>
<head>
<title>我的日记</title>
</head>
<body>
<style type="text/css">
body,td,th {
font-size: 20px;
color: #F0F;
font-style: italic;
}
body {
background-image: url(Mypsd_13870_201102141734070002B.jpg);
}
.b1{border:5px solid blue}
.b2{border:2px solid green}
</style>
<center>
<h2>我的日记</h2>
</center>
<img class=b2 src="50da81cb39dbb6fda57034890924ab18972b3772.jpg"width="100px"
height="100px"alt="broadview banner">
■<a href="登录成功.html"><input name="button" type="button" value="主页"></a>
■<a href="我的小文库.html"><input name="button" type="button" value="我的小文库"></a>
■<a href="我的相册.html"><input name="button" type="button" value="相册"></a>
<hr>
<marquee onmouseover="this.stop()"onmouseout="this.start()" direction="up" scrollamount="4">
<a href="日记1.html">
读《谈艺录》之“诗分唐宋”、“神韵”、“长吉诗”一.诗分唐宋
1.“所谓古今之别,非谓时代,乃言体制”(顾复);“性情原自无今古,格调何须辨唐宋”(戴昺)——这话非常通透、恰切。但至今诗仍以时代划分,主要是因为容易且方便,毕竟时代是划定了的,而性情则是仁者见仁,主观色彩太多,不可能有一个统一的标准。
2.“初、盛、中、晚…犹之乎春、夏、秋、冬…四序之中,各有良城美景…不得谓夏劣于春,冬劣于秋也…”(黄周星)——如陈眉公所言:黄花红树,春不如秋,白雪青松,冬亦胜夏,春夏园林,秋冬山谷。各有风致,不必厚此薄彼,只可以说个人自由偏爱。本人仍爱以“丰神情韵”擅长的唐诗,然后是宋诗的江湖派,汉诗,不喜清诗。
六.神韵
1.“上学、中学、下学”(《文子.道德篇》)与艾克哈特之“学分上、中、下”之论——王国维之“肉秀、骨秀、神秀”是也。京剧名家论声音最下者发于声,中者发于心,上者发于头脑,概也来源于《文子.道德篇》。
2.“体格声调,兴象风神”(胡元瑞)——二者的关系像是魂魄与精神,前者有质无形,后者有形无质。《史记.太史公自序》中论形神之语最透彻:神为形之本,形为神之具。
七.李长吉诗
1.“世间安得有奇…”(姚羹湖)之言——世间确有奇,且未必事事都可解,不可解处不必强解,不能解未必是无知。马未都先生论收藏曾言此,杨琪老师讲梵高曾言此。
2.“考据家不足与言诗”(张箦斋)——就像读史必究语出何处,见“管锥编.左传正义.杜预序”。又像牵强附会者,如读鲁迅读红楼必要把一字一词都说成有所隐喻。又像看一些意大利、法国新浪潮电影,非要说成性是拯救孤独空虚的不二法门,其实只是导演的意淫而已。有些人便摸准了这种观者的脾性,写一些、画一些、拍一些只代表自己意淫,甚至连意淫都没有的,或者是如支棋者的“哑谜”、反讽富家子之类的垃圾,因为他们深知,这些垃圾一定会被那些观者看出许多连自己都不知道的深意。
3.“行布拉杂,凌乱,重叠”——为辞而写,联句可也,成诗未免低级。
4.“若必经此境,始能道此语,则其为才也隘矣”(李仁卿)——正是未必经此境,却能道此语,方为天才,不止诗家如此。
八.长吉诗境
1.“唐人作唐人诗序,亦多夸词”(贺贻孙)——今人作今人书序,夸词亦多,若为尚且健在之人作序,夸词则多多,若为尚且健在且相识之人作序,则夸词如韩苏之文,“长江秋注”、“万斛泉源”。
九.长吉字法
丁敦龄乃无耻,苏曼殊乃知识有限,一为刻意,一为无意,但二者均起到了相同的作用:误导。若想不被误导,最好的办法就是自己读原文,不要“于卖花担子上看桃李”。世人以“诗仙”、“诗圣”、“诗鬼”等词赞众诗人,欧言苏曼殊竟以此眼光看拜伦雪莱太白长吉,可当“失明”。
“于文字海中飘零,未尝得筏登岸”——连边还没摸着呢。
一〇.长吉曲喻
“二物相似,以此喻彼,然彼此相似,只在一端,非为全体,苟全体相似,则物数虽二,物类则一”——“酽茶”与“黄酒”。
一一.长吉用啼泣字
1.“彼此有合,故乐”——有共鸣才乐。又可见人是群居动物,期许外物与己身心相合,渴望沟通、理解,即“情契”。
2.“宜诗不宜画”、“文字语言之特长,非他艺所可几及”——想象的空间。
3.“风景即心境”——人的心境多少都有所“载”,“虚”谈何容易。“载”或可看朱成碧,但正是因为有“载”,才会有自己的特点,而非原样复制。
一二.长吉用代字
“只知有花草蜂蝶,而不知世间一切皆诗”(张戒)——李贺诗类似唯美主义绘画,又不完全像,他比唯美主义多了许多诡异,又像日本动漫,精美第一,如果精美不够,就添些诡异,以奇取胜。不知平淡甚至丑陋中皆有美存焉。屡见喜欢所谓唯美的人不能欣赏“窃听风暴”、“僵尸肖恩”。看来此二者难以兼容,因一旦爱“尽俗能雅”者不会再被表象的精美吸引。一言以蔽之,李贺奇才,但小器,“化腐为奇,尽俗能雅”的苏韩乃大器。
一三.长吉与杜韩
李贺李白性情迥异,诗既源于性灵,李贺断写不出太白风骨。“突兀”二字极贴。李贺仅于个别用字上模仿了些李白的形罢了,李白诗乃自然流露,李贺似太白处乃雕琢而出。
一四.长吉年命之嗟
“茫茫来日愁如海,给予羲和快着鞭”——与次韵中“更酌羲和一杯酒,劝停征辔莫加鞭”同看。心境不同,辞与意全然相反。
推崇黄仲则诗有李白风,更以“前后观潮”诗为最者,不知作何想法。前后观潮好则好矣,但其与太白相比,远失灵动飘逸、浑然大器,频繁换韵更是缺少太白之“飞流直下三千尺”之流畅。或许与其本人诗风相比这两首算是豪迈磅礴,但就如小孩耍大锤,耍倒是耍动了,却让人看着吃力。哪里有他的《绮怀》十六首顺溜
</a>
</marquee>
<hr class=b1>
<marquee diretion="right">
我的好友::<a href="李刚.html" >李刚</a>::<a href="王城.html" >王城</a>::成龙::巴菲特::马云::李彦宏::马化腾::奥巴马::普京、、
</marquee>
<hr>
<marquee onmouseover="this.stop()"onmouseout="this.start()" direction="left">
<a href="李刚.html" ><img src="4b90f603738da97757032aa4b051f8198618e315.jpg"width="100px"
height="100px"alt="broadview banner"></a>
<a href="王城.html" ><img src="908fa0ec08fa513de7b5295e3d6d55fbb2fbd917.jpg"width="100px"
height="100px"alt="broadview banner"></a>
<img src="b64543a98226cffc640b0c42b9014a90f603ea19.jpg"width="100px"
height="100px"alt="broadview banner">
<img src="b8014a90f603738d9120f788b31bb051f819ec36.jpg"width="100px"
height="100px"alt="broadview banner">
<img src="a8014c086e061d95cb995db47bf40ad163d9ca5b.jpg"width="100px"
height="100px"alt="broadview banner">
<img src="72f082025aafa40fdadb9b51ab64034f78f01918.jpg"width="100px"
height="100px"alt="broadview banner">
<img src="7a899e510fb30f24403f3cf3c895d143ac4b039c.jpg"width="100px"
height="100px"alt="broadview banner">
<img src="dcc451da81cb39db44f4baa6d0160924ab18300e.jpg"width="100px"
height="100px"alt="broadview banner">
<img src="42a98226cffc1e1791905fc14a90f603738de917.jpg"width="100px"
height="100px"alt="broadview banner">
</marquee>
<hr>
<audio src="老男孩.MP3" controls="controls" loop="loop">
</body>
</html>
2013-05-04
C++深入研究必学的INTERNATIONAL ISO/IEC
Information technology — Programming
languages — C++
Technologies de l'information — Langages de programmation — C++
List of Tables
1 Trigraph sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2 Alternative tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3 Identifiers with special meaning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5 Alternative representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6 Types of integer constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7 Escape sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8 String literal concatenations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
9 Relations onconstandvolatile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10 simple-type-specifiers and the types they specify . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
11 Relationship between operator and function call notation . . . . . . . . . . . . . . . . . . . . . . 297
12 Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
13 Library categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
14 C++
library headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
15 C++
headers for C library facilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
16 C++
headers for freestanding implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
17 EqualityComparablerequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
18 LessThanComparablerequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
19 DefaultConstructiblerequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
20 MoveConstructiblerequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
21 CopyConstructiblerequirements (in addition to MoveConstructible) . . . . . . . . . . . . . . . 438
22 MoveAssignablerequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
23 CopyAssignablerequirements(in addition to MoveAssignable) . . . . . . . . . . . . . . . . . . . 438
24 Destructiblerequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
25 NullablePointerrequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
26 Hashrequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
27 Descriptive variable definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
28 Allocator requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
29 Language support library summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
30 Header<cstddef>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
31 Header<climits>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
32 Header<cfloat>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
33 Header<cstdlib>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
34 Header<csetjmp>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
35 Header<csignal>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
36 Header<cstdalign>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
37 Header<cstdarg>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
38 Header<cstdbool>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
39 Header<cstdlib>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
40 Header<ctime>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
List of Tables
xi
ISO/IEC 14882:2011(E)
© ISO/IEC 2011 – All rights reserved
41 Diagnostics library summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
42 Header<cassert>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
43 Header<cerrno>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
44 General utilities library summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
45 Header<cstdlib>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
46 Header<cstring>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
47 Primary type category predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
48 Composite type category predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
49 Type property predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
50 Type property queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
51 Type relationship predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
52 Const-volatile modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
53 Reference modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
54 Sign modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
55 Array modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
56 Pointer modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
57 Other transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
58 Expressions used to perform ratio arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
59 Clock requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
60 Header<ctime>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
61 Strings library summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
62 Character traits requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
63 basic_string(const Allocator&)effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
64 basic_string(const basic_string&)effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
65 basic_string(const basic_string&, size_type, size_type, const Allocator&)effects . 643
66 basic_string(const charT*, size_type, const Allocator&)effects . . . . . . . . . . . . . . 644
67 basic_string(const charT*, const Allocator&)effects . . . . . . . . . . . . . . . . . . . . . 644
68 basic_string(size_t, charT, const Allocator&)effects . . . . . . . . . . . . . . . . . . . . 644
69 basic_string(const basic_string&, const Allocator&)andbasic_string(basic_string&&,
const Allocator&)effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
70 operator=(const basic_string<charT, traits, Allocator>&)effects . . . . . . . . . . . . . 645
71 operator=(const basic_string<charT, traits, Allocator>&&)effects . . . . . . . . . . . . 645
72 compare()results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
73 Potentialmbstate_tdata races . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
74 Header<cctype>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
75 Header<cwctype>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
76 Header<cstring>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
77 Header<cwchar>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
78 Header<cstdlib>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
79 Header<cuchar>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
80 Localization library summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
81 Locale category facets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
82 Required specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
83 do_in/do_outresult values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
84 do_unshiftresult values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
85 Integer conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
86 Length modifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
87 Integer conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
List of Tables
xii
ISO/IEC 14882:2011(E)
© ISO/IEC 2011 – All rights reserved
88 Floating-point conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
89 Length modifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
90 Numeric conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
91 Fill padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
92 do_get_dateeffects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
93 Header<clocale>synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
94 Potentialsetlocaledata races . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
95 Containers library summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
96 Container requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
97 Reversible container requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
98 Optional container operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
99 Allocator-aware container requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
100 Sequence container requirements (in addition to container) . . . . . . . . . . . . . . . . . . . . . 735
101 Optional sequence container operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
102 Associative container requirements (in addition to container) . . . . . . . . . . . . . . . . . . . . 740
103 Unordered associative container requirements (in addition to container) . . . . . . . . . . . . . . 746
104 Iterators library summary . . . . . . .
2012-11-02
Windows8编程
windows8编程
Introduction ....................................................................................................... 11
Who This Book Is For ................................................................................................................................................................. 12
What You'll Need ........................................................................................................................................................................ 13
A Formatting Note...................................................................................................................................................................... 13
Acknowledgements .................................................................................................................................................................... 13
Errata & Book Support .............................................................................................................................................................. 14
We Want to Hear from You ..................................................................................................................................................... 15
Stay in Touch ................................................................................................................................................................................ 15
Chapter 1: The Life Story of a WinRT App:
Platform Characteristics of Windows 8 .......................................................... 16
Leaving Home: Onboarding to the Store ............................................................................................................................ 17
Discovery, Acquisition, and Installation ............................................................................................................................... 20
Playing in Your Own Room: The App Container .............................................................................................................. 23
Different Views of Life: View States and Resolution Scaling ......................................................................................... 27
Those Capabilities Again: Getting to Data and Devices ................................................................................................. 30
Taking a Break, Getting Some Rest: Process Lifecycle Management ......................................................................... 33
Remembering Yourself: App State and Roaming ............................................................................................................. 35
Coming Back Home: Updates and New Opportunities .................................................................................................. 39
And, Oh Yes, Then There’s Design ......................................................................................................................................... 40
Chapter 2: Quickstart ........................................................................................ 42
A Really Quick Quickstart: The Blank App Template ....................................................................................................... 42
Blank App Project Structure ................................................................................................................................................ 45
QuickStart #1: Here My Am! and an Introduction to Blend for Visual Studio ........................................................ 50
Design Wireframes ................................................................................................................................................................. 50
Create the Markup ................................................................................................................................................................. 53
Styling in Blend ....................................................................................................................................................................... 55
Adding the Code .................................................................................................................................................................... 59
Extra Credit: Receiving Messages from the iframe ...................................................................................................... 71
The Other Templates ................................................................................................................................................................. 73
Fixed Layout Template .......................................................................................................................................................... 73
Navigation Template ............................................................................................................................................................. 74
3
Grid Template .......................................................................................................................................................................... 74
Split Template .......................................................................................................................................................................... 74
What We’ve Just Learned ......................................................................................................................................................... 75
Chapter 3: App Anatomy and Page Navigation ........................................... 76
Local and Web Contexts within the App Host .................................................................................................................. 77
Referencing Content from App Data: ms-appdata ..................................................................................................... 81
Sequential Async Operations: Chaining Promises ............................................................................................................ 84
Debug Output, Error Reports, and the Event Viewer ................................................................................................. 87
App Activation ............................................................................................................................................................................. 89
Branding Your App 101: The Splash Screen and Other Visuals............................................................................... 89
Activation Event Sequence .................................................................................................................................................. 92
Activation Code Paths ........................................................................................................................................................... 93
WinJS.Application Events ..................................................................................................................................................... 95
Extended Splash Screens ...................................................................................................................................................... 97
App Lifecycle Transition Events and Session State ........................................................................................................... 99
Suspend, Resume, and Terminate ...................................................................................................................................100
Basic Session State in Here My Am! ...............................................................................................................................104
Data from Services and WinJS.xhr .......................................................................................................................................106
Handling Network Connectivity (in Brief).....................................................................................................................109
Tips and Tricks for WinJS.xhr ............................................................................................................................................109
Page Controls and Navigation ..............................................................................................................................................111
WinJS Tools for Pages and Page Navigation ...............................................................................................................111
The Navigation App Template, PageControl Structure, and PageControlNavigator ....................................112
The Navigation Process and Navigation Styles ..........................................................................................................118
Optimizing Page Switching: Show-and-Hide ..............................................................................................................120
Completing the Promises Story ............................................................................................................................................120
What We’ve Just Learned .......................................................................................................................................................122
Chapter 4: Controls, Control Styling, and Data Binding ........................... 124
The Control Model for HTML, CSS, and JavaScript ........................................................................................................125
HTML Controls ...........................................................................................................................................................................126
4
WinJS stylesheets: ui-light.css, ui-dark.css, and win-* styles ...................................................................................129
Extensions to HTML Elements ..........................................................................................................................................130
WinJS Controls ...........................................................................................................................................................................130
WinJS Control Instantiation ...............................................................................................................................................132
Strict Processing and processAll Functions ..................................................................................................................133
Example: WinJS.UI.Rating Control ...................................................................................................................................134
Example: WinJS.UI.Tooltip Control..................................................................................................................................135
Working with Controls in Blend ...........................................................................................................................................137
Control Styling ...........................................................................................................................................................................139
Styling Gallery: HTML Controls ........................................................................................................................................141
Styling Gallery: WinJS Controls ........................................................................................................................................143
Some Tips and Tricks ...........................................................................................................................................................146
Custom Controls ........................................................................................................................................................................147
Custom Control Examples .................................................................................................................................................149
Custom Controls in Blend ..................................................................................................................................................151
Data Binding ...............................................................................................................................................................................154
Data Binding in WinJS .........................................................................................................................................................157
Additional Binding Features..............................................................................................................................................162
What We’ve Just Learned .......................................................................................................................................................165
Chapter 5: Collections and Collection Controls .......................................... 167
Collection Control Basics ........................................................................................................................................................168
Quickstart #1: The HTML FlipView Control Sample ..................................................................................................168
Quickstart #2a: The HTML ListView Essentials Sample .............................................................................................170
Quickstart #2b: The ListView Grouping Sample .........................................................................................................172
ListView in the Grid App Project Template ..................................................................................................................177
The Semantic Zoom Control .................................................................................................................................................181
FlipView Features and Styling ...............................................................................................................................................184
Data Sources ...............................................................................................................................................................................187
A FlipView Using the Pictures Library ............................................................................................................................187
Custom Data Sources ..........................................................................................................................................................189
5
How Templates Really Work..................................................................................................................................................191
Referring to Templates .......................................................................................................................................................191
Template Elements and Rendering.................................................................................................................................192
Template Functions (Part 1): The Basics ........................................................................................................................193
ListView Features and Styling ................................................................................................................................................195
When Is ListView the Wrong Choice? ............................................................................................................................195
Options, Selections, and Item Methods ........................................................................................................................197
Styling .......................................................................................................................................................................................200
Backdrops ................................................................................................................................................................................201
Layouts and Cell Spanning ................................................................................................................................................202
Optimizing ListView Performance .......................................................................................................................................208
Random Access .....................................................................................................................................................................209
Incremental Loading ............................................................................................................................................................210
Template Functions (Part 2): Promises, Promises! .....................................................................................................210
What We’ve Just Learned .......................................................................................................................................................216
Chapter 6: Layout............................................................................................ 218
Principles of WinRT app Layout ...........................................................................................................................................219
Quickstart: Pannable Sections and Snap Points ..............................................................................................................223
Laying Out the Hub .............................................................................................................................................................223
Laying Out the Sections......................................................................................................................................................225
Snap Points .............................................................................................................................................................................225
The Many Faces of Your Display ..........................................................................................................................................226
View States ..............................................................................................................................................................................227
Screen Size, Pixel Density, and Scaling ..........................................................................................................................234
Adaptive and Fixed Layouts for Display Size ...................................................................................................................238
Fixed Layouts and the ViewBox Control .......................................................................................................................239
Adaptive Layouts ..................................................................................................................................................................241
Using the CSS Grid ....................................................................................................................................................................243
Overflowing a Grid Cell ......................................................................................................................................................244
Centering Content Vertically ............................................................................................................................................245
6
Scaling Font Size ...................................................................................................................................................................246
Item Layout .................................................................................................................................................................................247
CSS 2D and 3D Transforms................................................................................................................................................247
Flexbox .....................................................................................................................................................................................248
Nested and Inline Grids ......................................................................................................................................................249
Fonts and Text Overflow ....................................................................................................................................................250
Multicolumn Elements and Regions ...............................................................................................................................251
What We’ve Just Learned .......................................................................................................................................................254
Chapter 7: Commanding UI ........................................................................... 256
Where to Place Commands ...................................................................................................................................................257
The App Bar ................................................................................................................................................................................261
App Bar Basics and Standard Commands ....................................................................................................................263
App Bar Styling ......................................................................................................................................................................272
Command Menus .................................................................................................................................................................274
Custom App Bars and Navigation Bars .........................................................................................................................276
Flyouts and Menus....................................................................................................................................................................277
WinJS.UI.Flyout Properties, Methods, and Events ......................................................................................................279
Flyout Examples ....................................................................................................................................................................280
Menus and Menu Commands ..........................................................................................................................................283
Message Dialogs ........................................................................................................................................................................288
Improving Error Handling in Here My Am! ......................................................................................................................289
What We’ve Just Learned .......................................................................................................................................................294
Chapter 8: State, Settings, Files, and Documents ....................................... 295
The Story of State ......................................................................................................................................................................296
Settings and State .................................................................................................................................................................298
App Data Locations ..............................................................................................................................................................299
AppData APIs (WinRT and WinJS) ...................................................................................................................................301
Using App Data APIs for State Management ..............................................................................................................310
Settings Pane and UI ................................................................................................................................................................316
Design Guidelines for Settings .........................................................................................................................................317
7
Populating Commands .......................................................................................................................................................320
Implementing Commands: Links and Settings Flyouts ............................................................................................321
User Data: Libraries, File Pickers, and File Queries .........................................................................................................326
Using the File Picker ............................................................................................................................................................327
Media Libraries ......................................................................................................................................................................336
Documents and Removable Storage..............................................................................................................................337
Rich Enumeration with File Queries................................................................................................................................338
Here My Am! Update ...............................................................................................................................................................344
What We’ve Just Learned .......................................................................................................................................................344
Chapter 9: Input and Sensors ........................................................................ 346
Touch, Mouse, and Stylus Input ...........................................................................................................................................347
The Touch Language, Its Translations, and Mouse/Keyboard Equivalents .......................................................348
What Input Capabilities Are Present? ............................................................................................................................355
Unified Pointer Events .........................................................................................................................................................357
Gesture Events .......................................................................................................................................................................360
The Gesture Recognizer .....................................................................................................................................................369
Keyboard Input and the Soft Keyboard .............................................................................................................................371
Soft Keyboard Appearance and Configuration ..........................................................................................................371
Adjusting Layout for the Soft Keyboard .......................................................................................................................374
Standard Keystrokes ............................................................................................................................................................376
Inking ............................................................................................................................................................................................377
Geolocation .................................................................................................................................................................................380
Sensors ..........................................................................................................................................................................................383
What We’ve Just Learned .......................................................................................................................................................386
Chapter 10: Media .......................................................................................... 387
Creating Media Elements .......................................................................................................................................................388
Graphics Elements: Img, Svg, and Canvas (and a Little CSS) ......................................................................................390
Additional Characteristics of Graphics Elements ........................................................................................................393
Some Tips and Tricks ...........................................................................................................................................................394
Video Playback and Deferred Loading ..............................................................................................................................398
8
Disabling Screen Savers and the Lock Screen During Playback ............................................................................400
Video Element Extension APIs ..........................................................................................................................................401
Applying a Video Effect ......................................................................................................................................................402
Browsing Media Servers .....................................................................................................................................................403
Audio Playback and Mixing ...................................................................................................................................................403
Audio Element Extension APIs..........................................................................................................................................405
Playback Manager and Background Audio .................................................................................................................406
Playing Sequential Audio ...................................................................................................................................................410
Playlists .........................................................................................................................................................................................411
Loading and Manipulating Media .......................................................................................................................................414
Media File Metadata ............................................................................................................................................................414
Image Manipulation and Encoding ................................................................................................................................423
Manipulating Audio and Video .......................................................................................................................................429
Media Capture ...........................................................................................................................................................................433
Flexible Capture with the MediaCapture Object ........................................................................................................435
Selecting a Media Capture Device ..................................................................................................................................439
Streaming Media and PlayTo ................................................................................................................................................440
Streaming from a Server and Digital Rights Management (DRM) .......................................................................441
Streaming from App to Network ....................................................................................................................................442
PlayTo .......................................................................................................................................................................................443
What We Have Learned ..........................................................................................................................................................446
Chapter 11: Purposeful Animations ............................................................. 448
Systemwide Enabling and Disabling of Animations ......................................................................................................450
The WinJS Animations Library ..............................................................................................................................................451
Animations in Action ...........................................................................................................................................................454
CSS Animations and Transitions ...........................................................................................................................................458
The Independent Animations Sample ...........................................................................................................................463
Rolling Your Own: Tips and Tricks .......................................................................................................................................464
What We’ve Just Learned .......................................................................................................................................................469
Chapter 12: Contracts ..................................................................................... 470
9
Share ..............................................................................................................................................................................................472
Source Apps............................................................................................................................................................................474
Target Apps ............................................................................................................................................................................480
The Clipboard ........................................................................................................................................................................491
Search............................................................................................................................................................................................493
Search in the App Manifest and the Search Item Template ...................................................................................496
Basic Search and Search Activation ................................................................................................................................496
Providing Query Suggestions ...........................................................................................................................................499
Providing Result Suggestions ...........................................................................................................................................503
Type to Search .......................................................................................................................................................................504
Launching Apps: File Type and URI Scheme Associations ...........................................................................................504
File Activation ........................................................................................................................................................................506
Protocol Activation ..............................................................................................................................................................508
File Picker Providers .................................................................................................................................................................509
Manifest Declarations ..........................................................................................................................................................510
Activation of a File Picker Provider .................................................................................................................................511
Cached File Updater .................................................................................................................................................................518
Updating a Local File: UI ....................................................................................................................................................521
Updating a Remote File: UI ...............................................................................................................................................522
Update Events ........................................................................................................................................................................523
Contacts .......................................................................................................................................................................................527
Using the Contact Picker ....................................................................................................................................................529
Contact Picker Providers ....................................................................................................................................................531
What We’ve Just Learned .......................................................................................................................................................534
About the Author ........................................................................................... 536
Survey ............................................................................................................... 537
10
Introduction
Welcome, my friends, to Windows 8! On behalf
2012-10-31
HTML5 programming
HTML5 html5
■ Foreword .................................................................................................................. xiii
■ About the Authors..................................................................................................... xiv
■ About the Technical Reviewer ................................................................................... xv
■ Acknowledgements .................................................................................................. xvi
■ Introduction ............................................................................................................. xvii
■ Chapter 1: Overview of HTML5 ....................................................................................1
■ Chapter 2: Using the HTML5 Canvas API ...................................................................25
■ Chapter 3: Working with HTML5 Audio and Video ....................................................65
■ Chapter 4: Using the HTML5 Geolocation API ...........................................................87
■ Chapter 5: Using the Communication APIs..............................................................115
■ Chapter 6: Using the HTML5 WebSocket API ..........................................................137
■ Chapter 7: Using the HTML5 Forms API...................................................................169
■ Chapter 8: Using the HTML5 Web Workers API.......................................................193
■ Chapter 9: Using the HTML5 Web Storage API........................................................213
■ Chapter 10: Creating HTML5 Offline Web Applications............................................243
■ Chapter 11: The Future of HTML5 ............................................................................259
■ Index....................................
2012-10-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人