<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 15,comments - 0,trackbacks - 0
    這里所說的不是驅動對象,而是這個內核模塊在內核內存空間中的地址。這是一個常用的技巧:在驅動對象中DriverStart域和DriverSize域分別記載著這個驅動對象所代表的內核模塊在內核空間中的開始地址和大小。
    posted @ 2012-11-12 19:06 aya000 閱讀(213) | 評論 (0)編輯 收藏
    error LNK2019: unresolved external symbol _RtlStringVPrintfWorkerW@20 referenced in function _RtlStringCchPrintfW
    error LNK2019: unresolved external symbol _RtlStringValidateDestW@12 referenced in function _RtlStringCchPrintfW
    sources文件加入庫文件
    TARGETLIBS= $(DDK_LIB_PATH)\ntstrsafe.lib
    原文:http://blog.csdn.net/iamoyjj/archive/2011/02/01/6171792.aspx
    posted @ 2012-11-11 17:30 aya000 閱讀(664) | 評論 (0)編輯 收藏
    1>避免創建不必要的對象
    2>如果方法用不到成員變量,可以把方法聲明為static,性能會提高15%到20%
    3>避免使用getters/setters存取Field,可以把Field聲明為public,直接訪問
    4>static的變量如果不需要修改,應使用static final 修飾符定義為常量
    5>使用增強for循環語法——for(:)
    6>私有內布類要訪問外部類的Field或方法,可以把外部類的Field或方法聲明為包訪問權限
    7>合理使用浮點數,浮點數比整型慢兩倍
    posted @ 2012-11-03 22:30 aya000 閱讀(244) | 評論 (0)編輯 收藏
    這大概是由xml文件中的編碼規則決定要這么變換。
    在xml文件中有以下幾類字符要進行轉義替換:

    &lt;

    <

    小于號

    &gt;

    >

    大于號

    &amp;

    &

    &apos;

    '

    單引號

    &quot;

    "

    雙引號


    posted @ 2012-10-28 00:11 aya000 閱讀(444) | 評論 (0)編輯 收藏
    (function(){     
        if(!/*@cc_on!@*/0)
        return;
        var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;
        while(i--){document.createElement(e[i])}
    })()
    //然后在head中引入該js
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
    </script>
    <![endif]-->
    posted @ 2012-08-16 15:03 aya000 閱讀(205) | 評論 (0)編輯 收藏
            .
            .
            .
             //改變狀態
            this.addEventListener(MouseEvent.DOUBLE_CLICK,changeImg);
            .   
            .
            .
    //改變
    public function changeImg():void {
        arguments; //如果方法沒有參數,則必須在方法中添加這個聲明
        if(this.source == img0) {
            this.source = img1;
        } else {
                this.source = img0;
          }
            }
    posted @ 2012-04-15 12:20 aya000 閱讀(1462) | 評論 (0)編輯 收藏
      請求登錄人人網比較麻煩,需要記住cookie,尤其是這句代碼,
    httpContext.setAttribute(ClientContext.COOKIE_STORE,httpClient.getParams().getParameter("CookieStore"));
    試了很多遍才找到httpClient.getParams().getParameter("CookieStore"))。

    主要代碼如下:

    package com.koyo.downloadphoto.service.impl;

    import java.io.File;
    import java.io.InputStream;
    import java.util.ArrayList;
    import java.util.List;

    import org.apache.commons.io.FileUtils;
    import org.apache.commons.io.IOUtils;
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpResponse;
    import org.apache.http.NameValuePair;
    import org.apache.http.client.entity.UrlEncodedFormEntity;
    import org.apache.http.client.methods.HttpGet;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.client.protocol.ClientContext;
    import org.apache.http.message.BasicNameValuePair;
    import org.apache.http.util.EntityUtils;
    import org.apache.log4j.Logger;
    import org.htmlparser.Parser;
    import org.htmlparser.filters.AndFilter;
    import org.htmlparser.filters.HasAttributeFilter;
    import org.htmlparser.filters.TagNameFilter;
    import org.htmlparser.tags.ImageTag;
    import org.htmlparser.tags.LinkTag;
    import org.htmlparser.tags.Span;
    import org.htmlparser.util.NodeList;

    import com.koyo.downloadphoto.service.Spider;
    import com.koyo.downloadphoto.utils.HttpUtils;
    import com.koyo.downloadphoto.utils.ParseUtils;

    public class SpiderForRenRen extends Spider {

     private Logger logger = Logger.getLogger(SpiderForRenRen.class);

     @Override
     public void execute() {

      try {

       String url = "     + "/album/relatives";

       // ===================請求登錄======================================================
       HttpPost post = new HttpPost("
       // 添加POST參數
       List<NameValuePair> nvps = new ArrayList<NameValuePair>();
       nvps.add(new BasicNameValuePair("email", loginName));
       nvps.add(new BasicNameValuePair("password", loginPassword));
       post.setEntity(new UrlEncodedFormEntity(nvps, "utf-8"));
       HttpResponse response = httpClient.execute(post, httpContext);

       HttpEntity entity = response.getEntity();
       if (entity != null) {
        InputStream is = entity.getContent();
        // 使用響應中的編碼來解釋響應的內容
        String html1 = IOUtils.toString(is);
        LinkTag linkTag1 = ParseUtils.parseTag(html1, LinkTag.class);
        String url1 = linkTag1.getLink();

        HttpGet get = new HttpGet(url1);
        response = httpClient.execute(get, httpContext);
        // 保存cookie
        httpContext.setAttribute(ClientContext.COOKIE_STORE, httpClient
          .getParams().getParameter("CookieStore"));
        EntityUtils.consume(response.getEntity());
        
        System.out.println("賬號:" + loginName);
        System.out.println("密碼:" + loginPassword);
       }
       // ===================獲取相冊頁面信息===================================================
       // 根據URL地址,獲取網頁內容
       String html = HttpUtils.getHtml(httpClient, httpContext, url);

       if (html == null) {
        logger.error("無法獲取【" + url + "】網址的內容");
        throw new RuntimeException("無法獲取【" + url + "】網址的內容");
       }
       
       //獲取好友名
       Parser parser = new Parser();
       parser.setInputHTML(html);
       AndFilter andFilter = new AndFilter(new TagNameFilter("ul"), new HasAttributeFilter("class", "nav-tabs"));
       NodeList nodes = parser.parse(andFilter);
       String tempString = nodes.toHtml();
       LinkTag tempTag = ParseUtils.parseTag(tempString, LinkTag.class);
       String tempName = tempTag.getLinkText();
    //   String friendName = tempName.substring(tempName.indexOf("\n")+1,tempName.lastIndexOf("\n"));
       String friendName = tempName.trim();
       
       //獲取相冊名
       String albumName;
       
       List<LinkTag> linkTags = ParseUtils.parseTags(html, LinkTag.class,
         "class", "album-cover");
       List<Span> spans = ParseUtils.parseTags(html, Span.class,"class","album-name");

       if (linkTags != null) {
        for (int i=0; i<linkTags.size(); i++) {
         tempName = spans.get(i).getStringText();
         //由于頭像相冊前還有一個<span class="userhead"/>  故不能使用tempName.trim()
         albumName = tempName.substring(tempName.lastIndexOf("\n")+1);
         url = linkTags.get(i).getLink();
         // 根據URL地址,獲取網頁內容
         html = HttpUtils.getHtml(httpClient, httpContext, url);

         if (html == null) {
          logger.error("無法獲取【" + url + "】網址的內容");
          throw new RuntimeException("無法獲取【" + url + "】網址的內容");
         }

         List<LinkTag> linkTags2 = ParseUtils.parseTags(html,
           LinkTag.class, "class", "picture");
         if (linkTags2 != null) {
          for (LinkTag linkTag2 : linkTags2) {
           url = linkTag2.getLink();
           // 根據URL地址,獲取網頁內容
           html = HttpUtils.getHtml(httpClient, httpContext,
             url);

           if (html == null) {
            logger.error("無法獲取【" + url + "】網址的內容");
            throw new RuntimeException("無法獲取【" + url
              + "】網址的內容");
           }

           // 網頁中所包含的圖片,并下載到upload目錄,然后創建Attachment對象
           ImageTag imageTag = ParseUtils.parseTag(html,
             ImageTag.class, "id", "photo");
           if (imageTag != null) {

            // 得到圖片所在的路徑目錄
            // String baseUrl = url.substring(0,
            // url.lastIndexOf("/") + 1);

            // 這個是<img>標簽中的src的值
            String imageUrl = imageTag.getImageURL();
            String photoName = imageUrl.substring(imageUrl
              .lastIndexOf("/"));
            // 圖片的絕對路徑
            // String absoluteUrl = baseUrl + imageUrl;

            // : "文章標題/xxx.jpg"
            String imageName = friendName + "/" +albumName + photoName;

            // 把圖片保存到upload目錄
            // 首先確定,保存到本地的圖片的路徑
            String imageLocalFile = "D:/PhotosForRenRen/"
              + imageName;

            // 如果圖片已經被下載到本地,則不再下載
            if (!new File(imageLocalFile).exists()) {
             // 下載圖片的信息
             byte[] image = HttpUtils.getImage(
               httpClient, httpContext, imageUrl);
             // 直接使用new
             // FileOutputStream(imageLocalFile)這種方式,創建一個
             // 文件輸出流,存在的問題就是:如果這個文件所在的目錄不存在,則創建不了
             // 輸出流,會拋出異常!
             // 所以,使用輔助的工具類來創建一個文件輸出流:FileUtils.openOutputStream(new
             // File(imageLocalFile))
             // 通過這個方法,當文件所在的父目錄不存在的時候,將自動創建其所有的父目錄
             IOUtils.write(image, FileUtils
               .openOutputStream(new File(
                 imageLocalFile)));
             System.out.println("圖片【" + imageUrl
               + "】已下載");
            }
           }
          }
         }
        }
       }

      } catch (Exception e) {
       e.printStackTrace();
      }

     }
    }

    applicationContext.xml配置如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    <context:annotation-config/>
    <context:component-scan base-package="com.koyo"/>
    </beans>
    posted @ 2011-12-01 21:01 aya000 閱讀(1070) | 評論 (0)編輯 收藏
    public void SetValue(Object obj, String fieldName, Object value)
    throws SecurityException, NoSuchFieldException,
    NoSuchMethodException, IllegalArgumentException,
    IllegalAccessException, InvocationTargetException {
    String firstLetter = fieldName.substring(0, 1).toUpperCase();
    String setMethodName = "set" + firstLetter + fieldName.substring(1);
    Field field = obj.getClass().getDeclaredField(fieldName);
    Method setMethod = obj.getClass().getDeclaredMethod(setMethodName,
    field.getType());
    setMethod.invoke(obj, value);
    }
    posted @ 2011-10-16 21:46 aya000 閱讀(1328) | 評論 (0)編輯 收藏
    遇到這種問題,請參照這種寫法:
    s|Application
    {               
        fontFamily:"Georgia";
        color:#000000;
    }
    posted @ 2011-08-30 16:42 aya000 閱讀(738) | 評論 (0)編輯 收藏
    僅列出標題
    共2頁: 1 2 下一頁 
    主站蜘蛛池模板: 精品久久免费视频| 曰曰鲁夜夜免费播放视频 | 亚洲国产美女精品久久久久∴| 亚洲AV无码一区二区二三区软件| 免费人成动漫在线播放r18| 国产一级淫片免费播放电影| 午夜亚洲WWW湿好爽| 国产一区二区三区在线免费观看| 亚洲AV成人无码久久WWW| 国产男女猛烈无遮挡免费视频网站| 亚洲精品无码专区在线播放| 国产老女人精品免费视频| 亚洲AV第一成肉网| 亚洲免费无码在线| 99视频免费在线观看| 久久精品国产精品亚洲艾| 99视频免费播放| 亚洲日本久久久午夜精品| 在线a人片天堂免费观看高清| 亚洲精品无码你懂的| 亚洲国产精品成人久久蜜臀 | 天堂亚洲免费视频| 国内精品免费久久影院| 久久精品国产亚洲av水果派| 青草草色A免费观看在线| 亚洲AV无码一区二区三区久久精品| 国产精品免费看香蕉| 久久毛片免费看一区二区三区| 亚洲AV日韩精品久久久久久久| 免费A级毛片无码A∨中文字幕下载| 精品亚洲AV无码一区二区| 日本免费观看网站| 国产一区二区免费| 中文字幕亚洲情99在线| 国产精品亚洲w码日韩中文| 91人成网站色www免费下载| 亚洲日韩国产欧美一区二区三区| 亚洲裸男gv网站| 精品久久久久久久久免费影院| 青草青草视频2免费观看| 亚洲天堂中文字幕|