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

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

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

    posts - 89, comments - 241, trackbacks - 0, articles - 1
       :: 首頁(yè) ::  :: 聯(lián)系 :: 聚合  :: 管理

    2010年6月25日

         摘要: 代碼改編自 NetPuter 大大發(fā)布的 SDK,這份 SDK 是我用過(guò)的最好的 PHP SDK,修改了一些東西:1、增加了收到的訊息類型 voice video2、收到text的時(shí)候,如果是 hello2bizuser 的話,調(diào)用 onsubscribe 方法(微信4.x 以前貌似都還是發(fā)hello2bizuser 所以不得不兼容啊)Code highlighting produced by A...  閱讀全文

    posted @ 2013-08-24 16:02 saobaolu| 編輯 收藏

    <TABLE style="table-layout: auto | fixed">
    auto: 默認(rèn)值
    fixed: 寬度固定,截?cái)喑龅膬?nèi)容

    <TABLE style="word-break: normal | break-all | keep-all">
    normal: 默認(rèn)值,按字詞截?cái)鄵Q行
    break-all: 強(qiáng)行截?cái)嗖Q行
    keep-all: 不截?cái)嗖粨Q行

    使用:style="table-layout:fixed;"
    表示輸出停止,停留在設(shè)定的長(zhǎng)度內(nèi).

    使用:style="word-break : break-all;"
    表示對(duì)超長(zhǎng)部分,換行再繼續(xù)顯示.

    對(duì)于在英文中使用,請(qǐng)使用style="table-layout:fixed; word-wrap:break-word"
    推薦使用word-wrap:break-word;word-break:break-all;table-layout:fixed;

    ==============================================================================

    word-wrap同word-break的區(qū)別

    word-wrap:
    normal      Default. Content exceeds the boundaries of its container. 
    break-word Content wraps to next line, and a word-break occurs when necessary. 必要時(shí)會(huì)觸發(fā)word-break。

    word-break:
    normal      Default. Allows line breaking within words. 好像是只對(duì)Asian text起作用。
    break-all Behaves the same as normal for Asian text, yet allows the line to break arbitrarily for non-Asian text. This value is suited to Asian text that contains some excerpts of non-Asian text. 
    keep-all Does not allow word breaking for Chinese, Japanese, and Korean. Functions the same way as normal for all non-Asian languages. This value is optimized for text that includes small amounts of Chinese, Japanese, or Korean.

    總結(jié)如下:
    word-wrap是控制換行的。
    使用break-word時(shí),是將強(qiáng)制換行。中文沒(méi)有任何問(wèn)題,英文語(yǔ)句也沒(méi)問(wèn)題。但是對(duì)于長(zhǎng)串的英文,就不起作用。

    break-word是控制是否斷詞的。
    normal是默認(rèn)情況,英文單詞不被拆開(kāi)。
    break-all,是斷開(kāi)單詞。在單詞到邊界時(shí),下個(gè)字母自動(dòng)到下一行。主要解決了長(zhǎng)串英文的問(wèn)題。
    keep-all,是指Chinese, Japanese, and Korean不斷詞。即只用此時(shí),不用word-wrap,中文就不會(huì)換行了。(英文語(yǔ)句正常。)


    ie下:
    使用word-wrap:break-word;所有的都正常。

    ff下:
    如這2個(gè)都不用的話,中文不會(huì)出任何問(wèn)題。英文語(yǔ)句也不會(huì)出問(wèn)題。但是,長(zhǎng)串英文會(huì)出問(wèn)題。
    為了解決長(zhǎng)串英文,一般用word-wrap:break-word;word-break:break-all;。但是,此方式會(huì)導(dǎo)致,普通的英文語(yǔ)句中的單詞會(huì)被斷開(kāi)(ie下也是)。

    目前主要的問(wèn)題存在于 長(zhǎng)串英文 和 英文單詞被斷開(kāi)。其實(shí)長(zhǎng)串英文就是一個(gè)比較長(zhǎng)的單詞而已。
    即英文單詞應(yīng)不應(yīng)該被斷開(kāi)那?那問(wèn)題很明顯了,顯然不應(yīng)該被斷開(kāi)了。
    對(duì)于長(zhǎng)串英文,就是惡意的東西,自然不用去管了。但是,也要想些辦法,不讓它把容器撐大。
    用:overflow:auto; ie下,長(zhǎng)串會(huì)自動(dòng)折行。ff下,長(zhǎng)串會(huì)被遮蓋。


    所以,綜上,最好的方式是word-wrap:break-word;overflow:hidden;而不是word-wrap:break-word;word-break:break-all;。
    word-wrap:break-word;overflow:auto;在ie下沒(méi)有任何問(wèn)題。在ff下,長(zhǎng)串會(huì)被遮住部分內(nèi)容。

    另,測(cè)試代碼如下:

    1.htm===================================================================

    <style>
    .c1{ width:300px;      border:1px solid red}
    .c2{ width:300px;word-wrap:break-word;      border:1px solid yellow}
    .c3{ width:300px;word-wrap:break-word;word-break:break-all;      border:1px solid green}
    .c4{ width:300px;word-wrap:break-word;word-break:keep-all; border:1px solid blue}
    .c5{ width:300px;word-break:break-all;      border:1px solid black}
    .c6{ width:300px;word-break:keep-all;      border:1px solid red}
    .c7{ width:300px;word-wrap:break-word;overflow:auto;      border:1px solid yellow}
    </style>

    .c1{ width:300px;      border:1px solid red}
    <div class="c1">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c1>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c1>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c1>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    <br>
    .c2{ width:300px;word-wrap:break-word; border:1px solid yellow}
    <div class="c2">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c2>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c2>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c2>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    <br>
    .c3{ width:300px;word-wrap:break-word;word-break:break-all;      border:1px solid green}
    <div class="c3">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c3>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c3>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c3>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    <br>
    .c4{ width:300px;word-wrap:break-word;word-break:keep-all; border:1px solid blue}
    <div class="c4">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c4>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c4>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c4>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    <br>
    .c5{ width:300px;word-break:break-all;      border:1px solid black}
    <div class="c5">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c5>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c5>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c5>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    <br>
    .c6{ width:300px;word-break:keep-all;      border:1px solid red}
    <div class="c6">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c6>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c6>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c6>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    <br>
    .c7{ width:300px;word-wrap:break-word;overflow:auto;      border:1px solid yellow}
    <div class="c7">
    safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
    </div>
    <div class=c7>
    This is all English. This is all English. This is all English.
    </div>
    <div class=c7>
    全是中文的情況。全是中文的情況。全是中文的情況。
    </div>
    <div class=c7>
    中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
    </div>

    posted @ 2010-07-06 22:43 saobaolu| 編輯 收藏

     1 import java.io.*;
     2 import java.util.Scanner;
     3 public class SortTest {
     4     public static void main(String[] args) throws IOException {
     5         int temp = 0;//臨時(shí)變量,用于冒泡交換        
     6         int[] num=new int[10];  //聲明一個(gè)空的數(shù)組  10個(gè)長(zhǎng)度
     7         Scanner sc = new Scanner(System.in);
     8         FileOutputStream out=new FileOutputStream("1.txt");
     9         PrintStream p=new PrintStream(out);
    10         //開(kāi)始循環(huán)賦值
    11         for(int i =0;i<num.length;i++){
    12             num[i]=sc.nextInt();
    13         }
    14         p.append("排序前為:");
    15         for (int i = 0; i <num.length; i++) {
    16             System.out.println(num[i]);
    17             p.append(num[i]+" , ");
    18         }
    19         // 用于排序
    20         for (int i = 0; i < num.length-1; i++) {
    21             for (int j = 0; j < num.length - i - 1; j++) {
    22                 if (num[j] > num[j + 1]) {
    23                     temp = num[j];
    24                     num[j] = num[j + 1];
    25                     num[j + 1= temp;
    26                 }
    27             }
    28         }
    29         //輸出文件
    30         p.append("\n");
    31         p.append("排序后為:");
    32         // 循環(huán)輸出
    33         System.out.println("排序后為:");
    34         for (int i = 0; i <num.length; i++) {
    35             System.out.println(num[i]);
    36             p.append(num[i]+" , ");
    37         }
    38     
    39         
    40     }
    41 }
    最后應(yīng)該把p給close了哈

    posted @ 2010-06-26 09:02 saobaolu| 編輯 收藏

    轉(zhuǎn)自:http://www.ry168.net/bbs/thread-226-1-1.html
    table不能換行問(wèn)題 一般是:一行里面全是數(shù)字或是字母或者結(jié)尾有多個(gè)感嘆號(hào)而導(dǎo)致 table不能換行,中文默認(rèn)的會(huì)自動(dòng)換行的,字母不能換行問(wèn)題:
    style="table-layout:fixed; word-break: break-all; overflow:hidden;"
    復(fù)制代碼在單元格屬性里加入上面這句,如:
    <td style="table-layout:fixed; word-break: break-all; overflow:hidden;">
    復(fù)制代碼用表格做網(wǎng)頁(yè)排版的時(shí)候,一般都能正常使用。偏偏有時(shí)會(huì)碰到一段連續(xù)的英文詞或者一堆感嘆號(hào)(!!!)把網(wǎng)頁(yè)就撐開(kāi)的現(xiàn)象。

    總結(jié)了一下,只要在CSS中定義了如下句子,可保網(wǎng)頁(yè)不會(huì)再被撐開(kāi)了。

    自動(dòng)換行問(wèn)題,正常字符的換行是比較合理的,而連續(xù)的數(shù)字和英文字符常常將容器撐大,挺讓人頭疼,下面介紹的是CSS如何實(shí)現(xiàn)換行的方法

    對(duì)于div,p等塊級(jí)元素

    正常文字的換行(亞洲文字和非亞洲文字)元素?fù)碛心J(rèn)的white-space:normal,當(dāng)定義的寬度之后自動(dòng)換行

    html
    <div id="wrap">正常文字的換行(亞洲文字和非亞洲文字)元素?fù)碛心J(rèn)的white-space:normal,當(dāng)定義</div>
    css
    #wrap{white-space:normal; width:200px; }

    IE瀏覽器

    連續(xù)的英文字符和阿拉伯?dāng)?shù)字,使用word-wrap: break-word ;或者word-break:break-all;實(shí)現(xiàn)強(qiáng)制斷行

    html
    <div id="wrap">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

    css
    #wrap{word-break:break-all; width:200px;}
    或者
    #wrap{word-wrap:break-word; width:200px;}

    Firefox瀏覽器
    連續(xù)的英文字符和阿拉伯?dāng)?shù)字的斷行,Firefox的所有版本的沒(méi)有解決這個(gè)問(wèn)題,我們只有讓超出邊界的字符隱藏或者,給容器添加滾動(dòng)條

    html
    <div id="wrap">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

    css
    #wrap{word-break:break-all; width:200px; overflow:auto;}

    對(duì)于table元素
    IE瀏覽器
    1. 使用 table-layout:fixed;強(qiáng)制table的寬度,多余內(nèi)容隱藏<table style="table-layout:fixed" width="200"><tr><td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td></tr></table>
    復(fù)制代碼2. 使用 table-layout:fixed;強(qiáng)制table的寬度,內(nèi)層td,th采用word-break : break-all;或者word-wrap : break-word ;換行 <table width="200" style="table-layout:fixed;"><tr><td width="25%" style="word-break : break-all; ">abcdefghigklmnopqrstuvwxyz 1234567890</td><td style="word-wrap : break-word ;">abcdefghigklmnopqrstuvwxyz 1234567890</td></tr></table>
    復(fù)制代碼3.在td,th中嵌套div,p等采用上面提到的div,p的換行方法

    Firefox瀏覽器

    1. 使用 table-layout:fixed;強(qiáng)制table的寬度,內(nèi)層td,th采用word-break : break-all;或者word-wrap : break-word ;換行,使用overflow:hidden;隱藏超出內(nèi),這里overflow:auto;無(wú)法起作用<table style="table-layout:fixed" width="200"><tr>

    <td width="25%"  style="word-break : break-all; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>

    <td width="75%" style="word-wrap : break-word; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>

    </tr></table>
    復(fù)制代碼2.在td,th中嵌套div,p等采用上面提到的對(duì)付Firefox的方法。

    最佳CSS定義換行代碼.wrap { table-layout:fixed; word-break: break-all; overflow:hidden; }
    復(fù)制代碼當(dāng)然,這種現(xiàn)象出現(xiàn)的幾率很小,但是不能排除網(wǎng)友的惡搞。

    posted @ 2010-06-25 14:06 saobaolu| 編輯 收藏

    網(wǎng)址是http://wp.qq.com
    發(fā)現(xiàn)這個(gè)玩意越來(lái)越強(qiáng)大了,就忍不住把官方的介紹搬過(guò)來(lái):
    代碼樣例
    <a href="http://sighttp.qq.com/cgi-bin/check?sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d";target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:80000805:1' alt="點(diǎn)擊這里給我發(fā)消息"></a>

    1)、sigkey為個(gè)人鑒權(quán)key,請(qǐng)勿修改,否則無(wú)法發(fā)起臨時(shí)會(huì)話。

    2)、臨時(shí)會(huì)話圖標(biāo)<img border="0" SRC='http://wpa.qq.com/pa?p=1:80000805:1' alt="點(diǎn)擊這里給我發(fā)消息">

    SRC是圖標(biāo)鏈接,自定義圖標(biāo)中可以替換這一部分為自己圖片的鏈接,

    參數(shù):

    P=以冒號(hào)“:”分隔多個(gè)參數(shù)

    第一個(gè)參數(shù)為版本號(hào),目前為1;

    第二個(gè)為QQ/TM號(hào)碼;

    第三個(gè)參數(shù)為圖像風(fēng)格,支持多種狀態(tài)。

    alt是圖標(biāo)旁留言。

    3)、除了自定義圖標(biāo)需要修改臨時(shí)會(huì)話圖標(biāo)外,其他情況下建議不要修改代碼,因?yàn)橛锌赡軐?dǎo)致在不同的環(huán)境和瀏覽器下,無(wú)法發(fā)起臨時(shí)會(huì)話。


    自定義在線風(fēng)格圖片

    用JS實(shí)現(xiàn),具體步驟如下:

    1) 申請(qǐng)代碼

    <a href="http://sighttp.qq.com/cgi-bin/check?sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:80000805:1' alt="點(diǎn)擊這里給我發(fā)消息"></a>

    2) 定義online數(shù)組,必須是online命名

    <script>var online= new Array();</script>

    3) 獲取在線狀態(tài)

    <script src="http://webpresence.qq.com/getonline?Type=1&80000805:"></script>

    可以獲取多個(gè),必須以冒號(hào)分隔,以冒號(hào)結(jié)尾,比如:

    <script src="http://webpresence.qq.com/getonline?Type=1&80000805:10000:123456:"></script>

    online[0]=0,表示80000805離線

    online[1]=1,表示10000在線

    online[2]=1,表示123456在線

    填寫號(hào)碼的先后順序,分別對(duì)應(yīng)數(shù)組online的0、1、2

    4) 添加代碼

    把SRC='http://wpa.qq.com/pa?p=1:80000805:1'替換為自己的圖片,比如:

    <script> if(online[0]==0) document.write("<a href="http://sighttp.qq.com/cgi-bin/check?sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://xxxx/outline.jpg' alt="點(diǎn)擊這里給我發(fā)消息"></a>"); 
    else document.write("<a href="http://sighttp.qq.com/cgi-bin/check?sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://xxxx/online.jpg' alt="點(diǎn)擊這里給我發(fā)消息"></a>"); </script> 

    我是這樣看的,用tx的方法得到某QQ號(hào)是否在線,用js判斷,顯示online.jpg或者outline.jpg這兩個(gè)圖片,其余不變。

    posted @ 2010-06-25 07:28 saobaolu| 編輯 收藏

    主站蜘蛛池模板: 亚洲乱亚洲乱淫久久| 毛片基地免费观看| 大地资源在线资源免费观看| 国产偷国产偷亚洲高清人| 综合偷自拍亚洲乱中文字幕| 亚洲AV无码成人网站在线观看| 亚洲色大成网站www永久男同| 亚洲人成www在线播放| 亚洲一久久久久久久久| 亚洲婷婷第一狠人综合精品| 亚洲色欲色欲www| 亚洲欧美日韩久久精品| 相泽南亚洲一区二区在线播放| 亚洲变态另类一区二区三区| 香蕉视频免费在线| 深夜a级毛片免费无码| av电影在线免费看| 成全在线观看免费观看大全| 一个人免费日韩不卡视频| 最近2019年免费中文字幕高清| 91网站免费观看| 韩国日本好看电影免费看| 免费观看国产小粉嫩喷水| 亚洲伊人久久综合影院| 国产成人亚洲综合色影视| 亚洲高清无在码在线电影不卡| 亚洲av日韩av无码av| 亚洲av日韩综合一区久热| 国产黄在线播放免费观看| 一级毛片在线观看免费| 日韩av无码成人无码免费| 国产中文字幕免费观看| 亚洲综合无码AV一区二区| 亚洲综合精品香蕉久久网97| 亚洲一区二区三区成人网站| 美景之屋4在线未删减免费 | 亚洲精品无码久久不卡| 亚洲精品国产美女久久久| 亚洲欧洲视频在线观看| 国产青草亚洲香蕉精品久久| 99久久成人国产精品免费|