XHTML 笔记

原文出自 http://www.w3schools.com 中的 XHTML 教程


XHTML 结合 HTML 和 XML。

XHTML 元素必须严格的嵌套。
XHTML 元素必须总是闭合的。
XHTML 元素必须是小写的。XHTML 文档必须有根元素。

所有的 XHTML 文档必须有 DOCTYPE 声明。
DOCTYPE 声明必须是 XHTML 文档的第一行。

有 3 种文档类型定义: STRICT TRANSITIONAL FRAMESET
xml 代码
 
  1. <!DOCTYPE html PUBLIC  
  2. "-//W3C//DTD XHTML 1.0 Strict//EN"   
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  4.   
  5. <!DOCTYPE html PUBLIC  
  6. "-//W3C//DTD XHTML 1.0 Transitional//EN"  
  7. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8.   
  9. <!DOCTYPE html PUBLIC  
  10. "-//W3C//DTD XHTML 1.0 Frameset//EN"  
  11. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  



属性名称必须小写。
属性值必须用引号。
属性最简化被禁止。 如,
xml 代码
  1. <input type="checkbox" checked />

id 属性代替 name 属性。
单标签在末尾 / 之前有空格。 例如:
xml 代码
  1. <br />


XHTML 文档由三个主要的部分构成: DOCTYPE Head Body。
基本文档结构如下:
xml 代码
 
  1. <!DOCTYPE ...>  
  2. <html>  
  3. <head>  
  4. <title>... </title>  
  5. </head>  
  6. <body> ... </body>  
  7. </html>  


核心属性(不可用于 base, head, html, meta, param, script, style, 和 title 元素)
AttributeValueDescription
classclass_rule or style_ruleThe class of the element
idid_nameA unique id for the element
stylestyle_definitionAn inline style definition
titletooltip_text A text to display in a tool tip

语言属性(不可用于 base, br, frame, frameset, hr, iframe, param, 和 script 元素)
AttributeValueDescription
dirltr | rtlSets the text direction
langlanguage_codeSets the language code

键盘属性
AttributeValueDescription
accesskeycharacterSets a keyboard shortcut to access an element
tabindexnumberSets the tab order of an element

窗体事件(只有 body 和 frameset 元素可用)
AttributeValueDescription
onloadscriptScript to be run when a document loads
onunloadscriptScript to be run when a document unloads

表单元素事件(只在表单元素中有效)
AttributeValueDescription
onchangescriptScript to be run when the element changes
onsubmitscriptScript to be run when the form is submitted
onresetscriptScript to be run when the form is reset
onselectscript Script to be run when the element is selected
onblurscript Script to be run when the element loses focus
onfocusscript Script to be run when the element gets focus

键盘事件(不可用于 base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, 和 title 元素)
AttributeValueDescription
onkeydownscript What to do when key is pressed
onkeypressscript What to do when key is pressed and released
onkeyupscript What to do when key is released

鼠标事件(不可用于 base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, 和 title 元素)
AttributeValueDescription
onclickscript What to do on a mouse click
ondblclickscript What to do on a mouse doubleclick
onmousedownscript What to do when mouse button is pressed
onmousemovescript What to do when mouse pointer moves
onmouseoverscriptWhat to do when mouse pointer moves over an element
onmouseoutscriptWhat to do when mouse pointer moves out of an element
onmouseupscript What to do when mouse button is released

HTTP 响应信息:

1xx: Information

Message:Description:
100 Continue Only a part of the request has been received by the server, but as long as it has not been rejected, the client should continue with the request
101 Switching ProtocolsThe server switches protocol

2xx: Successful

Message:Description:
200 OKThe request is OK
201 CreatedThe request is complete, and a new resource is created
202 AcceptedThe request is accepted for processing, but the processing is not complete
203 Non-authoritative Information 
204 No Content 
205 Reset Content 
206 Partial Content 

3xx: Redirection

Message:Description:
300 Multiple ChoicesA link list. The user can select a link and go to that location. Maximum five addresses
301 Moved PermanentlyThe requested page has moved to a new url
302 FoundThe requested page has moved temporarily to a new url
303 See OtherThe requested page can be found under a different url
304 Not Modified 
305 Use Proxy 
306 UnusedThis code was used in a previous version. It is no longer used, but the code is reserved
307 Temporary RedirectThe requested page has moved temporarily to a new url

4xx: Client Error

Message:Description:
400 Bad RequestThe server did not understand the request
401 UnauthorizedThe requested page needs a username and a password
402 Payment RequiredYou can not use this code yet
403 ForbiddenAccess is forbidden to the requested page
404 Not FoundThe server can not find the requested page
405 Method Not AllowedThe method specified in the request is not allowed
406 Not AcceptableThe server can only generate a response that is not accepted by the client
407 Proxy Authentication RequiredYou must authenticate with a proxy server before this request can be served
408 Request TimeoutThe request took longer than the server was prepared to wait
409 ConflictThe request could not be completed because of a conflict
410 GoneThe requested page is no longer available
411 Length RequiredThe "Content-Length" is not defined. The server will not accept the request without it
412 Precondition FailedThe precondition given in the request evaluated to false by the server
413 Request Entity Too LargeThe server will not accept the request, because the request entity is too large
414 Request-url Too LongThe server will not accept the request, because the url is too long. Occurs when you convert a "post" request to a "get" request with a long query information
415 Unsupported Media TypeThe server will not accept the request, because the media type is not supported
416  
417 Expectation Failed 

5xx: Server Error

Message:Description:
500 Internal Server ErrorThe request was not completed. The server met an unexpected condition
501 Not ImplementedThe request was not completed. The server did not support the functionality required
502 Bad GatewayThe request was not completed. The server received an invalid response from the upstream server
503 Service UnavailableThe request was not completed. The server is temporarily overloading or down
504 Gateway TimeoutThe gateway has timed out
505 HTTP Version Not SupportedThe server does not support the "http protocol" version
资源下载链接为: https://pan.quark.cn/s/140386800631 通用大模型文本分类实践的基本原理是,借助大模型自身较强的理解和推理能力,在使用时需在prompt中明确分类任务目标,并详细解释每个类目概念,尤其要突出类目间的差别。 结合in-context learning思想,有效的prompt应包含分类任务介绍及细节、类目概念解释、每个类目对应的例子和待分类文本。但实际应用中,类目和样本较多易导致prompt过长,影响大模型推理效果,因此可先通过向量检索缩小范围,再由大模型做最终决策。 具体方案为:离线时提前配置好每个类目的概念及对应样本;在线时先对给定query进行向量召回,再将召回结果交给大模型决策。 该方法不更新任何模型参数,直接使用开源模型参数。其架构参考GPT-RE并结合相关实践改写,加入上下文学习以提高准确度,还使用BGE作为向量模型,K-BERT提取文本关键词,拼接召回的相似例子作为上下文输入大模型。 代码实现上,大模型用Qwen2-7B-Instruct,Embedding采用bge-base-zh-v1.5,向量库选择milvus。分类主函数的作用是在向量库中召回相似案例,拼接prompt后输入大模型。 结果方面,使用ICL时accuracy达0.94,比bert文本分类的0.98低0.04,错误类别6个,处理时添加“家居”类别,影响不大;不使用ICL时accuracy为0.88,错误58项,可能与未修改prompt有关。 优点是无需训练即可有较好结果,例子优质、类目界限清晰时效果更佳,适合围绕通用大模型api打造工具;缺点是上限不高,仅针对一个分类任务部署大模型不划算,推理速度慢,icl的token使用多,用收费api会有额外开销。 后续可优化的点是利用key-bert提取的关键词,因为核心词语有时比语意更重要。 参考资料包括
内容概要:本文详细介绍了哈希表及其相关概念和技术细节,包括哈希表的引入、哈希函数的设计、冲突处理机制、字符串哈希的基础、哈希错误率分析以及哈希的改进与应用。哈希表作为一种高效的数据结构,通过键值对存储数据,能够快速定位和检索。文中讨论了整数键值和字符串键值的哈希方法,特别是字符串哈希中的多项式哈希及其优化方法,如双哈希和子串哈希的快速计算。此外,还探讨了常见的冲突处理方法——拉链法和闭散列法,并提供了C++实现示例。最后,文章列举了哈希在字符串匹配、最长回文子串、最长公共子字符串等问题中的具体应用。 适合人群:计算机科学专业的学生、算法竞赛选手以及有一定编程基础并对数据结构和算法感兴趣的开发者。 使用场景及目标:①理解哈希表的工作原理及其在各种编程任务中的应用;②掌握哈希函数的设计原则,包括如何选择合适的模数和基数;③学会处理哈希冲突的方法,如拉链法和闭散列法;④了解并能运用字符串哈希解决实际问题,如字符串匹配、回文检测等。 阅读建议:由于哈希涉及较多数学知识和编程技巧,建议读者先熟悉基本的数据结构和算法理论,再结合代码实例进行深入理解。同时,在实践中不断尝试不同的哈希策略,对比性能差异,从而更好地掌握哈希技术。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值