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

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

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

    石建 | Fat Mind

    置頂隨筆

         摘要: 已遷往  http://fatmind.iteye.com主要參考: 1.寶寶的文章《中文化和國際化問題淺析》    2.阮一峰的網絡日志       http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html  ...  閱讀全文
    posted @ 2010-10-05 21:12 石建 | Fat Mind 閱讀(385) | 評論 (0)編輯 收藏

    2013年7月6日


    http://incubator.apache.org/kafka/design.html

    1.Why we built this
        asd(activity stream data)數據是任何網站的一部分,反映網站使用情況,如:那些內容被搜索、展示。通常,此部分數據被以log方式記錄在文件,然后定期的整合和分析。od(operation data)是關于機器性能數據,和其它不同途徑整合的操作數據。
        在近幾年,asd和od變成一個網站重要的一部分,更復雜的基礎設施是必須的。
         數據特點:
            a、大吞吐量的不變的ad,對實時計算是一個挑戰,會很容易超過10倍or100倍。
     
            b、傳統的記錄log方式是respectable and scalable方式去支持離線處理,但是延遲太高。
        Kafka is intended to be a single queuing platform that can support both offline and online use cases.

    2.Major Design Elements

    There is a small number of major design decisions that make Kafka different from most other messaging systems:

    1. Kafka is designed for persistent messages as the common case;消息持久
    2. Throughput rather than features are the primary design constraint;吞吐量是第一要求
    3. State about what has been consumed is maintained as part of the consumer not the server;狀態由客戶端維護
    4. Kafka is explicitly distributed. It is assumed that producers, brokers, and consumers are all spread over multiple machines;必須是分布式
    3.Basics
        Messages are the fundamental unit of communication;
        Messages are
     published to a topic by a producer which means they are physically sent to a server acting as a broker,消息被生產者發布到一個topic,意味著物理的發送消息到broker;
        多個consumer訂閱一個topic,則此topic的每個消息都會被分發到每個consumer;
        kafka是分布式:producer、broker、consumer,均可以由集群的多臺機器組成,相互協作 a logic group;
        屬于同一個consumer group的每一個consumer process,每個消息能準確的由其中的一個process消費;A more common case in our own usage is that we have multiple logical consumer groups, each consisting of a cluster of consuming machines that act as a logical whole.
        kafka不管一個topic有多少個consumer,其消息僅會存儲一份。

    4.Message Persistence and Caching

    4.1 Don't fear the filesystem !
        kafka完全依賴文件系統去存儲和cache消息;
        大家通常對磁盤的直覺是'很慢',則使人們對持久化結構,是否能提供有競爭力的性能表示懷疑;實際上,磁盤到底有多慢或多塊,完全取決于如何使用磁盤,a properly designed disk structure can often be as fast as the network.
        http://baike.baidu.com/view/969385.htm raid-5 
        http://www.china001.com/show_hdr.php?xname=PPDDMV0&dname=66IP341&xpos=172 磁盤種類
        磁盤順序讀寫的性能非常高, linear writes on a 6 7200rpm SATA RAID-5 array is about 300MB/sec;These linear reads and writes are the most predictable of all usage patterns, and hence the one detected and optimized best by the operating system using read-ahead and write-behind techniques。順序讀寫是最可預見的模式,因此操作系統通過read-head和write-behind技術去優化。
        現代操作系統,用mem作為disk的cache;Any modern OS will happily divert all free memory to disk caching with little performance penalty when the memory is reclaimed. All disk reads and writes will go through this unified cache. 
        Jvm:a、對象的內存開銷是非常大的,通常是數據存儲的2倍;b、當heap數據增大時,gc代價越來越大;
        As a result of these factors using the filesystem and relying on pagecache is superior to maintaining an in-memory cache or other structure。依賴文件系統和pagecache是優于mem cahce或其它結構的。
        數據壓縮,Doing so will result in a cache of up to 28-30GB on a 32GB machine without GC penalties. 
        This suggests a design which is very simple: maintain as much as possible in-memory and flush to the filesystem only when necessary. 盡可能的維持在內存中,僅當必須時寫回到文件系統.
        當數據被立即寫回到持久化的文件,而未調用flush,其意味著數據僅被寫入到os pagecahe,在后續某個時間由os flush。Then we add a configuration driven flush policy to allow the user of the system to control how often data is flushed to the physical disk (every N messages or every M seconds) to put a bound on the amount of data "at risk" in the event of a hard crash. 提供flush策略。

    4.2 
    Constant Time Suffices
        
    The persistent data structure used in messaging systems metadata is often a BTree. BTrees are the most versatile data structure available, and make it possible to support a wide variety of transactional and non-transactional semantics in the messaging system.
        Disk seeks come at 10 ms a pop, and each disk can do only one seek at a time so parallelism is limited. Hence even a handful of disk seeks leads to very high overhead. 
        Furthermore BTrees require a very sophisticated page or row locking implementation to avoid locking the entire tree on each operation.
    The implementation must pay a fairly high price for row-locking or else effectively serialize all reads.
        持久化消息的元數據通常是BTree結構,但磁盤結構,其代價太大。原因:尋道、避免鎖整棵樹。
        
    Intuitively a persistent queue could be built on simple reads and appends to files as is commonly the case with logging solutions.
        持久化隊列可以構建在讀和append to 文件。所以不支持BTree的一些語義,但其好處是:O(1)消耗,無鎖讀寫。
        
    the performance is completely decoupled from the data size--one server can now take full advantage of a number of cheap, low-rotational speed 1+TB SATA drives. 
    Though they have poor seek performance, these drives often have comparable performance for large reads and writes at 1/3 the price and 3x the capacity.

    4.3 Maximizing Efficiency
        Furthermore we assume each message published is read at least once (and often multiple times), hence we optimize for consumption rather than production. 更進一步,我們假設被發布的消息至少會讀一次,因此優化consumer優先于producer。
        
    There are two common causes of inefficiency :
            two many network requests, (
     APIs are built around a "message set" abstraction,
    This allows network requests to group messages together and amortize the overhead of the network roundtrip rather than sending a single message at a time.) 僅提供批量操作api,則每次網絡開銷是平分在一組消息,而不是單個消息。
        and excessive byte copying.(
    The message log maintained by the broker is itself just a directory of message sets that have been written to disk.
    Maintaining this common format allows optimization of the most important operation : network transfer of persistent log chunks.
        To understand the impact of sendfile, it is important to understand the common data path for transfer of data from file to socket:
    1. The operating system reads data from the disk into pagecache in kernel space
    2. The application reads the data from kernel space into a user-space buffer
    3. The application writes the data back into kernel space into a socket buffer
    4. The operating system copies the data from the socket buffer to the NIC buffer where it is sent over the network
        利用os提供的zero-copy,
    only the final copy to the NIC buffer is needed.

    4.4 End-to-end Batch Compression
        In many cases the bottleneck is actually not CPU but network. This is particularly true for a data pipeline that needs to send messages across data centers.
    Efficient compression requires compressing multiple messages together rather than compressing each message individually. 
    Ideally this would be possible in an end-to-end fashion — that is, data would be compressed prior to sending by the producer and remain compressed on the server, only being decompressed by the eventual consumers. 
        
    A batch of messages can be clumped together compressed and sent to the server in this form. This batch of messages will be delivered all to the same consumer and will remain in compressed form until it arrives there.
        理解:kafka 
    producer api 提供批量壓縮,broker不對此批消息做任何操作,且以壓縮的方式,一起被發送到consumer。

    4.5 Consumer state
        Keeping track of what has been consumed is one of the key things a messaging system must provide. 
    State tracking requires updating a persistent entity and potentially causes random accesses. 
        
    Most messaging systems keep metadata about what messages have been consumed on the broker. That is, as a message is handed out to a consumer, the broker records that fact locally. 大部分消息系統,存儲是否被消費的元信息在broker。則是說,一個消息被分發到一個consumer,broker記錄。
        問題:當consumer消費失敗后,會導致消息丟失;改進:每次consumer消費后,給broker ack,若broker在超時時間未收到ack,則重發此消息。
        問題:1.當消費成功,但未ack時,會導致消費2次  2.
     now the broker must keep multiple states about every single message  3.當broker是多臺機器時,則狀態之間需要同步

    4.5.1 Message delivery semantics
        
    So clearly there are multiple possible message delivery guarantees that could be provided : at most once 、at least once、exactly once。
        
    This problem is heavily studied, and is a variation of the "transaction commit" problem. Algorithms that provide exactly once semantics exist, two- or three-phase commits and Paxos variants being examples, but they come with some drawbacks. They typically require multiple round trips and may have poor guarantees of liveness (they can halt indefinitely). 
        消費分發語義,是 ‘事務提交’ 問題的變種。算法提供 exactly onece 語義,兩階段 or 三階段提交,paxos 均是例子,但它們存在缺點。典型的問題是要求多次round trip,且
    poor guarantees of liveness。
        
    Kafka does two unusual things with respect to metadata. 
    First the stream is partitioned on the brokers into a set of distinct partitions. 
    Within a partition messages are stored in the order in which they arrive at the broker, and will be given out to consumers in that same order. This means that rather than store metadata for each message (marking it as consumed, say), we just need to store the "high water mark" for each combination of consumer, topic, and partition.  
        
    4.5.2 
    Consumer state
        In Kafka, the consumers are responsible for maintaining state information (offset) on what has been consumed. 
    Typically, the Kafka consumer library writes their state data to zookeeper.
        
    This solves a distributed consensus problem, by removing the distributed part!
        
    There is a side benefit of this decision. A consumer can deliberately rewind back to an old offset and re-consume data.

    4.5.3 Push vs. pull
        
    A related question is whether consumers should pull data from brokers or brokers should push data to the subscriber.
    There are pros and cons to both approaches.
        However a push-based system has difficulty dealing with diverse consumers as the broker controls the rate at which data is transferred. push目標是consumer能在最大速率去消費,可不幸的是,當consume速率小于生產速率時,the consumer tends to be overwhelmed。
        
    A pull-based system has the nicer property that the consumer simply falls behind and catches up when it can. This can be mitigated with some kind of backoff protocol by which the consumer can indicate it is overwhelmed, but getting the rate of transfer to fully utilize (but never over-utilize) the consumer is trickier than it seems. Previous attempts at building systems in this fashion led us to go with a more traditional pull model.  不存在push問題,且也保證充分利用consumer能力。

    5. Distribution
        Kafka is built to be run across a cluster of machines as the common case. There is no central "master" node. Brokers are peers to each other and can be added and removed at anytime without any manual configuration changes. Similarly, producers and consumers can be started dynamically at any time. Each broker registers some metadata (e.g., available topics) in Zookeeper. Producers and consumers can use Zookeeper to discover topics and to co-ordinate the production and consumption. The details of producers and consumers will be described below.

    6. Producer

    6.1 Automatic producer load balancing
        Kafka supports client-side load balancing for message producers or use of a dedicated load balancer to balance TCP connections. 
     
        The advantage of using a level-4 load balancer is that each producer only needs a single TCP connection, and no connection to zookeeper is needed. 
    The disadvantage is that the balancing is done at the TCP connection level, and hence it may not be well balanced (if some producers produce many more messages then others, evenly dividing up the connections per broker may not result in evenly dividing up the messages per broker).
        
    Client-side zookeeper-based load balancing solves some of these problems. It allows the producer to dynamically discover new brokers, and balance load on a per-request basis. It allows the producer to partition data according to some key instead of randomly.

        The working of the zookeeper-based load balancing is described below. Zookeeper watchers are registered on the following events—

    • a new broker comes up
    • a broker goes down
    • a new topic is registered
    • a broker gets registered for an existing topic

        Internally, the producer maintains an elastic pool of connections to the brokers, one per broker. This pool is kept updated to establish/maintain connections to all the live brokers, through the zookeeper watcher callbacks. When a producer request for a particular topic comes in, a broker partition is picked by the partitioner (see section on semantic partitioning). The available producer connection is used from the pool to send the data to the selected broker partition.
        producer通過zk,管理與broker的連接。當一個請求,根據partition rule 計算分區,從連接池選擇對應的connection,發送數據。

    6.2 Asynchronous send

        Asynchronous non-blocking operations are fundamental to scaling messaging systems.
        
    This allows buffering of produce requests in a in-memory queue and batch sends that are triggered by a time interval or a pre-configured batch size. 

    6.3 Semantic partitioning
        
    The producer has the capability to be able to semantically map messages to the available kafka nodes and partitions. 
    This allows partitioning the stream of messages with some semantic partition function based on some key in the message to spread them over broker machines. 


    posted @ 2013-07-06 14:57 石建 | Fat Mind 閱讀(1761) | 評論 (0)編輯 收藏

    2012年9月9日

    1.Js代碼,login.js文件

    //用戶的登陸信息寫入cookies
    function SetCookie(form)//兩個參數,一個是cookie的名子,一個是值
    {   
        var name = form.name.value;
        var password = form.password.value;
        var Days = 1; //此 cookie 將被保存 7 天 
        var exp  = new Date(); //生成一個現在的日期,加上保存期限,然后設置cookie的生存期限!
        exp.setTime(exp.getTime() + Days*24*60*60*1000);
        document.cookie = "user="+ escape(name) + "/" + escape(password) + ";expires=" + exp.toGMTString();
    }
    //取cookies函數--正則表達式(不會,學習正則表達式)  
    function getCookie(name)      
    {
        var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
        if(arr != nullreturn unescape(arr[2]); 
        return null;
    }
    //取cookies函數--普通實現      
      function   readCookie(form){   
          var   cookieValue   =   "";   
          var   search   =   "user=";   
          if(document.cookie.length   >   0)     {   
              offset   =   document.cookie.indexOf(search);
              if(offset !=  -1){     
                  offset   +=   search.length;   
                  end   =   document.cookie.indexOf(";",offset);   
                  if   (end  ==  -1)   
                        end   =   document.cookie.length;
                  //獲取cookies里面的值          
                  cookieValue   =   unescape(document.cookie.substring(offset,end))
                  if(cookieValue != null){
                        var str = cookieValue.split("/");
                        form.name.value = str[0];
                        form.password.value = str[1]; 
                  }
              }   
          }    
      }   
    //刪除cookie,(servlet里面:設置時間為0,設置為-1和session的范圍是一樣的),javascript好像是有點區別
    function delCookie()
    {
        var name = "admin";
        var exp = new Date();
        exp.setTime(exp.getTime() - 1);
        var cval=getCookie(name);
        if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
    }

     

    2.jsp代碼,文件login.jsp

    <%@ page contentType="text/html; charset=gb2312" language="java"
        import="java.sql.*" errorPage=""%>
        
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
            <title>javascript 控制 cookie</title>
            <link href="css/style.css" rel="stylesheet" type="text/css">
            <script type="text/javascript" src="js/login.js"></script>
        </head>
        <script language="javascript">
        function checkEmpty(form){
            for(i=0;i<form.length;i++){
                if(form.elements[i].value==""){
                    alert("表單信息不能為空");
                    return false;
                }
            }
        }
    </script>
        <body onload="readCookie(form)"> <!-- 作為JavaScript控制的cookie-->
            <div align="center">
                <table width="324" height="225" border="0" cellpadding="0" cellspacing="0">
                    <tr height="50">
                        <td ></td>
                    </tr>
                    <tr align="center">
                        <td background="images/back.jpg">
                            <br>
                            <br>
                            登陸
                            <form name="form" method="post" action="" onSubmit="return checkEmpty(form)">
                                <input type="hidden" name="id" value="-1">
                                <table width="268" border="1" cellpadding="0" cellspacing="0">
                                    <tr align="center">
                                        <td width="63" height="30">
                                            用戶名:
                                        </td>
                                        <td width="199">
                                            <input type="text" name="name" id="name">
                                        </td>
                                    </tr>
                                    <tr align="center">
                                        <td height="30">
                                            密碼:
                                        </td>
                                        <td>
                                            <input type="password" name="password" id="password">
                                        </td>
                                    </tr>
                                </table>
                                <br>
                                <input type="submit" value="提交">
                                <input type="checkbox" name="cookie" onclick="SetCookie(form)">記住我          
                            </form>
                        </td>
                    </tr>
                </table>
            </div>
        </body>
    </html>

     


    目的:當你再次打開login.jsp頁面,表單里面的內容已經寫好了,是你上一次的登陸信息!


    問題:1.JavaScript里面取cookie都是寫死的,不是很靈活!
                2.JavaScript的cookie是按照字符串的形式存放的,所以拿出的時候,你要按照你放進去的形式來選擇!
                3.本來是想實現自動登陸的,可我的每個頁面都要session的檢查!一個客戶端,一個服務器端,沒能實現!

     

     

    posted @ 2012-09-09 15:18 石建 | Fat Mind 閱讀(638) | 評論 (0)編輯 收藏

    2012年5月20日

    1.變量類型
      - undefined
      - null
      - string
            - == 與 === 區別
      - number
      - boolean
      - string、number、boolean均有對應的 '對象類'
    2.函數
      - 定義函數
            - function 關鍵字
            - 參數(見例子),arguments
            - 函數內變量聲明,var區別
      - 作用域
            - 鏈式結構(子函數可以看見父函數的變量)
      - 匿名函數
          - 使用場景(非復用場景,如:jsonp回調函數)
          - this特征
    例子:
    var add = function(x) {
        return x++;

    }
    add(1,2,3); // 參數可以隨意多個,類似Java中的(int x ...)

    var fn = function(name, pass) {
        alert(name);
        alert(pass);
    };
    fn("hello","1234",5); // 按照傳遞的順序排列


    var name = "windows";
    var fn = function() {
        var name 
    = "hello";
        alert(
    this.name);
    }
    fn(); // windows,this在匿名函數內部是指向windows范圍

    var name = "windows";
    var fn = function() {
        name 
    = "hello";
        alert(
    this.name);
    }
    fn(); // 因函數內部變量name未聲明為var,則屬于全局變量,且this指向windows,則為'hello'

    function add(a) {
        return ++a;
    }
    var fn = function(x,add){
        return add(x);
    }
    fn(1, add);  // 函數作為參數

    3.閉包  
    http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html 【good】
    其它語言閉包概念 http://www.ibm.com/developerworks/cn/linux/l-cn-closure/

    4.對象
        - new Object()
        – 對象字面量
        – 構造函數
        - 上述操作,經歷的步驟
            –創建新對象
            –將構造方法的作用域賦給新對象(new 操作符)
            –為對象添加屬性, 方法
            –返回該對象

    var obj = new Object();  // new Object方式
    obj.name = 'zhangsan';

    var obj = {                   // 字面常量方式,定義對象
        name : 'zhangsan',
        showName : function (){
            alert(this.name);
        }
    };
    alert(obj.showName());
    function Person(name) { // 構造函數
        this.name = name;
        this.showName = function(){
            return this.name; }
        };
    var obj = new Person("zhangsan"); // 必須用 new 關鍵,否則等于調用一個普通函數
    obj.showName();
    alert(obj.name);


    資料:內部培訓ppt 
    posted @ 2012-05-20 13:50 石建 | Fat Mind 閱讀(263) | 評論 (0)編輯 收藏

    2012年4月6日


    1.句柄就是一個標識符,只要獲得對象的句柄,我們就可以對對象進行任意的操作。

    2.句柄不是指針,操作系統用句柄可以找到一塊內存,這個句柄可能是標識符,mapkey,也可能是指針,看操作系統怎么處理的了。

    fd算是在某種程度上替代句柄吧;

    Linux 有相應機制,但沒有統一的句柄類型,各種類型的系統資源由各自的類型來標識,由各自的接口操作。

    3.http://tech.ddvip.com/2009-06/1244006580122204_11.html

    在操作系統層面上,文件操作也有類似于FILE的一個概念,在Linux里,這叫做文件描述符(File Descriptor),而在Windows里,叫做句柄(Handle)(以下在沒有歧義的時候統稱為句柄)。用戶通過某個函數打開文件以獲得句柄,此 后用戶操縱文件皆通過該句柄進行。

     

    設計這么一個句柄的原因在于句柄可以防止用戶隨意讀寫操作系統內核的文件對象。無論是Linux還是Windows,文件句柄總是和內核的文件對象相關聯的,但如何關聯細節用戶并不可見。內核可以通過句柄來計算出內核里文件對象的地址,但此能力并不對用戶開放。

     

    下面舉一個實際的例子,在Linux中,值為012fd分別代表標準輸入、標準輸出和標準錯誤輸出。在程序中打開文件得到的fd3開始增長。 fd具體是什么呢?在內核中,每一個進程都有一個私有的打開文件表,這個表是一個指針數組,每一個元素都指向一個內核的打開文件對象。而fd,就是這 個表的下標。當用戶打開一個文件時,內核會在內部生成一個打開文件對象,并在這個表里找到一個空項,讓這一項指向生成的打開文件對象,并返回這一項的下標 作為fd。由于這個表處于內核,并且用戶無法訪問到,因此用戶即使擁有fd,也無法得到打開文件對象的地址,只能夠通過系統提供的函數來操作。

     

    C語言里,操縱文件的渠道則是FILE結構,不難想象,C語言中的FILE結構必定和fd有一對一的關系,每個FILE結構都會記錄自己唯一對應的fd。


    句柄 
    http://zh.wikipedia.org/wiki/%E5%8F%A5%E6%9F%84

    程序設計 ,句柄是一種特殊的智能指針 。當一個應用程序 要引用其他系統(數據庫、操作系統 )所管理的內存 塊或對象 時,就要使用句柄。

    句柄與普通指針 的區別在于,指針包含的是引用對象 內存地址 ,而句柄則是由系統所管理的引用標識,該標識可以被系統重新定位到一個內存地址 上。這種間接訪問對象 的模式增強了系統對引用對象 的控制。(參見封裝 )。

    在上世紀80年代的操作系統(如Mac OS Windows )的內存管理 中,句柄被廣泛應用。Unix 系統的文件描述符 基本上也屬于句柄。和其它桌面環境 一樣,Windows API 大量使用句柄來標識系統中的對象 ,并建立操作系統與用戶空間 之間的通信渠道。例如,桌面上的一個窗體由一個HWND 類型的句柄來標識。

    如今,內存 容量的增大和虛擬內存 算法使得更簡單的指針 愈加受到青睞,而指向另一指針的那類句柄受到冷淡。盡管如此,許多操作系統 仍然把指向私有對象 的指針以及進程傳遞給客戶端 的內部數組 下標稱為句柄。


     

    posted @ 2012-04-06 14:02 石建 | Fat Mind 閱讀(11888) | 評論 (0)編輯 收藏

    2012年3月29日


    官方 :http://code.google.com/p/powermock/ 

    1. 使用mockito的同學,推薦閱讀如下部分

        - document [必選]
            - getting started
            - motavition
        - mockito extends [必選]
            - mockito 1.8+ useage
        - common
        - tutorial
        - faq [必選]


    2. 附件:實際開發中使用到的
    powermock的一些特性,簡化后的例子(僅為說明powermock api使用)。主要包括

     

    -          修改私有域

    -          私有方法

    -            測試私有方法

    -            Mock

    -            Verify

    -          靜態方法

    -            Mock

    -            拋出異常

    -            Verify

    -          Mock類部分方法

    -          Mock Java core library,如:Thread

    -          Mock 構造器

    /Files/shijian/powermock.rar



    posted @ 2012-03-29 12:39 石建 | Fat Mind 閱讀(902) | 評論 (0)編輯 收藏

    2012年3月24日


    原文地址:
    http://googleresearch.blogspot.com/2012/03/excellent-papers-for-2011.html

     

    Excellent Papers for 2011

    Posted by Corinna Cortes and Alfred Spector, Google Research

    Googlers across the company actively engage with the scientific community by publishing technical papers, contributing open-source packages, working on standards, introducing new APIs and tools, giving talks and presentations, participating in ongoing technical debates, and much more. Our publications offer technical and algorithmic advances, feature aspects we learn as we develop novel products and services, and shed light on some of the technical challenges we face at Google.

     

    谷歌公司積極參與科學界的交流,通過發表技術論文,貢獻開源軟件,制定標準,引入新的API和工具,舉辦講座和演講,參加正在進行的技術辯論,等等。我們發布的文章提供技術和算法的進步,在開發新的產品和服務過程中學習到的內容,揭示一些我們在谷歌所面臨的技術挑戰。

     

    In an effort to highlight some of our work, we periodically select a number of publications to be featured on this blog. We first posted a set of papers on this blog in mid-2010 and subsequently discussed them in more detail in the following blog postings. In a second round, we highlighted new noteworthy papers from the later half of 2010. This time we honor the influential papers authored or co-authored by Googlers covering all of 2011 -- covering roughly 10% of our total publications.  It’s tough choosing, so we may have left out some important papers.  So, do see the publications list to review the complete group.

     

    為了彰顯我們的一些工作,我們定期選擇一些列文章發布在blog2010中期,我們第一次發布了一些列的文章在blog,并隨后在博客文章中更詳細討論它們。在第二輪中,我們強調從2010年下半年新值得注意的論文。這一次,我們給有影響力的文章的作者或合著者以榮譽,大約占總文章數的10%。這是艱難的選擇的,所以我們可能已經遺漏了一些重要文章。因此,請看完整的文章清單。

     

    In the coming weeks we will be offering a more in-depth look at these publications, but here are some summaries:

     

    在未來幾周我們將更深入的談論這些論文,但現在只做一些總結。

     

    Audio processing

     

    Cascades of two-pole–two-zero asymmetric resonators are good models of peripheral auditory function”, Richard F. Lyon,Journal of the Acoustical Society of America, vol. 130 (2011), pp. 3893-3904.
    Lyon's long title summarizes a result that he has been working toward over many years of modeling sound processing in the inner ear. 
     This nonlinear cochlear model is shown to be "good" with respect to psychophysical data on masking, physiological data on mechanical and neural response, and computational efficiency. These properties derive from the close connection between wave propagation and filter cascades. This filter-cascade model of the ear is used as an efficient sound processor for several machine hearing projects at Google.

     

    聲音處理:這個濾波器級聯模型的耳朵是用來作為一種高效的聲音處理器,是谷歌的幾個機器聲音處理項目之一。

     

    Electronic Commerce and Algorithms

     

    Online Vertex-Weighted Bipartite Matching and Single-bid Budgeted Allocations”, Gagan AggarwalGagan GoelChinmay KarandeAranyak MehtaSODA 2011.
    The authors introduce an elegant and powerful algorithmic technique to the area of online ad allocation and matching: a hybrid of random perturbations and greedy choice to make decisions on the fly. Their technique sheds new light on classic matching algorithms, and can be used, for example, to pick one among a set of relevant ads, without knowing in advance the demand for ad slots on future web page views. 

     

    作者介紹在線廣告分配和匹配方面的優雅和強大的算法技術:一種混合隨機擾動和貪婪選擇,實現在線決定。他們的技術揭示了經典的匹配算法的新的方向,例如,挑選其中一組相關的廣告,事先不知道未來的網站頁面訪問的廣告位置的需求。【關注】

     

    Milgram-routing in social networks”, Silvio Lattanzi, Alessandro Panconesi, D. Sivakumar, Proceedings of the 20th International Conference on World Wide Web, WWW 2011, pp. 725-734.
    Milgram’s "six-degrees-of-separation experiment" and the fascinating small world hypothesis that follows from it, have generated a lot of interesting research in recent years. In this landmark experiment, Milgram showed that people unknown to each other are often connected by surprisingly short chains of acquaintances. In the paper we prove theoretically and experimentally how a recent model of social networks, "Affiliation Networks", offers an explanation to this phenomena and inspires interesting technique for local routing within social networks.

     

    米爾格蘭姆的六個度分離實驗,迷人的小世界遵從它的結果,在最近幾年已經產生了很多有趣的研究。在這一具有里程碑意義的實驗,表明未知的對方往往是通過熟人,以令人驚訝的短鏈連接即可認識。在本文中,我們提供理論和實驗關于近代的社會網絡模型,Affiliation Networks,提供了一種解釋這種現象,并激發社會網絡的interesting technique for local routing?!娟P注】

     

    Non-Price Equilibria in Markets of Discrete Goods”, Avinatan Hassidim, Haim Kaplan, Yishay Mansour, Noam Nisan, EC, 2011.
    We present a correspondence between markets of indivisible items, and a family of auction based n player games. We show that a market has a price based (Walrasian) equilibrium if and only if the corresponding game has a pure Nash equilibrium. We then turn to markets which do not have a Walrasian equilibrium (which is the interesting case), and study properties of the mixed Nash equilibria of the corresponding games.

     

    在離散商品市場的非價格平衡【關注】

     

    HCI

     

    From Basecamp to Summit: Scaling Field Research Across 9 Locations”, Jens Riegelsberger, Audrey Yang, Konstantin Samoylov, Elizabeth Nunge, Molly Stevens, Patrick Larvie, CHI 2011 Extended Abstracts.
    The paper reports on our experience with a basecamp research hub to coordinate logistics and ongoing real-time analysis with research teams in the field. We also reflect on the implications for the meaning of research in a corporate context, where much of the value may be less in a final report, but more in the curated impressions and memories our colleagues take away from the the research trip.

    User-Defined Motion Gestures for Mobile Interaction”, Jaime Ruiz, Yang Li, Edward Lank, CHI 2011: ACM Conference on Human Factors in Computing Systems, pp. 197-206.
    Modern smartphones contain sophisticated sensors that can detect rich motion gestures — deliberate movements of the device by end-users to invoke commands. However, little is known about best-practices in motion gesture design for the mobile computing paradigm. We systematically studied the design space of motion gestures via a guessability study that elicits end-user motion gestures to invoke commands on a smartphone device. The study revealed consensus among our participants on parameters of movement and on mappings of motion gestures onto commands, by which we developed a taxonomy for motion gestures and compiled an end-user inspired motion gesture set. The work lays the foundation of motion gesture design—a new dimension for mobile interaction.

    Information Retrieval

    Reputation Systems for Open Collaboration”, B.T. Adler, L. de Alfaro, A. Kulshrestra, I. Pye, Communications of the ACM, vol. 54 No. 8 (2011), pp. 81-87.
    This paper describes content based reputation algorithms, that rely on automated content analysis to derive user and content reputation, and their applications for Wikipedia and google Maps. The Wikipedia reputation system WikiTrust relies on a chronological analysis of user contributions to articles, metering positive or negative increments of reputation whenever new contributions are made. The Google Maps system Crowdsensus compares the information provided by users on map business listings and computes both a likely reconstruction of the correct listing and a reputation value for each user. Algorithmic-based user incentives ensure the trustworthiness of evaluations of Wikipedia entries and Google Maps business information.

    Machine Learning and Data Mining

    Domain adaptation in regression”, Corinna CortesMehryar MohriProceedings of The 22nd International Conference on Algorithmic Learning Theory, ALT 2011.
    Domain adaptation is one of the most important and challenging problems in machine learning. 
     This paper presents a series of theoretical guarantees for domain adaptation in regression, gives an adaptation algorithm based on that theory that can be cast as a semi-definite programming problem, derives an efficient solution for that problem by using results from smooth optimization, shows that the solution can scale to relatively large data sets, and reports extensive empirical results demonstrating the benefits of this new adaptation algorithm.

    On the necessity of irrelevant variables”, David P. Helmbold, Philip M. LongICML, 2011
    Relevant variables sometimes do much more good than irrelevant variables do harm, so that it is possible to learn a very accurate classifier using predominantly irrelevant variables. 
     We show that this holds given an assumption that formalizes the intuitive idea that the variables are non-redundant.  For problems like this it can be advantageous to add many additional variables, even if only a small fraction of them are relevant.

    Online Learning in the Manifold of Low-Rank Matrices”, Gal Chechik, Daphna Weinshall, Uri Shalit, Neural Information Processing Systems (NIPS 23), 2011, pp. 2128-2136.
    Learning measures of similarity from examples of similar and dissimilar pairs is a problem that is hard to scale. LORETA uses retractions, an operator from matrix optimization, to learn low-rank similarity matrices efficiently. This allows to learn similarities between objects like images or texts when represented using many more features than possible before.

    Machine Translation

    Training a Parser for Machine Translation Reordering”, Jason Katz-Brown, Slav PetrovRyan McDonaldFranz Och, David Talbot, Hiroshi Ichikawa, Masakazu Seno, Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing (EMNLP '11).
    Machine translation systems often need to understand the syntactic structure of a sentence to translate it correctly. Traditionally, syntactic parsers are evaluated as standalone systems against reference data created by linguists. Instead, we show how to train a parser to optimize reordering accuracy in a machine translation system, resulting in measurable improvements in translation quality over a more traditionally trained parser.

    Watermarking the Outputs of Structured Prediction with an application in Statistical Machine Translation”, Ashish Venugopal,Jakob Uszkoreit, David Talbot, Franz Och, Juri Ganitkevitch, Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing (EMNLP).
    We propose a general method to watermark and probabilistically identify the structured results of machine learning algorithms with an application in statistical machine translation. Our approach does not rely on controlling or even knowing the inputs to the algorithm and provides probabilistic guarantees on the ability to identify collections of results from one’s own algorithm, while being robust to limited editing operations.

    Inducing Sentence Structure from Parallel Corpora for Reordering”, John DeNeroJakob UszkoreitProceedings of the 2011 Conference on Empirical Methods in Natural Language Processing (EMNLP).
    Automatically discovering the full range of linguistic rules that govern the correct use of language is an appealing goal, but extremely challenging. 
     Our paper describes a targeted method for discovering only those aspects of linguistic syntax necessary to explain how two different languages differ in their word ordering.  By focusing on word order, we demonstrate an effective and practical application of unsupervised grammar induction that improves a Japanese to English machine translation system.

    Multimedia and Computer Vision

    Kernelized Structural SVM Learning for Supervised Object Segmentation”, Luca BertelliTianli Yu, Diem Vu, Burak Gokturk,Proceedings of IEEE Conference on Computer Vision and Pattern Recognition 2011.
    The paper proposes a principled way for computers to learn how to segment the foreground from the background of an image given a set of training examples. The technology is build upon a specially designed nonlinear segmentation kernel under the recently proposed structured SVM learning framework.

    Auto-Directed Video Stabilization with Robust L1 Optimal Camera Paths”, Matthias GrundmannVivek Kwatra, Irfan Essa,IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2011).
    Casually shot videos captured by handheld or mobile cameras suffer from significant amount of shake. Existing in-camera stabilization methods dampen high-frequency jitter but do not suppress low-frequency movements and bounces, such as those observed in videos captured by a walking person. On the other hand, most professionally shot videos usually consist of carefully designed camera configurations, using specialized equipment such as tripods or camera dollies, and employ ease-in and ease-out for transitions. Our stabilization technique automatically converts casual shaky footage into more pleasant and professional looking videos by mimicking these cinematographic principles. The original, shaky camera path is divided into a set of segments, each approximated by either constant, linear or parabolic motion, using an algorithm based on robust L1 optimization. The stabilizer has been part of the YouTube Editor (youtube.com/editor) since March 2011.

    The Power of Comparative Reasoning”, Jay Yagnik, Dennis Strelow, David Ross, Ruei-Sung Lin, International Conference on Computer Vision (2011).
    The paper describes a theory derived vector space transform that converts vectors into sparse binary vectors such that Euclidean space operations on the sparse binary vectors imply rank space operations in the original vector space. The transform a) does not need any data-driven supervised/unsupervised learning b) can be computed from polynomial expansions of the input space in linear time (in the degree of the polynomial) and c) can be implemented in 10-lines of code. We show competitive results on similarity search and sparse coding (for classification) tasks.

    NLP

    Unsupervised Part-of-Speech Tagging with Bilingual Graph-Based Projections”, Dipanjan Das, Slav PetrovProceedings of the 49th Annual Meeting of the Association for Computational Linguistics (ACL '11), 2011, Best Paper Award.
    We would like to have natural language processing systems for all languages, but obtaining labeled data for all languages and tasks is unrealistic and expensive. We present an approach which leverages existing resources in one language (for example English) to induce part-of-speech taggers for languages without any labeled training data. We use graph-based label propagation for cross-lingual knowledge transfer and use the projected labels as features in a hidden Markov model trained with the Expectation Maximization algorithm.

    Networks

    TCP Fast Open”, Sivasankar Radhakrishnan, Yuchung ChengJerry ChuArvind Jain, Barath Raghavan, Proceedings of the 7th International Conference on emerging Networking EXperiments and Technologies (CoNEXT), 2011.
    TCP Fast Open enables data exchange during TCP’s initial handshake. It decreases application network latency by one full round-trip time, a significant speedup for today's short Web transfers. Our experiments on popular websites show that Fast Open reduces the whole-page load time over 10% on average, and in some cases up to 40%.

    Proportional Rate Reduction for TCP”, Nandita Dukkipati, Matt Mathis, Yuchung Cheng, Monia Ghobadi, Proceedings of the 11th ACM SIGCOMM Conference on Internet Measurement 2011, Berlin, Germany - November 2-4, 2011.
    Packet losses increase latency of Web transfers and negatively impact user experience. Proportional rate reduction (PRR) is designed to recover from losses quickly, smoothly and accurately by pacing out retransmissions across received ACKs during TCP’s fast recovery. Experiments on Google Web and YouTube servers in U.S. and India demonstrate that PRR reduces the TCP latency of connections experiencing losses by 3-10% depending on response size.

    Security and Privacy

    Automated Analysis of Security-Critical JavaScript APIs”, Ankur Taly, Úlfar Erlingsson, John C. Mitchell, Mark S. Miller, Jasvir Nagra, IEEE Symposium on Security & Privacy (SP), 2011.
    As software is increasingly written in high-level, type-safe languages, attackers have fewer means to subvert system fundamentals, and attacks are more likely to exploit errors and vulnerabilities in application-level logic. 
     This paper describes a generic, practical defense against such attacks, which can protect critical application resources even when those resources are partially exposed to attackers via software interfaces. In the context of carefully-crafted fragments of JavaScript, the paper applies formal methods and semantics to prove that these defenses can provide complete, non-circumventable mediation of resource access; the paper also shows how an implementation of the techniques can establish the properties of widely-used software, and find previously-unknown bugs.

    App Isolation: Get the Security of Multiple Browsers with Just One”, Eric Y. Chen, Jason Bau, Charles Reis, Adam Barth, Collin Jackson, 18th ACM Conference on Computer and Communications Security, 2011.
    We find that anecdotal advice to use a separate web browser for sites like your bank is indeed effective at defeating most cross-origin web attacks. 
     We also prove that a single web browser can provide the same key properties, for sites that fit within the compatibility constraints.

    Speech

    Improving the speed of neural networks on CPUs”, Vincent VanhouckeAndrew Senior, Mark Z. Mao, Deep Learning and Unsupervised Feature Learning Workshop, NIPS 2011.
    As deep neural networks become state-of-the-art in real-time machine learning applications such as speech recognition, computational complexity is fast becoming a limiting factor in their adoption. We show how to best leverage modern CPU architectures to significantly speed-up their inference.

    Bayesian Language Model Interpolation for Mobile Speech Input”, Cyril AllauzenMichael RileyInterspeech 2011.
    Voice recognition on the Android platform must contend with many possible target domains - e.g. search, maps, SMS. For each of these, a domain-specific language model was built by linearly interpolating several n-gram LMs from a common set of Google corpora. The current work has found a way to efficiently compute a single n-gram language model with accuracy very close to the domain-specific LMs but with considerably less complexity at recognition time.

    Statistics

    Large-Scale Parallel Statistical Forecasting Computations in R”, Murray Stokely, Farzan Rohani, Eric Tassone, JSM Proceedings, Section on Physical and Engineering Sciences, 2011.
    This paper describes the implementation of a framework for utilizing distributed computational infrastructure from within the R interactive statistical computing environment, with applications to timeseries forecasting. This system is widely used by the statistical analyst community at Google for data analysis on very large data sets.

    Structured Data

    Dremel: Interactive Analysis of Web-Scale Datasets”, Sergey Melnik, Andrey Gubarev, Jing Jing Long, Geoffrey Romer, Shiva Shivakumar, Matt Tolton, Communications of the ACM, vol. 54 (2011), pp. 114-123.
    Dremel is a scalable, interactive ad-hoc query system. By combining multi-level execution trees and columnar data layout, it is capable of running aggregation queries over trillion-row tables in seconds. Besides continued growth internally to Google, Dremel now also backs an increasing number of external customers including BigQuery and UIs such as AdExchange front-end.

    Representative Skylines using Threshold-based Preference Distributions”, Atish Das Sarma, Ashwin Lall, Danupon Nanongkai, Richard J. Lipton, Jim Xu, International Conference on Data Engineering (ICDE), 2011.
    The paper adopts principled approach towards representative skylines and formalizes the problem of displaying k tuples such that the probability that a random user clicks on one of them is maximized. This requires mathematically modeling (a) the likelihood with which a user is interested in a tuple, as well as (b) how one negotiates the lack of knowledge of an explicit set of users. This work presents theoretical and experimental results showing that the suggested algorithm significantly outperforms previously suggested approaches.

    Hyper-local, directions-based ranking of places”, Petros Venetis, Hector Gonzalez, Alon Y. Halevy, Christian S. Jensen,PVLDB, vol. 4(5) (2011), pp. 290-30.
    Click through information is one of the strongest signals we have for ranking web pages. We propose an equivalent signal for raking real world places: The number of times that people ask for precise directions to the address of the place. We show that this signal is competitive in quality with human reviews while being much cheaper to collect, we also show that the signal can be incorporated efficiently into a location search system.

    Systems

    Power Management of Online Data-Intensive Services”, David Meisner, Christopher M. Sadler, Luiz André BarrosoWolf-Dietrich Weber, Thomas F. Wenisch, Proceedings of the 38th ACM International Symposium on Computer Architecture, 2011.
    Compute and data intensive Web services (such as Search) are a notoriously hard target for energy savings techniques. This article characterizes the statistical hardware activity behavior of servers running Web search and discusses the potential opportunities of existing and proposed energy savings techniques.

    The Impact of Memory Subsystem Resource Sharing on Datacenter Applications”, Lingjia Tang, Jason Mars, Neil Vachharajani, Robert Hundt, Mary-Lou Soffa, ISCA, 2011.
    In this work, the authors expose key characteristics of an emerging class of Google-style workloads and show how to enhance system software to take advantage of these characteristics to improve efficiency in data centers. The authors find that across datacenter applications, there is both a sizable benefit and a potential degradation from improperly sharing micro-architectural resources on a single machine (such as on-chip caches and bandwidth to memory). The impact of co-locating threads from multiple applications with diverse memory behavior changes the optimal mapping of thread to cores for each application. By employing an adaptive thread-to-core mapper, the authors improved the performance of the datacenter applications by up to 22% over status quo thread-to-core mapping, achieving performance within 3% of optimal.

    Language-Independent Sandboxing of Just-In-Time Compilation and Self-Modifying Code”, Jason Ansel, Petr Marchenko, Úlfar Erlingsson, Elijah Taylor, Brad Chen, Derek Schuff, David Sehr, Cliff L. Biffle, Bennet S. Yee, ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2011.
    Since its introduction in the early 90's, Software Fault Isolation, or SFI, has been a static code technique, commonly perceived as incompatible with dynamic libraries, runtime code generation, and other dynamic code. 
     This paper describes how to address this limitation and explains how the SFI techniques in Google Native Client were extended to support modern language implementations based on just-in-time code generation and runtime instrumentation. This work is already deployed in Google Chrome, benefitting millions of users, and was developed over a summer collaboration with three Ph.D. interns; it exemplifies how Research at Google is focused on rapidly bringing significant benefits to our users through groundbreaking technology and real-world products.

    Thialfi: A Client Notification Service for Internet-Scale Applications”, Atul Adya, Gregory Cooper, Daniel MyersMichael Piatek,Proc. 23rd ACM Symposium on Operating Systems Principles (SOSP), 2011, pp. 129-142.
    This paper describes a notification service that scales to hundreds of millions of users, provides sub-second latency in the common case, and guarantees delivery even in the presence of a wide variety of failures. 
     The service has been deployed in several popular Google applications including Chrome, Google Plus, and Contacts.


    翻譯進行中.
     

    posted @ 2012-03-24 11:39 石建 | Fat Mind 閱讀(1080) | 評論 (0)編輯 收藏

    2012年3月18日


    今天開始嘗試clojure,遇到的問題、經驗整理

    1.了解clojure
    http://metaphy.iteye.com/blog/458872

    2.開始HelloWrold
        - 搭建開發環境(對于從Java過來的人,肯定習慣eclipse)
          在線安裝的速度比烏龜還慢,推薦全手動方式安裝插件
        (eclipse手動安裝插件 http://www.tkk7.com/shijian/archive/2012/03/18/372141.html
          離線zip: http://roysong.iteye.com/blog/1260147
        - 跑起來
            - 先'黑窗口'吧 http://clojure.org/getting_started,熱熱身
            - eclipse開發(提醒:必須把clojure-xxx.jar加入classpath)
            - 閱讀 http://www.ibm.com/developerworks/cn/opensource/os-eclipse-clojure/,再練習

    3.如何學習
       http://weiyongqing.iteye.com/blog/1441743
        引 “我就應該一步一步來,先把clojure的doc文檔網站上的core都敲打一遍,然后,學習孫寧的RPC框架,空閑時做4clojure的問題”


    posted @ 2012-03-18 23:33 石建 | Fat Mind 閱讀(1148) | 評論 (0)編輯 收藏

    一、快捷鍵

    1.常用快捷鍵
        a. crtl + h 查找內容
        b. ctrl + shift + r 快速打開資源文件
        c. ctrl + shift + t 快速打開類文件
        d. alt + shift + o  快速打開 '選中相同詞,出現陰影'

    2.如何設置自己特定的快捷鍵
        


    二、插件

    務必閱讀:
        http://wiki.eclipse.org/FAQ_How_do_I_install_new_plug-ins%3F (為什么推薦使用eclipse update manager)
        http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-way/ (主要講解'manual install'安裝 方式)

    1.插件安裝方式
        1.1 在線安裝
              官網wiki寫的很清楚,優勢:1.插件之間依賴管理、版本兼容性管理  2.如同你在Windows安裝軟件一樣,當你不需要的時候可以通過update manage很容易的卸載;當你安裝更多的plguin時,更容易管理。
        eclipse wiki對manual install的看法:This obviously is a more dangerous approach, as no certification takes place about the suitability of the plug-in; it may rely on other plug-ins not available in your installation. In the case of compatibility conflicts, you won’t find out until you use the plug-in that it might break.
            可惜的是,很多時候網絡的情況不是很理想,嘗試很多遍后,依然失??;這是促使manual install根本的原因。  
        1.2 手動安裝
            a、第一種方式:下載plugin到本地,解壓后復制features、plugin到%eclipse_home%下對應的目錄
            如此圖 http://static.flickr.com/75/219742315_9ee663e2c8_o.png
            優勢:絕對簡單;缺點:正好是通過update manager安裝的優點,插件之間的依賴、版本兼容性,以及后續的管理,都需要手動操作。
            b、第二種方式:通過.link的方式,解決'后續管理問題'
                 b-1、eclipse目錄創建 links 目錄
                 b-2、創建對應的.link文件,如:subversive.link
                 b-3、創建subversive/eclipse/,拷貝features、plugin到此目錄
                 b-4、修改subversive.link文件,如:path=E:/dev/eclipse-t/thrid-plugins/subversive
                 b-5、重啟eclipse(重啟后,發現要使用svn,必須安裝subversive connector;驗證手動安裝的缺點)
             c、提示:
                       - 手動安裝插件時,務必仔細閱讀,此插件的先前條件(否則出問題,很難排查)。
                        如:m2eclipse先決條件
    subeclipse
    、mylyn。
                        或 “Pre-requisite: an Eclipse version including Java Support (e.g. with the JDT : Java Development Tools, as in Eclipse For Java Developers, Eclipse For RCP/RAP developers, Eclipse for JavaEE developers, etc.)” http://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin
                       - 
    eclipse 手動安裝plugin,.link文件的path路徑 必須使用絕對路徑


    總結:對eclipse插件安裝,首先推薦update manager;僅當網絡環境不允許時,安裝失敗時,再嘗試手動安裝。

    2.插件資源收集

    2.1、 m2eclipse插件安裝
        1)先決條件
            a、eclipse3.2或更高版本(可忽略,一般使用的eclipse已經3.5以上 版本)
            b、jdk高于1.4版本;eclipse運行在jdk環境,非jre環境
            c、必須先安裝插件:subeclipse(svn)、mylyn(任務管理); mylyn在eclipse3.5以上版本,已默認存在,無需安裝
            svn插件在線安裝地址(網絡不確定性,更推薦下載zip,archive選擇本地文件安裝)
            http://subclipse.tigris.org/servlets/ProjectProcess;jsessionid=290480ED68C2C7E781DCCE66CE657FC2?pageID=p4wYuA
         2)安裝m2eclipse,未找到可下載到本地的zip,只能在線安裝,地址 http://www.eclipse.org/m2e/download/


    posted @ 2012-03-18 21:10 石建 | Fat Mind 閱讀(758) | 評論 (0)編輯 收藏

    2012年3月8日


    題記:單元測試的過程中,遇到泛型mock的問題;重新溫習一遍,閱讀(core java 泛型)



    xmind格式(可下載) :整理過程中,記錄為xmind格式

    單元測試遇到的問題,簡化后如下:

     1     public List<? extends Date> getDateT() {
     2         return null;
     3     }
     4     public List<Date> getDate() {
     5         return null;
     6     }
     7     public void mockGetDate() {
     8         TestMain main = mock(TestMain.class);
     9         when(main.getDate()).thenReturn(new ArrayList<Date>()); //編譯OK
    10         /*
    11          * The method thenReturn(List<capture#2-of ? extends Date>) in the type 
    12          * OngoingStubbing<List<capture#2-of ? extends Date>>
                     is not applicable for the arguments (ArrayList<Date>)
    13          */
    14         when(main.getDateT()).thenReturn(new ArrayList<Date>()); //編譯錯誤
    15         when(main.getDateT()).thenReturn(new ArrayList<Timestamp>()); //編譯錯誤
    16         when(main.getDateT()).thenReturn(new ArrayList<Object>()); //編譯錯誤
    17         when(main.getDateT()).thenReturn(new ArrayList()); //編譯OK
    18     }

    仍沒理解,哪位大仙,能幫我解釋下 ?
    posted @ 2012-03-08 21:05 石建 | Fat Mind 閱讀(332) | 評論 (0)編輯 收藏

    2011年12月15日


    1.應用 jar 沖突
        log4j沖突導致,應用報錯。類型轉換沖突。
        需求:定位某個類實際從那個jar加載 ? -verbose:class 參數(或者 
    -XX:+TraceClassLoading),詳細的記錄了加載了那些類、從那個jar加載。

    參見:http://agapple.iteye.com/blog/946603

    2.性能測試過程
       linux有什么命令、或軟件,可以同時收集cpu、load、上下文切換、mem、網絡IO、磁盤IO等數據嗎 ?
       vmstat 含義詳解 ? ->  圖形化報表 (痛苦的是要'人工'看著記錄數據,這簡直是程序員的污點呀)
       (vmstat的IO統計的是塊設備(如磁盤)的數據,網卡沒有對應的設備文件(http://oss.org.cn/kernel-book/ch11/11.2.3.htm),網絡IO統計使用iftop) 
       vmstat http://linux.about.com/library/cmd/blcmdl8_vmstat.htm

    3.Jboss啟動錯誤 
    java.sql.SQLException: Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]
    參見:http://dinghaoliang.blog.163.com/blog/static/126540714201082764733272/
    %jboss_home%/server/default/deploy/hsqldb-ds.xml這個文件中有一個DefaultDS數據源配置,臨時解決刪除hsqldb-ds.xml文件。原因未知。

    4.logback 0.9.19 版本,引入<encoder>,放棄 <appender><layout></appenader>
            <encoder>
                
    <pattern>%m%n</pattern>
                
    <charset class="java.nio.charset.Charset">UTF-8</charset>
            
    </encoder>

    源碼:OutputStreamAppender.java
      protected void writeOut(E event) throws IOException {
        this.encoder.doEncode(event);
      }
    對日志文件charset指定,經過debug調試,必須通過此方式配置才有效。否則取系統默認編碼。

    5.設置linux系統編碼
    http://linux.vbird.org/linux_basic/0320bash.php#variable_locale
    其實‘系統編碼’設置,即設置對應的系統變量,則所有可設置系統變量的文件都可設置編碼,export使其生效
    locale 查看當前用戶使用的編碼(),locale -a 查看機器所支持的所有編碼
    默認設置:
      a、系統級別  /etc/profile -> /etc/sysconfig/i18n,設置 LANG (無效顯示export生效)(YY:i18n有個LANGUAGE設定,不知其含義,刪除無影響)
      b、用戶級別 ~/bash_rc、~/bash_profile、~/bash_login、~/profile,讀取有限順序:從左向右;必須顯示export生效
      
    設定 LANG 或者是 LC_ALL 時,則其他的語系變數就會被這兩個變數所取代。總之一句話:在當前用戶設置LANG,是最優方案。

    posted @ 2011-12-15 15:55 石建 | Fat Mind 閱讀(715) | 評論 (0)編輯 收藏
    僅列出標題  下一頁

    導航

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    統計

    常用鏈接

    留言簿

    隨筆分類

    隨筆檔案

    搜索

    最新評論

    What 、How、Why,從細節中尋找不斷的成長點
    主站蜘蛛池模板: 性xxxx视频免费播放直播| 亚洲乱码一二三四区乱码| 亚洲国产成人精品无码区花野真一| 亚洲黄色免费网址| 亚洲第一精品福利| 一个人免费视频观看在线www | 久热综合在线亚洲精品| 成在线人视频免费视频| 国产亚洲AV无码AV男人的天堂| CAOPORM国产精品视频免费| 国产啪亚洲国产精品无码| 国产乱妇高清无乱码免费| 亚洲精品乱码久久久久久蜜桃不卡 | 亚洲精品宾馆在线精品酒店| 日韩特黄特色大片免费视频| 亚洲av日韩av永久无码电影| mm1313亚洲精品国产| 久久免费观看视频| 久久久久久亚洲AV无码专区| 在线观看日本免费a∨视频| 亚洲高清乱码午夜电影网| jizzjizz亚洲| 小草在线看片免费人成视久网| 亚洲三级在线视频| 国产一区视频在线免费观看| 久久久久久久久久久免费精品 | 亚洲美女视频一区| 韩国免费三片在线视频| 黄色a级免费网站| 亚洲成a人片77777kkkk| 91网站免费观看| 男女猛烈无遮掩视频免费软件| 亚洲精品国产字幕久久不卡 | 日韩在线视频免费| 麻豆亚洲AV永久无码精品久久| 最近中文字幕mv手机免费高清 | 一级特黄a免费大片| 深夜福利在线视频免费| 伊人久久精品亚洲午夜| 免费观看激色视频网站bd| 在线观看亚洲专区|