??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久亚洲精品天堂,亚洲一区二区三区免费观看,国产精品久久亚洲不卡动漫http://www.tkk7.com/yxhxj2006/zh-cnFri, 09 May 2025 20:05:43 GMTFri, 09 May 2025 20:05:43 GMT60jQuery 插gautocomplete 应用http://www.tkk7.com/yxhxj2006/archive/2016/06/17/430949.html奋斗成就男h奋斗成就男hFri, 17 Jun 2016 09:54:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2016/06/17/430949.htmlhttp://www.tkk7.com/yxhxj2006/comments/430949.htmlhttp://www.tkk7.com/yxhxj2006/archive/2016/06/17/430949.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/430949.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/430949.html

目中有时会用到自动补全查询Q就像Google搜烦框、淘宝商品搜索功能,输入汉字或字母,则以该汉字或字母开头的相关条目会显C出来供用户选择Q?nbsp;autocomplete插g是完成q样的功能?/span>

  autocomplete官网 Q?nbsp;http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ Q可下蝲jQuery autocomplete插gQ?/span>

  淘宝商品搜烦功能 效果Q?/span>

  下面来?autocomplete插g来实现类似效果?/span>

1. 创徏 AjaxPage.aspx 面Q在其中定义 WebMethod Ҏ来返?搜烦面需要的输入框所有提C条目?后台代码如下Q?/span>

复制代码
 1 using System.Collections.Generic;
2 using System.IO;
3 using System.Runtime.Serialization.Json;
4 using System.Web.Services;
5
6 public partial class AjaxPage : System.Web.UI.Page
7 {
8 [WebMethod]
9 public static string GetAllHints()
10 {
11 Dictionary<string, string> data = new Dictionary<string, string>();
12 data.Add("Ҏ4代iphone正品", "21782");
13 data.Add("Ҏ4?手机?/span>", "238061");
14 data.Add("Ҏ4", "838360");
15 data.Add("Ҏ?/span>", "242721");
16 data.Add("ҎW记?/span>", "63348");
17 data.Add("Ҏ4s", "24030");
18 data.Add("戴尔W记?/span>", "110105");
19 data.Add("戴尔手机", "18870");
20 data.Add("戴尔键盘", "30367");
21
22 DataContractJsonSerializer serializer = new DataContractJsonSerializer(data.GetType());
23
24 using (MemoryStream ms = new MemoryStream())
25 {
26 serializer.WriteObject(ms, data);
27 return System.Text.Encoding.UTF8.GetString(ms.ToArray());
28 }
29 }
30 }
复制代码

  注:该方法返回的数据格式为json字符丌Ӏ?/span>

2. 创徏搜烦面 Index.aspxQ?前台代码如下Q?/span>

复制代码
 1 <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Index.aspx.cs" Inherits="_Default" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <title></title>
8 <link rel="Stylesheet" href="Styles/jquery.autocomplete.css" />
9 <script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
10 <script type="text/javascript" src="Scripts/jquery.autocomplete.js"></script>
11 <script type="text/javascript">
12 var v = 1;
13 $(document).ready(function () {
14 $.ajax({
15 type: "POST",
16 contentType: "application/json",
17 url: "AjaxPage.aspx/GetAllHints",
18 data: "{}",
19 dataType: "json",
20 success: function (msg) {
21 var datas = eval('(' + msg.d + ')');
22 $("#txtIput").autocomplete(datas, {
23 formatItem: function (row, i, max) {
24 return "<table width='400px'><tr><td align='left'>" + row.Key + "</td><td align='right'><font style='color: #009933; font-family: 黑体; font-style: italic'>U?/span>" + row.Value + "个宝?lt;/font>&nbsp;&nbsp;</td></tr></table>";
25 },
26 formatMatch: function(row, i, max){
27 return row.Key;
28 }
29 });
30 }
31 });
32 });
33 </script>
34 </head>
35 <body>
36 <form id="form1" runat="server">
37 <div>
38 <center>
39 <asp:TextBox ID="txtIput" runat="server" Width="400px"></asp:TextBox>
40 </center>
41 </div>
42 </form>
43 </body>
44 </html>
复制代码

  实现效果如下Q?/span>

3. autocomplete 参数说明

* minChars (Number)
    在触发autoComplete前用戯需要输入的字符?Default: 1Q如果设?Q在输入框内双击或者删除输入框内内Ҏ昄列表
* width (Number)
    指定下拉框的宽度. Default: input元素的宽?/span>
* max (Number)
    autoComplete下拉昄目的个?Default: 10
* delay (Number)
    击键后激zautoComplete的gq时?单位毫秒).Default: q程?00 本地10
* autoFill (Boolean)
    要不要在用户选择时自动将用户当前鼠标所在的值填入到input? Default: false
* mustMatch (Booolean)
    如果讄为true,autoComplete只会允许匚w的结果出现在输入?所有当用户输入的是非法字符时将会得不到下拉?Default: false
* matchContains (Boolean)
    军_比较时是否要在字W串内部查看匚w,如ba是否与foo bar中的ba匚w.使用~存时比较重?不要和autofillL.Default: false
* selectFirst (Boolean)
    如果讄成true,在用户键入tab或return键时autoComplete下拉列表的第一个值将被自动选择,管它没被手工选中(用键盘或鼠标).当然如果用户选中某个目,那么q用户选中的? Default: true
* cacheLength (Number)
    ~存的长?卛_从数据库中取到的l果集要~存多少条记?设成1Z~存.Default: 10
* matchSubset (Boolean)
    autoComplete可不可以使用Ҏ务器查询的缓?如果~存对foo的查询结?那么如果用户输入foo׃需要再q行索了,直接使用~存.通常是打开q个选项以减L务器的负担以提高性能.只会在缓存长度大?时有?Default: true
* matchCase (Boolean)
    比较是否开启大写敏感开?使用~存时比较重?如果你理解上一个选项,q个也就不难理解,好比foot要不要到FOO的缓存中L.Default: false
* multiple (Boolean)
    是否允许输入多个值即多次使用autoComplete以输入多个? Default: false
* multipleSeparator (String)
    如果是多选时,用来分开各个选择的字W? Default: ","
* scroll (Boolean)
    当结果集大于默认高度时是否用卷轴显C?Default: true
* scrollHeight (Number)
    自动完成提示的卷轴高度用像素大小表示 Default: 180  
* formatItem (Function)
    为每个要昄的项目用高U标{?卛_l果中的每一行都会调用这个函?q回值将用LI元素包含昄在下拉列表中. Autocompleter会提供三个参?row, i, max): q回的结果数l? 当前处理的行?即第几个目,是从1开始的自然?, 当前l果数组元素的个数即目的个? Default: none, 表示不指定自定义的处理函?q样下拉列表中的每一行只包含一个?
* formatResult (Function)
    和formatItemcM,但可以将要输入到input文本框内的D行格式化.同样有三个参?和formatItem一?Default: none,表示要么是只有数?要么是用formatItem提供的?
* formatMatch (Function)
    Ҏ一行数据用此函数格式化需要查询的数据格式. q回值是l内部搜索算法用的. 参数值row
* extraParams (Object)
    为后?一般是服务端的脚本)提供更多的参?和通常的作法一h使用一个键值对对象.如果传过ȝ值是{ bar:4 },会被autocompleter解析成my_autocomplete_backend.php?q=foo&bar=4 (假设当前用户输入了foo). Default: {}
* result (handler)
    此事件会在用户选中某一后触发Q参CؓQ?/span>
    event: 事g对象. event.type为result.
    data: 选中的数据行.
    formatted:formatResult函数q回的?/span>
    例如Q?/span>
    $("#singleBirdRemote").result(function(event, data, formatted) {
        //如选择后给其他控g赋|触发别的事g{等
    });

 



]]>
防止重复dhhttp://www.tkk7.com/yxhxj2006/archive/2015/12/03/428505.html奋斗成就男h奋斗成就男hThu, 03 Dec 2015 08:03:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/12/03/428505.htmlhttp://www.tkk7.com/yxhxj2006/comments/428505.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/12/03/428505.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/428505.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/428505.htmlq页头生成Token,q行h验证,解决Ajaxh安全问题。目前ؓ止我做的最多的防止ajaxhd的就是添加验证码、添加随机Token,限制同一h在规定时间内的最大请求数?br />
下面重点说说d随机Token限制Q?br />
token是ؓ了防止表单重复提交,token 原理大致为:

1Q显C单的那个 action 中?nbsp;createToken() 生成一个随机的 token|q存攑֜服务?session或者cache?Qƈ且传递一份到面?br />
2Q表单页面用一个隐藏表单域获取后端传过来的 token|该表单页面提交时会将?nbsp;token g同提交到后端

3Q在表单面提交到的 actioin 中?nbsp;validateToken() 服务端与表单隐藏域中的 token D行对比,如果服务端存?nbsp;token值ƈ且与表单提交q来的值相{,证明是第一ơ提交?br />
4Q每ơ校验过后服务端?nbsp;token g立即被清除,所以当用户重复提交Ӟ后面的提交校验都再也无法通过。从而实C防止重复提交的功能,validateToken 是在 synchronized 块中执行的保障了多线E下的安全性?br />
    token 会优先存?nbsp;me.setTokenCache(ITokenCache) 指定?nbsp;TokenCache 中,如果未指定则默认使用 session 来存?/div>

但是q种机制是有问题的,比如我是用ajax提交表单Q提交完成以后表单页面ƈ不刷斎ͼ然后我修改了部分数据以后再次提交面Q那么tokenq是之前的那个tokenQ后C以ؓq个为重复提交不能通过校验Q那么请求就不能完成Q数据无法得到正的处理。我认ؓ合理的机制应该是q样的:

1Q显C单的那个 action 中?createToken() 生成一个随机的 token|q且传递一份到面?/p>

2Q表单页面用一个隐藏表单域获取后端传过来的 token|该表单页面提交时会将?token g同提交到后端

3Q将提交q来的token值放入session或者cache中,然后执行controller中的代码Q代码全部执行完以后Q再把存入session或cache中的token值删除掉Q验证用h否ؓ重复提交只需要验证提交过来的token是否存在于session或cache中,有则为重复提交,无则为正常提交?/p>

4Q该逻辑应该可以写成一个Interceptor,在需要的地方加上Q或者直接设为全局拦截器都是可以的Q简单,快捷Q?/p>

]]>在Java中直接调用js代码http://www.tkk7.com/yxhxj2006/archive/2015/11/19/428272.html奋斗成就男h奋斗成就男hWed, 18 Nov 2015 16:25:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/11/19/428272.htmlhttp://www.tkk7.com/yxhxj2006/comments/428272.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/11/19/428272.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/428272.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/428272.htmlJDK1.6版添加了新的ScriptEnginec,允许用户直接执行js代码?/p>

在Java中直接调用js代码

不能调用览器中定义的js函数Q会抛出异常提示ReferenceError: “alert” is not defined?/p>

 
package com.sinaapp.manjushri; 
import javax.script.ScriptEngine; 
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;   /**  * 直接调用js代码  */
public class ScriptEngineTest {    
public static void main(String[] args) { 
  ScriptEngineManager manager = new ScriptEngineManager();
  ScriptEngine engine = manager.getEngineByName("javascript");
     try{                engine.eval("var a=3; var b=4;print (a+b);");           // engine.eval("alert(\"js alert\");");    // 不能调用览器中定义的js函数 // 错误Q会抛出alert引用不存在的异常
 }catch(ScriptException e){   e.printStackTrace();  }  }    }

输出l果Q?

在Java中绑定js变量

在调用engine.get(key);Ӟ如果key没有定义Q则q回null

 
package com.sinaapp.manjushri;     import javax.script.Bindings;   import javax.script.ScriptContext;   import javax.script.ScriptEngine;   import javax.script.ScriptEngineManager;   import javax.script.ScriptException;     public class ScriptEngineTest2 {    public static void main(String[] args) {    ScriptEngineManager manager = new ScriptEngineManager();    ScriptEngine engine = manager.getEngineByName("javascript");    engine.put("a", 4);    engine.put("b", 3);    Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);   try {                          // 只能为DoubleQ用Float和Integer会抛出异?     Double result = (Double) engine.eval("a+b");         System.out.println("result = " + result);     engine.eval("c=a+b");      Double c = (Double)engine.get("c");      System.out.println("c = " + c);         } catch (ScriptException e) {     e.printStackTrace();         }      }   }

输出Q?br />result = 7.0
c = 7.0

在Java中调用js文g中的functionQ传入调用参敎ͼq获取返回?/h3>

js文g中的merge函数两个参数aQb相加Qƈq回c?/p>

 
// expression.js 
function merge(a, b) { 
 c = a * b; 
 return c; 
}

在Java代码中读取js文gQƈ参数两个参数Q然后回去返回倹{?/p>

 
package com.sinaapp.manjushri;     import java.io.FileReader;    import javax.script.Invocable;   import javax.script.ScriptEngine;   import javax.script.ScriptEngineManager;    /**  * Java调用q执行js文gQ传递参敎ͼq活动返回? *   * @author manjushri  */   public class ScriptEngineTest {      public static void main(String[] args) throws Exception {    ScriptEngineManager manager = new ScriptEngineManager();    ScriptEngine engine = manager.getEngineByName("javascript");       String jsFileName = "expression.js";   // djs文g     FileReader reader = new FileReader(jsFileName);   // 执行指定脚本    engine.eval(reader);     if(engine instanceof Invocable) {     Invocable invoke = (Invocable)engine;    // 调用mergeҎQƈ传入两个参数      // c = merge(2, 3);      Double c = (Double)invoke.invokeFunction("merge", 2, 3);      System.out.println("c = " + c);    }     reader.close();      } }

输出l果Q?br />c = 5.0


java调用脚本语言W记Qjython,jruby,groovyQ?/strong>

 有两U方?br />1.java se 6以后实现了jsr 223规范
java代码Q?/p>

[java]
  1. ScriptEngineManager factory = new ScriptEngineManager();  
  2. ScriptEngineManager scriptEngine = factory.getEngineByName("javascript");//或?js"  
  3. scriptEngine.eval(code);//执行一D脚本,code是js代码  


 很方便调用脚?/p>

2.可以使用脚本语方本n提供的与java的集成手D?/p>

jython集成
使用jsr223:
前提下蝲jython的包Q已实现jsr223
(在官|上下蝲Q在安装目录下有jython.jarQ?a style="color: #4169e1; text-decoration: none;">http://repo2.maven.org/maven2/org/python/jython/2.5.0/ q里也有Q但是这个包里没有jsr223的实玎ͼ看包下存不存在org.python.jsr223)

[java]
  1. ScriptEngineManager factory = new ScriptEngineManager();  
  2. ScriptEngineManager scriptEngine = factory.getEngineByName("python");//或?jython"  
  3. scriptEngine.eval(code);  


使用PythonInterpreterQ可以调用exec(String code)Ҏ:

[java]
  1. PythonInterpreter interpreter = new PythonInterpreter();  
  2. interpreter.exec(code);  

讉K数据?br />使用jdbc:

[python] 
  1. from oracle.jdbc.driver import OracleDriver  
  2. from java.sql import DriverManager  
  3.   
  4. username = 'hr'  
  5. password = '123456'  
  6. url = 'jdbc:oracle:thin:@localhost:1521:XE'  
  7. driver = OracleDriver()  
  8. DriverManager.registerDriver(driver)  
  9. conn = DriverManager.getConnection(url, username, password)  
  10. stmt = conn.createStatement()  
  11. sql = "select salary from EMPLOYEES t where t.salary<2300"  
  12. rs = stmt.executeQuery(sql)  
  13. while (rs.next()):  
  14.  print rs.getInt('salary')  
  15. rs.close()  
  16. stmt.close()  


 l果:
2200
2100
2200

使用zxJDBC :

[python] 
  1. from com.ziclix.python.sql import zxJDBC  
  2.   
  3. url = 'jdbc:oracle:thin:@localhost:1521:XE'  
  4. username = 'hr'  
  5. password = '123456'  
  6. driverName = 'oracle.jdbc.driver.OracleDriver'  
  7. mysqlConn = zxJDBC.connect(url,username, password,driverName)  
  8. cursor = mysqlConn.cursor()       
  9. cursor.execute("select last_name from EMPLOYEES t where t.salary<2300");  
  10. #print cursor.fetchone()  
  11. list = cursor.fetchall()  
  12. for record in list:  
  13.     print "name:"+record[0]  
  14. #print cursor.description[0]  
  15. #print cursor.description[1]  


 l果:
name:麦克
name:Olson
name:Philtanker

从数据库中查出的中文内容正常的?br />而在代码里面的中文全部是q或抛异常Q未解决?/p>

与jruby集成
使用jsr223:Java代码

[java]
  1. ScriptEngineManager factory = new ScriptEngineManager();  
  2. ScriptEngineManager scriptEngine = factory.getEngineByName("jruby");//或?ruby"  
  3. scriptEngine.eval(code);  

 讉K数据?/strong>

Ruby代码

[ruby] 
  1. require 'java'  
  2.   
  3. module JavaLang  
  4.   include_package "java.lang"  
  5. end  
  6.   
  7. module JavaSql  
  8.   include_package 'java.sql'  
  9. end  
  10.   
  11. begin  
  12.  username = 'hr'  
  13.  password = '123456'  
  14.  url = 'jdbc:oracle:thin:@localhost:1521:XE'  
  15.  driverName = 'oracle.jdbc.driver.OracleDriver'  
  16.  JavaLang::Class.forName(driverName).newInstance  
  17.  conn = JavaSql::DriverManager.getConnection(url, username, password)  
  18.  stmt = conn.createStatement  
  19.  sql = "select last_name from EMPLOYEES t where t.salary<2300"  
  20.  rs = stmt.executeQuery(sql)  
  21.  while (rs.next) do  
  22.   puts "名字:"+rs.getString("last_name")  
  23.  end  
  24.  rs.close  
  25.  stmt.close  
  26.  conn.close()  
  27. rescue JavaLang::ClassNotFoundException  
  28.  puts "ClassNotFoundException"  
  29. rescue JavaSql::SQLException  
  30.  puts "SQLException"  
  31. end  


 

 l果:
名字:楹﹀?br />名字:Olson
名字:Philtanker

 

从数据库中查出的中文内容Zؕ码的?br />而在代码里面的中文正常?/p>

 

与groovy集成
使用jsr223:

Java代码

[java] 
  1. ScriptEngineManager factory = new ScriptEngineManager();  
  2. ScriptEngineManager scriptEngine = factory.getEngineByName("groovy");//或?Groovy"  
  3. scriptEngine.eval(code);  


 使用GroovyShell:

Java代码

[java] 
  1. GroovyShell shell = new GroovyShell();  
  2. Script script = shell.parse(code);  
  3. Object result = script.run();  


讉K数据?/p>

Groovy代码

 

  1. import groovy.sql.Sql  
  2.   
  3. def username = 'hr'  
  4. def password = '123456'  
  5. def url = 'jdbc:oracle:thin:@localhost:1521:XE'  
  6. def driverName = 'oracle.jdbc.driver.OracleDriver'  
  7. def sql = Sql.newInstance(url, username, password, driverName)  
  8.   
  9. sql.eachRow("select last_name from EMPLOYEES t where t.salary<2300") {  
  10.  println "名字Q?{it.last_name}"  
  11. }  

l果:
名字Q麦?br />名字QOlson
名字QPhiltanker

 

在用groovyq程中碰C一个异?br />Exception in thread "main" java.lang.VerifyError: (class: groovy/runtime/metaclass/java/util/ArrayListMetaClass, method: super$2$invokeMethod signature: (Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;ZZ)Ljava/lang/Object;) Illegal use of nonvirtual function call
q个异常解决׃很长旉
是因为在原来目中存在json-lib-2.1.jar(有可能名UCؓjson-lib-2.1-jdk15.jar)Q这个包是用来处理json的,与groovy1.7.5存在冲突,更新为json-lib-2.3.jar卛_
(json-lib里有一些groovyq行时处理的内容)



]]>Java导入证书的问?PKIXQunable to find valid certification path to requested target 的问?http://www.tkk7.com/yxhxj2006/archive/2015/10/30/427988.html奋斗成就男h奋斗成就男hFri, 30 Oct 2015 07:06:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/10/30/427988.htmlhttp://www.tkk7.com/yxhxj2006/comments/427988.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/10/30/427988.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/427988.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/427988.htmlq两天Java服务器上忽然遇到q样的异常:

avax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

问题的根本是Q?/strong>

~少安全证书时出现的异常?br />

解决问题ҎQ?/strong>

你要访问的webservice/url....的安全认证证书导入到客户端即可?/p>


以下是获取安全证书的一U方法,通过以下E序获取安全证书Q?/p>

/*
 * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 *   - Neither the name of Sun Microsystems nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
*/

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;

public class InstallCert {

    public static void main(String[] args) throws Exception {
        String host;
        int port;
        char[] passphrase;
        if ((args.length == 1) || (args.length == 2)) {
            String[] c = args[0].split(":");
            host = c[0];
            port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
            String p = (args.length == 1) ? "changeit" : args[1];
            passphrase = p.toCharArray();
        } else {
            System.out
                    .println("Usage: java InstallCert <host>[:port] [passphrase]");
            return;
        }

        File file = new File("jssecacerts");
        if (file.isFile() == false) {
            char SEP = File.separatorChar;
            File dir = new File(System.getProperty("java.home") + SEP + "lib"
                    + SEP + "security");
            file = new File(dir, "jssecacerts");
            if (file.isFile() == false) {
                file = new File(dir, "cacerts");
            }
        }
        System.out.println("Loading KeyStore " + file + "");
        InputStream in = new FileInputStream(file);
        KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
        ks.load(in, passphrase);
        in.close();

        SSLContext context = SSLContext.getInstance("TLS");
        TrustManagerFactory tmf = TrustManagerFactory
                .getInstance(TrustManagerFactory.getDefaultAlgorithm());
        tmf.init(ks);
        X509TrustManager defaultTrustManager = (X509TrustManager) tmf
                .getTrustManagers()[0];
        SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
        context.init(nullnew TrustManager[] { tm }, null);
        SSLSocketFactory factory = context.getSocketFactory();

        System.out
                .println("Opening connection to " + host + ":" + port + "");
        SSLSocket socket = (SSLSocket) factory.createSocket(host, port);
        socket.setSoTimeout(10000);
        try {
            System.out.println("Starting SSL handshake");
            socket.startHandshake();
            socket.close();
            System.out.println();
            System.out.println("No errors, certificate is already trusted");
        } catch (SSLException e) {
            System.out.println();
            e.printStackTrace(System.out);
        }

        X509Certificate[] chain = tm.chain;
        if (chain == null) {
            System.out.println("Could not obtain server certificate chain");
            return;
        }

        BufferedReader reader = new BufferedReader(new InputStreamReader(
                System.in));

        System.out.println();
        System.out.println("Server sent " + chain.length + " certificate(s):");
        System.out.println();
        MessageDigest sha1 = MessageDigest.getInstance("SHA1");
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        for (int i = 0; i < chain.length; i++) {
            X509Certificate cert = chain[i];
            System.out.println(" " + (i + 1) + " Subject "
                    + cert.getSubjectDN());
            System.out.println("   Issuer  " + cert.getIssuerDN());
            sha1.update(cert.getEncoded());
            System.out.println("   sha1    " + toHexString(sha1.digest()));
            md5.update(cert.getEncoded());
            System.out.println("   md5     " + toHexString(md5.digest()));
            System.out.println();
        }

        System.out
                .println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
        String line = reader.readLine().trim();
        int k;
        try {
            k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
        } catch (NumberFormatException e) {
            System.out.println("KeyStore not changed");
            return;
        }

        X509Certificate cert = chain[k];
        String alias = host + "-" + (k + 1);
        ks.setCertificateEntry(alias, cert);

        OutputStream out = new FileOutputStream("jssecacerts");
        ks.store(out, passphrase);
        out.close();

        System.out.println();
        System.out.println(cert);
        System.out.println();
        System.out
                .println("Added certificate to keystore 'jssecacerts' using alias '"
                        + alias + "'");
    }

    private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();

    private static String toHexString(byte[] bytes) {
        StringBuilder sb = new StringBuilder(bytes.length * 3);
        for (int b : bytes) {
            b &= 0xff;
            sb.append(HEXDIGITS[b >> 4]);
            sb.append(HEXDIGITS[b & 15]);
            sb.append(' ');
        }
        return sb.toString();
    }

    private static class SavingTrustManager implements X509TrustManager {

        private final X509TrustManager tm;
        private X509Certificate[] chain;

        SavingTrustManager(X509TrustManager tm) {
            this.tm = tm;
        }

        public X509Certificate[] getAcceptedIssuers() {
            throw new UnsupportedOperationException();
        }

        public void checkClientTrusted(X509Certificate[] chain, String authType)
                throws CertificateException {
            throw new UnsupportedOperationException();
        }

        public void checkServerTrusted(X509Certificate[] chain, String authType)
                throws CertificateException {
            this.chain = chain;
            tm.checkServerTrusted(chain, authType);
        }
    }

}

~译InstallCert.javaQ然后执行:java InstallCert hostnameQ比如:
java InstallCert www.twitter.com
会看到如下信息:

java InstallCert www.twitter.com
Loading KeyStore /usr/java/jdk1.6.0_16/jre/lib/security/cacerts
Opening connection to www.twitter.com:443
Starting SSL handshake

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1476)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:846)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:815)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
    at InstallCert.main(InstallCert.java:63)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
    at sun.security.validator.Validator.validate(Validator.java:203)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)
    at InstallCert$SavingTrustManager.checkServerTrusted(InstallCert.java:158)
    at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:839)
     7 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)
     13 more

Server sent 2 certificate(s):

 1 Subject CN=www.twitter.com, O=example.com, C=US
   Issuer  CN=Certificate Shack, O=example.com, C=US
   sha1    2e 7f 76 9b 52 91 09 2e 5d 8f 6b 61 39 2d 5e 06 e4 d8 e9 c7 
   md5     dd d1 a8 03 d7 6c 4b 11 a7 3d 74 28 89 d0 67 54 

 2 Subject CN=Certificate Shack, O=example.com, C=US
   Issuer  CN=Certificate Shack, O=example.com, C=US
   sha1    fb 58 a7 03 c4 4e 3b 0e e3 2c 40 2f 87 64 13 4d df e1 a1 a6 
   md5     72 a0 95 43 7e 41 88 18 ae 2f 6d 98 01 2c 89 68 

Enter certificate to add to trusted keystore or 'q' to quit: [1]


输入1Q回车,然后会在当前的目录下产生一个名?#8220;ssecacerts”的证书?/p>

证书拷贝到$JAVA_HOME/jre/lib/security目录下,或者通过以下方式Q?br />System.setProperty("javax.net.ssl.trustStore", "你的jssecacerts证书路径");



注意Q因为是静态加载,所以要重新启动你的Web ServerQ证书才能生效?/span>


试了以上的方法,后来发现q不行。最后突然心血来潮Q我把Myeclipse关闭Q直接启动TomcatQ然后运行,居然可以了。具体原因没有找到。估计是
我的Myeclipse引用的JDK引用不对。后来就没有具体扑֎因了?br />



]]>
常用的MySQL语句写法http://www.tkk7.com/yxhxj2006/archive/2015/08/09/426700.html奋斗成就男h奋斗成就男hSun, 09 Aug 2015 15:31:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/08/09/426700.htmlhttp://www.tkk7.com/yxhxj2006/comments/426700.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/08/09/426700.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/426700.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/426700.htmlMySQL?/span>SQL语句写法Q除了那些基本的之外Q还有一些也比较常用的Q这里记录下来,以便以后查找?br />    好记性不如烂W头Q这话说的太有道理了Q一D|间不写它Q还真容易忘记。大家不要纠l这?/span>SQL语句包含的业务或是其它问题,本文只是一笔记而已?/span>

    数据从T1表导入到T2?/span>
INSERT INTO T2 (C1,C2) SELECT C1,C2 FROM T1 [WHERE C1 = XX AND C2 = XX ORDER BY C1]

    使用T2表的NAME来更?/span>T1表的NAME
UPDATE T1 AS A, T2 AS B SET A.NAME = B.NAME WHERE A.TID = B.ID

    两表的关联更?/span>
UPDATE T_ROLE_USER AS A,
 (
    SELECT
        ID
    FROM
        T_USER
    WHERE
        DEPARTID IN (
            SELECT
                ID
            FROM
                T_DEPART
            WHERE
                LENGTH(ORG_CODE) = 9
        )
AS B
SET A.ROLEID = '123456'
WHERE
    A.USERID = B.ID

    自己和自己关联更?/span>
UPDATE T_DEPART AS A,
 (
    SELECT
        ID,
        SUBSTRING(ORG_CODE, 16) ORG_CODE
    FROM
        T_DEPART
    WHERE
        LENGTH(ORG_CODE) = 8
    AND PARENT_DEPART_ID IS NOT NULL
AS B
SET A.PARENT_DEPART_ID = B.ID
WHERE
    SUBSTRING(A.ORG_CODE, 16= B.ORG_CODE

    两表兌删除Q将删除两表中有兌IDq且T2?/span>NAME为空的两表记?/span>
DELETE A,B FROM T1 AS A LEFT JOIN T2 AS B ON A.TID = B.ID WHERE B.NAME IS NULL

    统计结果插入到?/span>
INSERT INTO SE_STAT_ORG (
    RECORD_DATE,
    ORG_ID,
    ORG_NAME,
    SIGN_CONT_COUNT,
    SIGN_ARRI_CONT_COUNT,
    SIGN_CONT_MONEY,
    SIGN_ARRI_CONT_MONEY,
    TOTAL_ARRI_CONT_COUNT,
    TOTAL_ARRI_MONEY,
    PUBLISH_TOTAL_COUNT,
    PROJECT_COUNT
SELECT
    *
FROM
    (
        SELECT
            '2012-06-09' RECORD_DATE,
            PARENT_ORG_ID,
            PARENT_ORG_NAME,
            SUM(SIGN_CONT_COUNT) SIGN_CONT_COUNT,
            SUM(SIGN_ARRI_CONT_COUNT) SIGN_ARRI_CONT_COUNT,
            SUM(SIGN_CONT_MONEY) SIGN_CONT_MONEY,
            SUM(SIGN_ARRI_CONT_MONEY) SIGN_ARRI_CONT_MONEY,
            SUM(TOTAL_ARRI_CONT_COUNT) TOTAL_ARRI_CONT_COUNT,
            SUM(TOTAL_ARRI_MONEY) TOTAL_ARRI_MONEY,
            SUM(PUBLISH_TOTAL_COUNT) PUBLISH_TOTAL_COUNT,
            SUM(PROJECT_COUNT) PROJECT_COUNT,
        FROM SE_STAT_USER
        WHERE DATE_FORMAT(RECORD_DATE, '%Y-%m-%d'= '2012-06-09'
        GROUP BY PARENT_ORG_ID
    ) M

    三表兌更新
UPDATE SE_STAT_USER A,
 (
    SELECT
        USER_ID,
        SUM(INVEST_ORG_COUNT + FINANCIAL_ORG_COUNT + INTERMEDIARY_ORG_COUNT + ENTERPRISE_COUNT) AS COMMON_COUNT
    FROM SE_STAT_USER
    WHERE DATE_FORMAT(RECORD_DATE, '%Y-%m-%d'= '2012-06-09'
    GROUP BY USER_ID
) B,
 (
    SELECT
        USER_ID,
        SUM(ESTABLISH_COUNT + STOCK_COUNT + MERGER_COUNT + ACHIEVE_COUNT) AS PROJECT_COUNT
    FROM SE_STAT_USER
    WHERE DATE_FORMAT(RECORD_DATE, '%Y-%m-%d'= '2012-06-09'
    GROUP BY USER_ID
) C
SET A.COMMON_COUNT = B.COMMON_COUNT, A.PROJECT_COUNT = C.PROJECT_COUNT
WHERE A.USER_ID = B.USER_ID
AND A.USER_ID = C.USER_ID
AND DATE_FORMAT(A.RECORD_DATE, '%Y-%m-%d'= '2012-06-09'

    带条件的兌更新
UPDATE SE_STAT_USER A,
 (
    SELECT
        P.CHANNEL,
        COUNT(P.CONT_ID) AS CONT_COUNT,
        C.CUST_MGR_ID
    FROM
        (
            SELECT
                CHANNEL,
                CONT_ID
            FROM SK_PROJECT
            WHERE PROJECT_STATUS = 6
            AND DATE_FORMAT(AUDIT_TIME, '%Y-%m-%d'= '2012-06-11'
        ) p
    INNER JOIN SE_CONTRACT C ON P.CONT_ID = C.CONT_ID
    GROUP BY P.CHANNEL, C.CUST_MGR_ID
) B
SET
    A.STOCK_COUNT = CASE WHEN B.CHANNEL = 2 THEN B.CONT_COUNT ELSE 0 END,
    A.ESTABLISH_COUNT = CASE WHEN B.CHANNEL = 3 THEN B.CONT_COUNT ELSE 0 END,
    A.ACHIEVE_COUNT = CASE WHEN B.CHANNEL = 4 THEN B.CONT_COUNT ELSE 0 END
    A.BRAND_COUNT = CASE WHEN B.CHANNEL = 5 THEN B.CONT_COUNT ELSE 0 END,
    A.MERGER_COUNT = CASE WHEN B.CHANNEL = 6 THEN B.CONT_COUNT ELSE 0 END
WHERE
    A.USER_ID = B.CUST_MGR_ID
AND DATE_FORMAT(A.RECORD_DATE, '%Y-%m-%d'= '2012-06-11'

    加烦?/span>
ALTER TABLE PROJECT ADD INDEX INDEX_USER_ID (USER_ID),
        ADD INDEX INDEX_PROJECT_STATUS (PROJECT_STATUS);

    删除?/span>
ALTER TABLE PROJECT DROP COLUMN PROJECT_STATUS,
        DROP COLUMN EXPECT_RETURN,DROP COLUMN CURRENCY;

    增加?/span>
ALTER TABLE PROJECT 
        ADD COLUMN DICT_ID INT DEFAULT NULL COMMENT 'xxx' AFTER PROJECT_SITE,
        ADD COLUMN INTRODUCE TEXT DEFAULT NULL COMMENT 'xx' AFTER DICT_ID,
        ADD COLUMN STAGE INT DEFAULT NULL COMMENT 'xx' AFTER ID,
        ADD COLUMN ATTACH_URI VARCHAR(8DEFAULT NULL COMMENT 'xxx' AFTER INTRODUCE;

    修改列,一般用MODIFY修改数据cdQ?/span>CHANGE修改列名
ALTER TABLE PROJECT CHANGE DICT_ID DICT_ID1 INT NOT NULL,
        MODIFY PROJECT_STATUS TINYINT NOT NULL COMMENT 'xxx';


]]>
E序员必看的?/title><link>http://www.tkk7.com/yxhxj2006/archive/2015/06/13/425662.html</link><dc:creator>奋斗成就男h</dc:creator><author>奋斗成就男h</author><pubDate>Fri, 12 Jun 2015 16:03:00 GMT</pubDate><guid>http://www.tkk7.com/yxhxj2006/archive/2015/06/13/425662.html</guid><wfw:comment>http://www.tkk7.com/yxhxj2006/comments/425662.html</wfw:comment><comments>http://www.tkk7.com/yxhxj2006/archive/2015/06/13/425662.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/yxhxj2006/comments/commentRss/425662.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/yxhxj2006/services/trackbacks/425662.html</trackback:ping><description><![CDATA[<p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">做ؓ一名程序员Q如果你只顾得写代码Q那是不行的Q要抽出一下时间来丰富自己的知识,多看看书Q在q里我将为程序员们推荐一些不错的书。能够给E序员们带来帮助?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">大数据时?/strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a5bd00010d2903120426.jpg" alt="5487a5bd00010d2903120426" width="312" height="426" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《大数据时代》是国外大数据研I的先河之作Q本书作者维克托•q尔•舍恩伯格被誉?大数据商业应用第一?Q拥有在哈佛大学、牛z大学、耉大学和新加坡国立大学{多个互联网研究重镇L的经历,早在2010q就在《经学人》上发布了长?4对大数据应用的前瞻性研I?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">l克?#8226;q尔•舍恩伯格在书中前L地指出Q大数据带来的信息风暴正在变革我们的生活、工作和思维Q大数据开启了一ơ重大的时代转型Qƈ用三个部分讲qC大数据时代的思维变革、商业变革和理变革?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">l克托最h见之处在于,他明指出,大数据时代最大的转变是Q放弃对因果关系的求,而取而代之关注相兛_pR也是说只要知?是什?Q而不需要知?Z?。这颠覆了千百q来人类的思维惯例Q对人类的认知和与世界交的方式提出了全新的挑战?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"> 淘宝技术这十年</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a5c800013dae03030438.jpg" alt="5487a5c800013dae03030438" width="303" height="438" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《淘宝技术这十年》内容简介:M|站的发展都不是一y而就的。它在发展过E中会遇到各U各L问题和业务带来的压力。正是这些问题和压力推动着技术的q步和发展,而技术的发展反过来又会促q业务的更大提升。如今淘宝网的流量排名已是全球前15名、国内前3名,其系l服务器也从一台发展到万台以上?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《淘宝技术这十年》从工程师的角度讲述淘宝q个大规模互联|系l的成长历程Q及其所有主动和被动的技术变革的前因后果。书中有q后故事、品经验、架构演q、技术启蒙,也有大牛成长、业内八卦、失败案例、励志故事。《淘宝技术这十年》文风流畅,有技术h员特有的q默?内容U极正面Q有现场感,全部是作者亲w经历?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">白帽子讲Web安全</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a7b90001fa2303030438.jpg" alt="5487a7b90001fa2303030438" width="303" height="438" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《白帽子讲Web安全》内容简介:在互联网时代Q数据安全与个h隐私受到了前所未有的挑战,各种新奇的攻L术层ZI如何才能更好地保护我们的数?《白帽子讲Web安全》将带你走进Web安全的世界,让你了解Web安全的方斚w面。黑客不再变得神U,d技术原来我也可以会Q小|站主自׃能找到正的安全道\。大公司是怎么做安全的Qؓ什么要选择q样的方案呢?你能在《白帽子讲Web安全》中扑ֈ{案。详l的剖析Q让你不仅能"知其?Q更?知其所以然"?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">重构:改善既有代码的设?/strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a7c400010cce04000400.jpg" alt="5487a7c400010cce04000400" width="400" height="400" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《重构:改善既有代码的设计》清晰地揭示了重构的q程Q解释了重构的原理和最佛_跉|式,q给Z何时以及何地应该开始挖掘代码以求改善。书中给Z70多个可行的重构,每个重构都介l了一U经q验证的代码变换手法的动机和技术。《重构:改善既有代码的设计》提出的重构准则帮助你一ơ一步C改你的代码,从而减了开发过E中的风险?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《重构:改善既有代码的设计》适合软g开发h员、项目管理h员等阅读Q也可作为高{院校计机及相关专业师生的参考读物?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">代码整洁之道</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a7cf000167fd03240408.jpg" alt="5487a7cf000167fd03240408" width="324" height="408" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">软g质量Q不但依赖于架构及项目管理,而且与代码质量紧密相兟뀂这一点,无论是敏捷开发流z还是传l开发流z,都不得不承认。《代码整z之道》提ZU观念:代码质量与其整洁度成正比。干净的代码,既在质量上较为可靠,也ؓ后期l护、升U奠定了良好基础?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">作ؓ~程领域的佼D,《代码整z之道》作者给Z一pd行之有效的整z代码操作实c这些实践在《代码整z之道》中体现Z条条规则(或称"启示")Qƈ辅以来自现实目的正、反两面的范例。只要遵循这些规则,p~写出干净的代码,从而有效提升代码质量?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《代码整z之道》阅d象ؓ一切有志于改善代码质量的程序员及技术经理。书中介l的规则均来自作者多q的实践l验Q涵盖从命名到重构的多个~程斚wQ虽Z"?之言Q然诚有可资借鉴的h倹{?br /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">设计模式之禅 (W??</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><br /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549ccdfa00018b6503630363.jpg" alt="549ccdfa00018b6503630363" width="363" height="363" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">  本书是设计模式领域公认的3本经典著作之一Q?极具味Q容易理解,但讲解又极ؓ严}和透彻"是本书的写作风格和方法的最大特炏V第1?010q出版,畅销至今Q广受好评,是该领域的里E碑著作。深刻解?大设计原则和28U设计模式的准确定义、应用方法和最佛_践,全方位比较各U同cL式之间的异同Q详l讲解将不同的模式组合用的Ҏ。第2版在W?版的基础上有两方面的改进Q一斚wl合读者的意见和徏议对原有内容中的瑕疵q行了修正和完善Q另一斚w增加?U新的设计模式,希望q一版能为广大程序员们奉上一场更加完的设计模式盛宴!</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">E序员修g?/span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce040001ee3b03150420.jpg" alt="549cce040001ee3b03150420" width="315" height="420" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">  《程序员修炼之道》由一pd的独立的部分l成Q涵盖的主题从个仅R职业发展,直到用于使代码保持灵zRƈ且易于改~和复用的各U架构技术。利用许多富有娱乐性的奇闻轶事、有思想性的例子以及有趣的类比,全面阐释了Y件开发的许多不同斚w的最佛_践和重大陷阱。无Z是初学者,是有l验的程序员Q还是Y仉目经理,本书都适合你阅诅R?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">q_战略:正在席卷全球的商业模式革?/span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce0e00012ad003120426.jpg" alt="549cce0e00012ad003120426" width="312" height="426" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《^台战?正在席卷全球的商业模式革命》内容简介:q_商业模式的精髓,在于打造一个完善的、成长潜能强大的"生态圈"。它拥有独树一帜的_֯规范和机制系l,能有效激励多方群体之间互动,达成q_企业的愿景。纵观全球许多重新定义业架构的企业Q我们往往׃发现它们成功的关?#8212;—建立赯好的"q_生态圈"Q连接两个以上群体,弯曲、打了既有的业链?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">q_生态圈里的一方群体,一旦因为需求增加而壮大,另一方群体的需求也会随之增ѝ如此一来,一个良性@环机制便建立了,通过此^C的各方也会促进Ҏ无限增长。而通过q_模式辑ֈ战略目的Q包括规模的壮大和生态圈的完善,乃至Ҏ竞争者,甚至是拆解业现状、重塑市场格局?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">互联|创业启C录</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce170001475203030438.jpg" alt="549cce170001475203030438" width="303" height="438" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《互联网创业启示录》是一部互联网公司的创业指南,内容涉及|站创业的现状和机遇、创业公怭h倹{^台选择、工具和组、资金的{w、管理和盈利、社会化媒体环境、行动执行管理、开发h员方法论和工作效率、创始h的角色等斚wQ既有纲领和指导性理论,又有具体操作Ҏ。书中大量对互联|创业成功h士的访谈介绍Q以及创业公司的成功案例Q更可以作ؓ初次创业者的良好借鉴?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《互联网创业启示录》主要写l想自己创业的程序员Q但同样适合非技术h员,适合|络创业者、大学生创业者、网l营销人员及一切有志创业者。做|络不一定要懂技术,互联|的成功是可以借鉴和g伸的!</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">E序员健h?/span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce2600015a5003600369.jpg" alt="549cce2600015a5003600369" width="360" height="369" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书是ؓE序员量w制作的健康指南Q针对头痛、眼部疲功뀁背部疼痛和手腕疼痛{常见的问题Q简要介l了其成因、测试方法,q列Z每天的行动计划,从运动、饮食等斚wl出详细指导Q帮助程序员在不改变工作方式的情况下L拥有健康?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书适合E序员、长期伏案工作的其他人群以及所有关心健L人士阅读?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">l网@改变世界的互联网产品l理</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f680001268603060435.jpg" alt="54aa4f680001268603060435" width="306" height="435" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书以如何创建、发布、推q互联网产品ZU,介绍了互联网产品l理的工作内容以及应Ҏ一部分工作所需的方法和工具。ؓ用户创造h值是产品l理的第一要务Q品经理的工作是围l用户及具体d展开的,本书丰富的案例和透彻的分析道Z从发现用户到最l满用戯一q程背后的玄机?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书面向现在正在从事及未来将要从事互联网相关工作的创业者和产品l理Q也可以作ؓ互联|品策划h员或相关专业学生的参考书。新版完善了各章节,增加了优雅降U等内容Q读者也可从中更深地L受一名品经理的感悟?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">E序员面试逻辑题解?/span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f7800016ca403240408.jpg" alt="54aa4f7800016ca403240408" width="324" height="408" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">E序员面试逻辑题解析》共分ؓ3个部分。第一部分从有且ȝ头脑的谜题入手,l而给题思\和详l答案,更有"热n问题"l大家提供充分的思考空间。第二部分综合了不同cd的谜题,如数独、调度问题及概率题等。神U的W三部分带领大家不断历险Q开动脑{,解决大量密码及银行̎L斚w的问题。几十道z的谜题不仅充分锻g我们的思维方式Q更为提高面试成功率奠定了基?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;">    《程序员面试逻辑题解析》不仅适合E序员阅读,更是谜题爱好者的饕餮盛宴?/strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">E序员,你伤不v</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f8d000171b703060435.jpg" alt="54aa4f8d000171b703060435" width="306" height="435" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书是作者博客文章的_N集。是作者作牌E序员、现在的IT 创业?5 qY件开发生涯的心\历程和经验ȝ。涉及程序h生、开发经验、职业规划、创业心得。对M的Y件开发者和IT 从业人员都有借鉴价倹{作者语a风趣q默Q读hz|有味。字里行间充满了不屈不挠的码农正能量?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">像程序员一h?/span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f9800013e1e03270405.jpg" alt="54aa4f9800013e1e03270405" width="327" height="405" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">~程的真正挑战不是学习一U语a的语法,而是学习创造性地解决问题Q从而构建美妙的应用。《像E序员一h考》分析了E序员解决问题的ҎQƈ且教授你其他图书所忽略的一U能力,卛_何像E序员一h考?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">全书分ؓ8章。第1章通对几个l典的算法问题切入,概括了问题解决的基本技巧和步骤。第2章通过实际~写C++代码来解军_个简单的问题Q从而让读者进一步体会到问题解决的思\和应用。第3?章是书中的主体部分,分别探讨了用数组、指针和动态内存、类、递归和代码复用来解决问题的途径和实际应用。最后,W?章从培养E序员思维的角度,q行了ȝ和概括,告诉读者如何才能像E序员一h考?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">~写可读代码的艺?/span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4fbf0001a7c103180417.jpg" alt="54aa4fbf0001a7c103180417" width="318" height="417" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">l节军_成|Q思\清晰、言意赅的代码让E序员一目了?而格式凌乱、拖沓冗长的代码让程序员一头雾水。除了可以正运行以外,优秀的代码必d备良好的可读性,~写的代码要使其他h能在最短的旉内理解才行。本书旨在强调代码对人的友好性和可读性?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书x~码的细节,ȝ了很多提高代码可L的技巧,看似都微不道,但是对于整个软gpȝ的开发而言Q它们与宏观的架构决{、设计思想、指导原则同样重要。编码不仅仅只是一U技术,也是一门艺术,~写可读性高的代码尤其如此。如果你要成Z位优U的程序员Q要惛_发出高质量的软gpȝQ必Ml处着手,做到内外gQ本书将Z提供有效的指对{?/p><img src ="http://www.tkk7.com/yxhxj2006/aggbug/425662.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/yxhxj2006/" target="_blank">奋斗成就男h</a> 2015-06-13 00:03 <a href="http://www.tkk7.com/yxhxj2006/archive/2015/06/13/425662.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle分析函数入门http://www.tkk7.com/yxhxj2006/archive/2015/05/13/425032.html奋斗成就男h奋斗成就男hTue, 12 May 2015 16:46:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/05/13/425032.htmlhttp://www.tkk7.com/yxhxj2006/comments/425032.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/05/13/425032.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/425032.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/425032.html一、Oracle分析函数入门

分析函数是什么?
分析函数是Oracle专门用于解决复杂报表l计需?/span>的功能强大的函数Q?span style="line-height: 1.5; color: #ff0000;">它可以在数据中进行分l然后计基于组的某U统计?/span>Qƈ且每一l的每一行都可以q回一个统计倹{?/p>

          

分析函数和聚合函数的不同之处是什么?
普通的聚合函数用group by分组Q?span style="line-height: 1.5; color: #ff0000;">每个分组q回一个统计|而分析函数采用partition by分组Qƈ?span style="line-height: 1.5; color: #ff0000;">每组每行都可以返回一个统计倹{?/p>

              

分析函数的Ş?/strong>
分析函数带有一个开H函数over()Q包含三个分析子?分组(partition by), 排序(order by), H口(rows) Q他们的使用形式如下Qover(partition by xxx order by yyy rows between zzz)?br />注:H口子句在这里我只说rows方式的窗?range方式和滑动窗口也不提

    

分析函数例子(在scott用户下模?

CZ目的Q显C各部门员工的工资,q带显C部分的最高工资?br />

复制代码
--昄各部门员工的工资Qƈ附带昄该部分的最高工资?/span>
SELECT E.DEPTNO,
E.EMPNO,
E.ENAME,
E.SAL,
LAST_VALUE(E.SAL)
OVER(PARTITION BY E.DEPTNO
ORDER BY E.SAL ROWS
--unbounded preceding and unbouned following针对当前所有记录的前一条、后一条记录,也就是表中的所有记?/span>
--unboundedQ不受控制的Q无限的
--precedingQ在...之前
--followingQ在...之后
BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) MAX_SAL
FROM EMP E;
复制代码

q行l果Q?/p>

               

CZ目的Q按照deptno分组Q然后计每l值的d

SELECT EMPNO,
ENAME,
DEPTNO,
SAL,
SUM(SAL) OVER(PARTITION BY DEPTNO ORDER BY ENAME) max_sal
FROM SCOTT.EMP;

q行l果Q?/p>

     

CZ目的Q对各部门进行分l,q带显C第一行至当前行的汇?/span>

复制代码
SELECT EMPNO,
ENAME,
DEPTNO,
SAL,
--注意ROWS BETWEEN unbounded preceding AND current row 是指W一行至当前行的汇?/span>
SUM(SAL) OVER(PARTITION BY DEPTNO
ORDER BY ENAME
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) max_sal
FROM SCOTT.EMP;
复制代码

q行l果Q?/p>

   

CZ目标Q当前行x后一行的汇?/span>

复制代码
SELECT EMPNO,
ENAME,
DEPTNO,
SAL,
--注意ROWS BETWEEN current row AND unbounded following 指当前行到最后一行的汇?/span>
SUM(SAL) OVER(PARTITION BY DEPTNO
ORDER BY ENAME
ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) max_sal
FROM SCOTT.EMP;
复制代码

q行l果Q?/p>

   

 CZ目标Q当前行的上一?rownum-1)到当前行的汇?/span>

复制代码
SELECT EMPNO,
ENAME,
DEPTNO,
SAL,
--注意ROWS BETWEEN 1 preceding AND current row 是指当前行的上一?rownum-1)到当前行的汇?
SUM(SAL) OVER(PARTITION BY DEPTNO
ORDER BY ENAME ROWS
BETWEEN 1 PRECEDING AND CURRENT ROW) max_sal
FROM SCOTT.EMP;
复制代码

q行l果Q?/p>

    

CZ目标Q?nbsp;  当前行的上一?rownum-1)到当前行的下辆行(rownum+2)的汇?nbsp;    

复制代码
SELECT EMPNO,
ENAME,
DEPTNO,
SAL,
--注意ROWS BETWEEN 1 preceding AND 1 following 是指当前行的上一?rownum-1)到当前行的下辆行(rownum+2)的汇?/span>
SUM(SAL) OVER(PARTITION BY DEPTNO
ORDER BY ENAME
ROWS BETWEEN 1 PRECEDING AND 2 FOLLOWING) max_sal
FROM SCOTT.EMP;
复制代码

q行l果Q?/p>




]]>
常见分析函数详解http://www.tkk7.com/yxhxj2006/archive/2015/05/13/425033.html奋斗成就男h奋斗成就男hTue, 12 May 2015 16:46:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/05/13/425033.htmlhttp://www.tkk7.com/yxhxj2006/comments/425033.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/05/13/425033.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/425033.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/425033.html阅读全文

]]>
ORACLE 常用函数http://www.tkk7.com/yxhxj2006/archive/2015/05/13/425031.html奋斗成就男h奋斗成就男hTue, 12 May 2015 16:37:00 GMThttp://www.tkk7.com/yxhxj2006/archive/2015/05/13/425031.htmlhttp://www.tkk7.com/yxhxj2006/comments/425031.htmlhttp://www.tkk7.com/yxhxj2006/archive/2015/05/13/425031.html#Feedback0http://www.tkk7.com/yxhxj2006/comments/commentRss/425031.htmlhttp://www.tkk7.com/yxhxj2006/services/trackbacks/425031.html  q个pd我将整理一些日常我们经怋用到的ORACLE函数Q鉴于篇q太长,我大体会按下面分cL整理、汇总这些常用的ORACLE函数Q如果有些常用函数没有被整理q来Q也希望大家指点一二?/div>

 1Q?聚合函数

2Q?日期函数
3Q?字符串函?/div>
4Q?格式化函?/div>
5Q?cd转换函数
6Q?加密函数
7Q?控制函?/div>
8Q?数学函数
9Q?pȝ信息函数
10Q分析函?/span>

------------------------------------------聚合函数---------------------------------------------
--1:   AVG(DISTINCT|ALL)

ALL表示Ҏ有的值求q_?DISTINCT只对不同的值求q_?/span>
SELECT AVG(SAL) FROM SCOTT.EMP;
SELECT AVG(DISTINCT SAL) FROM SCOTT.EMP;
--2:   MAX(DISTINCT|ALL)

求最大?ALL表示Ҏ有的值求最大?DISTINCT表示对不同的值求最大?相同的只取一?/span>

(加不加查询结果一_不知DISTINCT有什么用途,不同于AVG{聚合函?
SELECT MAX(DISTINCT SAL) FROM SCOTT.EMP;
SELECT MAX(SAL) FROM SCOTT.EMP
--3:   MIN(DISTINCT|ALL)
求最?ALL表示Ҏ有的值求最?DISTINCT表示对不同的值求最?相同的只取一?/span>
SELECT MIN(SAL) FROM SCOTT.EMP;
SELECT MIN(DISTINCT SAL) FROM SCOTT.EMP;

--4:  STDDEV(distinct|all)
求标准差,ALL表示Ҏ有的值求标准?DISTINCT表示只对不同的值求标准?/span>
SELECT STDDEV(SAL) FROM SCOTT.EMP;
SELECT STDDEV(DISTINCT SAL) FROM SCOTT.EMP;

--5:   VARIANCE(DISTINCT|ALL)
求协方差  ALL表示Ҏ有的值求协方?DISTINCT表示只对不同的值求协方?/span>
SELECT VARIANCE(SAL) FROM SCOTT.EMP;
SELECT VARIANCE(DISTINCT SAL) FROM SCOTT.EMP;

--6:  SUM(DISTINCT|ALL)
求和  ALL表示Ҏ有值求和,DISTINCT表示只对不同值求?相同值只取一?
SELECT SUM(SAL) FROM SCOTT.EMP;
SELECT SUM(DISTINCT SAL) FROM SCOTT.EMP;


--7QCOUNT(DISTINCT|ALL)
求记录、数据个数?ALLҎ有记录,数组做统计, DISTINCT只对不同值统?相同值只取一?
SELECT COUNT(SAL) FROM SCOTT.EMP;
SELECT COUNT(DISTINCT SAL) FROM SCOTT.EMP;  
 
----8Q?MEDIAN
求中位数
SELECT MEDIAN(SAL) FROM SCOTT.EMP;
SELECT MEDIAN(DISTINCT SAL) FROM SCOTT.EMP;  --错误QDISTINCT 选项在此函数中禁用?/span>
----------------------------------------------------------------------------------------------


]]>如何判断PHPI间是否支持curl, gzip{功?/title><link>http://www.tkk7.com/yxhxj2006/archive/2015/04/22/424583.html</link><dc:creator>奋斗成就男h</dc:creator><author>奋斗成就男h</author><pubDate>Tue, 21 Apr 2015 16:04:00 GMT</pubDate><guid>http://www.tkk7.com/yxhxj2006/archive/2015/04/22/424583.html</guid><wfw:comment>http://www.tkk7.com/yxhxj2006/comments/424583.html</wfw:comment><comments>http://www.tkk7.com/yxhxj2006/archive/2015/04/22/424583.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/yxhxj2006/comments/commentRss/424583.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/yxhxj2006/services/trackbacks/424583.html</trackback:ping><description><![CDATA[<div style="color: #333333; font-size: 16px; line-height: 28px; margin-top: 40px; font-family: 'Microsoft Yahei', 微Y雅黑, arial, 宋体, sans-serif; background-color: #ffffff;"><div exp-brief-step"="" style="text-align: justify; margin-top: 5px;"><div style="position: relative;"><div><p style="margin: 20px 0px; padding: 0px;">在用PHPӞ我们需要将自己写好的php文g上传到已甌的phpI间。由于租用或甌的phpI间是不允许用户q行配置的,那么对于php的一些功能是否开启,如curl, allow_url_fopen, gzipQ就需要提前判断,而不是等写完代码后发C能用时Q那h动就大了?/p></div></div></div></div><div style="color: #333333; font-size: 16px; line-height: 28px; margin-top: 40px; font-family: 'Microsoft Yahei', 微Y雅黑, arial, 宋体, sans-serif; background-color: #ffffff;"><h2><a name="section-2" style="color: rgb(45, 100, 179); width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>Ҏ/步骤</h2><div style="text-align: justify; margin-top: 5px;"><ol style="margin: 0px; padding: 0px; list-style: none; clear: both;"><li list-item-1"="" style="margin: 20px 0px 0px 17px; padding: 0px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div style="width: 32px; height: 32px; position: absolute; left: -18px; top: 0px; color: #eeffee; text-align: center; line-height: 32px; background-image: url(http://img.baidu.com/img/iknow/exp/global/step_ol_bg.png); visibility: hidden; background-repeat: no-repeat no-repeat;"></div><div><p style="margin: 0px; padding: 0px;">其实判断功能是否开启,很简单,我们只需要写一个php文g上传之phpI间服务器中。v.php的源代码如图?/p></div><div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHPI间是否支持curl, gzip{功? src="http://c.hiphotos.baidu.com/exp/w=500/sign=6db0ec9bdb33c895a67e987be1127397/4bed2e738bd4b31ce5950fb785d6277f9e2ff815.jpg" style="border: 0px; display: block;" /></a></div></div></li><li list-item-2"="" style="margin: 1px 0px 0px 17px; padding: 45px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div style="width: 32px; height: 32px; position: absolute; left: -18px; top: 43px; color: #eeffee; text-align: center; line-height: 32px; background-image: url(http://img.baidu.com/img/iknow/exp/global/step_ol_bg.png); visibility: hidden; background-repeat: no-repeat no-repeat;"></div><div><p style="margin: 0px; padding: 0px;">其含义很单,是传入一个函数的名字Q服务器判断是否存在q个函数Q如果存在则表示支持该函数对应的功能Q输?#8220;支持”Q反之输?#8220;不支?#8221;。将文g上传至phpI间中?/p></div><div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHPI间是否支持curl, gzip{功? src="http://e.hiphotos.baidu.com/exp/w=500/sign=cca6fd7ff9f2b211e42e854efa816511/e61190ef76c6a7ef1285332afffaaf51f3de661f.jpg" style="border: 0px; display: block;" /></a></div></div></li><li list-item-3"="" style="margin: 1px 0px 0px 17px; padding: 45px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div style="width: 32px; height: 32px; position: absolute; left: -18px; top: 43px; color: #eeffee; text-align: center; line-height: 32px; background-image: url(http://img.baidu.com/img/iknow/exp/global/step_ol_bg.png); visibility: hidden; background-repeat: no-repeat no-repeat;"></div><div><p style="margin: 0px; padding: 0px;">再通过讉KI间Q地址+v.php?f=+要测试的功能所包括的函敎ͼ比如curl功能可以是v.php?f=curl_initQallow_url_fopen功能可以用v.php?f=fopen来测试?/p></div><div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHPI间是否支持curl, gzip{功? src="http://e.hiphotos.baidu.com/exp/w=500/sign=0d78242f612762d0803ea4bf90ed0849/242dd42a2834349ba7aff589cbea15ce36d3be15.jpg" style="border: 0px; display: block;" /><span style="background-image: url(http://img.baidu.com/img/iknow/exp/article/show-step.png); width: 120px; height: 40px; position: absolute; top: 337px; left: 250px; margin-top: -20px; margin-left: -60px; line-height: 40px; font-family: 微Y雅黑; color: #ffffff; text-indent: 22px; display: block; text-align: left; cursor: pointer; zoom: 1; background-repeat: no-repeat no-repeat;">步骤阅读</span></a></div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHPI间是否支持curl, gzip{功? src="http://b.hiphotos.baidu.com/exp/w=500/sign=b01c1c8bd2a20cf44690fedf46084b0c/3b292df5e0fe992555aff25c36a85edf8db1711f.jpg" style="border: 0px; display: block;" /></a></div></div></li><li list-item-3"="" style="margin: 1px 0px 0px 17px; padding: 45px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div></div></li></ol></div></div><img src ="http://www.tkk7.com/yxhxj2006/aggbug/424583.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/yxhxj2006/" target="_blank">奋斗成就男h</a> 2015-04-22 00:04 <a href="http://www.tkk7.com/yxhxj2006/archive/2015/04/22/424583.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> վ֩ģ壺 <a href="http://sdsxyz.com" target="_blank">޾ƷŮþþ </a>| <a href="http://microston.com" target="_blank">ؼëƬƵ</a>| <a href="http://xww678.com" target="_blank">þþþAVר</a>| <a href="http://4eeyy.com" target="_blank">ĻӰƵۿ</a>| <a href="http://helloyp.com" target="_blank">պƵ</a>| <a href="http://445645.com" target="_blank">ɬɬѹۿƷ</a>| <a href="http://shandonghj.com" target="_blank">רר</a>| <a href="http://rushiruhua.com" target="_blank">һŷ</a>| <a href="http://ztsf6688.com" target="_blank">쿴 </a>| <a href="http://avxyz.com" target="_blank">Ƶѹۿ</a>| <a href="http://dqcjlb.com" target="_blank">ij</a>| <a href="http://wulegu.com" target="_blank">޹ƷþþþϼӰԺ</a>| <a href="http://ymiwang.com" target="_blank">ձvaƵۿ</a>| <a href="http://ju7776.com" target="_blank">AVһ߹ۿ </a>| <a href="http://guhey.com" target="_blank">þƷƵ</a>| <a href="http://paweax.com" target="_blank">޾Ʒ״</a>| <a href="http://linanhotel.com" target="_blank">˳վ߹ۿŶ</a>| <a href="http://by6635.com" target="_blank">þۺϾžһ</a>| <a href="http://228609.com" target="_blank">޾Ʒ˳߹ۿ</a>| <a href="http://jundaflex.com" target="_blank">޸ƵһƵƵ</a>| <a href="http://199044.com" target="_blank">뾫ƷӰ</a>| <a href="http://vcnxa.com" target="_blank">þòþüӰԺ</a>| <a href="http://6132423.com" target="_blank">18վڵ</a>| <a href="http://xamxx.com" target="_blank">99þѾƷƵ</a>| <a href="http://xwy2.com" target="_blank">޳</a>| <a href="http://vvww-3499.com" target="_blank">þ㽶߿</a>| <a href="http://www55nana.com" target="_blank">ȫƵ߹ۿ</a>| <a href="http://xxxck.com" target="_blank">պƷרվ</a>| <a href="http://xacfdq.com" target="_blank">ĻƬa</a>| <a href="http://https357171.com" target="_blank">eeussӰԺsscom</a>| <a href="http://8xxon8.com" target="_blank">ĻӰ߿ѹۿ</a>| <a href="http://5s6b.com" target="_blank">ȫһһëƬѿ</a>| <a href="http://xhm33.com" target="_blank">ӰԺҹײ</a>| <a href="http://kyqp0033.com" target="_blank">avר߹ۿ</a>| <a href="http://www99383.com" target="_blank">ɫվwww</a>| <a href="http://alodaba.com" target="_blank">޾Һվ</a>| <a href="http://9ts9.com" target="_blank">˳վɫ7799</a>| <a href="http://2255325.com" target="_blank">޾ƷavĻ</a>| <a href="http://123994.com" target="_blank">A벥ëƬһ</a>| <a href="http://66h99.com" target="_blank">žAV뾫ƷëƬ</a>| <a href="http://jastrelax.com" target="_blank">޹պa߲</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>