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

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

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

    置頂隨筆

    [置頂]Java NIO 簡單經(jīng)典示例

    Java NIO 主要是Channel, SelectionKey, Selector 三個類之間的關系,下面的例子就是演示如果使用NIO來處理請求的:/**
     * 
     */
    package dongzi.nio.exercise.nio;

    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.net.ServerSocket;
    import java.nio.ByteBuffer;
    import java.nio.channels.ClosedChannelException;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;

    /**
     * 
    @author kyle
     * 
     
    */
    public class SelectSockets {

        private static final int PORT_NUMBER = 1234;

        /**
         * 
    @param args
         
    */
        public static void main(String[] args) {
            new SelectSockets().go(args);
        }

        private void go(String[] args) {
            int port = PORT_NUMBER;
            if (args.length > 0) {
                try {
                    port = Integer.parseInt(args[0]);
                } catch (Exception e) {
                }
            }

            System.out.println("Listening port: " + PORT_NUMBER);
            try {
                Selector selector = Selector.open();
                startServer(port, selector);
                while (true) {
                    int n = selector.select();
                    if (n == 0) {
                        continue;
                    }

                    Iterator it = selector.selectedKeys().iterator();
                    while (it.hasNext()) {
                        SelectionKey key = (SelectionKey) it.next();
                        if (key.isAcceptable()) {
                            ServerSocketChannel server = (ServerSocketChannel) key
                                    .channel();
                            SocketChannel channel = server.accept();
                            registerChannel(selector, channel, SelectionKey.OP_READ);
                            sayHello(channel);

                        }
                        if (key.isReadable()) {
                            readDataFromChannel(key);
                        }
                    }

                    it.remove();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        private ByteBuffer buffer = ByteBuffer.allocate(1024);

        private void readDataFromChannel(SelectionKey key) throws IOException {
            int count = 0;
            SocketChannel channel = (SocketChannel) key.channel();
            buffer.clear();
            while ((count = channel.read(buffer)) > 0) {
                buffer.flip();
                while (buffer.hasRemaining()) {
                    System.out.println(buffer.get());
                }
                buffer.clear();
            }
            if (count < 0) {
                channel.close();
            }

        }

        private void sayHello(SocketChannel channel) throws IOException {
            if (channel == null) {
                return;
            }
            buffer.clear();
            ByteBuffer buffer = ByteBuffer.wrap("Hi, there \r\n".getBytes());
            buffer.flip();
            channel.write(buffer);
        }

        private void registerChannel(Selector selector, SocketChannel channel,
                int opRead) throws IOException {

            if (channel == null) {
                return;
            }

            channel.configureBlocking(false);
            channel.register(selector, opRead);
        }

        private void startServer(int port, Selector selector) throws IOException,
                ClosedChannelException {
            ServerSocketChannel serverChannel = ServerSocketChannel.open();
            serverChannel.configureBlocking(false);
            ServerSocket serverSocket = serverChannel.socket();
            serverSocket.bind(new InetSocketAddress(port));
            serverChannel.register(selector, SelectionKey.OP_ACCEPT);
        }

    }

    posted @ 2012-09-26 22:40 王樹東 閱讀(4368) | 評論 (0)編輯 收藏

    2013年11月21日

    Linux 查看系統(tǒng)信息常用命令

    # uname -a # 查看內(nèi)核/操作系統(tǒng)/CPU信息 
    # head -n 1 /etc/issue # 查看操作系統(tǒng)版本 
    # cat /proc/cpuinfo # 查看CPU信息 
    # hostname # 查看計算機名 
    # lspci -tv # 列出所有PCI設備 
    # lsusb -tv # 列出所有USB設備 
    # lsmod # 列出加載的內(nèi)核模塊 
    # env # 查看環(huán)境變量資源 
    # free -m # 查看內(nèi)存使用量和交換區(qū)使用量 
    # df -h # 查看各分區(qū)使用情況 
    # du -sh <目錄名> # 查看指定目錄的大小 
    # grep MemTotal /proc/meminfo # 查看內(nèi)存總量 
    # grep MemFree /proc/meminfo # 查看空閑內(nèi)存量 
    # uptime # 查看系統(tǒng)運行時間、用戶數(shù)、負載 
    # cat /proc/loadavg # 查看系統(tǒng)負載磁盤和分區(qū) 
    # mount | column -t # 查看掛接的分區(qū)狀態(tài) 
    # fdisk -l # 查看所有分區(qū) 
    # swapon -s # 查看所有交換分區(qū) 
    # hdparm -i /dev/hda # 查看磁盤參數(shù)(僅適用于IDE設備) 
    # dmesg | grep IDE # 查看啟動時IDE設備檢測狀況網(wǎng)絡 
    # ifconfig # 查看所有網(wǎng)絡接口的屬性 
    # iptables -L # 查看防火墻設置 
    # route -n # 查看路由表 
    # netstat -lntp # 查看所有監(jiān)聽端口 
    # netstat -antp # 查看所有已經(jīng)建立的連接 
    # netstat -s # 查看網(wǎng)絡統(tǒng)計信息進程 
    # ps -ef # 查看所有進程 
    # top # 實時顯示進程狀態(tài)用戶 
    # w # 查看活動用戶 
    # id <用戶名> # 查看指定用戶信息 
    # last # 查看用戶登錄日志 
    # cut -d: -f1 /etc/passwd # 查看系統(tǒng)所有用戶 
    # cut -d: -f1 /etc/group # 查看系統(tǒng)所有組 
    # crontab -l # 查看當前用戶的計劃任務服務 
    # chkconfig –list # 列出所有系統(tǒng)服務 
    # chkconfig –list | grep on # 列出所有啟動的系統(tǒng)服務程序 
    # rpm -qa # 查看所有安裝的軟件包

    posted @ 2013-11-21 11:21 王樹東 閱讀(189) | 評論 (0)編輯 收藏

    2013年5月25日

    轉:UML中幾種類間關系:繼承、實現(xiàn)、依賴、關聯(lián)、聚合、組合的聯(lián)系與區(qū)別

    這篇文章轉自:http://blog.csdn.net/sfdev/article/details/3906243

    這篇文章清晰的講述了繼承, 實現(xiàn), 依賴, 關聯(lián),組合的概念及他們之間的關系,以下是原文內(nèi)容:

    這是一堂關于UML基礎知識的補習課;現(xiàn)在我們做項目時間都太緊了,基本上都沒有做過真正的class級別的詳細設計,更別提使用UML來實現(xiàn)規(guī)范建模了;本篇主要就以前自己一直感覺很迷糊的幾種class之間的關系進行整理,讓我們在真正用UML進行比如類圖設計時能夠更加清晰明了;以下就分別介紹這幾種關系:

     

    繼承

    指的是一個類(稱為子類、子接口)繼承另外的一個類(稱為父類、父接口)的功能,并可以增加它自己的新功能的能力,繼承是類與類或者接口與接口之間最常見的關系;在Java中此類關系通過關鍵字extends明確標識,在設計時一般沒有爭議性;

    實現(xiàn)

    指的是一個class類實現(xiàn)interface接口(可以是多個)的功能;實現(xiàn)是類與接口之間最常見的關系;在Java中此類關系通過關鍵字implements明確標識,在設計時一般沒有爭議性;

    依賴

    可以簡單的理解,就是一個類A使用到了另一個類B,而這種使用關系是具有偶然性的、、臨時性的、非常弱的,但是B類的變化會影響到A;比如某人要過河,需要借用一條船,此時人與船之間的關系就是依賴;表現(xiàn)在代碼層面,為類B作為參數(shù)被類A在某個method方法中使用;

    關聯(lián)

    他體現(xiàn)的是兩個類、或者類與接口之間語義級別的一種強依賴關系,比如我和我的朋友;這種關系比依賴更強、不存在依賴關系的偶然性、關系也不是臨時性的,一般是長期性的,而且雙方的關系一般是平等的、關聯(lián)可以是單向、雙向的;表現(xiàn)在代碼層面,為被關聯(lián)類B以類屬性的形式出現(xiàn)在關聯(lián)類A中,也可能是關聯(lián)類A引用了一個類型為被關聯(lián)類B的全局變量;

    聚合

    聚合是關聯(lián)關系的一種特例,他體現(xiàn)的是整體與部分、擁有的關系,即has-a的關系,此時整體與部分之間是可分離的,他們可以具有各自的生命周期,部分可以屬于多個整體對象,也可以為多個整體對象共享;比如計算機與CPU、公司與員工的關系等;表現(xiàn)在代碼層面,和關聯(lián)關系是一致的,只能從語義級別來區(qū)分;

    組合

    組合也是關聯(lián)關系的一種特例,他體現(xiàn)的是一種contains-a的關系,這種關系比聚合更強,也稱為強聚合;他同樣體現(xiàn)整體與部分間的關系,但此時整體與部分是不可分的,整體的生命周期結束也就意味著部分的生命周期結束;比如你和你的大腦;表現(xiàn)在代碼層面,和關聯(lián)關系是一致的,只能從語義級別來區(qū)分;

    對于繼承、實現(xiàn)這兩種關系沒多少疑問,他們體現(xiàn)的是一種類與類、或者類與接口間的縱向關系;其他的四者關系則體現(xiàn)的是類與類、或者類與接口間的引用、橫向關系,是比較難區(qū)分的,有很多事物間的關系要想準確定位是很難的,前面也提到,這幾種關系都是語義級別的,所以從代碼層面并不能完全區(qū)分各種關系;但總的來說,后幾種關系所表現(xiàn)的強弱程度依次為:組合>聚合>關聯(lián)>依賴;

    posted @ 2013-05-25 16:12 王樹東 閱讀(259) | 評論 (0)編輯 收藏

    2013年4月3日

    The Key of Grails Custom Validator

    當我們使用靜態(tài)的Scaffolding的時候, 我們經(jīng)常會用到一些自定義的validator, 那么我們怎樣自定義國際化的message呢?
    或者說我們定義怎樣的一個key, Grails能查到它呢?

    這里,用戶自定義Validator的key的pattern是:
    [Class Name].[Property Name].validator.invalid


    posted @ 2013-04-03 23:03 王樹東 閱讀(226) | 評論 (0)編輯 收藏

    中文和ASCII互轉

    我們在開發(fā)使時常會用到資源文件,這可能是為了多語言、國際化的需要,也可能是使用了國外開源項目的原因,這就需要中文轉ascii將中文轉換為ASCII 編碼,或者將 ASCII 轉換為中文,那么我們就可以使用 JDK 自帶的轉換工具 native2ascii

    for example

    No1、中文轉換為 ASCII 編碼

    步驟:1 、在 D 盤新建 chinese.txt  文件,內(nèi)容為:

    parameter.project.title=這是中文

    2、在環(huán)境變量中設置好 JDK 路徑

    3、進入 dos 控制臺,并進入 D 盤目錄

    4、輸入命令: native2ascii -encoding gb2312 chinese.txt  ascii.txt  回車

    那么在D 盤目錄下生成 ascii.txt 文件,內(nèi)容為:

    parameter.project.title=\u8fd9\u662f\u4e2d\u6ascii碼 中文587

    No1 ASCII 編碼轉換為中文

    步驟:1 、在 D 盤新建 ascii.txt  文件,內(nèi)容為:

    parameter.project.title=\u8fd9\u662f\u4e2d\u6ascii碼 中文587

    2、在環(huán)境變量中設置好 JDK 路徑

    3、進入 dos 控制臺,并進入 D 盤目錄

    4、輸入命令: native2ascii -reverse -encoding UTF8 ascii.txt  chinese.txt 回車

    那么在D 盤目錄下生成 chinese.txt 文件,內(nèi)容為:

    parameter.project.title=這是中文

    posted @ 2013-04-03 21:16 王樹東 閱讀(351) | 評論 (0)編輯 收藏

    2013年1月17日

    Linux 上服務的安裝以及示例:Apache服務的安裝(轉)

    1. chkconfig腳本格式:
    #!/bin/sh
    #chkconfig 2345 55 45
    #上面為固定格式:2345 表示運行級別,55表示開機執(zhí)行順序,45為關機順序
    #description:this is just a demo of chkconfig script
    case “$1” in
    start)
    <start-script>
    ;;
    Stop)
    <stop-script>
    ;;
    Status)
    Echo <the information you want to display>
    ;;
    *)
    Echo “the usage of the script”
    Case
    2. 然后將腳本保存,并賦予執(zhí)行權限,再復制到/etc/init.d目錄
    #chmod a+x <myscript>
    #copy <myscript> /etc/init.d
    3. 使用chkconfig命令添加成服務
    #chkconfig --add <myscript>
    #chkconfig --level 35 <myscript > on
    #chkconfig --list <myscript>
    4. 然后就可以通過service命令管理了
    #service <myscript> start | stop | status
    5. 下面是我寫的一個實例腳本,大家可以參考一些格式:
    #!/bin/sh
    #chkconfig: 2345 99 99
    #description:the script to set the network at run level 2345
    IN=eth0
    OUT=eth1
    HOST_NAME=cluster1.yang.com
    INIP=192.168.10.10
    OUTIP=192.168.136.10
    MASK=255.255.255.0
    IP=/sbin/ip
    IFC=/sbin/ifconfig
    ROUTE=/sbin/route
    #flush the address
    case "$1" in
    start)
    #echo "flush the address..."
    #$IP addr flush dev eth0
    #$IP addr flush dev eth1
    echo "set the address..."
    $IFC $IN $INIP netmask $MASK up
    $IFC $OUT $OUTIP netmask $MASK up
    echo "set the hostname..."
    hostname $HOST_NAME
    echo "set the default gateway..."
    $IP route flush all
    $ROUTE add default gw 192.168.136.2
    echo "finshed!!!"
    ;;
    stop)
    echo "flush the network setting..."
    $IP addr flush dev eth0
    $IP addr flush dev eth1
    echo "flush finshed!!!"
    ;;
    status)
    echo "hostname is $HOST_NAME"
    $IFC eth0
    $IFC eth1
    ;;
    *)
    echo "requires start,stop or status"
    ;;
    esac
    --------------------------------------------------------------------------------------------
    --------------------------------------------------------------------------------------------

    在Linux中chkconfighttpd任務添加,Apache服務器的最新穩(wěn)定發(fā)布版本是httpd-2.2..0,官方下載地址是:http://httpd.apache.org/download.cgi。我們通過下面的步驟來快速的搭建一個web服務器。

    1、下載源碼文件httpd-2.2.0.tar.gz 到linux服務器的某個目錄。
    2、解壓文件 # tar zxvf httpd-2.2.0.tar.gz .
    3、配置 # ./configure –refix=/usr/local/apache //指定安裝目錄,以后要刪除安裝就只需刪除這個目錄。
    4、編譯和安裝。 # make ; make install .
    5、編寫啟動腳本,把它放到目錄 /etc/rc.d/init.d/里,這里取名為httpd,其內(nèi)容如下:
     

    1. #!/bin/bash  
    2. #description:http server  
    3. #chkconfig: 235 98 98  
    4. case "$1" in  
    5. start)  
    6. echo "Starting Apache daemon..."  
    7. /usr/local/apache2/bin/apachectl -k start  
    8. ;;  
    9. stop)  
    10. echo "Stopping Apache daemon..."  
    11. /usr/local/apache2/bin/apachectl -k stop  
    12. ;;  
    13. restart)  
    14. echo "Restarting Apache daemon..."  
    15. /usr/local/apache2/bin/apachectl -k restart  
    16. ;;  
    17. status)  
    18. statusproc /usr/local/apache2/bin/httpd  
    19. ;;  
    20. *)  
    21. echo "Usage: $0 {start|stop|restart|status}"  
    22. exit 1  
    23. ;;  
    24. Esac  

     

    注意:#description:http server 這一行必須加上,否則在執(zhí)行命令

     # chkconfig –add httpd

    時會出現(xiàn)“service apache does not support chkconfig”的錯誤報告。

    #chkconfig: 2345 98 98 表示在執(zhí)行命令

     # chkconfig –add httpd 時會在目錄 /etc/rc2.d/ 、/etc/rc3.d/ /etc/rc5.d 分別生成文件 S98httpd和 K98httpd。這個數(shù)字可以是別的。

    6、執(zhí)行命令 # chkconfig –add httpd ,進入目錄/etc/rc3.d/檢查是否生成文件 S98httpd及K98httpd.
    7、啟動服務 # service httpd start .

    posted @ 2013-01-17 10:23 王樹東 閱讀(499) | 評論 (0)編輯 收藏

    2012年10月15日

    Java編程技巧之final


            關鍵詞final在Java中有多重用途,既可被用于instance變量、static變量
    也可用于classes或methods,表示不允許客戶覆寫它們。
            當一個方法被聲明成final,在兩個領域中顯得有位重要:
    1. class設計
    2. 運行期性能
            在程序設計里,有時我們不希望我們的方法被重寫或覆蓋,final關鍵字保證了這一點。
    final關鍵字是怎么影響性能的呢?
            當我們的方法被聲明成static,final和private, 此方法將成為Inlining(內(nèi)聯(lián)函數(shù))的候選者。此類方法可以在編譯期被靜態(tài)決議(staticallyresolved),而不需要動態(tài)決議(dynamicResolution)。以方法本體(methodbody)替換方法調(diào)用(methodcall)會使代碼執(zhí)行速度更快。
            將方法聲明為static、final和private會帶來一些缺點:這樣的方法無法通過Subclassing(子類化)進行擴展。這就束縛了derived class通過class函數(shù)做事情的機會。inlined方法只有在被多次調(diào)用的情況下,才會獲得令人側目的性能提升。這是因為當一個方法被inline后,就不再需要負擔方法調(diào)用的額外開銷。因此,方法被調(diào)用愈多次,節(jié)省就愈多。
            不過inlining也可能使你的代碼體積變大。如果這個方法有許多調(diào)用點,.class文件的體積便會膨脹,這是因為原本只需存儲一份的函數(shù)碼,由于inline而在所有調(diào)用點被復制了一份。

    posted @ 2012-10-15 22:23 王樹東 閱讀(261) | 評論 (0)編輯 收藏

    2012年9月26日

    Java NIO 簡單經(jīng)典示例

    Java NIO 主要是Channel, SelectionKey, Selector 三個類之間的關系,下面的例子就是演示如果使用NIO來處理請求的:/**
     * 
     */
    package dongzi.nio.exercise.nio;

    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.net.ServerSocket;
    import java.nio.ByteBuffer;
    import java.nio.channels.ClosedChannelException;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;

    /**
     * 
    @author kyle
     * 
     
    */
    public class SelectSockets {

        private static final int PORT_NUMBER = 1234;

        /**
         * 
    @param args
         
    */
        public static void main(String[] args) {
            new SelectSockets().go(args);
        }

        private void go(String[] args) {
            int port = PORT_NUMBER;
            if (args.length > 0) {
                try {
                    port = Integer.parseInt(args[0]);
                } catch (Exception e) {
                }
            }

            System.out.println("Listening port: " + PORT_NUMBER);
            try {
                Selector selector = Selector.open();
                startServer(port, selector);
                while (true) {
                    int n = selector.select();
                    if (n == 0) {
                        continue;
                    }

                    Iterator it = selector.selectedKeys().iterator();
                    while (it.hasNext()) {
                        SelectionKey key = (SelectionKey) it.next();
                        if (key.isAcceptable()) {
                            ServerSocketChannel server = (ServerSocketChannel) key
                                    .channel();
                            SocketChannel channel = server.accept();
                            registerChannel(selector, channel, SelectionKey.OP_READ);
                            sayHello(channel);

                        }
                        if (key.isReadable()) {
                            readDataFromChannel(key);
                        }
                    }

                    it.remove();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        private ByteBuffer buffer = ByteBuffer.allocate(1024);

        private void readDataFromChannel(SelectionKey key) throws IOException {
            int count = 0;
            SocketChannel channel = (SocketChannel) key.channel();
            buffer.clear();
            while ((count = channel.read(buffer)) > 0) {
                buffer.flip();
                while (buffer.hasRemaining()) {
                    System.out.println(buffer.get());
                }
                buffer.clear();
            }
            if (count < 0) {
                channel.close();
            }

        }

        private void sayHello(SocketChannel channel) throws IOException {
            if (channel == null) {
                return;
            }
            buffer.clear();
            ByteBuffer buffer = ByteBuffer.wrap("Hi, there \r\n".getBytes());
            buffer.flip();
            channel.write(buffer);
        }

        private void registerChannel(Selector selector, SocketChannel channel,
                int opRead) throws IOException {

            if (channel == null) {
                return;
            }

            channel.configureBlocking(false);
            channel.register(selector, opRead);
        }

        private void startServer(int port, Selector selector) throws IOException,
                ClosedChannelException {
            ServerSocketChannel serverChannel = ServerSocketChannel.open();
            serverChannel.configureBlocking(false);
            ServerSocket serverSocket = serverChannel.socket();
            serverSocket.bind(new InetSocketAddress(port));
            serverChannel.register(selector, SelectionKey.OP_ACCEPT);
        }

    }

    posted @ 2012-09-26 22:40 王樹東 閱讀(4368) | 評論 (0)編輯 收藏

    The lifecycle of a software product

    There are 5 different steps or milestones in a products lifecycle from beginning to release. These are:
    Stage 1 - First Cycle - QA Handoff/Acceptance - This is the milestone that determines if a product is stable enough to be tested against. When a product reaches this stage, it is generally released to QA Testers to begin the testing stage of the produt.
    Stage 2 - Alpha phase The product is still in QA review, but the testing scenarios are a little more destructive in nature, in an attempt to start shaking out most of the bugs in a product.
    Stage 3 - Beta phase- the product is at a stability level that it can be released to select customers in the customer base for further testing in the 'real world'. This usually shakes out more bugs in a product.
    Stage 4 - Release Candidate - This stage is towards the end of the cycle - The product has gone through its testing paces, and is being certified as ready for release.
    Stage 5 - GA -The product is ready for the world!


    Reference: http://answers.yahoo.com/question/index?qid=1006020204792

    posted @ 2012-09-26 09:37 王樹東 閱讀(208) | 評論 (0)編輯 收藏

    2012年1月30日

    (轉)Windows Server 2003 中尋找端口與進程的關聯(lián)

    @import url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
    Q:Windows Server 2003 中尋找端口與進程的關聯(lián)   A:如果發(fā)現(xiàn)一些從沒見過的端口號,你怎么分辯出該端口是不是木馬開放的端口?或者在進程列表中發(fā)現(xiàn)陌生的進程時,是否想知道該進程在你的系統(tǒng)中開了什么 端口? 一,根據(jù)進程查端口號首先在開始菜單的“運行”框中輸入“cmd.exe”進入命令提示符窗口,先鍵入“tasklist”命令將列出系統(tǒng)正在運行的進程 列表,把你要查的進程所對應的“PID”號記下或復制。把進程的PID好記下后,接下來就用這個PID號把該進程所開的端口顯示出來了。在當前的命令符下 繼續(xù)鍵入“netstat -ano | find 1140”命令,其中“netstat -ano”參數(shù)表示以數(shù)字形式顯示所有活動的TCP連接以及計算機正在偵聽的TCP、UDP端口,并且顯示查找進程ID(PID)號;“|find 1140”表示查找進程PID為“1140”的TCP連接以及TCP、UDP端口的偵聽情況(在實際應用中,需要把你剛才記下或復制的PID號替換掉這里 的1140)。按“回車”鍵后,就會顯示出該進程所開的端口號。 二,根據(jù)端口號查進程   在命令提示符窗口中輸入“netstat -ano”命令,列出系統(tǒng)當前的端口列表,該命令的作用已在上面提過了。-o參數(shù)的作用主要是顯示各端口對應的進程PID號,現(xiàn)在把你要查的端口對應的進 程PID號記下或復制。然后在命令提示符下繼續(xù)輸入tasklist /fi“PID eq 788”(在實際應用中,需要把你復制或記下的PID號替換掉這里的788),這行語句/fi參數(shù)表示在“tasklist”中篩選,而“ID eq 788”則是指定篩選的條件,按“回車”鍵后,就會顯示出端口對應的進程。 三,查出進程對應的程序   知道了端口和進程的關聯(lián)后,如何再進一步查出該進程是那個軟件或程序的進程呢?下面的操作就需要用到Windows2000(Server或 Professional版都可以)安裝光盤中的一個工具。首先在安裝光盤的“Support\Tools\”目錄下,用解壓軟件打開 “support.cab”壓縮包,找到“tlist.exe”文件,將此文件釋放到任一目錄,如“D:\Support”。然后在命令提示符窗口中切換 到此目錄,運行“tlist.exe”命令,把要查的進程對應的PID號記下或復制(第一列就是進程的PID號),然后繼續(xù)輸入“tlist.exe 2012”命令(你輸入的時候,需要將剛才記下的PID號替換掉這里的2012),“CmdLine:”后面顯示的就是該進程對應的軟件所在的目錄。除此 之外,返回信息中還列出了該進程所調(diào)用的文件,得到了這些信息就可以很容易查出進程對應的程序了。假如想關閉某個進程,可把該進程的PID號記下,在命令 提示符下輸入“taskkill/pid 2400”(2400是PID號)就可以將PID號為2400的進程關閉,如果要強制關閉該進程,只須在這條命令的后面加個“/f”參數(shù)即可。
    來源:http://www.cn6154.com/ask/question.php?id=2623

    posted @ 2012-01-30 09:31 王樹東 閱讀(439) | 評論 (0)編輯 收藏

    2011年12月14日

    Ubuntu 25個快捷鍵

    @import url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

    1. Win+E - 顯示所有桌面,方便的左右選擇。

    2. Alt+Ctrl+Left/Right Arrow -切換桌面

    3. Alt+Ctrl+Shift+Left/Right Arrow – 移動當前窗口到其他桌面

    4. Alt + Shift+ Up Arrow – 以很酷的方式顯示當前窗口

    5. Alt+F9/F10 – 最小化/最大化當前窗口

    6. Alt+F5 -不最大化當前窗口

    7. Alt+F7 – 激活當前窗口的移動選項,你可以使用方向鍵移動當前窗口,甚至移動到其他桌面。

    8. Alt+F8 – 用方向鍵調(diào)整當前窗口大小


    9. Ctrl + Alt + D – 顯示桌面/恢復當前窗口

    10. Alt+ Tab – 切換窗口

    Nautilus

    11. Shift+Ctrl+N – 新建文件夾, 很有用

    12. Alt + Enter – 查看選擇文件/文件夾的屬性,代替單擊右鍵選擇屬性

    13. Ctrl + 1/2 – 改變文件夾視圖查看方式,圖標視圖/列表視圖

    14. Ctrl + W – 關閉當前Nautilus窗口

    15. Ctrl + Shift + W – 關閉所有Nautilus窗口

    16. Ctrl+T – 在Nautilus中新建一個標簽

    17. Alt + Up/Down Arrow – 移動到父文件夾/選擇的文件夾

    18. Alt + Left/Right Arrow – 后退/前進

    19. Alt + Home -直接移動到主文件夾

    20. F9 – 開關顯示Nautilus側邊欄

    21. Ctrl + H -開關顯示隱藏文件夾

    22. Ctrl + Alt + L -鎖屏

    23. Alt + F1 – 打開應用程序菜單

    24. Alt + F2 – 打開運行應用程序對話框

    25. Win + 鼠標滾輪 – 放大/縮小屏幕

    posted @ 2011-12-14 22:58 王樹東 閱讀(270) | 評論 (0)編輯 收藏

    僅列出標題  下一頁
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導航

    統(tǒng)計

    公告

    常用鏈接

    留言簿

    隨筆分類(17)

    隨筆檔案(15)

    文章分類(4)

    文章檔案(5)

    收藏夾(4)

    Algorithm

    Design

    Environment Setup

    Installer

    Maven

    MINA

    OS

    Skills for Java

    VIM

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 成年女人午夜毛片免费视频| 亚洲国产a级视频| 亚洲国产精品日韩av不卡在线| 国产成人免费手机在线观看视频| 一级毛片免费在线| 久久综合亚洲色HEZYO社区| 精品久久久久久久免费人妻| 一个人免费观看日本www视频| 亚洲综合一区二区| 伊在人亚洲香蕉精品区麻豆| 18观看免费永久视频| 美国免费高清一级毛片| 亚洲欧洲综合在线| 亚洲无码高清在线观看| free哆啪啪免费永久| 日韩在线视频线视频免费网站| 亚洲自偷精品视频自拍| 亚洲AV无码一区二区三区国产 | 亚洲国产精品成人AV在线| 亚洲真人日本在线| 午夜宅男在线永久免费观看网| 精品无码一级毛片免费视频观看 | 亚洲人成在线播放| 中文字幕久久亚洲一区| 成年男女男精品免费视频网站| 免费成人在线视频观看| 国产AV无码专区亚洲AV蜜芽 | 成全视频高清免费观看电视剧| 亚洲精品无AMM毛片| 亚洲精品免费在线| 亚洲成AV人片在线观看无| 亚洲va中文字幕无码| 午夜精品在线免费观看| 精品免费久久久久久久| 久久国产精品2020免费m3u8| xxxx日本在线播放免费不卡| 色天使亚洲综合一区二区| 亚洲综合av一区二区三区 | 亚洲AV无码专区在线亚| 久久亚洲春色中文字幕久久久| 亚洲亚洲人成综合网络|