跳到主要內容

發表文章

[Python] Virtualenv 執行多版本 Python (windows環境)

目前電腦狀況: 已安裝python3 cmd 執行 python 預設執行 version3.4 *情境 開發環境需要python2.7 但不能直接修改環境變數預設改version2.7(有別的專案已用python3) -步驟 安裝python2.7 ( python網站下載後安裝 ) python2.7 安裝 pip 執行 [  python27   get-pip.py  ] ( python27  安裝python2.7的檔案位置; get-pip.py 為該py檔案路徑 ) pip install virtualenv cmd 在指定執行虛擬環境的資料夾( virpython27 ) 執行 [ virtualenv env ] 環境安裝好後,開發python2.7 時,在 cmd 執行 [ virpython27 \env\Scripts\activate ], cmd command 最前方會顯示 (env) ,此時已在虛擬環境 相關參考 【Python学习笔记】windows上virtualenv 安装及使用

[HIVE] 設定 hive authorization

設定 hive authorization root權限編輯hive config command vim /etc/hive/conf.dist/hive-site.xml *需打包jar  com.qiku.custom.auth.HiveServer2Auth  <property> <name> hive.server2.enable.doAs </name> <value> false </value> </property> <property> <name>hive.server2.authentication</name> <value> CUSTOM </value> </property> <property> <name>hive.server2.custom.authentication.class</name> <value> org . apache . hive . service . auth . PasswdAuthenticationProvider . SampleAuth </value> </property> 自定義登入邏輯 [java] 儲存為HiveServer2Auth.jar 放在 ${HIVE_HOME}/lib下  package org . apache . hive . service . auth . PasswdAuthenticationProvider . SampleAuth ; import java . util . Hashtable ; import javax . security . sasl . AuthenticationException ; import org . apache . hive . service . auth . ...

[Hive] 使用 Hive Transactions 發生 error 10265

root權限編輯hive config command vim /etc/hive/conf.dist/hive-site.xml 在hive config 增加property <property> <name>hive.support.concurrency</name> <value>true</value> </property> <property> <name>hive.enforce.bucketing</name> <value>true</value> </property> <property> <name>hive.exec.dynamic.partition.mode</name> <value>nonstrict</value> </property> <property> <name>hive.txn.manager</name> <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value> </property> <property> <name>hive.compactor.initiator.on</name> <value>true</value> </property> <property> <name>hive.compactor.worker.threads</name> <value>1</value...

[JS/JQuery] 多檔上傳 ( drap and drop )

[html] <div id=" ('divImg' +did) " title="上傳圖片" class="UploadImg" ondrop="ImgDrop(event,' did "> /*** drap and drop****/       <input id=" ('Img' +did) " name="Img" type="file" title=" ('file' +did) " > <label for=" ('Img' +did) ">點我上傳<em>或拖拉圖片檔案至此</em></span></label> <a class="BtnDel" title="刪除" onclick="DelPic(' did ');"></i>刪除</a> <img id=" ('imgPreview' +did) " style="display: none;" src="" alt="@item.Title"> /***end drap and drop****/ </div> <div id=" ('errFile' +did) " class="MsgError" tabindex="0"><span><i class="icon-error"></i></span></div>                 [js] var filelist = []; //點擊上傳 $(...

[JS/JQ] 捲動卷軸 增加結果 (一直拉捲動,顯示越來越多)

//捲到底次數(像分頁一樣) var sindex; $(function () {       //begin get data from 1.     sindex = 1;     showDetial(sindex);     $(window).scroll(function () {         var $BodyHeight = $(document).height();         var $ViewportHeight = $(window).height();         $ScrollTop = $(this).scrollTop();         if ($BodyHeight == ($ViewportHeight + $ScrollTop)) {             //scroll bar then add search index.             sindex++;             //get data.             showDetial(sindex);         }     });     //avoid click F5 when scrollerbar not in bottom then default run scroll that have same data, so this check user if click buttom that scroll to top.     $(window).keydown(function (e) { ...

[JS] Facebook 登入 & 取FB大頭照

[.js] window.fbAsyncInit = function () {     FB.init({         appId: ' fbid ',         cookie: true,         xfbml: true,         version: 'v2.2'     }); }; (function (d, s, id) {     var js, fjs = d.getElementsByTagName(s)[0];     if (d.getElementById(id)) return;     js = d.createElement(s); js.id = id;     js.src = "//connect.facebook.net/en_US/sdk.js";     fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); function FBLogin() {     FB.login(function (response) {         if (response.status === 'connected') {             //登入成功             UserLogin();         } else if (response.status === 'not_authorized') {                  ...