值得收藏的一些网页代码

【HTML孙鑫】总结 什么是HTML? HTML 指的是超文本标记语言:Hyper Text Markup Language HTML 不是一种编程语言,而是一种标记语言 标记语言是一套标记标签(markup tag) HTML 使用标记标签来标记网页 HTML 文档包含了HTML标签及文本内容 HTML 文档也叫作web页面 常见元素介绍 <!DOCTYPE html> 声明为 HTML5... 阅读详情
1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table

2. <body onselectstart="return false"> 取消选取、防止复制

3. onpaste="return false" 不准粘贴

4. oncopy="return false;" oncut="return false;" 防止复制

5. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自己的图标

6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标

7. <input style="ime-mode:disabled"> 关闭输入法

8. 永远都会带着框架
<script language="javascript"><!--
if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页
// --></script>

9. 防止被人frame
<SCRIPT LANGUAGE=javascript><!--
if (top.location != self.location)top.location=self.location;
// --></SCRIPT>

10. <noscript><iframe src=*.html></iframe></noscript> 网页将不能被另存为

11. <input type=button value=查看网页源代码
onclick="window.location = 'view-source:'+ 'http://www.csdn.net/&#39;">

12. 怎样通过asp的手段来检查来访者是否用了代理
<% if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" then
response.write "<font color=#FF0000>您通过了代理服务器,"& _
"真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
%>

13. 取得控件的绝对位置

//javascript
<script language="javascript">
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
alert("top="+t+"/nleft="+l);
}
</script>

//VBScript
<script language="VBScript"><!--
function getIE()
dim t,l,a,b
set a=document.all.img1
t=document.all.img1.offsetTop
l=document.all.img1.offsetLeft
while a.tagName<>"BODY"
set a = a.offsetParent
t=t+a.offsetTop
l=l+a.offsetLeft
wend
msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"
end function
--></script>

14. 光标是停在文本框文字的最后
<script language="javascript">
function cc()
{
var e = event.srcElement;
var r =e.createTextRange();
r.moveStart('character',e.value.length);
r.collapse(true);
r.select();
}
</script>
<input type=text name=text1 value="123" onfocus="cc()">

15. 判断上一页的来源
asp:
request.servervariables("HTTP_REFERER")

javascript :
document.referrer

16. 最小化、最大化、关闭窗口
<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Minimize"></object>
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Maximize"></object>
<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM NAME="Command" value="Close"></OBJECT>

<input type=button value=最小化 onclick=hh1.Click()>
<input type=button value=最大化 onclick=hh2.Click()>
<input type=button value=关闭 onclick=hh3.Click()>
本例适用于IE

17.
<%
'定义数据库连接的一些常量
Const adOpenForwardOnly = 0 '游标只向前浏览记录,不支持分页、Recordset、BookMark
Const adOpenKeyset = 1 '键集游标,其他用户对记录说做的修改将反映到记录集中,但其他用户增加或删除记录不会反映到记录集中。支持分页、Recordset、BookMark
Const adOpenDynamic = 2 '动态游标功能最强,但耗资源也最多。用户对记录说做的修改,增加或删除记录都将反映到记录集中。支持全功能浏览(ACCESS不支持)。
Const adOpenStatic = 3 '静态游标,只是数据的一个快照,用户对记录说做的修改,增加或删除记录都不会反映到记录集中。支持向前或向后移动

Const adLockReadOnly = 1 '锁定类型,默认的,只读,不能作任何修改
Const adLockPessimistic = 2 '当编辑时立即锁定记录,最安全的方式
Const adLockOptimistic = 3 '只有在调用Update方法时才锁定记录集,而在此前的其他操作仍可对当前记录进行更改、插入和删除等
Const adLockBatchOptimistic = 4 '当编辑时记录不会被锁定,而更改、插入和删除是在批处理方式下完成的

Const adCmdText = &H0001
Const adCmdTable = &H0002
%>

18. 网页不会被缓存
HTM网页
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
或者<META HTTP-EQUIV="expires" CONTENT="0">
ASP网页
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
PHP网页
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

19. 检查一段字符串是否全由数字组成
<script language="javascript"><!--
function checkNum(str){return str.match(//D/)==null}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// --></script>

20. 获得一个窗口的大小
document.body.clientWidth,document.body.clientHeight

21. 怎么判断是否是字符
if (/[^/x00-/xff]/g.test(s)) alert("含有汉字");
else alert("全是字符");

22.TEXTAREA自适应文字行数的多少
<textarea rows=1 name=s1 cols=27 onpropertychange="this.style.posHeight=this.scrollHeight">
</textarea>

23. 日期减去天数等于第二个日期
<script language=javascript>
function cc(dd,dadd)
{
//可以加上错误处理
var a = new Date(dd)
a = a.valueOf()
a = a - dadd * 24 * 60 * 60 * 1000
a = new Date(a)
alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日")
}
cc("12/23/2002",2)
</script>

24. 选择了哪一个Radio
<HTML><script language="vbscript">
function checkme()
for each ob in radio1
if ob.checked then window.alert ob.value
next
end function
</script><BODY>
<INPUT name="radio1" type="radio" value="style" checked>Style
<INPUT name="radio1" type="radio" value="barcode">Barcode
<INPUT type="button" value="check" onclick="checkme()">
</BODY></HTML>

25.获得本页url的request.servervariables("")集合
Response.Write "<TABLE border=1><!-- Table Header --><TR><TD><B>Variables</B></TD><TD><B>value</B></TD></TR>"
for each ob in Request.ServerVariables
Response.Write "<TR><TD>"&ob&"</TD><TD>"&Request.ServerVariables(ob)&"</TD></TR>"
next
Response.Write "</TABLE>"

26.
本机ip<%=request.servervariables("remote_addr")%>
服务器名<%=Request.ServerVariables("SERVER_NAME")%>
服务器IP<%=Request.ServerVariables("LOCAL_ADDR")%>
服务器端口<%=Request.ServerVariables("SERVER_PORT")%>
服务器时间<%=now%>
IIS版本<%=Request.ServerVariables"SERVER_SOFTWARE")%>
脚本超时时间<%=Server.ScriptTimeout%>
本文件路径<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%>
服务器CPU数量<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>
服务器解译引擎<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>
服务器操作系统<%=Request.ServerVariables("OS")%>

27.ENTER键可以让光标移到下一个输入框
<input onkeydown="if(event.keyCode==13)event.keyCode=9">

28. 检测某个网站的链接速度:
把如下代码加入<body>区域中:
<script language=javascript>
tim=1
setInterval("tim++",100)
b=1

var autourl=new Array()
autourl[1]="www.njcatv.net"
autourl[2]="javacool.3322.net"
autourl[3]="www.sina.com.cn"
autourl[4]="www.nuaa.edu.cn"
autourl[5]="www.cctv.com"

function butt(){
document.write("<form name=autof>")
for(var i=1;i<autourl.length;i++)
document.write("<input type=text name=txt"+i+" size=10 value=测试中……> =》<input type=text name=url"+i+" size=40> =》<input type=button value=GO onclick=window.open(this.form.url"+i+".value)><br/>")
document.write("<input type=submit value=刷新></form>")
}
butt()
function auto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="链接超时"}
else
{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}
b++
}
function run(){for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl+"/"+Math.random()+" width=1 height=1 onerror=auto('http://";;+autourl+"')>")}
run()</script>

29. 各种样式的光标
auto :标准光标
default :标准箭头
hand :手形光标
wait :等待光标
text :I形光标
vertical-text :水平I形光标
no-drop :不可拖动光标
not-allowed :无效光标
help :?帮助光标
all-scroll :三角方向标
move :移动标
crosshair :十字标
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize
网页html代码大全 网页html代码大全,比较直观,容易入手,新手学习必备! 立即下载

相关推荐

模型量化必知:Per-Tensor和Per-Channel到底怎么选?

本文深入解析了模型量化中Per-Tensor与Per-Channel两种核心策略的抉择。Per-Tensor量化实现简单、硬件兼容性极佳,适合激活值或分布均匀的权重;而Per-Channel量化精度更高,能更好地处理权重分布不均的卷积层,是现代CNN权重量化的主流。文章提供了从硬件平台、数值分布到精度需求的实战决策框架,并推荐了“权重Per-Channel,激活Per-Tensor”的混合量化最佳实践。

assembly8low的博客 986

大学生网页设计制作作业实例代码 (全网最全,建议收藏) HTML+CSS+JS

临近期末,大一新生的各种考试和专业结课作业纷至沓来。web实训大作业、网页期末作业、web课程与设计、网页设计等,简直让人头大。你还在为网页设计老师的作业要求感到头大?网页作业无从下手?网页要求的总数量太多?没有合适的模板?等等一系列问题。你想要解决的问题,在这篇博文中基本都能满足你的需求, 废话不多说,直接看效果。📔网站布局方面:计划采用目前主流的、能兼容各大主流浏览器、显示效果稳定的浮动网页布局结构。📓网站程序方面:计划采用最新的网页编程语言HTML5+CSS3+JS程序语言完成网站的功能设计。并确

HTML网页设计 27万+

基于C#的ASP.NET开发的党史学习网站课设

开展党史学习教育,就是要以史为镜、以史明志,把苦难辉煌的过去、日新月异的现在、光明宏大的未来贯通起来,在鉴往知来中砥砺前行,在乱云飞渡中把准航向,在凝心聚力中团结奋斗,共同创造新的历史伟业。登陆按钮与数据库进行连接,逻辑实现是如图3.1.3所示,自己定义一个SQL查询语句,将账号、密码放入SQL查询语句中,用sqlDataReader.HasRows语句进行逐一比较,找出结果,将用户名存入session并调用cookies,如果结果存在就关闭数据库,进行数据跳转,并弹出登陆成功的提示框,并关闭数据库。

m0_62408555的博客 977

常用网页代码全集

● 控制横向和纵向滚动条的显隐? <body style="overflow-y:hidden"> 去掉x轴 <body style="overflow-x:hidden"> 去掉y轴 <body scroll="no">不显 ● 表格变色 <TD onmouseover="this.style.backgroundColor='#FFFFFF'" ...

云博客_资源宝分享 1万+

RK3566 Android11固件烧录实战:从驱动配置到分区升级与救砖

在嵌入式开发与量产交付中,固件烧录是连接编译产物与硬件实体的关键环节,其本质并非简单的文件拷贝,而是依赖芯片BootROM与Loader协同完成的分区级数据搬运。以RK3566平台为例,理解Loader模式、MaskROM模式以及Android分区表的映射关系,是高效开展系统升级、单分区调试和异常恢复的基础。无论是研发阶段通过RKDevTool进行灵活的分区烧录,还是产线环境借助Linux命令行工具实现批量灌装,规范的驱动安装、工具链选型与硬件连接验证都直接决定成败。本文聚焦RK3566 Android11

weixin_29172963的博客 262

保姆级教程:用Java和HslCommunication库搞定三菱PLC数据读写(附完整代码)

本文提供了一份详细的Java与三菱PLC通信教程,通过HslCommunication库实现高效数据读写。内容涵盖环境配置、通信模式选择、数据类型操作、异常处理及性能优化,并附有完整代码示例,帮助开发者快速掌握工业自动化中的PLC数据交互技术。

weixin_28731223的博客 231

大二学生web期末大作业 在线电影网站 HTML+CSS+JS

📔网站布局方面:计划采用目前主流的、能兼容各大主流浏览器、显示效果稳定的浮动网页布局结构。📓网站程序方面:计划采用最新的网页编程语言HTML5+CSS3+JS程序语言完成网站的功能设计。并确保网站代码兼容目前市面上所有的主流浏览器,已达到打开后就能即时看到网站的效果。📘网站素材方面:计划收集各大平台好看的图片素材,并精挑细选适合网页风格的图片,然后使用PS做出适合网页尺寸的图片。📒网站文件方面:网站系统文件种类包含:html网页结构文件、css网页样式文件、js网页特效文件、images网页图片文件

HTML网页设计 专注大学生网页设计 7万+

超详细版!Obsidian+Claude+Skills+云同步,打造智能 AI 知识库

本文介绍如何搭建高效的AI知识管理系统,将Obsidian笔记工具与ClaudeAI助手深度整合。通过ClaudeCode安装配置、ObsidianSkills插件添加和坚果云同步设置,实现本地存储安全性与云端便捷性的完美结合。该系统支持智能笔记整理、知识图谱可视化、智能搜索问答和内容创作辅助等功能,使静态笔记转变为能自动分析关联、处理复杂结构的"活"知识库。详细步骤包括工具准备、环境配置、插件安装和云同步设置

2301_79998006的博客 1089

值得收藏的一些网页代码(asp,js,hml)

值得收藏的一些网页代码(asp,js,hml) 编程开发谌忠辉2004年3月22日 -------------------------------------------------------------------------------- 1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键<table bor...

weixin_30547797的博客 317

从通用到定制:营销Agent如何跨越数据鸿沟,实现对话SOP的个性化飞跃

从通用到定制:营销Agent如何跨越数据鸿沟,实现对话SOP的个性化飞跃

丨汀、的博客 659

ESP32与BH1750光照传感器结合使用的Web服务器案例

请注意,为了使代码正常工作,你需要将代码中的"你的WiFi网络名称"和"你的WiFi网络密码"替换为你自己的WiFi网络凭据。在代码中,我们首先导入了所需的库文件,包括Wire库用于I2C通信,BH1750库用于与光照传感器通信,WiFi库和WebServer库用于创建Web服务器。接下来,我们将编写一个Arduino代码来控制ESP32与BH1750的通信,并将读取到的光照强度值显示在Web服务器上。函数用于处理根路径的请求,其中我们读取光照传感器的值,并将其显示在返回的HTML页面中。

server_api196的博客 621

值得收藏的经典网页代码(1)

1. 将彻底屏蔽鼠标右键,无右键菜单 <body oncontextmenu="event.return=false"> 也可以用于网页中Table框架中:<table border oncontextmenu=return(false)><td>no</table> 2.取消选取、防止复制 <body onselectstart="ret...

weixin_30245867的博客 374

Prompt进阶2:LangGPT(构建高性能Prompt策略和技巧)--最佳实践指南

Prompt进阶2:LangGPT(构建高性能Prompt策略和技巧)--最佳实践指南

丨汀、的博客 2655

值得收藏的经典网页代码(2)

41.细线分隔线 <hr noshade size=0 color=#C0C0C0> 42.过度方式 < http-equiv="Page-Exit" content="revealTrans(Duration=3,Transition=5)"> Duration的值为网页动态过渡的时间,单位为秒。 Transition是过渡方式,它的值为0到23,分别对应24种过渡方式。...

weixin_30667649的博客 205

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

vb 6.0并口开发操作实例

vb6并口开发,简体中文,试例内有inpout32.dll动态链接库

网页移动代码大全,很值得收藏!

一、从右向左移 代码 需要移动的文字 二、从左向右移 代码 需要移动的文字 三、一圈一圈绕着移动 代码 需要移动的文字 四、只移动三次就停了 代码 需要移动的文字 五、移一步,停一停 代码 需要移动的文字 六、左右来回移动 代码 需要移动的文字 七、忽隐忽现移动

fy123001的专栏 1481

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

网页代码扒ppt_Python爬虫解析网页的4种方式 值得收藏

用Python写爬虫工具在现在是一种司空见惯的事情,每个人都希望能够写一段程序去互联网上扒一点资料下来,用于数据分析或者干点别的事情。我们知道,爬虫的原理无非是把目标网址的内容下载下来存储到内存中,这个时候它的内容其实是一堆HTML,然后再对这些HTML内容进行解析,按照自己的想法提取出想要的数据,所以今天我们主要来讲四种在Python中解析网页HTML内容的方法,各有千秋,适合在不同的场合下使用...

weixin_39983350的博客 1024

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

值得收藏的一些网页代码(ASP,JS,HTML)

1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键 no 可用于Table 2. 取消选取、防止复制 3. onpaste="return false" 不准粘贴 4. oncopy="return false;" oncut="return false;" 防止复制 5. IE地址栏前换成自己的图标 6. 可以

明 778

html常用网页特殊字符代码大全,值得收藏!

HTML特殊字符编码大全:往网页中输入特殊字符,需在html代码中加入以&开头的字母组合或以&#开头的数字。下面就是以字母或数字表示的特殊符号大全。 符号 html代码 符号 html代码 符号 html代码 符号 html代码 符号 html代码 符号 html代码 ...

我不生产数据,只是数据的搬运工 2083

asp.net 漂亮搜索框_值得收藏的10个网页搜索框样式(附代码下载)

php中文网最新课程每日17点准时技术干货分享网页搜索框是网站非常实用的一个功能,是提升网站用户体验度和增加用户粘性很好的一种方式,以下是php中文网为各位网页精选的十个实用好看的网页搜索框样式,大家在制作搜索框的时候可以进行参考,并下载代码。注:请点击左下【1. 七种纯CSS3搜索框UI设计效果 Search Box Design默认搜索框隐藏,点击搜索后,搜索框展开,如上样式,非常实...

weixin_39984952的博客 1450

html5网页密码框输入正确跳转_值得收藏的10个网页搜索框样式(附代码下载)...

php中文网最新课程每日17点准时技术干货分享网页搜索框是网站非常实用的一个功能,是提升网站用户体验度和增加用户粘性很好的一种方式,以下是php中文网为各位网页精选的十个实用好看的网页搜索框样式,大家在制作搜索框的时候可以进行参考,并下载代码。注:请点击左下【1. 七种纯CSS3搜索框UI设计效果 Search Box Design默认搜索框隐藏,点击搜索后,搜索框展开,如上样式,非常实...

weixin_30722591的博客 974

php搜索框搜索图片,值得收藏的10个网页搜索框样式(附代码下载)

网页搜索框是网站非常实用的一个功能,是提升网站用户体验度和增加用户粘性很好的一种方式,以下是php中文网为各位网页精选的十个实用好看的网页搜索框样式,大家在制作搜索框的时候可以进行参考,并下载代码。注:以下截取的演示图片可以点击放大显示,若想查看详细的搜索框演示效果,可以打开以下对应链接,点击【效果预览】在线演示。默认搜索框隐藏,点击搜索后,搜索框展开,如上样式,非常实用的样式特效!这是一款jQu...

weixin_39531635的博客 627

JavaScript加入收藏夹代码(收藏网站代码)

<br /><br />以下代码可收藏网站首页 ,调用方式: more details : www.5djava.com <br /> <br /><a href="javascript:favSite()">收藏本站</a> <br /> <br />JavaScript代码,此代码兼容IE及Firefox: <br /> <br />//收藏网站代码 <br />function favSite() <br />{ <br />    //网站网址 <br />    url  ='http://www

jay_leeqiang的专栏 2026

Edge浏览器网页怎么收藏 Edge浏览器网页收藏图文教程

Edge浏览器是微软最新推出的网页浏览工具。而现在有很多Edge浏览器新用户可能对它不是很了解,在使用过程中会出现小问题。今天小编就为大家解答Edge浏览器网页怎么收藏,一起来看教程吧! Edge浏览器网页收藏图文教程 一、怎么收藏网页? 1、打开Edge浏览器; Edge浏览器网页怎么收藏 Edge浏览器网页收藏图文教程 2、然后随便打开一个网页,我打开的是北京石油化工学院的官网,然后点击上面的星号键; Edge浏览器网页怎么收藏 Edge浏览器网页收藏图文教程 3、然后点击创建位置,选择收藏夹栏,然后点

yisago的博客 1906

将网页添加至收藏夹代码

其中rel="sidebar" title="待添加网页title" 是为了兼容火狐浏览器 /**  * 添加收藏夹   */ function addFavorite() { if (document.all) { window.external.addFavorite( 'http://XX', '待添加网页名称'); } else if (window.sidebar) {

kataerdeshui的专栏 1067
上一篇: 永恒的伊甸园—宫崎骏的动画世界
下一篇: 最好免费的Training 和Tutorials资源
vickivk
博客等级 码龄23年 0粉丝 2原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值