自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(205)
  • 资源 (2)
  • 收藏
  • 关注

转载 Avoid duplicate form submissions

When a web form is submitted to a server through an HTTP POST request, a web user that attempts to refresh the server response in certain user agents can cause the contents of the original HTTP POST

2015-10-20 14:42:38 971

转载 HTTP access control (CORS)

A resource makes a cross-origin HTTP request when it requests a resource from a different domain than the one which served itself. For example, an HTML page served from http://domain-a.com makes an 

2015-10-13 16:46:57 1102

转载 Classloader-Related Memory Issues

Sometimes I think the Java classloader is to Java what dll-hell was to Microsoft Windows (Read here , and here if you want to know more about this sort of hell). However, modern enterprise Java ap

2015-09-07 13:17:46 585

转载 How Garbage Collection Really Works

Java Memory Management, with its built-in garbage collection, is one of the language's finest achievements. It allows developers to create new objects without worrying explicitly about memory allocati

2015-09-04 14:20:37 493

转载 css3中单位px,em,rem,vh,vw,vmin,vmax的区别及浏览器支持情况

px:绝对单位,页面按精确像素展示em:相对单位,基准点为父节点字体的大小,如果自身定义了font-size按自身来计算(浏览器默认字体是16px),整个页面内1em不是一个固定的值。rem:相对单位,可理解为”root em”, 相对根节点html的字体大小来计算,CSS3新加属性,chrome/firefox/IE9+支持。(另外需注意chrome强制最小字体为12号,

2015-08-27 17:17:04 719

转载 JavaScript inheritance by example

This blog post illustrates several JavaScript inheritance topics via an example: We start with naive implementations of a constructor Point and its sub-constructor ColorPointand then improve them, ste

2015-08-18 18:43:29 529

转载 消息推送Comet介绍

这篇文章主要讲述B/S架构中服务器“推送”消息给浏览器。内容涉及ajax论询(polling),comet(streaming,long polling)。后面会附上源代码。小林最近在工作有这么一个需求,需要在门户首页获取服务器“推送”过来的消息,像小林这种菜鸟,一般首先想到的是用ajax。本着好奇的精神,到网上查了一下,相关方面的知识,收获还真不小,于是就记录下分享给大家。一般要

2015-08-18 17:00:44 563

转载 Java Scripting Programmer's Guide

Who is the Java Scripting API For?Some useful characteristics of scripting languages are:Convenience: Most scripting languages are dynamically typed. You can usually create new variables without

2015-07-20 16:37:07 545

转载 WEB安全漏洞(2)

本文档主要介绍WEB安全漏洞和解决方法。(续上篇)8. Cookie安全性漏洞描述cookie的一些属性设置不当,导致黑客利用网站存在的XSS漏洞来窃取cookie修复建议在设置cookie时:1)domain设置为网站本域名;2)HTTPOnly属性设为true;3)如果网站使用HTTPS协议,设置secure属性为true。9.Troja

2015-07-14 23:08:01 457

转载 WEB安全漏洞(1)

本文档主要介绍WEB安全漏洞和解决方法。1. SQL注入漏洞漏洞描述SQL注入攻击(SQL Injection),简称注入攻击、SQL注入,被广泛用于非法获取网站控制权,是发生在应用程序的数据库层上的安全漏洞。 在设计不良的程序当中,忽略了对输入字符串中夹带的SQL指令的检查,那么这些夹带进去的指令就会被数据库误认为是正常的SQL指令而运行,从而使数据库受到攻击,可能导致数

2015-07-14 23:06:14 930

转载 服务器安全配置参考

2.1) Apache Tomcat删除Tomcat的Manager控制台软件删除{Tomcat安装目录}\webapps\manager文件夹如无法做到删除,参考以下步骤检查弱口令:操作目的检查Tomcat弱口令检查方法打开Tomcat_home\conf\tomcat-users.xml,查

2015-07-14 14:01:27 714

转载 Javascript模块化编程(三):require.js的用法

这个系列的第一部分和第二部分,介绍了Javascript模块原型和理论概念,今天介绍如何将它们用于实战。我采用的是一个非常流行的库require.js。一、为什么要用require.js?最早的时候,所有Javascript代码都写在一个文件里面,只要加载这一个文件就够了。后来,代码越来越多,一个文件不够了,必须分成多个文件,依次加载。下面的网页代码,相信很多人都见

2015-07-09 18:22:30 421

转载 Javascript模块化编程(二):AMD规范

这个系列的第一部分介绍了Javascript模块的基本写法,今天介绍如何规范地使用模块。(接上文)七、模块的规范先想一想,为什么模块很重要?因为有了模块,我们就可以更方便地使用别人的代码,想要什么功能,就加载什么模块。但是,这样做有一个前提,那就是大家必须以同样的方式编写模块,否则你有你的写法,我有我的写法,岂不是乱了套!考虑到Javascript模

2015-07-09 18:21:42 423

转载 Javascript模块化编程(一):模块的写法

随着网站逐渐变成"互联网应用程序",嵌入网页的Javascript代码越来越庞大,越来越复杂。网页越来越像桌面程序,需要一个团队分工协作、进度管理、单元测试等等......开发者不得不使用软件工程的方法,管理网页的业务逻辑。Javascript模块化编程,已经成为一个迫切的需求。理想情况下,开发者只需要实现核心的业务逻辑,其他都可以加载别人已经写好的模块。但是,Ja

2015-07-09 18:20:46 364

转载 JavaScript编码规范-Baidu

JavaScript编码规范1 前言2 代码风格  2.1 文件  2.2 结构    2.2.1 缩进    2.2.2 空格    2.2.3 换行    2.2.4 语句  2.3 命名  2.4 注释    2.4.1 单行注释    2.4.2 多行注释    2.4.3 文档化注释

2015-07-09 13:06:13 565

转载 Servlet 中文乱码问题及解决方案剖析

一、常识了解 1.GBK包含GB2312,即如果通过GB2312编码后可以通过GBK解码,反之可能不成立;2.java.nio.charset.Charset.defaultCharset() 获得平台默认字符编码;3.getBytes() 是通过平台默认字符集进行编码; 二、中文乱码出现 在学习任何一门技术时,经常会有初学者遇到中文乱码

2015-07-06 14:08:46 387

转载 Google-Guice入门介绍

一. 概述Guice是一个轻量级的DI框架。本文对Guice的基本用法作以介绍。本文的所有例子基于Guice 3.0本文的很多代码来源于Guice主页:http://code.google.com/p/google-guice/wiki/GettingStarted考虑到是入门介绍,本文中并未涉及到AOP相关内容,如有需要还请参考上面链接。二. 举例说明

2015-07-05 17:44:48 506

转载 Event order

On the Introduction to events page I asked a question that at first sight seems incomprehensible: “If an element and one of its ancestors have an event handler for the same event, which one should f

2015-07-01 14:35:12 778

转载 Nginx: Beginner’s Guide

This guide gives a basic introduction to nginx and describes some simple tasks that can be done with it. It is supposed that nginx is already installed on the reader’s machine. If it is not, see the I

2015-06-23 18:19:51 553

转载 Using cURL to automate HTTP jobs

HTTP Scripting1.1 Background1.2 The HTTP Protocol1.3 See the Protocol1.4 See the Timing1.5 See the ResponseURL2.1 Spec2.2 Host2.3 Port number2.4 User name and password2.5 Pat

2015-06-23 12:42:59 590

转载 微信公众平台开发:OAuth2.0网页授权

微信公众平台最近新推出微信认证,认证后可以获得高级接口权限,其中一个是OAuth2.0网页授权,很多朋友在使用这个的时候失败了或者无法理解其内容,希望我出个教程详细讲解一下,于是便有了这篇文章。 一、什么是OAuth2.0官方网站:http://oauth.net/   http://oauth.net/2/权威定义:OAuth is An open protoco

2015-06-22 13:35:25 722

转载 微信公众平台开发:JS API支付

本文介绍微信支付下的jsapi实现流程前言微信支付现在分为v2版和v3版,2014年9月10号之前申请的为v2版,之后申请的为v3版。V3版的微信支付没有paySignKey参数。v2的相关介绍请参考方倍工作室的其他文章。本文介绍的微信支付v3。流程实现1. OAuth2.0授权JSAPI 支付前需要调用 登录授权接口获取到用户的 Openid 。所以需要做

2015-06-22 13:33:59 787

转载 JSON Example With RESTEasy + Jackson

In this tutorial we are going to see how you can integrate RESTEasy withJackson to develop JAX-RS RESTful services that produce and consume JSON streams. As you probably know, Jackson is used to mar

2015-06-16 13:23:03 827

转载 XML Example With RESTEasy+ JAXB

In this example we are going to see how you can integrateRESTEasy with JAXB (Java Architecture for XML Binding) to create RESTful services that consume and produce XML streams. As you probably know

2015-06-16 13:19:19 1104

转载 用JavaScript实现单继承和多继承的简单方法

JavaScript是一种强大的多泛型编程语言,其融合了面向过程、面向对象和函数式编程于一身,具备强大的表现能力。JavaScript就其本质是函数式编程语言,是Lisp的后代,同时又加入了一下面向对象编程的元素,放弃了一些难懂的函数式语言的元素。 函数式编程语言可以实现面向对象编程,这是毫无疑义的,Curry方法可以实现对类和对象的模拟。但是JavaScript提供了另一种实

2015-06-03 10:53:52 430

转载 Wait A Moment, JavaScript Does Support Multiple Inheritance!

... we are just doing it wrong!Classical Inheritance? We Have Something Better!The main limit about multiple inheritance in JavaScript is the presence of "instanceof" operator. In a prototyp

2015-06-02 15:27:55 409

转载 Inheritance and the prototype chain

JavaScript is a bit confusing for developers experienced in class-based languages (like Java or C++), as it is dynamic and does not provide a class implementation per se (the class keyword is introd

2015-06-02 15:09:00 442

转载 Elasticsearch安装中文分词插件ik

Elasticsearch默认提供的分词器,会把每个汉字分开,而不是我们想要的根据关键词来分词。例如:[html] view plaincopycurl -XPOST  "http://localhost:9200/userinfo/_analyze?analyzer=standard&pretty=true&text=我是中国人"  我们会

2015-05-24 18:37:43 476

转载 windows下安装elasticsearch

windows下安装elasticsearch1.下载elasticsearch,地址:http://www.elasticsearch.org/overview/elkdownloads/2.配置环境变量path,指向elasticsearch的bin3.发布为service。打开dos窗口输入:service install [service-name]

2015-05-24 18:33:25 403

转载 Windows下安装并设置Redis

Redis对于Linux是官方支持的,安装和使用没有什么好说的,普通使用按照官方指导,5分钟以内就能搞定。详情请参考:http://redis.io/download 但有时候又想在windows下折腾下Redis,可以从redis下载页面看到如下提示:[plain] view plaincopyWin64

2015-05-24 13:37:22 376

转载 Java 8新特性探究(三)解开lambda最强作用的神秘面纱

我们期待了很久lambda为java带来闭包的概念,但是如果我们不在集合中使用它的话,就损失了很大价值。现有接口迁移成为lambda风格的问题已经通过default methods解决了,在这篇文章将深入解析Java集合里面的批量数据操作(bulk operation),解开lambda最强作用的神秘面纱。1.关于JSR335JSR是Java Specification Req

2015-05-04 18:15:18 474

转载 Java 8新特性探究(二)深入解析默认方法

上篇讲了 lambda表达式的语法,但只是 JEP126 特性的一部分,另一部分就是默认方法(也称为虚拟扩展方法或防护方法) 什么是默认方法,为什么要有默认方法简单说,就是接口可以有实现方法,而且不需要实现类去实现其方法。只需在方法名前面加个default关键字即可。 为什么要有这个特性?首先,之前的接口是个双刃剑,好处是面向抽象而不是面向具体编程,缺陷是,当需

2015-05-04 17:00:01 359

转载 Web 通信 之 长连接、长轮询(long polling)

基于HTTP的长连接,是一种通过长轮询方式实现"服务器推"的技术,它弥补了HTTP简单的请求应答模式的不足,极大地增强了程序的实时性和交互性。一、什么是长连接、长轮询?用通俗易懂的话来说,就是客户端不停的向服务器发送请求以获取最新的数据信息。这里的“不停”其实是有停止的,只是我们人眼无法分辨是否停止,它只是一种快速的停下然后又立即开始连接而已。二、长连接

2015-04-21 16:16:01 346

转载 WEBSOCKET VERSUS COMET – REAL-TIME WEB APPLICATIONS

IntroductionMany web application developershave tried to develop a high performance web application with real-timebehaviors. A common example of such an application could be a communication webplatf

2015-04-21 13:28:40 565

转载 EJB3.x JPA: When to use rollback() and setRollbackOnly()

After JTA was introduced for more than a decade ago, then later with the introduction of Bean-Managed Transaction and Container-Managed Transaction in the J2EE 1.2 specs; still, there are many devel

2015-04-15 15:34:32 1365

转载 Java 8新特性探究(一)通往lambda之路_语法篇

摘要 说到java 8,首先会想到lambda(闭包)以及虚拟扩展方法(default method),这个特性早已经被各大技术网站炒得沸沸扬扬了,也是我们java 8系列开篇要讲的第一特性(JEP126 http://openjdk.java.net/jeps/126),jdk8的一些库已经应用了lambda表达式重新设计了,理解他对学习java 8新特性有着重要的意义。lambda j

2015-04-15 11:05:53 378

转载 用MySQL-Proxy实现读写分离

MySQL-Proxy, 6月份发布的MySQL-Proxy是处在你的MySQL数据库客户和服务端之间的程序,它还支持嵌入性脚本语言Lua。这个代理可以用来分析、监控和变换(transform)通信数据,它支持非常广泛的使用场景:负载平衡和故障转移处理查询分析和日志SQL宏(SQL macros)查询重写(query rewriting)执行shell命令MyS

2015-04-13 16:22:31 359

转载 Conversion of Oracle Columns into Rows

You AskedHi Tom, I have t1 table as follows create table t1 (mnth varchar2(10), col_1 number, col_2 number, col_3 number, col_4 number, col_5 number ); insert into t1 values ('

2015-04-10 18:56:47 359

转载 Converting Oracle rows to columns

Sometimes we need to write SQL that takes separate row results (on separate lines) and roll them together into a single column. Also see my notes on non-SQL techniques for displaying multiple colu

2015-04-10 18:52:27 593

转载 Oracle 行转列和列转行

一、行转列1.1、初始测试数据表结构:TEST_TB_GRADESql代码:?1234567createtable TEST_TB_GRADE (  ID        NUMBER(10) notnull,

2015-04-10 18:51:38 633

HTTP1.1(English).pdf

HTTP1.1(English).pdf

2015-06-09

HTTP1.1 Protocol

Http1.1 Protocol介绍HTTP1.1的协议的介绍,值得一看。

2015-03-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除