2016年12月13日 星期二

mongodb shell 操作

mongodb shell 操作

最下面放很有價值的參考連結。


mysql專有名詞對應:

SQLMongoDB
databasedatabase
tablecollection
rowdocument
columnfield


新增使用者
db.createUser()  註: addUser為前幾版的mongo指令

ex:

db.createUser(
   {
     user: "admin",
     pwd: "1111",
     roles: [  { role: "userAdminAnyDatabase", db: "admin" } ]
   }
)

重要:剛開始一個資料庫只能新增一個user,若新增第2個或是下達其他的指令,則會發生權限不足的問題,必須先用db.auth()登入資料庫才能獲得權限,一般的roles指定為readWrite,db必須要指定目前所在的db名稱。

若要查看roles種類,以下網址:
https://docs.mongodb.com/v3.2/reference/built-in-roles/#database-user-roles

use db_name
進入資料庫

查看使用者:
show users

查看資料表:
show collections

查看所有的資料庫
show databases 註:只會顯示有放資料的資料庫

創建資料庫
use db_name  註:只要insert一筆資料就可以在show databases上看到

創建資料表:
mongodb為Schema Free,所以不需預先創造資料表、欄位等。
db.createCollection("TableTest")

詳細createCollection規範,以下網址:
https://docs.mongodb.com/v3.2/reference/method/db.createCollection/#definition

更新使用者
db.updateUser()

insert指令:
db.table_name.insert({name:"omg",status:"test"})

搜尋全部資料
db.collectionName.find()

搜尋條件資料
db.collectionName.find("條件")
ex:  db.TableName.find({"name":"value"})列出name=value的所有row(document)

刪除row(document)
db.collectionName.remove()

更新資料:
db.collectionName.update()

參考:
http://ibruce.info/2015/03/03/mongodb3-auth/

https://www.facebook.com/notes/%E9%84%AD%E6%A5%AD%E8%96%B0/%E5%B7%A5%E4%BD%9C%E7%AD%86%E8%A8%98mongodb-user-role%E8%A8%AD%E5%AE%9A%E7%AD%86%E8%A8%98/10152402345234468/

http://www.cnblogs.com/tannerBG/p/4026308.html

https://coder.tw/?p=781

LINE PAY PHP版 測試網頁

LINE PAY PHP版 測試網頁

github : https://github.com/6chinwei/LINE-Pay-PHP-Tutorial/


測試網頁: http://52funds.com/LINE/Example/index.php

2016年10月23日 星期日

解決:jquery ui: cannot call methods on dialog prior to initialization; attempted to call method 'isOpen'

錯誤使用jquery ui的isoOpen function


要確認jquery的dialog是否為開啟,設定以下jquery dialog

<script>
 $( function() {
    $( "#dialog-confirm" ).dialog({
      resizable: false,
      height: "auto",
      width: 400,
      modal: true,
 autoOpen: true,
      buttons: [{
      text: "Ok",
      click: function() {
        $( this ).dialog( "close" );
location.href='index.php';
      }
      }]
    });
  } );
</script>

檢測dialog是否為開啟狀態

alert( $( ".selector" ).dialog( "isOpen" ));

觸發錯誤 jquery ui: cannot call methods on dialog prior to initialization; attempted to call method 'isOpen'

以下列寫法修正:

alert( $( ".selector" ).dialog().dialog( "isOpen" ));

參考:http://stackoverflow.com/questions/3827830/jqueryui-uncaught-exception-cannot-call-methods

2016年8月24日 星期三

wordpress好工具: Content Views 輕鬆建立grid post 不用任何程式碼

介紹:


wordpress對於post的擺設是自由的,但往往使用者會受到theme的限制,例如:單欄(one column)、雙欄(two column)、三欄、四欄、格狀(grid)等。


post的排列方式會影響來訪人的觀感,讓人耳目一新的或是方便閱讀的風格都可以增加回訪率(return visitor rate : RVR)。


2016年8月10日 星期三

wordpress好工具:Bulk Delete 大量刪除post

當網誌上面充滿著大量錯誤或無用的post,而想要大量刪除post的話,手動一個一個刪除一定是一個非常愚蠢的選擇。

或許使用內建一次刪一整頁的功能,可以滿足一般使用者的需求。

但是對於一些使用內建函式wp_insert_post大量產生post的人來說是不太足夠的,因此就要使用Bulk Delete,使用如下圖:

2016年7月29日 星期五

(2016/7/29) ACER 產品 發展

1. 家用:

    筆電
            Switch One 10、Switch Alpha 12、Aspire S 13、Aspire V 13
    桌電
            Aspire T3、Aspire Z3 Portable、Revo Build、DC
    平板
            Iconia One 10、Iconia Talk S、Iconia One 8、Iconia Tab 10
    智慧型手機
            Liquid Z630S、Liquid Z330、Liquid Z530、Liquid Z630
    顯示器
            R1、XZ、KA、XR
    投影機
            教育、Portable LED、大型場地、超值
    穿戴式裝置
            Liquid Leap+
    GAMING
            Aspire V Nitro、XR、XB

2.商用

   筆電
          TravelMate P6、Extensa 15、TravelMate P2、TravelMate P4
   桌電
          Acer Chromebox、Veriton Z、Veriton N、Veriton X
   平板
          Iconia One 8、Iconia Tab 10、Iconia One 7、Iconia A1
   工作站
         Veriton P130 F4、Veriton P330 F3、Veriton P530 F2、Veriton P330 F2
   顯示器
         CB、V6、B6
   投影機
         教育、Portable LED、大型場地、超值
   伺服器
         Altos T110 F4、AR780 F3、Altos B380 F3、Altos B360 F3

3.IOT

   宏碁自建雲
   宏碁通信

4.Predator系列 電競

   桌電
       Predator G6、Predator G3、Predator G1
   筆電
       Predator 17、Predator 15
   平板
       Predator 8
   顯示器
      Predator X34、Predator Z35、Predator XB1、Predator Z1
   投影機
      Predator Z650

5.software

    Windows
          Acer Drive
          Acer Care Center
          Acer Quick Access
          Acer Explorer

    Android
         Iconia Suite
         AcerEXTEND

6.工具箱

    Acer Smart Client Manager
    Acer ProShield
    Acer Office Manager
    Acer Smart Setup
    Acer Smart Console
    Acer Smart Server Manager
    Acer 與 Intel®的 21 世紀教育解決方案

2016年7月28日 星期四

PHP自我檢驗項目


1. echo和print有什麼區別
2. GET和POST方法有什麼區別
3. 字串翻轉
4. include和require有什麼區別
5. 單引號跟雙引號的區別
6. PHP中的錯誤類型
7. 時間格式運算
8. 各型態的try catch
9. session是甚麼、運作原理
10. Type Juggling是甚麼
11. var_dump
12. heredoc
13. namespace
14. static function、static variable
15.  class 繼承
16. final 關鍵字
17. php各型態轉換
18. float 不精確問題 0.1+0.2 == 0.3 is false