- 博客(134)
- 资源 (6)
- 收藏
- 关注
转载 Angular Material vs. Material Design Lite
https://scotch.io/bar-talk/angular-material-vs-material-design-liteIn this article we’re going to explore the options that Google provides us when implementing Material Design in our
2016-05-16 11:19:37 1757
转载 React one-way flow
React is all about one-way data flow down the component hierarchy. It may not be immediately clear which component should own what state. This is often the most challenging part for newcomers to unders
2016-04-14 23:31:13 590
转载 HTTP Headers
HTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议。HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应。就整个网络资源传输而言,包括message-header和message-body两部分。首先传递message- header,即http header消息 。http header 消息通常被分为4个部分:g
2016-03-21 20:19:09 530
转载 浏览器禁止 后退键
//处理键盘事件 function doKey(e){ var ev = e || window.event;//获取event对象 var obj = ev.target || ev.srcElement;//获取事件源 var t = obj.type || obj.getAttribute('type');//获取事件源类型 if
2016-03-14 15:28:17 705
原创 html form formenctype属性
该属性表示在发送表单数据前对数据如何对数据进行编码。 可以使用以下属性: 屬性值 説明 application/x-www-form-urlencoded 默认值; 在发送前编码所有字符;如果请求为get,浏览器会将数据转换成?name=value&name=value的方式拼接到提交目标URL的后面 multipart/form-data 不对字符编码; text/pl
2016-02-09 11:51:17 551
翻译 HTTP/1.1 协议常用的方法
原文地址 1. 幂等方法 幂等是指执行N>0个请求,得到的返回是等效的. 请求方法 GET,HEAD, PUT, DELETE 都是幂等方法。但是方法OPTIONS,TRACE就不具备幂等性. 2. OPTIONS OPTIONS请求主要是用来请求指定URI是否可用的方法. OPTIONS方法允许客户端主动终止请求和请求在服务器端的资源.服务器返回的response 是不能
2016-01-27 20:12:04 912
原创 跨域 上传文件 的一个例子
web端: var xhr = new XMLHttpRequest(); /** * handle callback */ xhr.onreadystatechange = onreadystatechange;
2016-01-21 20:28:16 3187
原创 默认Spring DispatcherServlet 不支持 OPTIONS方法
For default Spring DispatcherServlet supports GET, HEAD, POST, PUT, PATCH and DELETE only; if you want to support TRACE and OPTIONS you have to put "dispatchOptionsRequest" and "dispatchTraceRequest"
2016-01-21 11:05:05 2080
转载 XMLHttpRequest
PropertyDescriptiononreadystatechangeStores a function (or the name of a function) to be called automatically each time the readyState property changesreadyStateHolds the status of t
2016-01-18 16:57:48 372
原创 angular debounce throttle
throttle我们这里说的throttle就是函数节流的意思。再说的通俗一点就是函数调用的频度控制器,是连续执行时间间隔控制。主要应用的场景比如:鼠标移动,mousemove 事件DOM 元素动态定位,window对象的resize和scroll 事件有人形象的把上面说的事件形象的比喻成机关枪的扫射,throttle就是机关枪的扳机,你不放扳机,它就一直扫射。我们
2015-12-14 15:35:00 2669 1
转载 angular form validator
Taming Forms in AngularJS 1.3Learn how to use the new form features in AngularJS 1.3Forms in AngularJS 1.3 have been improved quite a bit from what they were back in 1.2 and 1.1. Lots of bug
2015-12-07 00:36:06 1631
转载 NodeJs 安全
毫无疑问,Node.js现在是越来越成熟。尽管这样,我们还没有形成很多的安全准则。在这篇文章中,我会分享一些关于提高Node.js安全性方面的技巧。不用eval,赢得朋友你不仅仅要避免使用eval - 你也应该避免使用在下列情况,他们等价于直接使用eval;setInterval(String, 2)setTimeout(Str
2015-11-18 19:39:54 690
原创 yo generator 强制更新文件
conflicts: function () { this.conflicter.force = true;},
2015-11-14 15:49:38 555
原创 yo generator 对象 方法
templatePath : 当前index.js所在目录destinationPath : generator根目录destinationRoot : functionsourceRoot : functiontemplatePath : functiondestinationPath : function resolved : 当前index.jsappna
2015-11-14 14:57:07 757
转载 gulp
gulp一、前言gulp是一个适用于javascript的构建工具,能自动执行已定义的常见任务,如语法检测(jshint)、测试(mocha)、压缩(uglify)等。其相当于maven之于java。还有一个更早出现的构建工具grunt,其也提供了gulp的功能,且功能更为强大,但其在配置及使用上更为繁琐,其实现的理念也导致其编译效率较低,新出现gulp的出现正是为了解
2015-11-09 20:25:36 822
原创 safeApply angular
function safeApply(fn) { var phase = this.$root.$$phase; if (phase == '$apply' || phase == '$digest') { if (fn && (typeof(fn) === 'function')) { fn(); } } else
2015-11-04 18:43:51 1198
转载 Restful API 的设计规范
http://www.tuicool.com/articles/bUZNZbZRestful API 的设计规范1. URIURI规范资源集合 vs 单个资源避免层级过深的URI对Composite资源的访问2. RequestHTTP方法安全性和幂等性复杂查询BookmarkerFormatContent Negotiation6. Response分
2015-10-20 15:12:15 3138
转载 rest api
两周前因为公司一次裁人,好几个人的活都被按在了我头上,这其中的一大部分是一系列REST API,撰写者号称基本完成,我测试了一下,发现尽管从功能的角度来说,这些API实现了spec的显式要求,但是从实际使用的角度,欠缺的东西太多(各种各样的隐式需求)。REST API是一个系统的backend和frontend(或者3rd party)打交道的通道,承前启后,有很多很多隐式需求,比如调用接口与RF
2015-10-20 11:29:15 768
转载 HTTP Header
http://www.cnblogs.com/Joans/p/3956490.htmlHTTP(HyperTextTransferProtocol) 即超文本传输协议,目前网页传输的的通用协议。HTTP协议采用了请求/响应模 型,浏览器或其他客户端发出请求,服务器给与响应。就整个网络资源传输而言,包括message-header和message-body两部分。首先传 递message-hea
2015-10-20 11:23:58 509
转载 AngularJS 异常处理
$exceptionHandler对于 Angular digest 中未捕获的异常,由 $exceptionHandler 处理。Any uncaught exception in angular expressions is delegated to this service. The default implementation simply delegates to $lo
2015-10-19 15:17:50 6072
转载 应用程序结构的LIFT准则
原文http://www.reqianduan.com/1722.html应用程序结构的LIFT准则LIFT[Style Y140]构建一个可以快速定位(Locate)代码、一目了然地识别(Identify)代码、拥有一个平直(Flattest)的结构、尽量(Try)坚持DRY(Don’t Repeat Yourself)的应用程序,其结构应该遵循这4项基本
2015-10-17 16:52:23 610
原创 angular controller 依赖声明
依赖声明INJECTOR如何知道需要给组件提供那些依赖?程序的开发人员需要明确的声明依赖以便injector决定如何解决依赖关系。在Angular中,有三种方式可以声明一个组件所依赖的服务:隐式的从函数参数名中推断使用$inject属性声明使用数组声明隐式依赖最简单获取依赖的方式就是假定函数的参数名就是依赖的名字:function MyC
2015-10-17 16:08:05 1474
原创 html 文档模式 与 meta
文档模式:HTML文档模式是通过使用文档类型DOCTYPE来指定的。目前文档模式有三种:混杂模式(quirks mode)、标准模式(standards mode)和准标准模式。对于准标准模式,一般又是通过过渡型(transitional)和框架集型(frameset)来触发。准标准模式下很对特性都会按照浏览器标准去解析(当然,不是所有),文档开始处如果没有发现文档类型声明,则默认是混杂模
2015-10-17 14:48:39 804
原创 angular this vs $scope (How does 'this' and $scope work in AngularJS controllers?)
"How does 'this' and $scope work in AngularJS controllers?"Short answer:thisWhen the controller constructor function is called, this is the controller.When a function defined on a $sco
2015-10-15 11:49:04 856
原创 angular compile vs link vs controller
compile function - use for template DOM manipulation (i.e., manipulation of tElement = template element), hence manipulations that apply to all DOM clones of the template associated with the directi
2015-10-08 10:06:14 602
原创 angular debug 调试
function minErr(module, ErrorConstructor) { ErrorConstructor = ErrorConstructor || Error; return function() { var SKIP_INDEXES = 2; var templateArgs = arguments, code = templateArgs
2015-10-07 18:09:46 5736 1
转载 javascript toString.call()
The toString() method returns a string representing object.Syntaxobj.toString()DescriptionEvery object has a toString() method that is automatically called when the object is to be rep
2015-09-17 19:19:30 1193
原创 for循环 i 闭包
for (var i = 0; i < len - 1; i++) { (function(i) { //do anything })(i); }这样就能正常访问index I了
2015-08-31 15:24:23 382
原创 更改angular $http post 默认json
By default, the $http service will transform the outgoing request by serializing the data as JSON and then posting it with the content- type, "application/json". When we want to post the value as a FO
2015-08-31 10:11:09 2801
原创 angular 封装 Jquery插件时作用域问题
今天在封装一个Jquery插件的时候,在用jquery处理绑定事件时需要访问scope去更新绑定model的值代码如下: commonDirective.directive('commonDate', function() { var defaultUrl = CONSTANT.COMMONDIRECTIVE.PATH + 'commonDate.html'; return {
2015-08-24 11:06:48 1036
原创 dynamic change content of bootstrap tooltip or popover
f you grab the popover instance like this:var popover = $('.reply').data('bs.popover');Then, to redraw the popover, use the .setContent() method:popover.setContent();I found out browsing t
2015-08-20 14:18:28 573
转载 BeanUtils与PropertyUtils区别
BeanUtils与PropertyUtils区别以及java.util.Date发生异常问题:除BeanUtils外还有一个名为PropertyUtils的工具类,它也提供copyProperties()方法,作用与BeanUtils的同名方法十分相似,主要的区别在于后者提供类型转换功能,即发现两个JavaBean的同名属性为不同类型时,在支持的数据类型范围内进行转换,而前者不支持这个功
2015-08-13 17:02:03 671
转载 Angular ui-grid 2.0 与 3.0 版本区别
这两天用到了Angular的ui-grid插件。网上能搜到的教程基本上是基于2.0版本的,现把3.0版本的不同点列出来,以免入坑。Upgrading from 2.x to 3.0ui-grid 3.0 is a substantial upgrade from ng-grid 2.x, with the majority of the code base having been
2015-08-13 15:23:47 3088 2
转载 angular scope of directive
在这之前希望你对AngularJS的Directive有一定的了解,不然你对下面部分的理解可能会有一点难度。步入正题:每当一个指令被创建的时候,都会有这样一个选择,是继承自己的父作用域(一般是外部的Controller提供的作用域或者根作用域($rootScope)),还是创建一个新的自己的作用域,当然AngularJS为我们指令的scope参数提供了三种选择,分别是:false,
2015-08-12 14:48:27 743
原创 Angular controller, services, scopes fundamental concept
Controller:Use controllers to:Set up the initial state of the $scope object.Add behavior to the $scope object.Do not use controllers to:Manipulate DOM — Controllers should contain only
2015-07-27 16:15:54 532
原创 JavaScript 异步编程 与异步式I/O
和JavaSript线程异步同步相同的还有 对I/O的处理。I/O的处理包括同步式I/O(阻塞式I/O) 与 异步式I/O(非阻塞式I/O)。什么是阻塞(block)呢?线程在执行中如果遇到磁盘读写或网络通信(统称为 I/O 操作),通常要耗费较长的时间,这时操作系统会剥夺这个线程的 CPU 控制权,使其暂停执行,同时将资源让给其他的工作线程,这种线程调度方式称为 阻塞。
2015-07-25 16:33:17 2499
原创 OS 线程模型 及JVM线程模型的实现
关于线程, 有内核级线程和 用户级线程(user land)内核级线程是OS设定的,用户(开发者)没有权利更改, 而用户级线程是用户可以进行实现和处理的。然后内核级线程和用户级线程的对应关系有 1:1 , M: 1, M:N 三种。--------线程模型这里有一个误区就是,只有1:1的比例才会发挥出用户级线程的多线程好处。这个要看具体的模型的实现。、在JVM规范里是没有规定的—
2015-07-25 15:34:41 878
转载 “Thinking in AngularJS” if I have a jQuery background?
1. Don't design your page, and then change it with DOMmanipulationsIn jQuery, you design a page, and then you make it dynamic. This is because jQuery was designed for augmentation and has grown in
2015-07-25 14:30:22 621
主题网络爬虫研究综述.pdf
2013-02-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人