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

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

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

    云自無心水自閑

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

    2015年12月11日

    1. java zip 多個文件時,如果先添加了一個excel文件,然后再想添加其他的文件時會出現 steam is closed的錯誤。這是因為work.write(outputSteam)后,出調用outputSteam.close(),關閉輸出流。
    解決方法:
    將原來的程序:
                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區分大小寫
    select * from table1 where binary field1 = 'abc';

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

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

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

    move Git Server to a new IP/URL:

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

    也可以在git視圖中,右鍵點擊項目,選擇屬性,然后修改url中的地址

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

    autohotkey
    listary
    cmder可以split screen,在一個窗口中同時運行數個cmd

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

    官網地址: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 云自無心水自閑 閱讀(368) | 評論 (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 云自無心水自閑 閱讀(402) | 評論 (0)編輯 收藏


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

    這里要注意的就是要把數組的數據類型強制轉換為Object 

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

    在windows環境中,可以用如下方法重置root密碼

    1、先停止mysql數據庫

    2、保存密碼重置sql文件
         5.7.6(包括)以后的版本:ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
         5.7.5(包括)以前的版本:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
    假設保存到文件: c:\reset.txt

    3、以管理員身份打開命令行窗口,運行
    C:\> cd "C:\Program Files\MySQL\MySQL Server 5.5\bin"
    C:\> mysqld --init-file=C:\reset.txt

    4、啟動后,還不能馬上用新密碼連接數據庫,需要重啟mysql數據庫

    posted @ 2016-12-21 07:12 云自無心水自閑 閱讀(370) | 評論 (0)編輯 收藏

    This is a general step that happens when m2e/m2eclipse (Maven integration for Eclipse) is installed, whether projects are actively using it or not.
    這是因為m2eclipse(maven插件)要在啟動時需要進行的一個步驟。

    This step can be disabled through the Eclipse preferences: Window / Preferences / Maven / "Download repository index updates on startup". This option is on the main "Maven" preference page (not a child page). Just uncheck the box to prevent this from happening.
    我們可以停止這個動作。方法:Windows -> Preferences -> Maven 取消勾選 Download repository index updates on startup

    posted @ 2016-11-29 08:38 云自無心水自閑 閱讀(1310) | 評論 (0)編輯 收藏

    有好幾個java library都可以實現這個功能,但是從pdf提取文本的一個問題是,提取出來的文本沒有固定的順序,不容易比較好的還原其格式。

    我的做法是使用pdfclown來進行這項工作。官方網站是:https://pdfclown.org/ 先下載其最新版本。
    參考其示例代碼:https://pdfclown.org/2010/01/02/upcoming-0-0-8-whats-going-to-be-new/#more-30

    使用這段代碼,我們不僅可以得到文本的字符串,還能得到文本的頁數和相對坐標。
    我的思路是先把所有文本的字符串和坐標提取出來。然后排序,排序的順序是縱坐標,然后橫坐標。
    這樣排序完畢后,就能比較好的解決文本格式問題。

    posted @ 2016-11-28 11:03 云自無心水自閑 閱讀(385) | 評論 (0)編輯 收藏


    1, 先定義一個input, 做為datepicker的容器。
    <input type='text' class="form-control" id="dateTo" name="dateTo" required/>

    2, 在后面加上glyphicon, 注意關鍵是label 中的for的id需要是前面定義的容器的id, 這樣點擊glyphicon的時候就會觸發彈出日期選擇框。
    <label for="dateTo" class="input-group-addon"><span class="glyphicon glyphicon-time"></span></label>

    posted @ 2016-10-10 19:57 云自無心水自閑 閱讀(219) | 評論 (0)編輯 收藏

    在日志文件中看到這個錯誤信息
    Cause: java.sql.SQLException: #HY000

    后來才知道這是因為數據庫中有個別字段要求不能為空, 但是insert語句中沒有提供數據,造成了這個錯誤。

    關鍵是錯誤信息不明確直觀,不容易知道是這個原因


    posted @ 2016-09-28 13:13 云自無心水自閑 閱讀(1067) | 評論 (0)編輯 收藏

        public void afterJFinalStart(){
            Configuration config = FreeMarkerRender.getConfiguration();
            config.setTemplateUpdateDelayMilliseconds( 2 );
            config.setAPIBuiltinEnabled( true );
        }

    posted @ 2016-09-21 14:02 云自無心水自閑 閱讀(239) | 評論 (0)編輯 收藏


    中文版地址  https://angular.cn/

    posted @ 2016-09-16 13:13 云自無心水自閑 閱讀(2108) | 評論 (0)編輯 收藏

    1, call ##002# to cancel "call diversion"

    2, call 121600, choose option "2" to cancel "Active call catcher"

    posted @ 2016-08-25 12:58 云自無心水自閑 閱讀(154) | 評論 (0)編輯 收藏

    1. 格式化XML的插件
    可以安裝“XML Tools", 安裝完畢后,選擇 插件->XML Tools->Pretty Print(XML Only - with line breaks)

    2. 格式化JSON的插件
    可以安裝”JSON Viewer", 安裝完畢后,選擇 插件->JSON Viewer->Format JSON

    3. 格式化SQL的插件
    可以安裝“Poor man's T-Sql Formatter", 選擇 插件->Poor man's T-Sql Formatter->Format T-Sql Code

    posted @ 2016-08-12 15:14 云自無心水自閑 閱讀(1052) | 評論 (0)編輯 收藏

     
    使用的工具

    1. Apache HttpClient
    2. Firefox + FireBug
    3. Burp Suite ( https://portswigger.net/burp ) + Firefox FoxyProxy

    Firefox + FireBug 主要用于查看渲染出的頁面中的信息(比如:表單項的名稱,節點ID等等)
    Burp Suite 主要用于動態攔截頁面的交互,查看Ajax的調用。
    HttpClient 用于最后程序的編制。搞清楚了網頁交互的過程,就可以自主決定程序需要包含的內容。
    在實際網頁中,可能需要點開數級菜單,才能最后看到需要的內容。
    但是在程序中,可以直接跳到最后一步。

    posted @ 2016-06-05 19:00 云自無心水自閑 閱讀(198) | 評論 (0)編輯 收藏

    1. 表格文字右對齊 
     <table>
    <tr>
        <td><p style="text-align:right;margin:0;padding:0">文字右對齊</p></td>
        <td>文字左對齊</td>
    </tr>
    </table>

    2. 表格邊緣的margin 需要在表格外再套一個div
    <div style="margin:10px">
        <table>
        ......
        </table>
    </div>

    3. btn-toolbar class can put a margin between 2 "pull-right" buttons
            <div class="row">
                <div class="col-md-2"></div>
                <div class="col-md-8 btn-toolbar">
                    <input type="submit" class="btn btn-warning pull-right" value="Submit">
                    <input type="button" id="profilePassBackBtn" class="btn btn-info pull-right" value="Back">
                </div>
                <div class="col-md-2">
                </div>
            </div>

    posted @ 2016-05-31 11:39 云自無心水自閑 閱讀(378) | 評論 (0)編輯 收藏

     AngularJS 2.0 已經發布了Beta版本,相信正式版不久以后就會發布了。

    下面是官網上的新功能介紹:

    1. 更快更高效。AngularJS 2 將會比 AnuglarJS 1 快很多。因為它會支持:從遠程胳快速加載、離線編譯以便于更快啟動、以及超快的變動檢測和為使滾動更平滑的視圖緩存等等。

    2. 更加簡單清晰。語法將會顯得更加自然,易于編寫

    3. 跨越平臺。無論是臺式機、手機瀏覽器、安卓、IOS平臺,AngularJS都能提供相應的支持。

    4. 無縫從 AngularJS 1 升級到 2

    5. 簡便的開發。支持各種開發語言,ES5, TypeScript, Dart

    6. 全面完備的路由。 方便地映射URL到應用組件,并提供多種高級功能,比如:嵌套和鄰接路由,支持卡片棧導航、動畫過渡、手機用戶延遲加載等等

    7. 依賴注入。

    8. 舊瀏覽器的良好支持

    9. 動畫效果 (仍在開發中)

    10. 國際化支持(仍在開發中)

    posted @ 2016-04-18 20:09 云自無心水自閑 閱讀(265) | 評論 (0)編輯 收藏

    1. Go to web project properties.
    2. Deployment Assembly (Left).
    3. Add > Select project > Select your lib project > Check "Assemble projects into the WEB-INF/lib folder of the web application" if not checked > Finish.

    posted @ 2016-04-13 10:35 云自無心水自閑 閱讀(171) | 評論 (0)編輯 收藏

     使用酷狗就可以轉換。
    右鍵點擊歌曲 ,工具,格式轉換。
    唯一要注意的是要先登錄。

    posted @ 2016-03-17 20:20 云自無心水自閑 閱讀(1595) | 評論 (0)編輯 收藏

    今天把commons dbcp 和 pool都升級到2.x, 結果發現不能正常的工作,卡在new BasicDataSource()上了.
    后來才發現原因是因為沒有加入commons-logging的jar文件

    幾個注意點:
    1. commons dbcp2.x 和 commons pool需要同時升到2.x
    2. dbcp 2.x要運行在java 7以上 
    3. mysql connector要5.1.11以上
    4. 需要有commons-logging的包,我使用的是slf4j, 就需要加一個jcl-over-slf4j

    posted @ 2016-02-09 11:44 云自無心水自閑 閱讀(615) | 評論 (0)編輯 收藏

    Error
    com.jcraft.jsch.JSchException: The cipher 'aes256-cbc' is required, but it is not available.
    or
    Caused by: java.security.InvalidKeyException: Illegal key size


    posted @ 2016-02-05 13:51 云自無心水自閑 閱讀(270) | 評論 (0)編輯 收藏


    我在網上搜索了一下如何使用Selenium下載文件,其中確實有幾篇文件介紹了實現的方法。
    但是其主要思想都是使用httpClient或者URL獲得InputStream, 然后保存到文件中。
    但是,其中的問題是用戶登錄的Session不能維持。

    我發現了一個簡單的方法。
    直接使用WebDriver.get, 示例如下:

    webDriver.get("https://website.com/login");
    WebElement element = driver.findElement( By.id( "userID" ) );
    element.sendKeys( "user01" );

    element = driver.findElement( By.id( "passwd" ) );
    element.sendKeys( "password" );

    element = driver.findElement( By.name( "Login" ) );
    element.submit();

    webDriver.get("https://website.cm/download.do?start=xx&end=yy");
    String source = webDriver.getPageSource();

    這個source就是我們想保存的要下載的內容。
    只要把這個String寫到一個文件中,就實現了文件下載的目的

    posted @ 2016-01-28 18:06 云自無心水自閑 閱讀(470) | 評論 (0)編輯 收藏

         摘要: 在我的上一篇文章中介紹了如何進行GPG加密解密。
    加密解密的基本操作流程是,用戶使用公鑰對明文進行加密,解密方使用私鑰對密文進行解密。

    在實際應用中,除了加密保證文本內容不泄露外,同時還要考慮能夠驗證密文發送方的身份,比較普遍使用的方法就是簽名。
    本文主要對具體的方法進行介紹并附上源代碼。  閱讀全文

    posted @ 2015-12-11 21:40 云自無心水自閑 閱讀(1268) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 亚洲一本到无码av中文字幕| 丁香五月亚洲综合深深爱| 亚洲国产精品免费视频| 亚洲精品天堂无码中文字幕| 99国产精品免费视频观看| 91福利视频免费| 国产一区在线观看免费| 亚洲线精品一区二区三区影音先锋| 一级黄色片免费观看| 亚洲精品第一国产综合精品99| 狼人大香伊蕉国产WWW亚洲 | 国产精品自拍亚洲| 免费v片在线观看| 国产97视频人人做人人爱免费| free哆啪啪免费永久| 国产亚洲sss在线播放| 日本高清色本免费现在观看| 亚洲人成亚洲精品| 妻子5免费完整高清电视| 亚洲高清乱码午夜电影网| 亚洲国产成人VA在线观看 | 偷自拍亚洲视频在线观看 | 亚洲福利电影在线观看| 成全视成人免费观看在线看| 日本视频免费在线| 一级一级一级毛片免费毛片| 亚洲国产精品婷婷久久| 国内自产拍自a免费毛片| 一本久久免费视频| 久久国产亚洲高清观看| 国产免费一区二区视频| 亚洲不卡中文字幕| 四虎免费久久影院| 亚洲成人免费在线| 久久精品国产亚洲AV无码偷窥| 久久精品免费全国观看国产| 香蕉97碰碰视频免费| 久久亚洲精品无码AV红樱桃| 日韩免费高清视频网站| 久久久久久久久久国产精品免费| 亚洲中文无码永久免|