云自無心水自閑

          天平山上白云泉,云自無心水自閑。何必奔沖山下去,更添波浪向人間!
          posts - 288, comments - 524, trackbacks - 0, articles - 6
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          2016年12月29日

          1. java zip 多個(gè)文件時(shí),如果先添加了一個(gè)excel文件,然后再想添加其他的文件時(shí)會(huì)出現(xiàn) steam is closed的錯(cuò)誤。這是因?yàn)閣ork.write(outputSteam)后,出調(diào)用outputSteam.close(),關(guān)閉輸出流。
          解決方法:
          將原來的程序:
                      ZipEntry entry = new ZipEntry( "file3.txt" );
                      zos.putNextEntry( entry );
                      workbook.write( zos );
                      zos.closeEntry();
          改為:
                      ZipEntry entry = new ZipEntry( "file3.txt" );
                      zos.putNextEntry( entry );
                      workbook.write( new NonCloseableOutputStream( zos ) );
                      zos.closeEntry();

          其中 NonCloseableOutputStream 定義如下:
          public class NonCloseableOutputStream extends java.io.FilterOutputStream {
              public NonCloseableOutputStream(OutputStream out) {
                  super(out);
              }
              @Override public void close() throws IOException {
                  flush();
              }
          }



          2. 使用binary使得mysql區(qū)分大小寫
          select * from table1 where binary field1 = 'abc';

          posted @ 2017-08-09 19:52 云自無心水自閑 閱讀(442) | 評(píng)論 (0)編輯 收藏

          https://notepad-plus-plus.org/community/topic/13661/plugin-manager-x64-available-submit-your-plugins

          posted @ 2017-06-26 09:33 云自無心水自閑 閱讀(411) | 評(píng)論 (0)編輯 收藏

          move Git Server to a new IP/URL:

          you can just edit 
          .git/config and change the URLs there

          也可以在git視圖中,右鍵點(diǎn)擊項(xiàng)目,選擇屬性,然后修改url中的地址

          posted @ 2017-06-15 08:40 云自無心水自閑 閱讀(330) | 評(píng)論 (0)編輯 收藏

          autohotkey
          listary
          cmder可以split screen,在一個(gè)窗口中同時(shí)運(yùn)行數(shù)個(gè)cmd

          posted @ 2017-05-24 07:13 云自無心水自閑 閱讀(18316) | 評(píng)論 (0)編輯 收藏

          官網(wǎng)地址:autohotkey.com

          ; fill password
          ^Numpad2::
          Send, root{tab}root{enter}
          Return
          ^Numpad3::
          IfWinExist, ahk_exe OUTLOOK.EXE
          {
              WinActivate ahk_exe OUTLOOK.EXE ; Automatically uses the window found above.
              ; WinMaximize  ; same
              ;Send, Some text.{Enter}
          msgbox Outlook is running.
          }
          Return

          posted @ 2017-03-08 13:06 云自無心水自閑 閱讀(377) | 評(píng)論 (0)編輯 收藏

          <html>
          <head>
              <script src="https://unpkg.com/vue/dist/vue.js"></script>
              <script>
                  window.onload = function () {
                      var app = new Vue({
                          el: '#app',
                          data: {
                              message: 'Hello Vue!'
                          }
                      });
                  }    
              </script>
          </head>

          <body>
              <div id="app">
                {{ message }}
              </div>
          </body>
          </html>

          posted @ 2017-02-09 07:41 云自無心水自閑 閱讀(412) | 評(píng)論 (0)編輯 收藏


          String[] splits=someString.split("a,b,c,d", ",");
          logger.debug( "array: {}", (Object) splits );

          這里要注意的就是要把數(shù)組的數(shù)據(jù)類型強(qiáng)制轉(zhuǎn)換為Object 

          posted @ 2016-12-29 11:51 云自無心水自閑 閱讀(1633) | 評(píng)論 (0)編輯 收藏

          主站蜘蛛池模板: 高陵县| 内丘县| 于田县| 微山县| 溆浦县| 公主岭市| 土默特右旗| 绥芬河市| 安阳市| 会昌县| 娱乐| 调兵山市| 昭苏县| 太原市| 景宁| 芮城县| 望奎县| 新源县| 崇明县| 寻甸| 通榆县| 阿合奇县| 夏河县| 珲春市| 望都县| 西贡区| 麻江县| 洞口县| 洛宁县| 开原市| 保山市| 平度市| 沅陵县| 昌吉市| 正阳县| 克拉玛依市| 宜春市| 胶州市| 祁门县| 桑植县| 鹰潭市|