<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
       :: 首頁 ::  :: 聯系 :: 聚合  :: 管理

    2010年6月25日

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

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

    <TABLE style="table-layout: auto | fixed">
    auto: 默認值
    fixed: 寬度固定,截斷超出的內容

    <TABLE style="word-break: normal | break-all | keep-all">
    normal: 默認值,按字詞截斷換行
    break-all: 強行截斷并換行
    keep-all: 不截斷不換行

    使用:style="table-layout:fixed;"
    表示輸出停止,停留在設定的長度內.

    使用:style="word-break : break-all;"
    表示對超長部分,換行再繼續顯示.

    對于在英文中使用,請使用style="table-layout:fixed; word-wrap:break-word"
    推薦使用word-wrap:break-word;word-break:break-all;table-layout:fixed;

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

    word-wrap同word-break的區別

    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. 必要時會觸發word-break。

    word-break:
    normal      Default. Allows line breaking within words. 好像是只對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.

    總結如下:
    word-wrap是控制換行的。
    使用break-word時,是將強制換行。中文沒有任何問題,英文語句也沒問題。但是對于長串的英文,就不起作用。

    break-word是控制是否斷詞的。
    normal是默認情況,英文單詞不被拆開。
    break-all,是斷開單詞。在單詞到邊界時,下個字母自動到下一行。主要解決了長串英文的問題。
    keep-all,是指Chinese, Japanese, and Korean不斷詞。即只用此時,不用word-wrap,中文就不會換行了。(英文語句正常。)


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

    ff下:
    如這2個都不用的話,中文不會出任何問題。英文語句也不會出問題。但是,長串英文會出問題。
    為了解決長串英文,一般用word-wrap:break-word;word-break:break-all;。但是,此方式會導致,普通的英文語句中的單詞會被斷開(ie下也是)。

    目前主要的問題存在于 長串英文 和 英文單詞被斷開。其實長串英文就是一個比較長的單詞而已。
    即英文單詞應不應該被斷開那?那問題很明顯了,顯然不應該被斷開了。
    對于長串英文,就是惡意的東西,自然不用去管了。但是,也要想些辦法,不讓它把容器撐大。
    用:overflow:auto; ie下,長串會自動折行。ff下,長串會被遮蓋。


    所以,綜上,最好的方式是word-wrap:break-word;overflow:hidden;而不是word-wrap:break-word;word-break:break-all;。
    word-wrap:break-word;overflow:auto;在ie下沒有任何問題。在ff下,長串會被遮住部分內容。

    另,測試代碼如下:

    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;//臨時變量,用于冒泡交換        
     6         int[] num=new int[10];  //聲明一個空的數組  10個長度
     7         Scanner sc = new Scanner(System.in);
     8         FileOutputStream out=new FileOutputStream("1.txt");
     9         PrintStream p=new PrintStream(out);
    10         //開始循環賦值
    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         // 循環輸出
    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 }
    最后應該把p給close了哈

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

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

    總結了一下,只要在CSS中定義了如下句子,可保網頁不會再被撐開了。

    自動換行問題,正常字符的換行是比較合理的,而連續的數字和英文字符常常將容器撐大,挺讓人頭疼,下面介紹的是CSS如何實現換行的方法

    對于div,p等塊級元素

    正常文字的換行(亞洲文字和非亞洲文字)元素擁有默認的white-space:normal,當定義的寬度之后自動換行

    html
    <div id="wrap">正常文字的換行(亞洲文字和非亞洲文字)元素擁有默認的white-space:normal,當定義</div>
    css
    #wrap{white-space:normal; width:200px; }

    IE瀏覽器

    連續的英文字符和阿拉伯數字,使用word-wrap: break-word ;或者word-break:break-all;實現強制斷行

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

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

    Firefox瀏覽器
    連續的英文字符和阿拉伯數字的斷行,Firefox的所有版本的沒有解決這個問題,我們只有讓超出邊界的字符隱藏或者,給容器添加滾動條

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

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

    對于table元素
    IE瀏覽器
    1. 使用 table-layout:fixed;強制table的寬度,多余內容隱藏<table style="table-layout:fixed" width="200"><tr><td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td></tr></table>
    復制代碼2. 使用 table-layout:fixed;強制table的寬度,內層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>
    復制代碼3.在td,th中嵌套div,p等采用上面提到的div,p的換行方法

    Firefox瀏覽器

    1. 使用 table-layout:fixed;強制table的寬度,內層td,th采用word-break : break-all;或者word-wrap : break-word ;換行,使用overflow:hidden;隱藏超出內,這里overflow:auto;無法起作用<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>
    復制代碼2.在td,th中嵌套div,p等采用上面提到的對付Firefox的方法。

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

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

    網址是http://wp.qq.com
    發現這個玩意越來越強大了,就忍不住把官方的介紹搬過來:
    代碼樣例
    <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="點擊這里給我發消息"></a>

    1)、sigkey為個人鑒權key,請勿修改,否則無法發起臨時會話。

    2)、臨時會話圖標<img border="0" SRC='http://wpa.qq.com/pa?p=1:80000805:1' alt="點擊這里給我發消息">

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

    參數:

    P=以冒號“:”分隔多個參數

    第一個參數為版本號,目前為1;

    第二個為QQ/TM號碼;

    第三個參數為圖像風格,支持多種狀態。

    alt是圖標旁留言。

    3)、除了自定義圖標需要修改臨時會話圖標外,其他情況下建議不要修改代碼,因為有可能導致在不同的環境和瀏覽器下,無法發起臨時會話。


    自定義在線風格圖片

    用JS實現,具體步驟如下:

    1) 申請代碼

    <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="點擊這里給我發消息"></a>

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

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

    3) 獲取在線狀態

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

    可以獲取多個,必須以冒號分隔,以冒號結尾,比如:

    <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在線

    填寫號碼的先后順序,分別對應數組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="點擊這里給我發消息"></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="點擊這里給我發消息"></a>"); </script> 

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

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

    主站蜘蛛池模板: 久久精品蜜芽亚洲国产AV| 国产亚洲精品免费视频播放| 亚洲网址在线观看| 久久99精品国产免费观看| 久久精品国产亚洲AV网站| 无码成A毛片免费| 亚洲人成电影亚洲人成9999网| 免费人成网站在线观看不卡| 国产AV无码专区亚洲AVJULIA | 久久久高清免费视频| 亚洲伊人精品综合在合线| 一二三四在线观看免费高清中文在线观看 | 国产偷国产偷亚洲清高APP| 日韩中文字幕在线免费观看 | 亚洲综合激情九月婷婷| 91免费人成网站在线观看18| 亚洲AV一二三区成人影片| 成人A级毛片免费观看AV网站| 亚洲日韩中文字幕一区| 免费成人在线观看| 好男人资源在线WWW免费| 亚洲不卡中文字幕无码| 91短视频免费在线观看| 亚洲私人无码综合久久网| 国产一精品一aⅴ一免费| 在线观看免费视频一区| 久久精品国产亚洲av麻豆小说| 日韩在线免费视频| 男性gay黄免费网站| 国产成人亚洲综合无码精品| 中文字幕免费在线看线人| 亚洲av永久无码精品网址| 国产亚洲精品成人a v小说| 18禁无遮挡无码国产免费网站| 亚洲国产精品ⅴa在线观看| 伊人久久亚洲综合| 四虎最新永久免费视频| 麻豆安全免费网址入口| 久久国产亚洲高清观看| 国产又长又粗又爽免费视频| 很黄很污的网站免费|