学习 JavaScript, jQuery, ASP.NET MVC

.NET中实现后台调用前台JavaScript方法和传递参数 通过上述方法,我们可以在.NET开发中实现后台调用前台JavaScript方法并传递参数。在ASP.NET WebForms中,我们使用ScriptManager控件和PageMethods对象来实现;在ASP.NET MVC中,我们使用JsonResult类型的Action方法和ajax方法来实现。在.NET开发中,经常需要在后台代码中调用前台JavaScript方法,并传递参数。这种情况下,我们可以借助ASP.NET WebForms或ASP.NET MVC框架提供的一些技术来实现。 阅读详情

 

      因为工作的原因,要开始学习JavaScript的基础知识,经人介绍选择了《JavaScript权威指南(第6版)》作为入门的指导丛书,呵呵!很喜欢第一张第一段对JavaScript、HTML和CSS这个Triad的精辟描述:

  • HTML to specify the content of web pages,
  • CSS to specify the presentation of web pages
  • JavaScript to specify the behavior of web pages.

 

=== 表达式和语句的关系===

An expression is a phrase of JavaScript that a JavaScript interpreter can evaluate to produce a value. If the phrases of JavaScript are expressions, then the full sentences are statements. JavaScript statements are terminated with semicolon. Expressions are evaluated to produce a value, but statements are excuted to make something happen.

 

=== Closure ===

  什么是closure?  closure是Javascript语言的重要概念是之一,如果不理解这个概念,会影响后面对jQuery Plug-in等概念的学习。但对于像我这样初学者而言,很难能一下子准确把握其含义,特别是书上那些拗口的定义, 例如:"Closure is yet another element from Lisp that has migrated into Javascript. When a function is created in Javascript, the function has access to any lexically scoped variables that were in the environment that created it." 摘自《Programming HTML5 Applications》。

       这里有篇好文章 Closures , 由浅入深介绍了closure的概念 : "A closure is a special kind of object that combines two things: a function, and the environment in which that function was created. The environment consists of any local variables that were in-scope at the time that the closure was created." 

       在下面的例子中,add5和add10就是两个closure。它们不仅代表一个function,同时还关联着一个environment,这个environment中保留了add5和add10在被创建时所能够访问到variable,如:x。这有就是为什么,makeAdder退出后,add5和add10仍能够访问x。

<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>Learning JavaScript Concept - Closure</title> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script> <script> $(document).ready(function () { // makeAdder is a factory function function makeAdder(x) { return function (y) { return x + y; }; }; // add5 is a closure var add5 = makeAdder(5); // add10 is another close var add10 = makeAdder(10); var list = "<li> Call add5(1) = " + add5(1) + "</li>"; list += "<li> Call add10(1) = " + add10(1) + "</li>"; $("#list").html(list); }); </script></head><body> <ul id="list"> </ul></body></html>

 

=== Anonymous function? ===

 Javascript anonymous function. 

"Variables are scoped at the function level in javascript. This is different to what you might be used to in a language like C# or Java where the variables are scoped to the block. What this means is if you declare a variable inside a loop or an if statement, it will be available to the entire function."

 

=== 什么是self-invocation pattern? === 

 Self-invocation 

"Self-invocation (also known as auto-invocation) is when a function executes immediately upon it’s definition. This is a core pattern and serves as the foundation for many other patterns of JavaScript development."

"In an effort to protect the global object, all JavaScript applications should be written within a self-invoking function. This will create an application scope in which variables can be created without the fear of them colliding with other applications."

 

=== Javascript strict mode ===

 'use strict' :  IE10 才支持。

 

=== ASP.NET MVC 4 - Bundles ===

Bundling and Minification(F12, Debugging, EnableOptimizations),ScriptBundle, StyleBuddle.

Bundles set the HTTP Expires Header one year from when the bundle is  created. If you  navigate to a previously viewed page, Fiddler shows IE does not make a  conditional request for the bundle, that is, there are no HTTP GET requests from  IE for the bundles and no HTTP 304 responses from the server. You can force IE  to make a conditional request for each bundle with the F5 key (resulting in a  HTTP 304 response for each bundle). You can  force a full refresh by using^F5 (resulting in a HTTP 200 response for each bundle

 

=== Razor : SiteLayout.cshtml, _viewStart.cshtml @RendorSection() ===

ASP.NET MVC : Layout with Razor 

" Razor includes a new feature that enables us to remove the need to explicitly set the Layout in each view – and instead allows us to define the layout logic once for all views in the site – making our view files even cleaner and more maintainable (and ensuring we keep to the DRY principle: Don’t Repeat Yourself). "  ------  通过定义 _ViewStart.cshtml 文件,并将其放置在 \views 文件夹下这样就可以为所有view定义Layout了。

 

=== HTTP 304 === 

HTTP Status Code Definitions,Get Rid of HTTP 401 and HTTP 304 

(In generalHTTP 304 is returned by web server when the browser is not really sure about up-to-date’ness of the resource)

 

=== JavaScript : No Class but constructor ===

There are no classes in JavaScript and this allows for great flexibility, because you don't have to know anything about your object in advance; you don't need a class "blueprint".

 

=== JSON - JavaScript Object Notation ===

It's only a combination of the array and the object literal notation. The only syntax differenc between JSON and the object literal is that property names need to be wrapped in quotes to be valid JSON. Here is a JSON string example :  {"Name" : "Jeffrey", "Some" : [1, 2, 3] } . In JSON strings, you cannot use functions or regular expression literals.JSON.parse() andJSON.stringify() are natively supported by the JavaScript engine in modern browsers, such as IE. jQuery has jQuery.parseJSON but no the opposite operation ?

To convert a JSON text into an object, you can use the eval() function. It invokes the JavaScript compiler. Since JSON is a proper subset of JavaScript, the compiler will correctly parse the text and produce an object structure. The text must be wrapped in parens to avoid tripping on an ambiguity in JavaScript's syntax.  

var myObject = eval('(' + myJSONtext + ')');

The eval function is very fast. However, it can compile and execute any JavaScript program,so there can be security issues. The use of eval is indicated when the source is trusted and competent. It is much safer to use a JSON parser

Chainability - Understand the chain. iFrame memory in IE,Lost Focus http://blog.csdn.net/liaobc/article/details/7887238

JQuery  blur()

             The blur event fires when an element loses focus either via the pointing device or by tabbing navigation.

        this.each()

jQuery supports "chainable methods", which means that most jQuery functions should return this. .each() returns this, and if you want $('selector').yourPlugin().css(...) to work, you should return this.

 

=== Knockout.js ===

       jQuery作为一种通用的JavaScript框架使JavaScript编程变得容易和简洁很多,但是它在解决一些特定问题时还是有捉襟见肘的时候,比如:数据与UI元素的绑定。Knockout.js就是专门针对数据与UI元素绑定的框架,它使得这种绑定的代码更简洁。Beginners Guide  to Knockout.js : Part 1 ,Part 2 和 Part 3,是不错的入门好文。KnockoutJS 与ASP.NET MVC结合的视频, 还有MVC Techniques with JQuery,JSON and Knockout.js。

       knockout优点之一就是,它使用data-bind属性建立数据和界面元素的绑定关系,避免了直接与DOM元素耦合在一起,HTML结构的改变不会影响绑定,例如:

<p>The day of the week is <span data-bind="text: dayOfWeek"></span>. It's time for <span data-bind="text: activity"></span></p> 
function viewModel() {
  this.dayOfWeek = ko.observable('Sunday');
  this.activity = ko.observable('rest');
};
ko.applyBindings(new viewModel());

 

       要真正用好knockout, 还需要对MVVM模式有所了解,Understanding MVVM - A Guide For Javascipt Developers 是不错的介绍文章,下面的概述非常点睛 :

MVVM (Model View ViewModel) is an architectural pattern based on MVC and MVP, which attempts to more clearly separate the development of user-interfaces (UI) from that of thebusiness logic and behaviour in an application. To this end, many implementations of this pattern make use of declarative data bindings to allow a separation of work on Views from other layers.

This facilitates UI and development work occurring almost simultaneously within the same codebase. UI developers write bindings to the ViewModel within their document markup (HTML), where the Model and ViewModel are maintained by developers working on the logic for the application.

 

=== altJS ===

           这年月新词汇太多了,稍不小心就OUT了。altJS应该说的是JavaScript的替代品, 参看CoffeeScript vs. TypeScript vs. Dart。?????? JavaScript有什么不好,为啥要替代了人家??????

 

=== Require.js ===

           Modular Javascript with  RequireJS 主要是用来弥补JavaScript语言对模块化编程(Modular Programming)支持的不做。在没有RequireJS时候,开发人员主要是依赖于<script>标签,来定义并加载一系列需要的JavaScript文件。这种方式对于使用少量的JavaScript文件的应用来说是有效的,但对于使用大量JavaScript文件的应用而言,维护的成本和复杂度是非常大的。同时,采用<script>也会带来性能方面的影响,用户需要等待所有文件加载完毕后才能使用该应用。

RequireJS使用带来了两点好处: 1. 清晰的模块定义;2. 模块异步加载的性能提升;

          RequireJS Org Doc

          RequireJS Doc API 上面两篇文章适合在接触过RequireJS的初学者入门使用,而这边RequireJS自己的文档,更是适合需要具体了解RequireJS细节的开发人员阅读。它更详细地介绍了,RequireJS的方方面面,具体到API的使用和配置等。特别是Require() API在加载时,对非Module类型的JavaScript文件的处理等。

      RequireJS/Text 是一个用来加载文字内容的插件。

      RequireJS使JavaScript代码有个更好的模块化结构,但是如果对这样的代码进行单元测试呢? 特别如果屏蔽掉模块的外部依赖呢?http://fragphace.pl/blog/2013-03-13-Mocking-requirejs-dependencies 是不错的入门好文。

 

=== Backbone.js === 

Getting Started with Backbone.js 

" Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface."

 

" Backbone provides a clean way to surgically separate your data from your presentation. The model that works with the data is only concerned with synchronizing with a server while the view’s primary duty is listening to changes to the subscribed model and rendering the HTML "

 

=== Knockback ===

疑问  Can Knockback be used to handle complicated data object, where the object is nested with collections?疑问

 

Getting Started with Knockback.js

In essence, Knockback.js bridges the dynamic DOM bindings ofKnockout.js with the models, computeds, and routers ofBackbone.js. It also brings some other cool features like localization, default values, and nested view models!

 

Tutorial : Getting started with knockback.

" You can use Knockback to bind Backbone Models/Collections to your HTML/templates (View) using Knockout. "

 

2-Way Databanding using Knockout and Backbone

" Knockback is a fantastic little “bridge” library that brings together the MVP structure of Backbone and the magical data-binding goodness ofKnockout.  The library doesn’t replace either one, but just smoothes over the rough edges where they stomp on each other, allowing you to create a Knockout ViewModel from a plain old Backbone.Model."

 

=== Bootstrap ===

How to use Twitter bootstrap to create a responsive web design?

" At the core of Bootstrap is a set of basic HTML elements that have been styled to allow for easy enhancement via classes and user styles."
 

=== MEF ====

Get started with MEF

" The Managed Extensibility Framework or MEF is a library for creating lightweight, extensible applications. It allows application developers to discover and use extensions with no configuration required. It also lets extension developers easily encapsulate code and avoid fragile hard dependencies. MEF not only allows extensions to be reused within applications, but across applications as well. "

 

==== HTTP/HTTPS ====

The First Few Milliseconds of an HTTPS Connection

 

 

Reference:

  1. Writing Fast, Memory Efficient JavaScript
  2. JavaScript and Memory Leak 
  3. Closures in JavaScript
  4. How to author a jQuery plug-in 

利用PLECS实现Boost变换器的闭环控制仿真与优化 本文详细介绍了如何利用PLECS仿真软件实现Boost变换器的闭环控制与优化。从基础原理到开环系统搭建,再到闭环控制设计与动态优化,提供了完整的仿真实践指南。通过PLECS的仿真功能,工程师可以有效诊断问题、优化参数,并实现高性能的DC-DC变换器设计。 阅读详情

相关推荐

使用Dify打造视频生成工作流:从提示词到视频的完整指南

Dify作为开源LLM应用开发平台,通过可视化工作流编排实现从文本到视频的端到端生成,将创意周期从天级缩短至分钟级。核心流程包括提示词工程、视频API调用、存储分发和结果反馈。

牛奶夹心巧克力 3451

ASP.NET MVC使用javascript

在母版页,也就是布局页,使用 @if (IsSectionDefined("SubMenu")) { @RenderSection("SubMenu", required: false) } SubMenu:这个名字随便取 在需要用脚本的地方 @section SubMenu{ <script src="~/js/submenu.js"></script> } 就完成了。 ...

一杯浊酒笑风尘 2038

短视频mssdk中get_token协议逆向与加密流程深度解析

本文深度解析了短视频mssdk中get_token协议的逆向分析与加密流程。通过抓包、Frida Hook、静态分析等手段,详细拆解了协议数据的Protobuf结构、设备信息采集来源,并重点剖析了其核心加密链路:zlib压缩、自定义TEA算法与AES-CBC加密,最终实现完整的协议模拟。

flower的专栏 573

asp.net mvc 与JavaScript ajax使用(刚学不久,想必很菜,希望对刚学的同学有用)

这是第一次记录文章

u012935474的专栏 337

ADS2020实战:手把手教你搭建交叉耦合VCO并分析相位噪声(附避坑指南)

本文以ADS2020软件为例,提供了交叉耦合压控振荡器(VCO)从原理图搭建到相位噪声分析的完整实战指南。详细讲解了核心器件选择、谐波平衡与瞬态仿真的关键设置,并重点剖析了相位噪声的仿真方法与优化方向。文中附有详细的避坑指南,帮助初学者和工程师高效完成VCO设计与仿真验证,避免常见错误。

p5l2m9n4o6q的博客 294

Zabbix华为交换机光衰告警

zabbix使用自动发现监控huawei网络设备光衰

qq_31651649的博客 4550

ASP.NET MVC 引入JavaScript(.JS)文件

 <script src="<%=Url.Content("~/Scripts/jquery-1.4.2.min.js") %>" type="text/javascript"></script><br /> <script src="<%= Url.Content("~/Scripts/jquery-1.3.2.min.js")%>" type="text/javascript"></script> <br /> <br />

超越梦想... 7372

【从零开始学Skynet】基础篇(一):Skynet环境搭建

Skynet运行于Linux操作系统,我们可以在自己的电脑上搭建虚拟机系统,也可以购买阿里云、腾讯云服务器,笔者这个系列的所有代码都是在Ubuntu16.04版本的虚拟机系统下运行编辑。

我是一条寻水的鱼 3172

Asp.Net MVC 多语言实现—— JavaScript多语言支持

对于JavaScript多语言支持,我们可以分别为不同的语言编辑定义多语言的JS文件,再根据情况加载不同语言的JS文件。这里要说的是另一种情况,JS和View共用Resource文件,这样修改或添加语言项只针对资源文件即可。 1. 首先建立Controller及Action: publicclassContentController:Controller { ...

weixin_30925411的博客 255

wpa_supplicant EAPOL状态机分析

wpa_supplicant EAPOL状态机分析

加油鸭 1490

LoRA 完整解析:从理论到实践

LoRA(低秩适应)是一种高效的大模型微调方法,通过添加少量可训练参数(低秩矩阵)来适配新任务,避免全参数微调的高成本。其核心是将权重更新ΔW分解为两个小矩阵B×A的乘积,大幅减少训练参数量(仅0.1-1%)。LoRA基于内在维度假设,通过低秩约束捕捉核心任务信息,兼具效率与效果。实际应用中,常用配置为秩r=16-32,目标模块选择注意力层的q_proj和v_proj,学习率比全参数微调大10倍(约1e-4)。优势包括参数高效(内存降低60-80%)、多任务适配灵活、保留预训练知识等,已成为大模型微调的主流

echo的博客 1429

网站资料收集 主要查看js的学习部分

1、Asp.Net MVC3.0基本的简单的可能都会用,更深入的使用还需加深研究,之后希望对MVC4.0和5.0进行对比学习,暂时看到@葡萄城控件技术团队博客的MVC5系列正在继续http://www.cnblogs.com/powertoolsteam/tag/MVC/。 2、JavaScript、jQuery基本的也会不少,通常都是用啥百度、google然后差不多就出来了,之后要系统学习下,...

weixin_33834137的博客 111

AUTOSAR 导入DBC ISOLAR工程配置

ISOLAR工程配置-dbc导入

汽车电子电气 2419

Web前端工作2个月小结

开始语: 2013年6月30日,Microsoft Learning support 项目结束,转而进入Forerunner Development 项目,这对于这块领域空白的我,空前的困难,可是我坚信事在人为!于是乎,开始了我的Web 前端的征程……   首先,为了能快速加入这个项目,我提前开始了HTML5+CSS3+JavaScript+jQuery的学习   其次,为了能快速适应这个项目...

weixin_30810239的博客 238

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

WINCC7.3破解文件

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

如何高效的利用博客园?

写在前面 在河南工作那会儿,虽然遇到问题也百度过,google过,但是很少留意内容来自哪个网站,也许是工作的内容太简单了,也许是太单调了,之后的之后就很少上网查东西了,因为模块相似,功能相似,代码写了n遍了。真不用了!后来也因为合同到期了,就选择了让我向往已久的北京。 来了北京后,发现自己其实很菜,之前那种玩法都是小儿科。不得不重新充实自己。然后就是不断的学习,不断的提高,一个偶然的...

banfu7150的博客 163

深度学习工具包 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")

10多种JavaScript和jQuery MVC教程

自2011年已接近尾声,我们即将面对另一品牌新的一年在几个星期内,我们认为我们会给你提供超过10个的JavaScript的收集和jQuery的MVC教程 ,你可能愿意学习之前2012年MVC FTW! 玩得开心! jQuery的MVC 1. AJAX - 春MVC 3和jQuery集成 在本教程中,我们将建立与使用jQuery AJAX功能的简单的Spring MVC 3应用程序。 我们...

552

ASP.net MVC4 + HTML5 + JS 学习贴

1、MVC The Official Microsoft ASP.NET Site http://www.asp.net/mvc 2、跟我一起学习ASP.NET 4.5 MVC4.0 http://www.cnblogs.com/xdotnet/archive/2012/03/05/aspnet_mvc40_preview.html 3、codeproject - ASP.NE...

v5browser 249

分享16个javascript&jQuery的MVC教程

日期:2011/12/19 来源:GBin1.com 2011即将过去我们将在几周后迎来新的一年。 这里我们将介绍10多个js和jQuery的MVC教程希望大家喜欢! jQuery MVC 1. AJAX - Spring MVC 3和jQuery的整合 这个教程中我们将使用jQuery的AJAX机制开发一个简单的Spring MVC3应用。我们将介绍如何使用jQuery.post()方...

weixin_30832405的博客 91

2009年自我总结

转眼之间,又是一年过去。2010年的第一个月就剩这最后一天。也该为自己的2009总结总结了,为今年计划计划。 回想2009年,就这样匆匆的过去了。看看自己在2008年末为自己定的计划,好多都没有达到预期的目标。虽说有工作上的原因(加班比较多,平时学习的时间少了),自身也有原因(计划的执行力不够),计划制定也不够细(制定了大的目标,没有进行任务分解,设置里程碑)。原因种种,希望能在2010...

dengqi4009的博客 149

asp.net、html、javascript等比较有用的网站

Learn模块下web、mvc、razor等。 http://www.asp.net/ 包括html、javascript、jquery、xml等教程。 http://www.w3school.com.cn/ jq-school.com MSDN官网 技术性问题等基本上都能搜到答案。 http://msdn.microsoft.com/ http://www....

weixin_30260399的博客 77

前端工程师的三个学习阶段

阶段一:前台工程师 1. 入门:html 2. 进阶:css 3. 中级: JavaScript 4.高级: 活学活用,三者结合,大量实践 5.高手: jQuery(是JavaScript操作html和css的利器) 6.终极: PS+FLASH。 如果JavaScript学的好,可以顺便学一下 Action Script 阶段二: Net后台工程师 1. 初级: Acces...

weixin_30346033的博客 211

B/S总结

前言    从牛腩,HTML,XML,asp.net,javascript,css,jqery到ajax,B/S模块的学习结束啦!这段时间,伴随着视频、demo和真正项目的历练,突然觉得这些基础真的太重要了,之后的那些框架啊技术啊都是在这些基础之上建立的!结束之际,做一个总结!框架    一开始牛腩新闻发布系统用的就是纯三层(U、B、D),后来做库房管理系统用的是MVC框架+三层,其实就是将U层划

不会英语的程序员不是好开拓者 513

走过1314

2013年的最后一天,简短的写个总结,仅此而已。 上一篇随笔中,我提到今年要换个公司,涨点工资,这个目标已经实现了,但是明年我还有更多和更大的目标需要去实现。 很高兴在今年的尾声终于加入到了ASP.NET MVC的项目中工作,还用到了WCF技术和Oracle数据库,但都还只是刚接触而已,明年的首要任务就是熟练地去掌握这些技术,能够达到更熟练的去运用,遇到问题能够快速独立...

weixin_30839881的博客 122

ajaxpro post html,c# - Call ASP.NET function from JavaScript? - Stack Overflow

Static, strongly-typed programming has always felt very natural to me, so at first I resisted learning JavaScript (not to mention HTML and CSS) when I had to build web-based front-ends for my applicat...

weixin_31099497的博客 228

.NET Web开发技术简单整理

在最初学习一些编程语言、一些编程技术的时候,做的更多的是如何使用该技术,如何更好的使用该技术解决问题,而没有去关注它的相关性、关注它的理论支持,这种学习技术的方式是短平快。其实工作中有时候也是这样,公司要推崇一个新技术、一个解决方案,我们总是短平快的去学习如何使用它,按照固定的解决问题思路按着案例进行,这也是一种应对项目紧急的一些措施。 个人感觉如果有空闲时间的话,还是分析一下、理解一下、深入了

819

12.19.2016 下半年技术小结

下半年课蛮重的,加上心思比较野,在学习新东西上对自己比较失望 课业: ASP.NET MVC开发:MyStore购物网站 和 SSLS 图书馆管理网站(由于用的mac,只能在学校电脑写.NET,真的蛋疼) 前端:加深jquery和bootstrap的理解和运用 汇编语言:从无到有 有空闲想看看react.js 转载于:https://www.cnblogs.com/ma...

weixin_30611509的博客 86

SHAREPOINT 2016 & 2013 DEVELOPER TRAINING

OVERVIEW course explores the development opportunities available with SharePoint Onpremises using either SharePoint Server 2016 and SharePoint Server 2013. Students will learn about the tradeoff...

dianzhuoxing1136的博客 228
上一篇: 介绍 Windows Azure Role Architecture 的文章
下一篇: Powershell - Failed to enumerate SSL bindings, error code 234
quicknet
博客等级 码龄25年 398粉丝 117原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址